From cb17c596ae7a40bc10edc6e6c42be066a94363b4 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Tue, 16 Jun 2020 04:24:03 -0700 Subject: [PATCH] feat(genomics): update the API #### genomics:v2alpha1 The following keys were added: - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.description - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.flatPath - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.httpMethod - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.id - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.parameterOrder - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.parameters.id.description - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.parameters.id.location - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.parameters.id.pattern - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.parameters.id.required - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.parameters.id.type - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.path - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.request.$ref - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.response.$ref - resources.workers.resources.projects.resources.workers.methods.uploadSosReport.scopes - schemas.HttpBody.description - schemas.HttpBody.id - schemas.HttpBody.properties.contentType.description - schemas.HttpBody.properties.contentType.type - schemas.HttpBody.properties.data.description - schemas.HttpBody.properties.data.format - schemas.HttpBody.properties.data.type - schemas.HttpBody.properties.extensions.description - schemas.HttpBody.properties.extensions.items.additionalProperties.description - schemas.HttpBody.properties.extensions.items.additionalProperties.type - schemas.HttpBody.properties.extensions.items.type - schemas.HttpBody.properties.extensions.type - schemas.HttpBody.type - schemas.UploadSOSReportResponse.description - schemas.UploadSOSReportResponse.id - schemas.UploadSOSReportResponse.type - schemas.VirtualMachine.properties.dockerCacheImages.description - schemas.VirtualMachine.properties.dockerCacheImages.items.type - schemas.VirtualMachine.properties.dockerCacheImages.type The following keys were changed: - resources.projects.resources.workers.methods.checkIn.parameters.id.description - resources.workers.methods.checkIn.parameters.id.description --- discovery/genomics-v2alpha1.json | 85 +++++++++++- src/apis/genomics/v2alpha1.ts | 221 ++++++++++++++++++++++++++++++- 2 files changed, 297 insertions(+), 9 deletions(-) diff --git a/discovery/genomics-v2alpha1.json b/discovery/genomics-v2alpha1.json index 5c8d5dc2b5..496aa58924 100644 --- a/discovery/genomics-v2alpha1.json +++ b/discovery/genomics-v2alpha1.json @@ -245,7 +245,7 @@ ], "parameters": { "id": { - "description": "The worker id, assigned when it was created.", + "description": "The VM identity token for authenticating the VM instance.\nhttps://cloud.google.com/compute/docs/instances/verifying-instance-identity", "location": "path", "pattern": "^projects/[^/]+/workers/[^/]+$", "required": true, @@ -280,7 +280,7 @@ ], "parameters": { "id": { - "description": "The worker id, assigned when it was created.", + "description": "The VM identity token for authenticating the VM instance.\nhttps://cloud.google.com/compute/docs/instances/verifying-instance-identity", "location": "path", "required": true, "type": "string" @@ -298,10 +298,49 @@ "https://www.googleapis.com/auth/genomics" ] } + }, + "resources": { + "projects": { + "resources": { + "workers": { + "methods": { + "uploadSosReport": { + "description": "The worker uses this method to upload SOS reports for unexpected errors.", + "flatPath": "v2alpha1/workers/projects/{projectsId}/workers/{workersId}:uploadSosReport", + "httpMethod": "POST", + "id": "genomics.workers.projects.workers.uploadSosReport", + "parameterOrder": [ + "id" + ], + "parameters": { + "id": { + "description": "The VM identity token for authenticating the VM instance.\nhttps://cloud.google.com/compute/docs/instances/verifying-instance-identity", + "location": "path", + "pattern": "^projects/[^/]+/workers/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v2alpha1/workers/{+id}:uploadSosReport", + "request": { + "$ref": "HttpBody" + }, + "response": { + "$ref": "UploadSOSReportResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/genomics" + ] + } + } + } + } + } } } }, - "revision": "20200507", + "revision": "20200611", "rootUrl": "https://genomics.googleapis.com/", "schemas": { "Accelerator": { @@ -700,6 +739,33 @@ }, "type": "object" }, + "HttpBody": { + "description": "Message that represents an arbitrary HTTP body. It should only be used for\npayload formats that can't be represented as JSON, such as raw binary or\nan HTML page.\n\n\nThis message can be used both in streaming and non-streaming API methods in\nthe request as well as the response.\n\nIt can be used as a top-level request field, which is convenient if one\nwants to extract parameters from either the URL or HTTP template into the\nrequest fields and also want access to the raw HTTP body.\n\nExample:\n\n message GetResourceRequest {\n // A unique request id.\n string request_id = 1;\n\n // The raw HTTP body is bound to this field.\n google.api.HttpBody http_body = 2;\n }\n\n service ResourceService {\n rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);\n rpc UpdateResource(google.api.HttpBody) returns\n (google.protobuf.Empty);\n }\n\nExample with streaming methods:\n\n service CaldavService {\n rpc GetCalendar(stream google.api.HttpBody)\n returns (stream google.api.HttpBody);\n rpc UpdateCalendar(stream google.api.HttpBody)\n returns (stream google.api.HttpBody);\n }\n\nUse of this type only changes how the request and response bodies are\nhandled, all other features will continue to work unchanged.", + "id": "HttpBody", + "properties": { + "contentType": { + "description": "The HTTP Content-Type header value specifying the content type of the body.", + "type": "string" + }, + "data": { + "description": "The HTTP request/response body as raw binary.", + "format": "byte", + "type": "string" + }, + "extensions": { + "description": "Application specific response metadata. Must be set in the first response\nfor streaming APIs.", + "items": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, "ListOperationsResponse": { "description": "The response message for Operations.ListOperations.", "id": "ListOperationsResponse", @@ -1125,6 +1191,12 @@ }, "type": "object" }, + "UploadSOSReportResponse": { + "description": "The response to the UploadSOSReport method.", + "id": "UploadSOSReportResponse", + "properties": {}, + "type": "object" + }, "VirtualMachine": { "description": "Carries information about a Compute Engine VM resource.", "id": "VirtualMachine", @@ -1156,6 +1228,13 @@ }, "type": "array" }, + "dockerCacheImages": { + "description": "The Compute Engine Disk Images to use as a Docker cache. The disks will be\nmounted into the Docker folder in a way that the images present in the\ncache will not need to be pulled. The digests of the cached images must\nmatch those of the tags used or the latest version will still be pulled.\nOnly a single image is supported.", + "items": { + "type": "string" + }, + "type": "array" + }, "enableStackdriverMonitoring": { "description": "Whether Stackdriver monitoring should be enabled on the VM.", "type": "boolean" diff --git a/src/apis/genomics/v2alpha1.ts b/src/apis/genomics/v2alpha1.ts index 3734c4e98d..3412566348 100644 --- a/src/apis/genomics/v2alpha1.ts +++ b/src/apis/genomics/v2alpha1.ts @@ -384,6 +384,23 @@ export namespace genomics_v2alpha1 { */ code?: string | null; } + /** + * 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$HttpBody { + /** + * The HTTP Content-Type header value specifying the content type of the body. + */ + contentType?: string | null; + /** + * The HTTP request/response body as raw binary. + */ + data?: string | null; + /** + * Application specific response metadata. Must be set in the first response for streaming APIs. + */ + extensions?: Array<{[key: string]: any}> | null; + } /** * The response message for Operations.ListOperations. */ @@ -698,6 +715,10 @@ export namespace genomics_v2alpha1 { */ exitStatus?: number | null; } + /** + * The response to the UploadSOSReport method. + */ + export interface Schema$UploadSOSReportResponse {} /** * Carries information about a Compute Engine VM resource. */ @@ -722,6 +743,10 @@ export namespace genomics_v2alpha1 { * The list of disks to create and attach to the VM. */ disks?: Schema$Disk[]; + /** + * The Compute Engine Disk Images to use as a Docker cache. The disks will be mounted into the Docker folder in a way that the images present in the cache will not need to be pulled. The digests of the cached images must match those of the tags used or the latest version will still be pulled. Only a single image is supported. + */ + dockerCacheImages?: string[] | null; /** * Whether Stackdriver monitoring should be enabled on the VM. */ @@ -1506,7 +1531,8 @@ export namespace genomics_v2alpha1 { * * // Do the magic * const res = await genomics.projects.workers.checkIn({ - * // The worker id, assigned when it was created. + * // The VM identity token for authenticating the VM instance. + * // https://cloud.google.com/compute/docs/instances/verifying-instance-identity * id: 'projects/my-project/workers/my-worker', * * // Request body metadata @@ -1539,7 +1565,7 @@ export namespace genomics_v2alpha1 { * @memberOf! () * * @param {object} params Parameters for request - * @param {string} params.id The worker id, assigned when it was created. + * @param {string} params.id The VM identity token for authenticating the VM instance. https://cloud.google.com/compute/docs/instances/verifying-instance-identity * @param {().CheckInRequest} params.requestBody Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. @@ -1628,7 +1654,7 @@ export namespace genomics_v2alpha1 { export interface Params$Resource$Projects$Workers$Checkin extends StandardParameters { /** - * The worker id, assigned when it was created. + * The VM identity token for authenticating the VM instance. https://cloud.google.com/compute/docs/instances/verifying-instance-identity */ id?: string; @@ -1640,8 +1666,10 @@ export namespace genomics_v2alpha1 { export class Resource$Workers { context: APIRequestContext; + projects: Resource$Workers$Projects; constructor(context: APIRequestContext) { this.context = context; + this.projects = new Resource$Workers$Projects(this.context); } /** @@ -1674,7 +1702,8 @@ export namespace genomics_v2alpha1 { * * // Do the magic * const res = await genomics.workers.checkIn({ - * // The worker id, assigned when it was created. + * // The VM identity token for authenticating the VM instance. + * // https://cloud.google.com/compute/docs/instances/verifying-instance-identity * id: 'placeholder-value', * * // Request body metadata @@ -1707,7 +1736,7 @@ export namespace genomics_v2alpha1 { * @memberOf! () * * @param {object} params Parameters for request - * @param {string} params.id The worker id, assigned when it was created. + * @param {string} params.id The VM identity token for authenticating the VM instance. https://cloud.google.com/compute/docs/instances/verifying-instance-identity * @param {().CheckInRequest} params.requestBody Request body data * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. * @param {callback} callback The callback that handles the response. @@ -1794,7 +1823,7 @@ export namespace genomics_v2alpha1 { export interface Params$Resource$Workers$Checkin extends StandardParameters { /** - * The worker id, assigned when it was created. + * The VM identity token for authenticating the VM instance. https://cloud.google.com/compute/docs/instances/verifying-instance-identity */ id?: string; @@ -1803,4 +1832,184 @@ export namespace genomics_v2alpha1 { */ requestBody?: Schema$CheckInRequest; } + + export class Resource$Workers$Projects { + context: APIRequestContext; + workers: Resource$Workers$Projects$Workers; + constructor(context: APIRequestContext) { + this.context = context; + this.workers = new Resource$Workers$Projects$Workers(this.context); + } + } + + export class Resource$Workers$Projects$Workers { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * genomics.workers.projects.workers.uploadSosReport + * @desc The worker uses this method to upload SOS reports for unexpected errors. + * @example + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/genomics.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 genomics = google.genomics('v2alpha1'); + * + * 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', + * 'https://www.googleapis.com/auth/genomics', + * ], + * }); + * + * // 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 genomics.workers.projects.workers.uploadSosReport({ + * // The VM identity token for authenticating the VM instance. + * // https://cloud.google.com/compute/docs/instances/verifying-instance-identity + * id: 'projects/my-project/workers/my-worker', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "contentType": "my_contentType", + * // "data": "my_data", + * // "extensions": [] + * // } + * }, + * }); + * console.log(res.data); + * + * // Example response + * // {} + * } + * + * main().catch(e => { + * console.error(e); + * throw e; + * }); + * + * @alias genomics.workers.projects.workers.uploadSosReport + * @memberOf! () + * + * @param {object} params Parameters for request + * @param {string} params.id The VM identity token for authenticating the VM instance. https://cloud.google.com/compute/docs/instances/verifying-instance-identity + * @param {().HttpBody} params.requestBody Request body data + * @param {object} [options] Optionally override request options, such as `url`, `method`, and `encoding`. + * @param {callback} callback The callback that handles the response. + * @return {object} Request object + */ + uploadSosReport( + params: Params$Resource$Workers$Projects$Workers$Uploadsosreport, + options: StreamMethodOptions + ): GaxiosPromise; + uploadSosReport( + params?: Params$Resource$Workers$Projects$Workers$Uploadsosreport, + options?: MethodOptions + ): GaxiosPromise; + uploadSosReport( + params: Params$Resource$Workers$Projects$Workers$Uploadsosreport, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + uploadSosReport( + params: Params$Resource$Workers$Projects$Workers$Uploadsosreport, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + uploadSosReport( + params: Params$Resource$Workers$Projects$Workers$Uploadsosreport, + callback: BodyResponseCallback + ): void; + uploadSosReport( + callback: BodyResponseCallback + ): void; + uploadSosReport( + paramsOrCallback?: + | Params$Resource$Workers$Projects$Workers$Uploadsosreport + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Workers$Projects$Workers$Uploadsosreport; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = {} as Params$Resource$Workers$Projects$Workers$Uploadsosreport; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = options.rootUrl || 'https://genomics.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v2alpha1/workers/{+id}:uploadSosReport').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + }, + options + ), + params, + requiredParams: ['id'], + pathParams: ['id'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback<{} | void> + ); + } else { + return createAPIRequest(parameters); + } + } + } + + export interface Params$Resource$Workers$Projects$Workers$Uploadsosreport + extends StandardParameters { + /** + * The VM identity token for authenticating the VM instance. https://cloud.google.com/compute/docs/instances/verifying-instance-identity + */ + id?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$HttpBody; + } }