From b866d658e2ca22bd2843ca24cf441bad8eb5ea62 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Tue, 2 May 2023 01:37:52 +0000 Subject: [PATCH] feat(artifactregistry): update the API #### artifactregistry:v1beta1 The following keys were changed: - schemas.Repository.properties.format.enum - schemas.Repository.properties.format.enumDescriptions #### artifactregistry:v1beta2 The following keys were changed: - schemas.Repository.properties.format.enum - schemas.Repository.properties.format.enumDescriptions #### artifactregistry:v1 The following keys were added: - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.description - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.flatPath - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.httpMethod - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.id - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.parameterOrder - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.parameters.parent.description - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.parameters.parent.location - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.parameters.parent.pattern - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.parameters.parent.required - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.parameters.parent.type - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.path - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.request.$ref - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.response.$ref - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.import.scopes - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.description - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.flatPath - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.httpMethod - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.id - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.mediaUpload.accept - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.mediaUpload.protocols.simple.multipart - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.mediaUpload.protocols.simple.path - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.parameterOrder - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.parameters.parent.description - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.parameters.parent.location - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.parameters.parent.pattern - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.parameters.parent.required - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.parameters.parent.type - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.path - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.request.$ref - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.response.$ref - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.scopes - resources.projects.resources.locations.resources.repositories.resources.googetArtifacts.methods.upload.supportsMediaUpload - schemas.ImportGoogetArtifactsGcsSource.description - schemas.ImportGoogetArtifactsGcsSource.id - schemas.ImportGoogetArtifactsGcsSource.properties.uris.description - schemas.ImportGoogetArtifactsGcsSource.properties.uris.items.type - schemas.ImportGoogetArtifactsGcsSource.properties.uris.type - schemas.ImportGoogetArtifactsGcsSource.properties.useWildcards.description - schemas.ImportGoogetArtifactsGcsSource.properties.useWildcards.type - schemas.ImportGoogetArtifactsGcsSource.type - schemas.ImportGoogetArtifactsRequest.description - schemas.ImportGoogetArtifactsRequest.id - schemas.ImportGoogetArtifactsRequest.properties.gcsSource.$ref - schemas.ImportGoogetArtifactsRequest.properties.gcsSource.description - schemas.ImportGoogetArtifactsRequest.type - schemas.UploadGoogetArtifactMediaResponse.description - schemas.UploadGoogetArtifactMediaResponse.id - schemas.UploadGoogetArtifactMediaResponse.properties.operation.$ref - schemas.UploadGoogetArtifactMediaResponse.properties.operation.description - schemas.UploadGoogetArtifactMediaResponse.type - schemas.UploadGoogetArtifactRequest.description - schemas.UploadGoogetArtifactRequest.id - schemas.UploadGoogetArtifactRequest.type The following keys were changed: - schemas.Repository.properties.format.enum - schemas.Repository.properties.format.enumDescriptions --- discovery/artifactregistry-v1.json | 122 +++++++- discovery/artifactregistry-v1beta1.json | 4 +- discovery/artifactregistry-v1beta2.json | 4 +- src/apis/artifactregistry/v1.ts | 391 ++++++++++++++++++++++++ 4 files changed, 518 insertions(+), 3 deletions(-) diff --git a/discovery/artifactregistry-v1.json b/discovery/artifactregistry-v1.json index 91934141d7..c58fce7709 100644 --- a/discovery/artifactregistry-v1.json +++ b/discovery/artifactregistry-v1.json @@ -803,6 +803,78 @@ } } }, + "googetArtifacts": { + "methods": { + "import": { + "description": "Imports GooGet artifacts. The returned Operation will complete once the resources are imported. Package, Version, and File resources are created based on the imported artifacts. Imported artifacts that conflict with existing resources are ignored.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/googetArtifacts:import", + "httpMethod": "POST", + "id": "artifactregistry.projects.locations.repositories.googetArtifacts.import", + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "The name of the parent resource where the artifacts will be imported.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/googetArtifacts:import", + "request": { + "$ref": "ImportGoogetArtifactsRequest" + }, + "response": { + "$ref": "Operation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ] + }, + "upload": { + "description": "Directly uploads a GooGet artifact. The returned Operation will complete once the resources are uploaded. Package, Version, and File resources are created based on the imported artifact. Imported artifacts that conflict with existing resources are ignored.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/googetArtifacts:create", + "httpMethod": "POST", + "id": "artifactregistry.projects.locations.repositories.googetArtifacts.upload", + "mediaUpload": { + "accept": [ + "*/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/v1/{+parent}/googetArtifacts:create" + } + } + }, + "parameterOrder": [ + "parent" + ], + "parameters": { + "parent": { + "description": "The name of the parent resource where the artifacts will be uploaded.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+parent}/googetArtifacts:create", + "request": { + "$ref": "UploadGoogetArtifactRequest" + }, + "response": { + "$ref": "UploadGoogetArtifactMediaResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform" + ], + "supportsMediaUpload": true + } + } + }, "kfpArtifacts": { "methods": { "upload": { @@ -1517,7 +1589,7 @@ } } }, - "revision": "20230313", + "revision": "20230427", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "AptArtifact": { @@ -1852,6 +1924,35 @@ }, "type": "object" }, + "ImportGoogetArtifactsGcsSource": { + "description": "Google Cloud Storage location where the artifacts currently reside.", + "id": "ImportGoogetArtifactsGcsSource", + "properties": { + "uris": { + "description": "Cloud Storage paths URI (e.g., gs://my_bucket/my_object).", + "items": { + "type": "string" + }, + "type": "array" + }, + "useWildcards": { + "description": "Supports URI wildcards for matching multiple objects from a single URI.", + "type": "boolean" + } + }, + "type": "object" + }, + "ImportGoogetArtifactsRequest": { + "description": "The request to import new googet artifacts.", + "id": "ImportGoogetArtifactsRequest", + "properties": { + "gcsSource": { + "$ref": "ImportGoogetArtifactsGcsSource", + "description": "Google Cloud Storage location where input content is located." + } + }, + "type": "object" + }, "ImportYumArtifactsErrorInfo": { "description": "Error information explaining why a package was not imported.", "id": "ImportYumArtifactsErrorInfo", @@ -2518,6 +2619,7 @@ "NPM", "APT", "YUM", + "GOOGET", "PYTHON", "KFP" ], @@ -2528,6 +2630,7 @@ "NPM package format.", "APT package format.", "YUM package format.", + "GooGet package format.", "Python package format.", "Kubeflow Pipelines package format." ], @@ -2714,6 +2817,23 @@ }, "type": "object" }, + "UploadGoogetArtifactMediaResponse": { + "description": "The response to upload an artifact.", + "id": "UploadGoogetArtifactMediaResponse", + "properties": { + "operation": { + "$ref": "Operation", + "description": "Operation to be returned to the user." + } + }, + "type": "object" + }, + "UploadGoogetArtifactRequest": { + "description": "The request to upload an artifact.", + "id": "UploadGoogetArtifactRequest", + "properties": {}, + "type": "object" + }, "UploadKfpArtifactMediaResponse": { "description": "The response to upload an artifact.", "id": "UploadKfpArtifactMediaResponse", diff --git a/discovery/artifactregistry-v1beta1.json b/discovery/artifactregistry-v1beta1.json index 8aeccf91d5..b76cdbef4f 100644 --- a/discovery/artifactregistry-v1beta1.json +++ b/discovery/artifactregistry-v1beta1.json @@ -929,7 +929,7 @@ } } }, - "revision": "20230313", + "revision": "20230427", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "Binding": { @@ -1297,6 +1297,7 @@ "NPM", "APT", "YUM", + "GOOGET", "PYTHON" ], "enumDescriptions": [ @@ -1306,6 +1307,7 @@ "NPM package format.", "APT package format.", "YUM package format.", + "GooGet package format.", "Python package format." ], "type": "string" diff --git a/discovery/artifactregistry-v1beta2.json b/discovery/artifactregistry-v1beta2.json index c6587479ac..2793a971d2 100644 --- a/discovery/artifactregistry-v1beta2.json +++ b/discovery/artifactregistry-v1beta2.json @@ -1135,7 +1135,7 @@ } } }, - "revision": "20230313", + "revision": "20230427", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "AptArtifact": { @@ -1751,6 +1751,7 @@ "NPM", "APT", "YUM", + "GOOGET", "PYTHON" ], "enumDescriptions": [ @@ -1760,6 +1761,7 @@ "NPM package format.", "APT package format.", "YUM package format.", + "GooGet package format.", "Python package format." ], "type": "string" diff --git a/src/apis/artifactregistry/v1.ts b/src/apis/artifactregistry/v1.ts index 1e8cefff4c..22609540d1 100644 --- a/src/apis/artifactregistry/v1.ts +++ b/src/apis/artifactregistry/v1.ts @@ -357,6 +357,28 @@ export namespace artifactregistry_v1 { */ errors?: Schema$ImportAptArtifactsErrorInfo[]; } + /** + * Google Cloud Storage location where the artifacts currently reside. + */ + export interface Schema$ImportGoogetArtifactsGcsSource { + /** + * Cloud Storage paths URI (e.g., gs://my_bucket/my_object). + */ + uris?: string[] | null; + /** + * Supports URI wildcards for matching multiple objects from a single URI. + */ + useWildcards?: boolean | null; + } + /** + * The request to import new googet artifacts. + */ + export interface Schema$ImportGoogetArtifactsRequest { + /** + * Google Cloud Storage location where input content is located. + */ + gcsSource?: Schema$ImportGoogetArtifactsGcsSource; + } /** * Error information explaining why a package was not imported. */ @@ -957,6 +979,19 @@ export namespace artifactregistry_v1 { */ aptArtifacts?: Schema$AptArtifact[]; } + /** + * The response to upload an artifact. + */ + export interface Schema$UploadGoogetArtifactMediaResponse { + /** + * Operation to be returned to the user. + */ + operation?: Schema$Operation; + } + /** + * The request to upload an artifact. + */ + export interface Schema$UploadGoogetArtifactRequest {} /** * The response to upload an artifact. */ @@ -2174,6 +2209,7 @@ export namespace artifactregistry_v1 { aptArtifacts: Resource$Projects$Locations$Repositories$Aptartifacts; dockerImages: Resource$Projects$Locations$Repositories$Dockerimages; files: Resource$Projects$Locations$Repositories$Files; + googetArtifacts: Resource$Projects$Locations$Repositories$Googetartifacts; kfpArtifacts: Resource$Projects$Locations$Repositories$Kfpartifacts; mavenArtifacts: Resource$Projects$Locations$Repositories$Mavenartifacts; npmPackages: Resource$Projects$Locations$Repositories$Npmpackages; @@ -2189,6 +2225,10 @@ export namespace artifactregistry_v1 { this.files = new Resource$Projects$Locations$Repositories$Files( this.context ); + this.googetArtifacts = + new Resource$Projects$Locations$Repositories$Googetartifacts( + this.context + ); this.kfpArtifacts = new Resource$Projects$Locations$Repositories$Kfpartifacts(this.context); this.mavenArtifacts = @@ -4478,6 +4518,357 @@ export namespace artifactregistry_v1 { parent?: string; } + export class Resource$Projects$Locations$Repositories$Googetartifacts { + context: APIRequestContext; + constructor(context: APIRequestContext) { + this.context = context; + } + + /** + * Imports GooGet artifacts. The returned Operation will complete once the resources are imported. Package, Version, and File resources are created based on the imported artifacts. Imported artifacts that conflict with existing resources are ignored. + * @example + * ```js + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/artifactregistry.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 artifactregistry = google.artifactregistry('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 artifactregistry.projects.locations.repositories.googetArtifacts.import( + * { + * // The name of the parent resource where the artifacts will be imported. + * parent: + * 'projects/my-project/locations/my-location/repositories/my-repositorie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // { + * // "gcsSource": {} + * // } + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "done": false, + * // "error": {}, + * // "metadata": {}, + * // "name": "my_name", + * // "response": {} + * // } + * } + * + * 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. + */ + import( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import, + options: StreamMethodOptions + ): GaxiosPromise; + import( + params?: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import, + options?: MethodOptions + ): GaxiosPromise; + import( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + import( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import, + options: MethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + import( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import, + callback: BodyResponseCallback + ): void; + import(callback: BodyResponseCallback): void; + import( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): void | GaxiosPromise | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://artifactregistry.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/googetArtifacts:import').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + }, + options + ), + params, + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + + /** + * Directly uploads a GooGet artifact. The returned Operation will complete once the resources are uploaded. Package, Version, and File resources are created based on the imported artifact. Imported artifacts that conflict with existing resources are ignored. + * @example + * ```js + * // Before running the sample: + * // - Enable the API at: + * // https://console.developers.google.com/apis/api/artifactregistry.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 artifactregistry = google.artifactregistry('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 artifactregistry.projects.locations.repositories.googetArtifacts.upload( + * { + * // The name of the parent resource where the artifacts will be uploaded. + * parent: + * 'projects/my-project/locations/my-location/repositories/my-repositorie', + * + * // Request body metadata + * requestBody: { + * // request body parameters + * // {} + * }, + * media: { + * mimeType: 'placeholder-value', + * body: 'placeholder-value', + * }, + * } + * ); + * console.log(res.data); + * + * // Example response + * // { + * // "operation": {} + * // } + * } + * + * 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. + */ + upload( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload, + options: StreamMethodOptions + ): GaxiosPromise; + upload( + params?: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload, + options?: MethodOptions + ): GaxiosPromise; + upload( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + upload( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + upload( + params: Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload, + callback: BodyResponseCallback + ): void; + upload( + callback: BodyResponseCallback + ): void; + upload( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://artifactregistry.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+parent}/googetArtifacts:create').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'POST', + }, + options + ), + params, + mediaUrl: ( + rootUrl + '/upload/v1/{+parent}/googetArtifacts:create' + ).replace(/([^:]\/)\/+/g, '$1'), + requiredParams: ['parent'], + pathParams: ['parent'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest( + parameters + ); + } + } + } + + export interface Params$Resource$Projects$Locations$Repositories$Googetartifacts$Import + extends StandardParameters { + /** + * The name of the parent resource where the artifacts will be imported. + */ + parent?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$ImportGoogetArtifactsRequest; + } + export interface Params$Resource$Projects$Locations$Repositories$Googetartifacts$Upload + extends StandardParameters { + /** + * The name of the parent resource where the artifacts will be uploaded. + */ + parent?: string; + + /** + * Request body metadata + */ + requestBody?: Schema$UploadGoogetArtifactRequest; + + /** + * Media metadata + */ + media?: { + /** + * Media mime-type + */ + mimeType?: string; + + /** + * Media body contents + */ + body?: any; + }; + } + export class Resource$Projects$Locations$Repositories$Kfpartifacts { context: APIRequestContext; constructor(context: APIRequestContext) {