From 4fba2fd0d25183c449f0dbeee2142a49408162b6 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Date: Wed, 8 May 2024 01:23:34 +0000 Subject: [PATCH] feat(artifactregistry)!: update the API BREAKING CHANGE: This release has breaking changes. #### artifactregistry:v1beta2 The following keys were deleted: - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.description - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.flatPath - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.httpMethod - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.id - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameterOrder - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.description - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.location - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.pattern - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.required - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.type - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.path - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.response.$ref - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.scopes - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.supportsMediaDownload - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.useMediaDownloadService - schemas.Repository.properties.satisfiesPzi.description - schemas.Repository.properties.satisfiesPzi.readOnly - schemas.Repository.properties.satisfiesPzi.type The following keys were added: - resources.media.methods.download.description - resources.media.methods.download.flatPath - resources.media.methods.download.httpMethod - resources.media.methods.download.id - resources.media.methods.download.parameterOrder - resources.media.methods.download.parameters.name.description - resources.media.methods.download.parameters.name.location - resources.media.methods.download.parameters.name.pattern - resources.media.methods.download.parameters.name.required - resources.media.methods.download.parameters.name.type - resources.media.methods.download.path - resources.media.methods.download.response.$ref - resources.media.methods.download.scopes - resources.media.methods.download.supportsMediaDownload - resources.media.methods.download.useMediaDownloadService The following keys were changed: - resources.projects.resources.locations.resources.repositories.methods.patch.parameters.name.description - schemas.GoogleDevtoolsArtifactregistryV1beta2File.properties.name.description - schemas.Repository.properties.name.description #### artifactregistry:v1 The following keys were deleted: - resources.media.methods.download.description - resources.media.methods.download.flatPath - resources.media.methods.download.httpMethod - resources.media.methods.download.id - resources.media.methods.download.parameterOrder - resources.media.methods.download.parameters.name.description - resources.media.methods.download.parameters.name.location - resources.media.methods.download.parameters.name.pattern - resources.media.methods.download.parameters.name.required - resources.media.methods.download.parameters.name.type - resources.media.methods.download.path - resources.media.methods.download.response.$ref - resources.media.methods.download.scopes - resources.media.methods.download.supportsMediaDownload - resources.media.methods.download.useMediaDownloadService The following keys were added: - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.description - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.flatPath - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.httpMethod - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.id - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameterOrder - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.description - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.location - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.pattern - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.required - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.parameters.name.type - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.path - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.response.$ref - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.scopes - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.supportsMediaDownload - resources.projects.resources.locations.resources.repositories.resources.files.methods.download.useMediaDownloadService - schemas.Repository.properties.satisfiesPzi.description - schemas.Repository.properties.satisfiesPzi.readOnly - schemas.Repository.properties.satisfiesPzi.type The following keys were changed: - resources.projects.resources.locations.resources.repositories.methods.patch.parameters.name.description - schemas.GoogleDevtoolsArtifactregistryV1File.properties.name.description - schemas.Repository.properties.name.description - schemas.VirtualRepositoryConfig.description --- discovery/artifactregistry-v1.json | 75 ++++---- discovery/artifactregistry-v1beta2.json | 73 ++++---- src/apis/artifactregistry/v1.ts | 223 ++++++++++++------------ 3 files changed, 184 insertions(+), 187 deletions(-) diff --git a/discovery/artifactregistry-v1.json b/discovery/artifactregistry-v1.json index 1d0b0cf891..db8bcecaaa 100644 --- a/discovery/artifactregistry-v1.json +++ b/discovery/artifactregistry-v1.json @@ -115,38 +115,6 @@ }, "protocol": "rest", "resources": { - "media": { - "methods": { - "download": { - "description": "Download a file.", - "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", - "httpMethod": "GET", - "id": "artifactregistry.media.download", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The name of the file to download.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1/{+name}:download", - "response": { - "$ref": "DownloadFileResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true - } - } - }, "projects": { "methods": { "getProjectSettings": { @@ -538,7 +506,7 @@ ], "parameters": { "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$", "required": true, @@ -767,6 +735,34 @@ }, "files": { "methods": { + "download": { + "description": "Download a file.", + "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", + "httpMethod": "GET", + "id": "artifactregistry.projects.locations.repositories.files.download", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the file to download.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1/{+name}:download", + "response": { + "$ref": "DownloadFileResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "supportsMediaDownload": true, + "useMediaDownloadService": true + }, "get": { "description": "Gets a file.", "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}", @@ -1782,7 +1778,7 @@ } } }, - "revision": "20240425", + "revision": "20240501", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "AptArtifact": { @@ -2224,7 +2220,7 @@ "type": "array" }, "name": { - "description": "The name of the file, for example: \"projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt\". If the file ID part contains slashes, they are escaped.", + "description": "The name of the file, for example: `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. If the file ID part contains slashes, they are escaped.", "type": "string" }, "owner": { @@ -3319,13 +3315,18 @@ "type": "string" }, "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", "type": "string" }, "remoteRepositoryConfig": { "$ref": "RemoteRepositoryConfig", "description": "Configuration specific for a Remote Repository." }, + "satisfiesPzi": { + "description": "Output only. If set, the repository satisfies physical zone isolation.", + "readOnly": true, + "type": "boolean" + }, "satisfiesPzs": { "description": "Output only. If set, the repository satisfies physical zone separation.", "readOnly": true, @@ -3754,7 +3755,7 @@ "type": "object" }, "VirtualRepositoryConfig": { - "description": "Virtual repository configuration.", + "description": "LINT.IfChange Virtual repository configuration.", "id": "VirtualRepositoryConfig", "properties": { "upstreamPolicies": { diff --git a/discovery/artifactregistry-v1beta2.json b/discovery/artifactregistry-v1beta2.json index b2d4fd958e..240a75d13c 100644 --- a/discovery/artifactregistry-v1beta2.json +++ b/discovery/artifactregistry-v1beta2.json @@ -115,6 +115,38 @@ }, "protocol": "rest", "resources": { + "media": { + "methods": { + "download": { + "description": "Download a file.", + "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", + "httpMethod": "GET", + "id": "artifactregistry.media.download", + "parameterOrder": [ + "name" + ], + "parameters": { + "name": { + "description": "Required. The name of the file to download.", + "location": "path", + "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", + "required": true, + "type": "string" + } + }, + "path": "v1beta2/{+name}:download", + "response": { + "$ref": "DownloadFileResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only" + ], + "supportsMediaDownload": true, + "useMediaDownloadService": true + } + } + }, "projects": { "methods": { "getProjectSettings": { @@ -446,7 +478,7 @@ ], "parameters": { "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", "location": "path", "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$", "required": true, @@ -603,34 +635,6 @@ }, "files": { "methods": { - "download": { - "description": "Download a file.", - "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}:download", - "httpMethod": "GET", - "id": "artifactregistry.projects.locations.repositories.files.download", - "parameterOrder": [ - "name" - ], - "parameters": { - "name": { - "description": "Required. The name of the file to download.", - "location": "path", - "pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+/files/[^/]+$", - "required": true, - "type": "string" - } - }, - "path": "v1beta2/{+name}:download", - "response": { - "$ref": "DownloadFileResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true - }, "get": { "description": "Gets a file.", "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}/files/{filesId}", @@ -1204,7 +1208,7 @@ } } }, - "revision": "20240501", + "revision": "20240425", "rootUrl": "https://artifactregistry.googleapis.com/", "schemas": { "AptArtifact": { @@ -1330,7 +1334,7 @@ "type": "array" }, "name": { - "description": "The name of the file, for example: `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. If the file ID part contains slashes, they are escaped.", + "description": "The name of the file, for example: \"projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt\". If the file ID part contains slashes, they are escaped.", "type": "string" }, "owner": { @@ -1873,14 +1877,9 @@ "description": "Maven repository config contains repository level configuration for the repositories of maven type." }, "name": { - "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique.", + "description": "The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`.", "type": "string" }, - "satisfiesPzi": { - "description": "Output only. If set, the repository satisfies physical zone isolation.", - "readOnly": true, - "type": "boolean" - }, "satisfiesPzs": { "description": "Output only. If set, the repository satisfies physical zone separation.", "readOnly": true, diff --git a/src/apis/artifactregistry/v1.ts b/src/apis/artifactregistry/v1.ts index 872a2b0350..280a4b05e2 100644 --- a/src/apis/artifactregistry/v1.ts +++ b/src/apis/artifactregistry/v1.ts @@ -112,7 +112,6 @@ export namespace artifactregistry_v1 { */ export class Artifactregistry { context: APIRequestContext; - media: Resource$Media; projects: Resource$Projects; constructor(options: GlobalOptions, google?: GoogleConfigurable) { @@ -121,7 +120,6 @@ export namespace artifactregistry_v1 { google, }; - this.media = new Resource$Media(this.context); this.projects = new Resource$Projects(this.context); } } @@ -434,7 +432,7 @@ export namespace artifactregistry_v1 { */ hashes?: Schema$Hash[]; /** - * The name of the file, for example: "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt". If the file ID part contains slashes, they are escaped. + * The name of the file, for example: `projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt`. If the file ID part contains slashes, they are escaped. */ name?: string | null; /** @@ -1184,13 +1182,17 @@ export namespace artifactregistry_v1 { */ mode?: string | null; /** - * The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. + * The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique. */ name?: string | null; /** * Configuration specific for a Remote Repository. */ remoteRepositoryConfig?: Schema$RemoteRepositoryConfig; + /** + * Output only. If set, the repository satisfies physical zone isolation. + */ + satisfiesPzi?: boolean | null; /** * Output only. If set, the repository satisfies physical zone separation. */ @@ -1489,7 +1491,7 @@ export namespace artifactregistry_v1 { updateTime?: string | null; } /** - * Virtual repository configuration. + * LINT.IfChange Virtual repository configuration. */ export interface Schema$VirtualRepositoryConfig { /** @@ -1545,113 +1547,6 @@ export namespace artifactregistry_v1 { publicRepository?: Schema$GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository; } - export class Resource$Media { - context: APIRequestContext; - constructor(context: APIRequestContext) { - this.context = context; - } - - /** - * Download a file. - * - * @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. - */ - download( - params: Params$Resource$Media$Download, - options: StreamMethodOptions - ): GaxiosPromise; - download( - params?: Params$Resource$Media$Download, - options?: MethodOptions - ): GaxiosPromise; - download( - params: Params$Resource$Media$Download, - options: StreamMethodOptions | BodyResponseCallback, - callback: BodyResponseCallback - ): void; - download( - params: Params$Resource$Media$Download, - options: - | MethodOptions - | BodyResponseCallback, - callback: BodyResponseCallback - ): void; - download( - params: Params$Resource$Media$Download, - callback: BodyResponseCallback - ): void; - download(callback: BodyResponseCallback): void; - download( - paramsOrCallback?: - | Params$Resource$Media$Download - | BodyResponseCallback - | BodyResponseCallback, - optionsOrCallback?: - | MethodOptions - | StreamMethodOptions - | BodyResponseCallback - | BodyResponseCallback, - callback?: - | BodyResponseCallback - | BodyResponseCallback - ): - | void - | GaxiosPromise - | GaxiosPromise { - let params = (paramsOrCallback || {}) as Params$Resource$Media$Download; - let options = (optionsOrCallback || {}) as MethodOptions; - - if (typeof paramsOrCallback === 'function') { - callback = paramsOrCallback; - params = {} as Params$Resource$Media$Download; - options = {}; - } - - if (typeof optionsOrCallback === 'function') { - callback = optionsOrCallback; - options = {}; - } - - const rootUrl = - options.rootUrl || 'https://artifactregistry.googleapis.com/'; - const parameters = { - options: Object.assign( - { - url: (rootUrl + '/v1/{+name}:download').replace( - /([^:]\/)\/+/g, - '$1' - ), - method: 'GET', - apiVersion: '', - }, - options - ), - params, - requiredParams: ['name'], - pathParams: ['name'], - context: this.context, - }; - if (callback) { - createAPIRequest( - parameters, - callback as BodyResponseCallback - ); - } else { - return createAPIRequest(parameters); - } - } - } - - export interface Params$Resource$Media$Download extends StandardParameters { - /** - * Required. The name of the file to download. - */ - name?: string; - } - export class Resource$Projects { context: APIRequestContext; locations: Resource$Projects$Locations; @@ -3210,7 +3105,7 @@ export namespace artifactregistry_v1 { export interface Params$Resource$Projects$Locations$Repositories$Patch extends StandardParameters { /** - * The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. + * The name of the repository, for example: `projects/p1/locations/us-central1/repositories/repo1`. For each location in a project, repository names must be unique. */ name?: string; /** @@ -3709,6 +3604,101 @@ export namespace artifactregistry_v1 { this.context = context; } + /** + * Download a file. + * + * @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. + */ + download( + params: Params$Resource$Projects$Locations$Repositories$Files$Download, + options: StreamMethodOptions + ): GaxiosPromise; + download( + params?: Params$Resource$Projects$Locations$Repositories$Files$Download, + options?: MethodOptions + ): GaxiosPromise; + download( + params: Params$Resource$Projects$Locations$Repositories$Files$Download, + options: StreamMethodOptions | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + download( + params: Params$Resource$Projects$Locations$Repositories$Files$Download, + options: + | MethodOptions + | BodyResponseCallback, + callback: BodyResponseCallback + ): void; + download( + params: Params$Resource$Projects$Locations$Repositories$Files$Download, + callback: BodyResponseCallback + ): void; + download(callback: BodyResponseCallback): void; + download( + paramsOrCallback?: + | Params$Resource$Projects$Locations$Repositories$Files$Download + | BodyResponseCallback + | BodyResponseCallback, + optionsOrCallback?: + | MethodOptions + | StreamMethodOptions + | BodyResponseCallback + | BodyResponseCallback, + callback?: + | BodyResponseCallback + | BodyResponseCallback + ): + | void + | GaxiosPromise + | GaxiosPromise { + let params = (paramsOrCallback || + {}) as Params$Resource$Projects$Locations$Repositories$Files$Download; + let options = (optionsOrCallback || {}) as MethodOptions; + + if (typeof paramsOrCallback === 'function') { + callback = paramsOrCallback; + params = + {} as Params$Resource$Projects$Locations$Repositories$Files$Download; + options = {}; + } + + if (typeof optionsOrCallback === 'function') { + callback = optionsOrCallback; + options = {}; + } + + const rootUrl = + options.rootUrl || 'https://artifactregistry.googleapis.com/'; + const parameters = { + options: Object.assign( + { + url: (rootUrl + '/v1/{+name}:download').replace( + /([^:]\/)\/+/g, + '$1' + ), + method: 'GET', + apiVersion: '', + }, + options + ), + params, + requiredParams: ['name'], + pathParams: ['name'], + context: this.context, + }; + if (callback) { + createAPIRequest( + parameters, + callback as BodyResponseCallback + ); + } else { + return createAPIRequest(parameters); + } + } + /** * Gets a file. * @@ -3899,6 +3889,13 @@ export namespace artifactregistry_v1 { } } + export interface Params$Resource$Projects$Locations$Repositories$Files$Download + extends StandardParameters { + /** + * Required. The name of the file to download. + */ + name?: string; + } export interface Params$Resource$Projects$Locations$Repositories$Files$Get extends StandardParameters { /**