From 1cece79a990ae3b47b0d9f21c54de6acd3b516b8 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Mon, 3 Aug 2020 04:29:05 -0700 Subject: [PATCH] feat(run): update the API #### run:v1 The following keys were added: - resources.projects.resources.authorizeddomains.methods.list.description - resources.projects.resources.authorizeddomains.methods.list.flatPath - resources.projects.resources.authorizeddomains.methods.list.httpMethod - resources.projects.resources.authorizeddomains.methods.list.id - resources.projects.resources.authorizeddomains.methods.list.parameterOrder - resources.projects.resources.authorizeddomains.methods.list.parameters.pageSize.description - resources.projects.resources.authorizeddomains.methods.list.parameters.pageSize.format - resources.projects.resources.authorizeddomains.methods.list.parameters.pageSize.location - resources.projects.resources.authorizeddomains.methods.list.parameters.pageSize.type - resources.projects.resources.authorizeddomains.methods.list.parameters.pageToken.description - resources.projects.resources.authorizeddomains.methods.list.parameters.pageToken.location - resources.projects.resources.authorizeddomains.methods.list.parameters.pageToken.type - resources.projects.resources.authorizeddomains.methods.list.parameters.parent.description - resources.projects.resources.authorizeddomains.methods.list.parameters.parent.location - resources.projects.resources.authorizeddomains.methods.list.parameters.parent.pattern - resources.projects.resources.authorizeddomains.methods.list.parameters.parent.required - resources.projects.resources.authorizeddomains.methods.list.parameters.parent.type - resources.projects.resources.authorizeddomains.methods.list.path - resources.projects.resources.authorizeddomains.methods.list.response.$ref - resources.projects.resources.authorizeddomains.methods.list.scopes The following keys were changed: - resources.namespaces.resources.authorizeddomains.methods.list.parameters.parent.description - resources.projects.resources.locations.resources.authorizeddomains.methods.list.parameters.parent.description - schemas.AuthorizedDomain.properties.name.description --- discovery/run-v1.json | 48 ++++++++++- src/apis/run/v1.ts | 188 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 225 insertions(+), 11 deletions(-) diff --git a/discovery/run-v1.json b/discovery/run-v1.json index 5c8e50556a..f06dd3156a 100644 --- a/discovery/run-v1.json +++ b/discovery/run-v1.json @@ -288,7 +288,7 @@ "type": "string" }, "parent": { - "description": "Name of the parent Application resource. Example: `apps/myapp`.", + "description": "Name of the parent Project resource. Example: `projects/myproject`.", "location": "path", "pattern": "^namespaces/[^/]+$", "required": true, @@ -963,6 +963,46 @@ }, "projects": { "resources": { + "authorizeddomains": { + "methods": { + "list": { + "description": "List authorized domains.", + "flatPath": "v1/projects/{projectsId}/authorizeddomains", + "httpMethod": "GET", + "id": "run.projects.authorizeddomains.list", + "parameterOrder": [ + "parent" + ], + "parameters": { + "pageSize": { + "description": "Maximum results to return per page.", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "Continuation token for fetching the next page of results.", + "location": "query", + "type": "string" + }, + "parent": { + "description": "Name of the parent Project resource. Example: `projects/myproject`.", + "location": "path", + "pattern": "^projects/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/authorizeddomains", + "response": { + "$ref": "ListAuthorizedDomainsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + } + } + }, "locations": { "methods": { "list": { @@ -1031,7 +1071,7 @@ "type": "string" }, "parent": { - "description": "Name of the parent Application resource. Example: `apps/myapp`.", + "description": "Name of the parent Project resource. Example: `projects/myproject`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+$", "required": true, @@ -1942,7 +1982,7 @@ } } }, - "revision": "20200720", + "revision": "20200727", "rootUrl": "https://run.googleapis.com/", "schemas": { "Addressable": { @@ -2012,7 +2052,7 @@ "type": "string" }, "name": { - "description": "Read only. Full path to the `AuthorizedDomain` resource in the API. Example: `apps/myapp/authorizedDomains/example.com`.", + "description": "Deprecated Read only. Full path to the `AuthorizedDomain` resource in the API. Example: `projects/myproject/authorizedDomains/example.com`.", "type": "string" } }, diff --git a/src/apis/run/v1.ts b/src/apis/run/v1.ts index b52d6c2ae5..ef690f6916 100644 --- a/src/apis/run/v1.ts +++ b/src/apis/run/v1.ts @@ -172,7 +172,7 @@ export namespace run_v1 { */ id?: string | null; /** - * Read only. Full path to the `AuthorizedDomain` resource in the API. Example: `apps/myapp/authorizedDomains/example.com`. + * Deprecated Read only. Full path to the `AuthorizedDomain` resource in the API. Example: `projects/myproject/authorizedDomains/example.com`. */ name?: string | null; } @@ -2370,7 +2370,7 @@ export namespace run_v1 { * pageSize: 'placeholder-value', * // Continuation token for fetching the next page of results. * pageToken: 'placeholder-value', - * // Name of the parent Application resource. Example: `apps/myapp`. + * // Name of the parent Project resource. Example: `projects/myproject`. * parent: 'namespaces/my-namespace', * }); * console.log(res.data); @@ -2393,7 +2393,7 @@ export namespace run_v1 { * @param {object} params Parameters for request * @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.parent Name of the parent Application resource. Example: `apps/myapp`. + * @param {string} params.parent Name of the parent Project resource. Example: `projects/myproject`. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object @@ -2498,7 +2498,7 @@ export namespace run_v1 { */ pageToken?: string; /** - * Name of the parent Application resource. Example: `apps/myapp`. + * Name of the parent Project resource. Example: `projects/myproject`. */ parent?: string; } @@ -5202,13 +5202,187 @@ export namespace run_v1 { export class Resource$Projects { context: APIRequestContext; + authorizeddomains: Resource$Projects$Authorizeddomains; locations: Resource$Projects$Locations; constructor(context: APIRequestContext) { this.context = context; + this.authorizeddomains = new Resource$Projects$Authorizeddomains( + this.context + ); this.locations = new Resource$Projects$Locations(this.context); } } + export class Resource$Projects$Authorizeddomains { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * run.projects.authorizeddomains.list + * @desc List authorized domains. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/run.googleapis.com + * // - Login into gcloud by running: + * // `$ gcloud auth application-default login` + * // - Install the npm module by running: + * // `$ npm install googleapis` + * + * const {google} = require('googleapis'); + * const run = google.run('v1'); + * + * async function main() { + * const auth = new google.auth.GoogleAuth({ + * // Scopes can be specified either as an array or as a single, space-delimited string. + * scopes: ['https://www.googleapis.com/auth/cloud-platform'], + * }); + * + * // Acquire an auth client, and bind it to all future calls + * const authClient = await auth.getClient(); + * google.options({auth: authClient}); + * + * // Do the magic + * const res = await run.projects.authorizeddomains.list({ + * // Maximum results to return per page. + * pageSize: 'placeholder-value', + * // Continuation token for fetching the next page of results. + * pageToken: 'placeholder-value', + * // Name of the parent Project resource. Example: `projects/myproject`. + * parent: 'projects/my-project', + * }); + * console.log(res.data); + * + * // Example response + * // { + * // "domains": [], + * // "nextPageToken": "my_nextPageToken" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias run.projects.authorizeddomains.list + * @memberOf! () + * + * @param {object} params Parameters for request + * @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.parent Name of the parent Project resource. Example: `projects/myproject`. + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + list( + params: Params$Resource$Projects$Authorizeddomains$List, + options: StreamMethodOptions + ): GaxiosPromise; + list( + params?: Params$Resource$Projects$Authorizeddomains$List, + options?: MethodOptions + ): GaxiosPromise; + list( + params: Params$Resource$Projects$Authorizeddomains$List, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Projects$Authorizeddomains$List, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + list( + params: Params$Resource$Projects$Authorizeddomains$List, + callback: BodyResponseCallback + ): void; + list( + callback: BodyResponseCallback + ): void; + list( + paramsOrCallback?: + | Params$Resource$Projects$Authorizeddomains$List + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Authorizeddomains$List; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Projects$Authorizeddomains$List; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://run.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/authorizeddomains').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest( + parameters + ); + } + } + } + + export interface Params$Resource$Projects$Authorizeddomains$List + extends StandardParameters { + /** + * Maximum results to return per page. + */ + pageSize?: number; + /** + * Continuation token for fetching the next page of results. + */ + pageToken?: string; + /** + * Name of the parent Project resource. Example: `projects/myproject`. + */ + parent?: string; + } + export class Resource$Projects$Locations { context: APIRequestContext; authorizeddomains: Resource$Projects$Locations$Authorizeddomains; @@ -5443,7 +5617,7 @@ export namespace run_v1 { * pageSize: 'placeholder-value', * // Continuation token for fetching the next page of results. * pageToken: 'placeholder-value', - * // Name of the parent Application resource. Example: `apps/myapp`. + * // Name of the parent Project resource. Example: `projects/myproject`. * parent: 'projects/my-project/locations/my-location', * }); * console.log(res.data); @@ -5466,7 +5640,7 @@ export namespace run_v1 { * @param {object} params Parameters for request * @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.parent Name of the parent Application resource. Example: `apps/myapp`. + * @param {string} params.parent Name of the parent Project resource. Example: `projects/myproject`. * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. * @return {object} Request object @@ -5571,7 +5745,7 @@ export namespace run_v1 { */ pageToken?: string; /** - * Name of the parent Application resource. Example: `apps/myapp`. + * Name of the parent Project resource. Example: `projects/myproject`. */ parent?: string; }