Skip to content

Commit

Permalink
feat(bigqueryreservation): update the API
Browse files Browse the repository at this point in the history
#### bigqueryreservation:v1

The following keys were added:
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.description
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.flatPath
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.httpMethod
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.id
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameterOrder
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.name.description
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.name.location
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.name.pattern
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.name.required
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.name.type
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.updateMask.description
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.updateMask.format
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.updateMask.location
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.parameters.updateMask.type
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.path
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.request.$ref
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.response.$ref
- resources.projects.resources.locations.resources.reservations.resources.assignments.methods.patch.scopes
  • Loading branch information
yoshi-automation authored and sofisl committed Apr 1, 2022
1 parent 3a2a649 commit 92155c6
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 1 deletion.
37 changes: 36 additions & 1 deletion discovery/bigqueryreservation-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
}
}
}
Expand All @@ -788,7 +823,7 @@
}
}
},
"revision": "20220319",
"revision": "20220326",
"rootUrl": "https://bigqueryreservation.googleapis.com/",
"schemas": {
"Assignment": {
Expand Down
166 changes: 166 additions & 0 deletions src/apis/bigqueryreservation/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3549,6 +3549,156 @@ export namespace bigqueryreservation_v1 {
return createAPIRequest<Schema$Assignment>(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<Readable>;
patch(
params?: Params$Resource$Projects$Locations$Reservations$Assignments$Patch,
options?: MethodOptions
): GaxiosPromise<Schema$Assignment>;
patch(
params: Params$Resource$Projects$Locations$Reservations$Assignments$Patch,
options: StreamMethodOptions | BodyResponseCallback<Readable>,
callback: BodyResponseCallback<Readable>
): void;
patch(
params: Params$Resource$Projects$Locations$Reservations$Assignments$Patch,
options: MethodOptions | BodyResponseCallback<Schema$Assignment>,
callback: BodyResponseCallback<Schema$Assignment>
): void;
patch(
params: Params$Resource$Projects$Locations$Reservations$Assignments$Patch,
callback: BodyResponseCallback<Schema$Assignment>
): void;
patch(callback: BodyResponseCallback<Schema$Assignment>): void;
patch(
paramsOrCallback?:
| Params$Resource$Projects$Locations$Reservations$Assignments$Patch
| BodyResponseCallback<Schema$Assignment>
| BodyResponseCallback<Readable>,
optionsOrCallback?:
| MethodOptions
| StreamMethodOptions
| BodyResponseCallback<Schema$Assignment>
| BodyResponseCallback<Readable>,
callback?:
| BodyResponseCallback<Schema$Assignment>
| BodyResponseCallback<Readable>
): void | GaxiosPromise<Schema$Assignment> | GaxiosPromise<Readable> {
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<Schema$Assignment>(
parameters,
callback as BodyResponseCallback<unknown>
);
} else {
return createAPIRequest<Schema$Assignment>(parameters);
}
}
}

export interface Params$Resource$Projects$Locations$Reservations$Assignments$Create
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 92155c6

Please sign in to comment.