diff --git a/discovery/bigqueryreservation-v1.json b/discovery/bigqueryreservation-v1.json index aab421c06f..8a8009901f 100644 --- a/discovery/bigqueryreservation-v1.json +++ b/discovery/bigqueryreservation-v1.json @@ -778,6 +778,41 @@ "https://www.googleapis.com/auth/bigquery", "https://www.googleapis.com/auth/cloud-platform" ] + }, + "patch": { + "description": "Updates an existing assignment. Only the `priority` field can be updated.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/reservations/{reservationsId}/assignments/{assignmentsId}", + "httpMethod": "PATCH", + "id": "bigqueryreservation.projects.locations.reservations.assignments.patch", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. For the assignment id, it must only contain lower case alphanumeric characters or dashes and the max length is 64 characters.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/reservations/[^/]+/assignments/[^/]+$", + "required": true, + "type": "string" + }, + "updateMask": { + "description": "Standard field mask for the set of fields to be updated.", + "format": "google-fieldmask", + "location": "query", + "type": "string" + } + }, + "path": "v1/{+name}", + "request": { + "$ref": "Assignment" + }, + "response": { + "$ref": "Assignment" + }, + "scopes": [ + "https://www.googleapis.com/auth/bigquery", + "https://www.googleapis.com/auth/cloud-platform" + ] } } } @@ -788,7 +823,7 @@ } } }, - "revision": "20220319", + "revision": "20220326", "rootUrl": "https://bigqueryreservation.googleapis.com/", "schemas": { "Assignment": { diff --git a/src/apis/bigqueryreservation/v1.ts b/src/apis/bigqueryreservation/v1.ts index 7fa795a67e..aeadeaaba3 100644 --- a/src/apis/bigqueryreservation/v1.ts +++ b/src/apis/bigqueryreservation/v1.ts @@ -3549,6 +3549,156 @@ export namespace bigqueryreservation_v1 { return createAPIRequest(parameters); } } + + /** + * Updates an existing assignment. Only the `priority` field can be updated. + * @example + * ```js + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/bigqueryreservation.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 bigqueryreservation = google.bigqueryreservation('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/bigquery', + * '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 bigqueryreservation.projects.locations.reservations.assignments.patch( + * { + * // Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. For the assignment id, it must only contain lower case alphanumeric characters or dashes and the max length is 64 characters. + * name: 'projects/my-project/locations/my-location/reservations/my-reservation/assignments/my-assignment', + * // Standard field mask for the set of fields to be updated. + * updateMask: 'placeholder-value', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "assignee": "my_assignee", + * // "jobType": "my_jobType", + * // "name": "my_name", + * // "state": "my_state" + * // } + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * ``` + * + * @param params - Parameters for request + * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. + * @param callback - Optional callback that handles the response. + * @returns A promise if used with async/await, or void if used with a callback. + */ + patch( + params: Params$Resource$Projects$Locations$Reservations$Assignments$Patch, + options: StreamMethodOptions + ): GaxiosPromise; + patch( + params?: Params$Resource$Projects$Locations$Reservations$Assignments$Patch, + options?: MethodOptions + ): GaxiosPromise; + patch( + params: Params$Resource$Projects$Locations$Reservations$Assignments$Patch, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Projects$Locations$Reservations$Assignments$Patch, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + patch( + params: Params$Resource$Projects$Locations$Reservations$Assignments$Patch, + callback: BodyResponseCallback + ): void; + patch(callback: BodyResponseCallback): void; + patch( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Reservations$Assignments$Patch + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Reservations$Assignments$Patch; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Projects$Locations$Reservations$Assignments$Patch; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://bigqueryreservation.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}').replace(/([^:]\/)\/+/g, '$1'), + method: 'PATCH', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } } export interface Params$Resource$Projects$Locations$Reservations$Assignments$Create @@ -3601,4 +3751,20 @@ export namespace bigqueryreservation_v1 { */ requestBody?: Schema$MoveAssignmentRequest; } + export interface Params$Resource$Projects$Locations$Reservations$Assignments$Patch + extends StandardParameters { + /** + * Output only. Name of the resource. E.g.: `projects/myproject/locations/US/reservations/team1-prod/assignments/123`. For the assignment id, it must only contain lower case alphanumeric characters or dashes and the max length is 64 characters. + */ + name?: string; + /** + * Standard field mask for the set of fields to be updated. + */ + updateMask?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$Assignment; + } }