// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Artifact Registry API Client for Deno * ===================================== * * Store and manage build artifacts in a scalable and integrated service built on Google infrastructure. * * Docs: https://cloud.google.com/artifacts/docs/ * Source: https://googleapis.deno.dev/v1/artifactregistry:v1.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Store and manage build artifacts in a scalable and integrated service built * on Google infrastructure. */ export class ArtifactRegistry { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://artifactregistry.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Retrieves the Settings for the Project. * * @param name Required. The name of the projectSettings resource. */ async projectsGetProjectSettings(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ProjectSettings; } /** * Gets information about a location. * * @param name Resource name for the location. */ async projectsLocationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Location; } /** * Retrieves the VPCSC Config for the Project. * * @param name Required. The name of the VPCSCConfig resource. */ async projectsLocationsGetVpcscConfig(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as VPCSCConfig; } /** * Lists information about the supported locations for this service. * * @param name The resource that owns the locations collection, if applicable. */ async projectsLocationsList(name: string, opts: ProjectsLocationsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }/locations`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListLocationsResponse; } /** * Gets the latest state of a long-running operation. Clients can use this * method to poll the operation result at intervals as recommended by the API * service. * * @param name The name of the operation resource. */ async projectsLocationsOperationsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Operation; } /** * Imports Apt 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. * * @param parent The name of the parent resource where the artifacts will be imported. */ async projectsLocationsRepositoriesAptArtifactsImport(parent: string, req: ImportAptArtifactsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/aptArtifacts:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Directly uploads an Apt 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. * * @param parent The name of the parent resource where the artifacts will be uploaded. */ async projectsLocationsRepositoriesAptArtifactsUpload(parent: string, req: UploadAptArtifactRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/aptArtifacts:create`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadAptArtifactMediaResponse; } /** * Creates an attachment. The returned Operation will finish once the * attachment has been created. Its response will be the created attachment. * * @param parent Required. The name of the parent resource where the attachment will be created. */ async projectsLocationsRepositoriesAttachmentsCreate(parent: string, req: Attachment, opts: ProjectsLocationsRepositoriesAttachmentsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/attachments`); if (opts.attachmentId !== undefined) { url.searchParams.append("attachmentId", String(opts.attachmentId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes an attachment. The returned Operation will finish once the * attachments has been deleted. It will not have any Operation metadata and * will return a `google.protobuf.Empty` response. * * @param name Required. The name of the attachment to delete. */ async projectsLocationsRepositoriesAttachmentsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets an attachment. * * @param name Required. The name of the attachment to retrieve. */ async projectsLocationsRepositoriesAttachmentsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Attachment; } /** * Lists attachments. * * @param parent Required. The name of the parent resource whose attachments will be listed. */ async projectsLocationsRepositoriesAttachmentsList(parent: string, opts: ProjectsLocationsRepositoriesAttachmentsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/attachments`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListAttachmentsResponse; } /** * Creates a repository. The returned Operation will finish once the * repository has been created. Its response will be the created Repository. * * @param parent Required. The name of the parent resource where the repository will be created. */ async projectsLocationsRepositoriesCreate(parent: string, req: Repository, opts: ProjectsLocationsRepositoriesCreateOptions = {}): Promise { req = serializeRepository(req); const url = new URL(`${this.#baseUrl}v1/${ parent }/repositories`); if (opts.repositoryId !== undefined) { url.searchParams.append("repositoryId", String(opts.repositoryId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a repository and all of its contents. The returned Operation will * finish once the repository has been deleted. It will not have any Operation * metadata and will return a google.protobuf.Empty response. * * @param name Required. The name of the repository to delete. */ async projectsLocationsRepositoriesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets a docker image. * * @param name Required. The name of the docker images. */ async projectsLocationsRepositoriesDockerImagesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeDockerImage(data); } /** * Lists docker images. * * @param parent Required. The name of the parent resource whose docker images will be listed. */ async projectsLocationsRepositoriesDockerImagesList(parent: string, opts: ProjectsLocationsRepositoriesDockerImagesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/dockerImages`); if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListDockerImagesResponse(data); } /** * Deletes a file and all of its content. It is only allowed on generic * repositories. The returned operation will complete once the file has been * deleted. * * @param name Required. The name of the file to delete. */ async projectsLocationsRepositoriesFilesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Download a file. * * @param name Required. The name of the file to download. */ async projectsLocationsRepositoriesFilesDownload(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }:download`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as DownloadFileResponse; } /** * Gets a file. * * @param name Required. The name of the file to retrieve. */ async projectsLocationsRepositoriesFilesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeGoogleDevtoolsArtifactregistryV1File(data); } /** * Lists files. * * @param parent Required. The name of the repository whose files will be listed. For example: "projects/p1/locations/us-central1/repositories/repo1 */ async projectsLocationsRepositoriesFilesList(parent: string, opts: ProjectsLocationsRepositoriesFilesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/files`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListFilesResponse(data); } /** * Updates a file. * * @param name 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. */ async projectsLocationsRepositoriesFilesPatch(name: string, req: GoogleDevtoolsArtifactregistryV1File, opts: ProjectsLocationsRepositoriesFilesPatchOptions = {}): Promise { req = serializeGoogleDevtoolsArtifactregistryV1File(req); opts = serializeProjectsLocationsRepositoriesFilesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeGoogleDevtoolsArtifactregistryV1File(data); } /** * Directly uploads a file to a repository. The returned Operation will * complete once the resources are uploaded. * * @param parent Required. The resource name of the repository where the file will be uploaded. */ async projectsLocationsRepositoriesFilesUpload(parent: string, req: UploadFileRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/files:upload`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadFileMediaResponse; } /** * Directly uploads a Generic artifact. The returned operation will complete * once the resources are uploaded. Package, version, and file resources are * created based on the uploaded artifact. Uploaded artifacts that conflict * with existing resources will raise an `ALREADY_EXISTS` error. * * @param parent The resource name of the repository where the generic artifact will be uploaded. */ async projectsLocationsRepositoriesGenericArtifactsUpload(parent: string, req: UploadGenericArtifactRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/genericArtifacts:create`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadGenericArtifactMediaResponse; } /** * Gets a repository. * * @param name Required. The name of the repository to retrieve. */ async projectsLocationsRepositoriesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeRepository(data); } /** * Gets the IAM policy for a given resource. * * @param resource REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsRepositoriesGetIamPolicy(resource: string, opts: ProjectsLocationsRepositoriesGetIamPolicyOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:getIamPolicy`); if (opts["options.requestedPolicyVersion"] !== undefined) { url.searchParams.append("options.requestedPolicyVersion", String(opts["options.requestedPolicyVersion"])); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePolicy(data); } /** * Directly uploads a Go module. The returned Operation will complete once * the Go module is uploaded. Package, Version, and File resources are created * based on the uploaded Go module. * * @param parent The resource name of the repository where the Go module will be uploaded. */ async projectsLocationsRepositoriesGoModulesUpload(parent: string, req: UploadGoModuleRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/goModules:create`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadGoModuleMediaResponse; } /** * 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. * * @param parent The name of the parent resource where the artifacts will be imported. */ async projectsLocationsRepositoriesGoogetArtifactsImport(parent: string, req: ImportGoogetArtifactsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/googetArtifacts:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * 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. * * @param parent The name of the parent resource where the artifacts will be uploaded. */ async projectsLocationsRepositoriesGoogetArtifactsUpload(parent: string, req: UploadGoogetArtifactRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/googetArtifacts:create`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadGoogetArtifactMediaResponse; } /** * Directly uploads a KFP artifact. The returned Operation will complete once * the resource is uploaded. Package, Version, and File resources will be * created based on the uploaded artifact. Uploaded artifacts that conflict * with existing resources will be overwritten. * * @param parent The resource name of the repository where the KFP artifact will be uploaded. */ async projectsLocationsRepositoriesKfpArtifactsUpload(parent: string, req: UploadKfpArtifactRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/kfpArtifacts:create`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadKfpArtifactMediaResponse; } /** * Lists repositories. * * @param parent Required. The name of the parent resource whose repositories will be listed. */ async projectsLocationsRepositoriesList(parent: string, opts: ProjectsLocationsRepositoriesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/repositories`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListRepositoriesResponse(data); } /** * Gets a maven artifact. * * @param name Required. The name of the maven artifact. */ async projectsLocationsRepositoriesMavenArtifactsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as MavenArtifact; } /** * Lists maven artifacts. * * @param parent Required. The name of the parent resource whose maven artifacts will be listed. */ async projectsLocationsRepositoriesMavenArtifactsList(parent: string, opts: ProjectsLocationsRepositoriesMavenArtifactsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/mavenArtifacts`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListMavenArtifactsResponse; } /** * Gets a npm package. * * @param name Required. The name of the npm package. */ async projectsLocationsRepositoriesNpmPackagesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as NpmPackage; } /** * Lists npm packages. * * @param parent Required. The name of the parent resource whose npm packages will be listed. */ async projectsLocationsRepositoriesNpmPackagesList(parent: string, opts: ProjectsLocationsRepositoriesNpmPackagesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/npmPackages`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListNpmPackagesResponse; } /** * Deletes a package and all of its versions and tags. The returned operation * will complete once the package has been deleted. * * @param name Required. The name of the package to delete. */ async projectsLocationsRepositoriesPackagesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets a package. * * @param name Required. The name of the package to retrieve. */ async projectsLocationsRepositoriesPackagesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializePackage(data); } /** * Lists packages. * * @param parent Required. The name of the parent resource whose packages will be listed. */ async projectsLocationsRepositoriesPackagesList(parent: string, opts: ProjectsLocationsRepositoriesPackagesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/packages`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListPackagesResponse(data); } /** * Updates a package. * * @param name The name of the package, for example: `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`. If the package ID part contains slashes, the slashes are escaped. */ async projectsLocationsRepositoriesPackagesPatch(name: string, req: Package, opts: ProjectsLocationsRepositoriesPackagesPatchOptions = {}): Promise { req = serializePackage(req); opts = serializeProjectsLocationsRepositoriesPackagesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializePackage(data); } /** * Creates a tag. * * @param parent The name of the parent resource where the tag will be created. */ async projectsLocationsRepositoriesPackagesTagsCreate(parent: string, req: Tag, opts: ProjectsLocationsRepositoriesPackagesTagsCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/tags`); if (opts.tagId !== undefined) { url.searchParams.append("tagId", String(opts.tagId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Tag; } /** * Deletes a tag. * * @param name The name of the tag to delete. */ async projectsLocationsRepositoriesPackagesTagsDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets a tag. * * @param name The name of the tag to retrieve. */ async projectsLocationsRepositoriesPackagesTagsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Tag; } /** * Lists tags. * * @param parent The name of the parent package whose tags will be listed. For example: `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`. */ async projectsLocationsRepositoriesPackagesTagsList(parent: string, opts: ProjectsLocationsRepositoriesPackagesTagsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/tags`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListTagsResponse; } /** * Updates a tag. * * @param name The name of the tag, for example: "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". If the package part contains slashes, the slashes are escaped. The tag part can only have characters in [a-zA-Z0-9\-._~:@], anything else must be URL encoded. */ async projectsLocationsRepositoriesPackagesTagsPatch(name: string, req: Tag, opts: ProjectsLocationsRepositoriesPackagesTagsPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesPackagesTagsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Tag; } /** * Deletes multiple versions across a repository. The returned operation will * complete once the versions have been deleted. * * @param parent The name of the repository holding all requested versions. */ async projectsLocationsRepositoriesPackagesVersionsBatchDelete(parent: string, req: BatchDeleteVersionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions:batchDelete`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Deletes a version and all of its content. The returned operation will * complete once the version has been deleted. * * @param name The name of the version to delete. */ async projectsLocationsRepositoriesPackagesVersionsDelete(name: string, opts: ProjectsLocationsRepositoriesPackagesVersionsDeleteOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.force !== undefined) { url.searchParams.append("force", String(opts.force)); } const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Operation; } /** * Gets a version * * @param name The name of the version to retrieve. */ async projectsLocationsRepositoriesPackagesVersionsGet(name: string, opts: ProjectsLocationsRepositoriesPackagesVersionsGetOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeVersion(data); } /** * Lists versions. * * @param parent The name of the parent resource whose versions will be listed. */ async projectsLocationsRepositoriesPackagesVersionsList(parent: string, opts: ProjectsLocationsRepositoriesPackagesVersionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/versions`); if (opts.filter !== undefined) { url.searchParams.append("filter", String(opts.filter)); } if (opts.orderBy !== undefined) { url.searchParams.append("orderBy", String(opts.orderBy)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return deserializeListVersionsResponse(data); } /** * Updates a version. * * @param name The name of the version, for example: `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`. If the package or version ID parts contain slashes, the slashes are escaped. */ async projectsLocationsRepositoriesPackagesVersionsPatch(name: string, req: Version, opts: ProjectsLocationsRepositoriesPackagesVersionsPatchOptions = {}): Promise { req = serializeVersion(req); opts = serializeProjectsLocationsRepositoriesPackagesVersionsPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeVersion(data); } /** * Updates a repository. * * @param name 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. */ async projectsLocationsRepositoriesPatch(name: string, req: Repository, opts: ProjectsLocationsRepositoriesPatchOptions = {}): Promise { req = serializeRepository(req); opts = serializeProjectsLocationsRepositoriesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return deserializeRepository(data); } /** * Gets a python package. * * @param name Required. The name of the python package. */ async projectsLocationsRepositoriesPythonPackagesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as PythonPackage; } /** * Lists python packages. * * @param parent Required. The name of the parent resource whose python packages will be listed. */ async projectsLocationsRepositoriesPythonPackagesList(parent: string, opts: ProjectsLocationsRepositoriesPythonPackagesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/pythonPackages`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListPythonPackagesResponse; } /** * Creates a rule. * * @param parent Required. The name of the parent resource where the rule will be created. */ async projectsLocationsRepositoriesRulesCreate(parent: string, req: GoogleDevtoolsArtifactregistryV1Rule, opts: ProjectsLocationsRepositoriesRulesCreateOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/rules`); if (opts.ruleId !== undefined) { url.searchParams.append("ruleId", String(opts.ruleId)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as GoogleDevtoolsArtifactregistryV1Rule; } /** * Deletes a rule. * * @param name Required. The name of the rule to delete. */ async projectsLocationsRepositoriesRulesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Gets a rule. * * @param name Required. The name of the rule to retrieve. */ async projectsLocationsRepositoriesRulesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v1/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as GoogleDevtoolsArtifactregistryV1Rule; } /** * Lists rules. * * @param parent Required. The name of the parent repository whose rules will be listed. For example: `projects/p1/locations/us-central1/repositories/repo1`. */ async projectsLocationsRepositoriesRulesList(parent: string, opts: ProjectsLocationsRepositoriesRulesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/rules`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListRulesResponse; } /** * Updates a rule. * * @param name The name of the rule, for example: `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`. */ async projectsLocationsRepositoriesRulesPatch(name: string, req: GoogleDevtoolsArtifactregistryV1Rule, opts: ProjectsLocationsRepositoriesRulesPatchOptions = {}): Promise { opts = serializeProjectsLocationsRepositoriesRulesPatchOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as GoogleDevtoolsArtifactregistryV1Rule; } /** * Updates the IAM policy for a given resource. * * @param resource REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsRepositoriesSetIamPolicy(resource: string, req: SetIamPolicyRequest): Promise { req = serializeSetIamPolicyRequest(req); const url = new URL(`${this.#baseUrl}v1/${ resource }:setIamPolicy`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializePolicy(data); } /** * Tests if the caller has a list of permissions on a resource. * * @param resource REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field. */ async projectsLocationsRepositoriesTestIamPermissions(resource: string, req: TestIamPermissionsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ resource }:testIamPermissions`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as TestIamPermissionsResponse; } /** * Imports Yum (RPM) 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. * * @param parent The name of the parent resource where the artifacts will be imported. */ async projectsLocationsRepositoriesYumArtifactsImport(parent: string, req: ImportYumArtifactsRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/yumArtifacts:import`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Operation; } /** * Directly uploads a Yum 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. * * @param parent The name of the parent resource where the artifacts will be uploaded. */ async projectsLocationsRepositoriesYumArtifactsUpload(parent: string, req: UploadYumArtifactRequest): Promise { const url = new URL(`${this.#baseUrl}v1/${ parent }/yumArtifacts:create`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UploadYumArtifactMediaResponse; } /** * Updates the VPCSC Config for the Project. * * @param name The name of the project's VPC SC Config. Always of the form: projects/{projectID}/locations/{location}/vpcscConfig In update request: never set In response: always set */ async projectsLocationsUpdateVpcscConfig(name: string, req: VPCSCConfig, opts: ProjectsLocationsUpdateVpcscConfigOptions = {}): Promise { opts = serializeProjectsLocationsUpdateVpcscConfigOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as VPCSCConfig; } /** * Updates the Settings for the Project. * * @param name The name of the project's settings. Always of the form: projects/{project-id}/projectSettings In update request: never set In response: always set */ async projectsUpdateProjectSettings(name: string, req: ProjectSettings, opts: ProjectsUpdateProjectSettingsOptions = {}): Promise { opts = serializeProjectsUpdateProjectSettingsOptions(opts); const url = new URL(`${this.#baseUrl}v1/${ name }`); if (opts.updateMask !== undefined) { url.searchParams.append("updateMask", String(opts.updateMask)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as ProjectSettings; } } /** * A detailed representation of an Apt artifact. Information in the record is * derived from the archive's control file. See * https://www.debian.org/doc/debian-policy/ch-controlfields.html */ export interface AptArtifact { /** * Output only. Operating system architecture of the artifact. */ readonly architecture?: string; /** * Output only. Repository component of the artifact. */ readonly component?: string; /** * Output only. Contents of the artifact's control metadata file. */ readonly controlFile?: Uint8Array; /** * Output only. The Artifact Registry resource name of the artifact. */ readonly name?: string; /** * Output only. The Apt package name of the artifact. */ readonly packageName?: string; /** * Output only. An artifact is a binary or source package. */ readonly packageType?: | "PACKAGE_TYPE_UNSPECIFIED" | "BINARY" | "SOURCE"; } /** * Configuration for an Apt remote repository. */ export interface AptRepository { /** * Customer-specified remote repository. */ customRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryCustomRepository; /** * One of the publicly available Apt repositories supported by Artifact * Registry. */ publicRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryPublicRepository; } /** * An Attachment refers to additional metadata that can be attached to * artifacts in Artifact Registry. An attachment consists of one or more files. */ export interface Attachment { /** * Optional. User annotations. These attributes can only be set and used by * the user, and not by Artifact Registry. See * https://google.aip.dev/128#annotations for more details such as format and * size limitations. */ annotations?: { [key: string]: string }; /** * The namespace this attachment belongs to. E.g. If an attachment is created * by artifact analysis, namespace is set to * `artifactanalysis.googleapis.com`. */ attachmentNamespace?: string; /** * Output only. The time when the attachment was created. */ readonly createTime?: Date; /** * Required. The files that belong to this attachment. If the file ID part * contains slashes, they are escaped. E.g. * `projects/p1/locations/us-central1/repositories/repo1/files/sha:`. */ files?: string[]; /** * The name of the attachment. E.g. * `projects/p1/locations/us/repositories/repo/attachments/sbom`. */ name?: string; /** * Output only. The name of the OCI version that this attachment created. * Only populated for Docker attachments. E.g. * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. */ readonly ociVersionName?: string; /** * Required. The target the attachment is for, can be a Version, Package or * Repository. E.g. * `projects/p1/locations/us-central1/repositories/repo1/packages/p1/versions/v1`. */ target?: string; /** * Type of attachment. E.g. `application/vnd.spdx+json` */ type?: string; /** * Output only. The time when the attachment was last updated. */ readonly updateTime?: Date; } /** * The metadata of an LRO from deleting multiple versions. */ export interface BatchDeleteVersionsMetadata { /** * The versions the operation failed to delete. */ failedVersions?: string[]; } /** * The request to delete multiple versions across a repository. */ export interface BatchDeleteVersionsRequest { /** * Required. The names of the versions to delete. A maximum of 10000 versions * can be deleted in a batch. */ names?: string[]; /** * If true, the request is performed without deleting data, following * AIP-163. */ validateOnly?: boolean; } /** * Associates `members`, or principals, with a `role`. */ export interface Binding { /** * The condition that is associated with this binding. If the condition * evaluates to `true`, then this binding applies to the current request. If * the condition evaluates to `false`, then this binding does not apply to the * current request. However, a different role binding might grant the same * role to one or more of the principals in this binding. To learn which * resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ condition?: Expr; /** * Specifies the principals requesting access for a Google Cloud resource. * `members` can have the following values: * `allUsers`: A special identifier * that represents anyone who is on the internet; with or without a Google * account. * `allAuthenticatedUsers`: A special identifier that represents * anyone who is authenticated with a Google account or a service account. * Does not include identities that come from external identity providers * (IdPs) through identity federation. * `user:{emailid}`: An email address * that represents a specific Google account. For example, `alice@example.com` * . * `serviceAccount:{emailid}`: An email address that represents a Google * service account. For example, `my-other-app@appspot.gserviceaccount.com`. * * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An * identifier for a [Kubernetes service * account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). * For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * * `group:{emailid}`: An email address that represents a Google group. For * example, `admins@example.com`. * `domain:{domain}`: The G Suite domain * (primary) that represents all the users of that domain. For example, * `google.com` or `example.com`. * * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workforce identity pool. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: * All workforce identities in a group. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All workforce identities with a specific attribute value. * * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: * All identities in a workforce identity pool. * * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: * A single identity in a workload identity pool. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: * A workload identity pool group. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: * All identities in a workload identity pool with a certain attribute. * * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: * All identities in a workload identity pool. * * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique * identifier) representing a user that has been recently deleted. For * example, `alice@example.com?uid=123456789012345678901`. If the user is * recovered, this value reverts to `user:{emailid}` and the recovered user * retains the role in the binding. * * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus * unique identifier) representing a service account that has been recently * deleted. For example, * `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If * the service account is undeleted, this value reverts to * `serviceAccount:{emailid}` and the undeleted service account retains the * role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email * address (plus unique identifier) representing a Google group that has been * recently deleted. For example, * `admins@example.com?uid=123456789012345678901`. If the group is recovered, * this value reverts to `group:{emailid}` and the recovered group retains the * role in the binding. * * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: * Deleted single identity in a workforce identity pool. For example, * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. */ members?: string[]; /** * Role that is assigned to the list of `members`, or principals. For * example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview * of the IAM roles and permissions, see the [IAM * documentation](https://cloud.google.com/iam/docs/roles-overview). For a * list of the available pre-defined roles, see * [here](https://cloud.google.com/iam/docs/understanding-roles). */ role?: string; } /** * Artifact policy configuration for repository cleanup policies. */ export interface CleanupPolicy { /** * Policy action. */ action?: | "ACTION_UNSPECIFIED" | "DELETE" | "KEEP"; /** * Policy condition for matching versions. */ condition?: CleanupPolicyCondition; /** * The user-provided ID of the cleanup policy. */ id?: string; /** * Policy condition for retaining a minimum number of versions. May only be * specified with a Keep action. */ mostRecentVersions?: CleanupPolicyMostRecentVersions; } function serializeCleanupPolicy(data: any): CleanupPolicy { return { ...data, condition: data["condition"] !== undefined ? serializeCleanupPolicyCondition(data["condition"]) : undefined, }; } function deserializeCleanupPolicy(data: any): CleanupPolicy { return { ...data, condition: data["condition"] !== undefined ? deserializeCleanupPolicyCondition(data["condition"]) : undefined, }; } /** * CleanupPolicyCondition is a set of conditions attached to a CleanupPolicy. * If multiple entries are set, all must be satisfied for the condition to be * satisfied. */ export interface CleanupPolicyCondition { /** * Match versions newer than a duration. */ newerThan?: number /* Duration */; /** * Match versions older than a duration. */ olderThan?: number /* Duration */; /** * Match versions by package prefix. Applied on any prefix match. */ packageNamePrefixes?: string[]; /** * Match versions by tag prefix. Applied on any prefix match. */ tagPrefixes?: string[]; /** * Match versions by tag status. */ tagState?: | "TAG_STATE_UNSPECIFIED" | "TAGGED" | "UNTAGGED" | "ANY"; /** * Match versions by version name prefix. Applied on any prefix match. */ versionNamePrefixes?: string[]; } function serializeCleanupPolicyCondition(data: any): CleanupPolicyCondition { return { ...data, newerThan: data["newerThan"] !== undefined ? data["newerThan"] : undefined, olderThan: data["olderThan"] !== undefined ? data["olderThan"] : undefined, }; } function deserializeCleanupPolicyCondition(data: any): CleanupPolicyCondition { return { ...data, newerThan: data["newerThan"] !== undefined ? data["newerThan"] : undefined, olderThan: data["olderThan"] !== undefined ? data["olderThan"] : undefined, }; } /** * CleanupPolicyMostRecentVersions is an alternate condition of a CleanupPolicy * for retaining a minimum number of versions. */ export interface CleanupPolicyMostRecentVersions { /** * Minimum number of versions to keep. */ keepCount?: number; /** * List of package name prefixes that will apply this rule. */ packageNamePrefixes?: string[]; } /** * Common remote repository settings type. */ export interface CommonRemoteRepository { /** * Required. A common public repository base for remote repository. */ uri?: string; } /** * DockerImage represents a docker artifact. The following fields are returned * as untyped metadata in the Version resource, using camelcase keys (i.e. * metadata.imageSizeBytes): * imageSizeBytes * mediaType * buildTime */ export interface DockerImage { /** * The time this image was built. This field is returned as the * 'metadata.buildTime' field in the Version resource. The build time is * returned to the client as an RFC 3339 string, which can be easily used with * the JavaScript Date constructor. */ buildTime?: Date; /** * Calculated size of the image. This field is returned as the * 'metadata.imageSizeBytes' field in the Version resource. */ imageSizeBytes?: bigint; /** * Media type of this image, e.g. * "application/vnd.docker.distribution.manifest.v2+json". This field is * returned as the 'metadata.mediaType' field in the Version resource. */ mediaType?: string; /** * Required. registry_location, project_id, repository_name and image id * forms a unique image name:`projects//locations//repository//dockerImages/`. * For example, * "projects/test-project/locations/us-west4/repositories/test-repo/dockerImages/ * nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf", * where "us-west4" is the registry_location, "test-project" is the * project_id, "test-repo" is the repository_name and * "nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf" * is the image's digest. */ name?: string; /** * Tags attached to this image. */ tags?: string[]; /** * Output only. The time when the docker image was last updated. */ readonly updateTime?: Date; /** * Time the image was uploaded. */ uploadTime?: Date; /** * Required. URL to access the image. Example: * us-west4-docker.pkg.dev/test-project/test-repo/nginx@sha256:e9954c1fc875017be1c3e36eca16be2d9e9bccc4bf072163515467d6a823c7cf */ uri?: string; } function serializeDockerImage(data: any): DockerImage { return { ...data, buildTime: data["buildTime"] !== undefined ? data["buildTime"].toISOString() : undefined, imageSizeBytes: data["imageSizeBytes"] !== undefined ? String(data["imageSizeBytes"]) : undefined, uploadTime: data["uploadTime"] !== undefined ? data["uploadTime"].toISOString() : undefined, }; } function deserializeDockerImage(data: any): DockerImage { return { ...data, buildTime: data["buildTime"] !== undefined ? new Date(data["buildTime"]) : undefined, imageSizeBytes: data["imageSizeBytes"] !== undefined ? BigInt(data["imageSizeBytes"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, uploadTime: data["uploadTime"] !== undefined ? new Date(data["uploadTime"]) : undefined, }; } /** * Configuration for a Docker remote repository. */ export interface DockerRepository { /** * Customer-specified remote repository. */ customRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigDockerRepositoryCustomRepository; /** * One of the publicly available Docker repositories supported by Artifact * Registry. */ publicRepository?: | "PUBLIC_REPOSITORY_UNSPECIFIED" | "DOCKER_HUB"; } /** * DockerRepositoryConfig is docker related repository details. Provides * additional configuration details for repositories of the docker format type. */ export interface DockerRepositoryConfig { /** * The repository which enabled this flag prevents all tags from being * modified, moved or deleted. This does not prevent tags from being created. */ immutableTags?: boolean; } /** * The response to download a file. */ export interface DownloadFileResponse { } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * Represents a textual expression in the Common Expression Language (CEL) * syntax. CEL is a C-like expression language. The syntax and semantics of CEL * are documented at https://github.com/google/cel-spec. Example (Comparison): * title: "Summary size limit" description: "Determines if a summary is less * than 100 chars" expression: "document.summary.size() < 100" Example * (Equality): title: "Requestor is owner" description: "Determines if requestor * is the document owner" expression: "document.owner == * request.auth.claims.email" Example (Logic): title: "Public documents" * description: "Determine whether the document should be publicly visible" * expression: "document.type != 'private' && document.type != 'internal'" * Example (Data Manipulation): title: "Notification string" description: * "Create a notification string with a timestamp." expression: "'New message * received at ' + string(document.create_time)" The exact variables and * functions that may be referenced within an expression are determined by the * service that evaluates it. See the service documentation for additional * information. */ export interface Expr { /** * Optional. Description of the expression. This is a longer text which * describes the expression, e.g. when hovered over it in a UI. */ description?: string; /** * Textual representation of an expression in Common Expression Language * syntax. */ expression?: string; /** * Optional. String indicating the location of the expression for error * reporting, e.g. a file name and a position in the file. */ location?: string; /** * Optional. Title for the expression, i.e. a short string describing its * purpose. This can be used e.g. in UIs which allow to enter the expression. */ title?: string; } /** * GenericArtifact represents a generic artifact */ export interface GenericArtifact { /** * Output only. The time when the Generic module is created. */ readonly createTime?: Date; /** * Resource name of the generic artifact. project, location, repository, * package_id and version_id create a unique generic artifact. i.e. * "projects/test-project/locations/us-west4/repositories/test-repo/ * genericArtifacts/package_id:version_id" */ name?: string; /** * Output only. The time when the Generic module is updated. */ readonly updateTime?: Date; /** * The version of the generic artifact. */ version?: string; } /** * GoModule represents a Go module. */ export interface GoModule { /** * Output only. The time when the Go module is created. */ readonly createTime?: Date; /** * The resource name of a Go module. */ name?: string; /** * Output only. The time when the Go module is updated. */ readonly updateTime?: Date; /** * The version of the Go module. Must be a valid canonical version as defined * in https://go.dev/ref/mod#glos-canonical-version. */ version?: string; } /** * A detailed representation of a GooGet artifact. */ export interface GoogetArtifact { /** * Output only. Operating system architecture of the artifact. */ readonly architecture?: string; /** * Output only. The Artifact Registry resource name of the artifact. */ readonly name?: string; /** * Output only. The GooGet package name of the artifact. */ readonly packageName?: string; } /** * Files store content that is potentially associated with Packages or * Versions. */ export interface GoogleDevtoolsArtifactregistryV1File { /** * Optional. Client specified annotations. */ annotations?: { [key: string]: string }; /** * Output only. The time when the File was created. */ readonly createTime?: Date; /** * Output only. The time when the last attempt to refresh the file's data was * made. Only set when the repository is remote. */ readonly fetchTime?: Date; /** * The hashes of the file content. */ hashes?: 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. */ name?: string; /** * The name of the Package or Version that owns this file, if any. */ owner?: string; /** * The size of the File in bytes. */ sizeBytes?: bigint; /** * Output only. The time when the File was last updated. */ readonly updateTime?: Date; } function serializeGoogleDevtoolsArtifactregistryV1File(data: any): GoogleDevtoolsArtifactregistryV1File { return { ...data, hashes: data["hashes"] !== undefined ? data["hashes"].map((item: any) => (serializeHash(item))) : undefined, sizeBytes: data["sizeBytes"] !== undefined ? String(data["sizeBytes"]) : undefined, }; } function deserializeGoogleDevtoolsArtifactregistryV1File(data: any): GoogleDevtoolsArtifactregistryV1File { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, fetchTime: data["fetchTime"] !== undefined ? new Date(data["fetchTime"]) : undefined, hashes: data["hashes"] !== undefined ? data["hashes"].map((item: any) => (deserializeHash(item))) : undefined, sizeBytes: data["sizeBytes"] !== undefined ? BigInt(data["sizeBytes"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Customer-specified publicly available remote repository. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryCustomRepository { /** * An http/https uri reference to the upstream remote repository, for ex: * "https://my.apt.registry/". */ uri?: string; } /** * Publicly available Apt repositories constructed from a common repository * base and a custom repository path. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigAptRepositoryPublicRepository { /** * A common public repository base for Apt. */ repositoryBase?: | "REPOSITORY_BASE_UNSPECIFIED" | "DEBIAN" | "UBUNTU" | "DEBIAN_SNAPSHOT"; /** * A custom field to define a path to a specific repository from the base. */ repositoryPath?: string; } /** * Customer-specified publicly available remote repository. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigDockerRepositoryCustomRepository { /** * An http/https uri reference to the custom remote repository, for ex: * "https://registry-1.docker.io". */ uri?: string; } /** * Customer-specified publicly available remote repository. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigMavenRepositoryCustomRepository { /** * An http/https uri reference to the upstream remote repository, for ex: * "https://my.maven.registry/". */ uri?: string; } /** * Customer-specified publicly available remote repository. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigNpmRepositoryCustomRepository { /** * An http/https uri reference to the upstream remote repository, for ex: * "https://my.npm.registry/". */ uri?: string; } /** * Customer-specified publicly available remote repository. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigPythonRepositoryCustomRepository { /** * An http/https uri reference to the upstream remote repository, for ex: * "https://my.python.registry/". */ uri?: string; } /** * Customer-specified publicly available remote repository. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryCustomRepository { /** * An http/https uri reference to the upstream remote repository, for ex: * "https://my.yum.registry/". */ uri?: string; } /** * Publicly available Yum repositories constructed from a common repository * base and a custom repository path. */ export interface GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository { /** * A common public repository base for Yum. */ repositoryBase?: | "REPOSITORY_BASE_UNSPECIFIED" | "CENTOS" | "CENTOS_DEBUG" | "CENTOS_VAULT" | "CENTOS_STREAM" | "ROCKY" | "EPEL"; /** * A custom field to define a path to a specific repository from the base. */ repositoryPath?: string; } /** * A rule defines the deny or allow action of the operation it applies to and * the conditions required for the rule to apply. You can set one rule for an * entire repository and one rule for each package within. */ export interface GoogleDevtoolsArtifactregistryV1Rule { /** * The action this rule takes. */ action?: | "ACTION_UNSPECIFIED" | "ALLOW" | "DENY"; /** * Optional. A CEL expression for conditions that must be met in order for * the rule to apply. If not provided, the rule matches all objects. */ condition?: Expr; /** * The name of the rule, for example: * `projects/p1/locations/us-central1/repositories/repo1/rules/rule1`. */ name?: string; operation?: | "OPERATION_UNSPECIFIED" | "DOWNLOAD"; /** * The package ID the rule applies to. If empty, this rule applies to all * packages inside the repository. */ packageId?: string; } /** * A hash of file content. */ export interface Hash { /** * The algorithm used to compute the hash value. */ type?: | "HASH_TYPE_UNSPECIFIED" | "SHA256" | "MD5"; /** * The hash value. */ value?: Uint8Array; } function serializeHash(data: any): Hash { return { ...data, value: data["value"] !== undefined ? encodeBase64(data["value"]) : undefined, }; } function deserializeHash(data: any): Hash { return { ...data, value: data["value"] !== undefined ? decodeBase64(data["value"] as string) : undefined, }; } /** * Error information explaining why a package was not imported. */ export interface ImportAptArtifactsErrorInfo { /** * The detailed error status. */ error?: Status; /** * Google Cloud Storage location requested. */ gcsSource?: ImportAptArtifactsGcsSource; } /** * Google Cloud Storage location where the artifacts currently reside. */ export interface ImportAptArtifactsGcsSource { /** * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). */ uris?: string[]; /** * Supports URI wildcards for matching multiple objects from a single URI. */ useWildcards?: boolean; } /** * The operation metadata for importing artifacts. */ export interface ImportAptArtifactsMetadata { } /** * The request to import new apt artifacts. */ export interface ImportAptArtifactsRequest { /** * Google Cloud Storage location where input content is located. */ gcsSource?: ImportAptArtifactsGcsSource; } /** * The response message from importing APT artifacts. */ export interface ImportAptArtifactsResponse { /** * The Apt artifacts imported. */ aptArtifacts?: AptArtifact[]; /** * Detailed error info for packages that were not imported. */ errors?: ImportAptArtifactsErrorInfo[]; } /** * Error information explaining why a package was not imported. */ export interface ImportGoogetArtifactsErrorInfo { /** * The detailed error status. */ error?: Status; /** * Google Cloud Storage location requested. */ gcsSource?: ImportGoogetArtifactsGcsSource; } /** * Google Cloud Storage location where the artifacts currently reside. */ export interface ImportGoogetArtifactsGcsSource { /** * Cloud Storage paths URI (e.g., `gs://my_bucket/my_object`). */ uris?: string[]; /** * Supports URI wildcards for matching multiple objects from a single URI. */ useWildcards?: boolean; } /** * The operation metadata for importing artifacts. */ export interface ImportGoogetArtifactsMetadata { } /** * The request to import new googet artifacts. */ export interface ImportGoogetArtifactsRequest { /** * Google Cloud Storage location where input content is located. */ gcsSource?: ImportGoogetArtifactsGcsSource; } /** * The response message from importing artifacts. */ export interface ImportGoogetArtifactsResponse { /** * Detailed error info for packages that were not imported. */ errors?: ImportGoogetArtifactsErrorInfo[]; /** * The GooGet artifacts updated. */ googetArtifacts?: GoogetArtifact[]; } /** * Error information explaining why a package was not imported. */ export interface ImportYumArtifactsErrorInfo { /** * The detailed error status. */ error?: Status; /** * Google Cloud Storage location requested. */ gcsSource?: ImportYumArtifactsGcsSource; } /** * Google Cloud Storage location where the artifacts currently reside. */ export interface ImportYumArtifactsGcsSource { /** * Cloud Storage paths URI (e.g., gs://my_bucket//my_object). */ uris?: string[]; /** * Supports URI wildcards for matching multiple objects from a single URI. */ useWildcards?: boolean; } /** * The operation metadata for importing artifacts. */ export interface ImportYumArtifactsMetadata { } /** * The request to import new yum artifacts. */ export interface ImportYumArtifactsRequest { /** * Google Cloud Storage location where input content is located. */ gcsSource?: ImportYumArtifactsGcsSource; } /** * The response message from importing YUM artifacts. */ export interface ImportYumArtifactsResponse { /** * Detailed error info for packages that were not imported. */ errors?: ImportYumArtifactsErrorInfo[]; /** * The yum artifacts imported. */ yumArtifacts?: YumArtifact[]; } /** * A detailed representation of a KFP artifact. */ export interface KfpArtifact { /** * Output only. Resource name of the KFP artifact. Since users don't directly * interact with this resource, the name will be derived from the associated * version. For example, when version = ".../versions/sha256:abcdef...", the * name will be ".../kfpArtifacts/sha256:abcdef...". */ readonly name?: string; /** * The version associated with the KFP artifact. Must follow the Semantic * Versioning standard. */ version?: string; } /** * The response from listing attachments. */ export interface ListAttachmentsResponse { /** * The attachments returned. */ attachments?: Attachment[]; /** * The token to retrieve the next page of attachments, or empty if there are * no more attachments to return. */ nextPageToken?: string; } /** * The response from listing docker images. */ export interface ListDockerImagesResponse { /** * The docker images returned. */ dockerImages?: DockerImage[]; /** * The token to retrieve the next page of artifacts, or empty if there are no * more artifacts to return. */ nextPageToken?: string; } function serializeListDockerImagesResponse(data: any): ListDockerImagesResponse { return { ...data, dockerImages: data["dockerImages"] !== undefined ? data["dockerImages"].map((item: any) => (serializeDockerImage(item))) : undefined, }; } function deserializeListDockerImagesResponse(data: any): ListDockerImagesResponse { return { ...data, dockerImages: data["dockerImages"] !== undefined ? data["dockerImages"].map((item: any) => (deserializeDockerImage(item))) : undefined, }; } /** * The response from listing files. */ export interface ListFilesResponse { /** * The files returned. */ files?: GoogleDevtoolsArtifactregistryV1File[]; /** * The token to retrieve the next page of files, or empty if there are no * more files to return. */ nextPageToken?: string; } function serializeListFilesResponse(data: any): ListFilesResponse { return { ...data, files: data["files"] !== undefined ? data["files"].map((item: any) => (serializeGoogleDevtoolsArtifactregistryV1File(item))) : undefined, }; } function deserializeListFilesResponse(data: any): ListFilesResponse { return { ...data, files: data["files"] !== undefined ? data["files"].map((item: any) => (deserializeGoogleDevtoolsArtifactregistryV1File(item))) : undefined, }; } /** * The response message for Locations.ListLocations. */ export interface ListLocationsResponse { /** * A list of locations that matches the specified filter in the request. */ locations?: Location[]; /** * The standard List next-page token. */ nextPageToken?: string; } /** * The response from listing maven artifacts. */ export interface ListMavenArtifactsResponse { /** * The maven artifacts returned. */ mavenArtifacts?: MavenArtifact[]; /** * The token to retrieve the next page of artifacts, or empty if there are no * more artifacts to return. */ nextPageToken?: string; } /** * The response from listing npm packages. */ export interface ListNpmPackagesResponse { /** * The token to retrieve the next page of artifacts, or empty if there are no * more artifacts to return. */ nextPageToken?: string; /** * The npm packages returned. */ npmPackages?: NpmPackage[]; } /** * The response from listing packages. */ export interface ListPackagesResponse { /** * The token to retrieve the next page of packages, or empty if there are no * more packages to return. */ nextPageToken?: string; /** * The packages returned. */ packages?: Package[]; } function serializeListPackagesResponse(data: any): ListPackagesResponse { return { ...data, packages: data["packages"] !== undefined ? data["packages"].map((item: any) => (serializePackage(item))) : undefined, }; } function deserializeListPackagesResponse(data: any): ListPackagesResponse { return { ...data, packages: data["packages"] !== undefined ? data["packages"].map((item: any) => (deserializePackage(item))) : undefined, }; } /** * The response from listing python packages. */ export interface ListPythonPackagesResponse { /** * The token to retrieve the next page of artifacts, or empty if there are no * more artifacts to return. */ nextPageToken?: string; /** * The python packages returned. */ pythonPackages?: PythonPackage[]; } /** * The response from listing repositories. */ export interface ListRepositoriesResponse { /** * The token to retrieve the next page of repositories, or empty if there are * no more repositories to return. */ nextPageToken?: string; /** * The repositories returned. */ repositories?: Repository[]; } function serializeListRepositoriesResponse(data: any): ListRepositoriesResponse { return { ...data, repositories: data["repositories"] !== undefined ? data["repositories"].map((item: any) => (serializeRepository(item))) : undefined, }; } function deserializeListRepositoriesResponse(data: any): ListRepositoriesResponse { return { ...data, repositories: data["repositories"] !== undefined ? data["repositories"].map((item: any) => (deserializeRepository(item))) : undefined, }; } /** * The response from listing rules. */ export interface ListRulesResponse { /** * The token to retrieve the next page of rules, or empty if there are no * more rules to return. */ nextPageToken?: string; /** * The rules returned. */ rules?: GoogleDevtoolsArtifactregistryV1Rule[]; } /** * The response from listing tags. */ export interface ListTagsResponse { /** * The token to retrieve the next page of tags, or empty if there are no more * tags to return. */ nextPageToken?: string; /** * The tags returned. */ tags?: Tag[]; } /** * The response from listing versions. */ export interface ListVersionsResponse { /** * The token to retrieve the next page of versions, or empty if there are no * more versions to return. */ nextPageToken?: string; /** * The versions returned. */ versions?: Version[]; } function serializeListVersionsResponse(data: any): ListVersionsResponse { return { ...data, versions: data["versions"] !== undefined ? data["versions"].map((item: any) => (serializeVersion(item))) : undefined, }; } function deserializeListVersionsResponse(data: any): ListVersionsResponse { return { ...data, versions: data["versions"] !== undefined ? data["versions"].map((item: any) => (deserializeVersion(item))) : undefined, }; } /** * A resource that represents a Google Cloud location. */ export interface Location { /** * The friendly name for this location, typically a nearby city name. For * example, "Tokyo". */ displayName?: string; /** * Cross-service attributes for the location. For example * {"cloud.googleapis.com/region": "us-east1"} */ labels?: { [key: string]: string }; /** * The canonical id for this location. For example: `"us-east1"`. */ locationId?: string; /** * Service-specific metadata. For example the available capacity at the given * location. */ metadata?: { [key: string]: any }; /** * Resource name for the location, which may vary between implementations. * For example: `"projects/example-project/locations/us-east1"` */ name?: string; } /** * MavenArtifact represents a maven artifact. */ export interface MavenArtifact { /** * Artifact ID for the artifact. */ artifactId?: string; /** * Output only. Time the artifact was created. */ readonly createTime?: Date; /** * Group ID for the artifact. Example: com.google.guava */ groupId?: string; /** * Required. registry_location, project_id, repository_name and * maven_artifact forms a unique artifact For example, * "projects/test-project/locations/us-west4/repositories/test-repo/mavenArtifacts/ * com.google.guava:guava:31.0-jre", where "us-west4" is the * registry_location, "test-project" is the project_id, "test-repo" is the * repository_name and "com.google.guava:guava:31.0-jre" is the maven * artifact. */ name?: string; /** * Required. URL to access the pom file of the artifact. Example: * us-west4-maven.pkg.dev/test-project/test-repo/com/google/guava/guava/31.0/guava-31.0.pom */ pomUri?: string; /** * Output only. Time the artifact was updated. */ readonly updateTime?: Date; /** * Version of this artifact. */ version?: string; } /** * Configuration for a Maven remote repository. */ export interface MavenRepository { /** * Customer-specified remote repository. */ customRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigMavenRepositoryCustomRepository; /** * One of the publicly available Maven repositories supported by Artifact * Registry. */ publicRepository?: | "PUBLIC_REPOSITORY_UNSPECIFIED" | "MAVEN_CENTRAL"; } /** * MavenRepositoryConfig is maven related repository details. Provides * additional configuration details for repositories of the maven format type. */ export interface MavenRepositoryConfig { /** * The repository with this flag will allow publishing the same snapshot * versions. */ allowSnapshotOverwrites?: boolean; /** * Version policy defines the versions that the registry will accept. */ versionPolicy?: | "VERSION_POLICY_UNSPECIFIED" | "RELEASE" | "SNAPSHOT"; } /** * NpmPackage represents an npm artifact. */ export interface NpmPackage { /** * Output only. Time the package was created. */ readonly createTime?: Date; /** * Required. registry_location, project_id, repository_name and npm_package * forms a unique package For example, * "projects/test-project/locations/us-west4/repositories/test-repo/npmPackages/ * npm_test:1.0.0", where "us-west4" is the registry_location, "test-project" * is the project_id, "test-repo" is the repository_name and npm_test:1.0.0" * is the npm package. */ name?: string; /** * Package for the artifact. */ packageName?: string; /** * Tags attached to this package. */ tags?: string[]; /** * Output only. Time the package was updated. */ readonly updateTime?: Date; /** * Version of this package. */ version?: string; } /** * Configuration for a Npm remote repository. */ export interface NpmRepository { /** * Customer-specified remote repository. */ customRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigNpmRepositoryCustomRepository; /** * One of the publicly available Npm repositories supported by Artifact * Registry. */ publicRepository?: | "PUBLIC_REPOSITORY_UNSPECIFIED" | "NPMJS"; } /** * This resource represents a long-running operation that is the result of a * network API call. */ export interface Operation { /** * If the value is `false`, it means the operation is still in progress. If * `true`, the operation is completed, and either `error` or `response` is * available. */ done?: boolean; /** * The error result of the operation in case of failure or cancellation. */ error?: Status; /** * Service-specific metadata associated with the operation. It typically * contains progress information and common metadata such as create time. Some * services might not provide such metadata. Any method that returns a * long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any }; /** * The server-assigned name, which is only unique within the same service * that originally returns it. If you use the default HTTP mapping, the `name` * should be a resource name ending with `operations/{unique_id}`. */ name?: string; /** * The normal, successful response of the operation. If the original method * returns no data on success, such as `Delete`, the response is * `google.protobuf.Empty`. If the original method is standard * `Get`/`Create`/`Update`, the response should be the resource. For other * methods, the response should have the type `XxxResponse`, where `Xxx` is * the original method name. For example, if the original method name is * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any }; } /** * Metadata type for longrunning-operations, currently empty. */ export interface OperationMetadata { } /** * Packages are named collections of versions. */ export interface Package { /** * Optional. Client specified annotations. */ annotations?: { [key: string]: string }; /** * The time when the package was created. */ createTime?: Date; /** * The display name of the package. */ displayName?: string; /** * The name of the package, for example: * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1`. If * the package ID part contains slashes, the slashes are escaped. */ name?: string; /** * The time when the package was last updated. This includes publishing a new * version of the package. */ updateTime?: Date; } function serializePackage(data: any): Package { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializePackage(data: any): Package { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * An Identity and Access Management (IAM) policy, which specifies access * controls for Google Cloud resources. A `Policy` is a collection of * `bindings`. A `binding` binds one or more `members`, or principals, to a * single `role`. Principals can be user accounts, service accounts, Google * groups, and domains (such as G Suite). A `role` is a named list of * permissions; each `role` can be an IAM predefined role or a user-created * custom role. For some types of Google Cloud resources, a `binding` can also * specify a `condition`, which is a logical expression that allows access to a * resource only if the expression evaluates to `true`. A condition can add * constraints based on attributes of the request, the resource, or both. To * learn which resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). * **JSON example:** ``` { "bindings": [ { "role": * "roles/resourcemanager.organizationAdmin", "members": [ * "user:mike@example.com", "group:admins@example.com", "domain:google.com", * "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": * "roles/resourcemanager.organizationViewer", "members": [ * "user:eve@example.com" ], "condition": { "title": "expirable access", * "description": "Does not grant access after Sep 2020", "expression": * "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": * "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - members: * - user:mike@example.com - group:admins@example.com - domain:google.com - * serviceAccount:my-project-id@appspot.gserviceaccount.com role: * roles/resourcemanager.organizationAdmin - members: - user:eve@example.com * role: roles/resourcemanager.organizationViewer condition: title: expirable * access description: Does not grant access after Sep 2020 expression: * request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= * version: 3 ``` For a description of IAM and its features, see the [IAM * documentation](https://cloud.google.com/iam/docs/). */ export interface Policy { /** * Associates a list of `members`, or principals, with a `role`. Optionally, * may specify a `condition` that determines how and when the `bindings` are * applied. Each of the `bindings` must contain at least one principal. The * `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of * these principals can be Google groups. Each occurrence of a principal * counts towards these limits. For example, if the `bindings` grant 50 * different roles to `user:alice@example.com`, and not to any other * principal, then you can add another 1,450 principals to the `bindings` in * the `Policy`. */ bindings?: Binding[]; /** * `etag` is used for optimistic concurrency control as a way to help prevent * simultaneous updates of a policy from overwriting each other. It is * strongly suggested that systems make use of the `etag` in the * read-modify-write cycle to perform policy updates in order to avoid race * conditions: An `etag` is returned in the response to `getIamPolicy`, and * systems are expected to put that etag in the request to `setIamPolicy` to * ensure that their change will be applied to the same version of the policy. * **Important:** If you use IAM Conditions, you must include the `etag` field * whenever you call `setIamPolicy`. If you omit this field, then IAM allows * you to overwrite a version `3` policy with a version `1` policy, and all of * the conditions in the version `3` policy are lost. */ etag?: Uint8Array; /** * Specifies the format of the policy. Valid values are `0`, `1`, and `3`. * Requests that specify an invalid value are rejected. Any operation that * affects conditional role bindings must specify version `3`. This * requirement applies to the following operations: * Getting a policy that * includes a conditional role binding * Adding a conditional role binding to * a policy * Changing a conditional role binding in a policy * Removing any * role binding, with or without a condition, from a policy that includes * conditions **Important:** If you use IAM Conditions, you must include the * `etag` field whenever you call `setIamPolicy`. If you omit this field, then * IAM allows you to overwrite a version `3` policy with a version `1` policy, * and all of the conditions in the version `3` policy are lost. If a policy * does not include any conditions, operations on that policy may specify any * valid version or leave the field unset. To learn which resources support * conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ version?: number; } function serializePolicy(data: any): Policy { return { ...data, etag: data["etag"] !== undefined ? encodeBase64(data["etag"]) : undefined, }; } function deserializePolicy(data: any): Policy { return { ...data, etag: data["etag"] !== undefined ? decodeBase64(data["etag"] as string) : undefined, }; } /** * The Artifact Registry settings that apply to a Project. */ export interface ProjectSettings { /** * The redirection state of the legacy repositories in this project. */ legacyRedirectionState?: | "REDIRECTION_STATE_UNSPECIFIED" | "REDIRECTION_FROM_GCR_IO_DISABLED" | "REDIRECTION_FROM_GCR_IO_ENABLED" | "REDIRECTION_FROM_GCR_IO_FINALIZED" | "REDIRECTION_FROM_GCR_IO_ENABLED_AND_COPYING" | "REDIRECTION_FROM_GCR_IO_PARTIAL_AND_COPYING"; /** * The name of the project's settings. Always of the form: * projects/{project-id}/projectSettings In update request: never set In * response: always set */ name?: string; /** * The percentage of pull traffic to redirect from GCR to AR when using * partial redirection. */ pullPercent?: number; } /** * Additional options for ArtifactRegistry#projectsLocationsList. */ export interface ProjectsLocationsListOptions { /** * A filter to narrow down results to a preferred subset. The filtering * language accepts strings like `"displayName=tokyo"`, and is documented in * more detail in [AIP-160](https://google.aip.dev/160). */ filter?: string; /** * The maximum number of results to return. If not set, the service selects a * default. */ pageSize?: number; /** * A page token received from the `next_page_token` field in the response. * Send that page token to receive the subsequent page. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesAttachmentsCreate. */ export interface ProjectsLocationsRepositoriesAttachmentsCreateOptions { /** * Required. The attachment id to use for this attachment. */ attachmentId?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesAttachmentsList. */ export interface ProjectsLocationsRepositoriesAttachmentsListOptions { /** * Optional. An expression for filtering the results of the request. Filter * rules are case insensitive. The fields eligible for filtering are: * * `target` * `type` * `attachment_namespace` */ filter?: string; /** * The maximum number of attachments to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for ArtifactRegistry#projectsLocationsRepositoriesCreate. */ export interface ProjectsLocationsRepositoriesCreateOptions { /** * Required. The repository id to use for this repository. */ repositoryId?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesDockerImagesList. */ export interface ProjectsLocationsRepositoriesDockerImagesListOptions { /** * The field to order the results by. */ orderBy?: string; /** * The maximum number of artifacts to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesFilesList. */ export interface ProjectsLocationsRepositoriesFilesListOptions { /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: * `name` * `owner` * * `annotations` Examples of using a filter: To filter the results of your * request to files with the name `my_file.txt` in project `my-project` in the * `us-central` region, in repository `my-repo`, append the following filter * expression to your request: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-file.txt"` * You can also use wildcards to match any number of characters before or * after the value: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/my-*"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file.txt"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/files/*file*"` * To filter the results of your request to files owned by the version `1.0` * in package `pkg1`, append the following filter expression to your request: * * * `owner="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` * To filter the results of your request to files with the annotation * key-value pair [`external_link`: `external_link_value`], append the * following filter expression to your request: * * `"annotations.external_link:external_link_value"` To filter just for a * specific annotation key `external_link`, append the following filter * expression to your request: * `"annotations.external_link"` If the * annotation key or value contains special characters, you can escape them by * surrounding the value with backticks. For example, to filter the results of * your request to files with the annotation key-value pair * [`external.link`:`https://example.com/my-file`], append the following * filter expression to your request: * `` * "annotations.`external.link`:`https://example.com/my-file`" `` You can also * filter with annotations with a wildcard to match any number of characters * before or after the value: * `` "annotations.*_link:`*example.com*`" `` */ filter?: string; /** * The field to order the results by. */ orderBy?: string; /** * The maximum number of files to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesFilesPatch. */ export interface ProjectsLocationsRepositoriesFilesPatchOptions { /** * Required. The update mask applies to the resource. For the `FieldMask` * definition, see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesFilesPatchOptions(data: any): ProjectsLocationsRepositoriesFilesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesFilesPatchOptions(data: any): ProjectsLocationsRepositoriesFilesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesGetIamPolicy. */ export interface ProjectsLocationsRepositoriesGetIamPolicyOptions { /** * Optional. The maximum policy version that will be used to format the * policy. Valid values are 0, 1, and 3. Requests specifying an invalid value * will be rejected. Requests for policies with any conditional role bindings * must specify version 3. Policies with no conditional role bindings may * specify any valid value or leave the field unset. The policy in the * response might use the policy version that you specified, or it might use a * lower policy version. For example, if you specify version 3, but the policy * has no conditional role bindings, the response uses version 1. To learn * which resources support conditions in their IAM policies, see the [IAM * documentation](https://cloud.google.com/iam/help/conditions/resource-policies). */ ["options.requestedPolicyVersion"]?: number; } /** * Additional options for ArtifactRegistry#projectsLocationsRepositoriesList. */ export interface ProjectsLocationsRepositoriesListOptions { /** * Optional. An expression for filtering the results of the request. Filter * rules are case insensitive. The fields eligible for filtering are: * `name` * Examples of using a filter: To filter the results of your request to * repositories with the name `my-repo` in project `my-project` in the * `us-central` region, append the following filter expression to your * request: * * `name="projects/my-project/locations/us-central1/repositories/my-repo"` You * can also use wildcards to match any number of characters before or after * the value: * * `name="projects/my-project/locations/us-central1/repositories/my-*"` * * `name="projects/my-project/locations/us-central1/repositories/*repo"` * * `name="projects/my-project/locations/us-central1/repositories/*repo*"` */ filter?: string; /** * Optional. The field to order the results by. */ orderBy?: string; /** * The maximum number of repositories to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesMavenArtifactsList. */ export interface ProjectsLocationsRepositoriesMavenArtifactsListOptions { /** * The maximum number of artifacts to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesNpmPackagesList. */ export interface ProjectsLocationsRepositoriesNpmPackagesListOptions { /** * The maximum number of artifacts to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesList. */ export interface ProjectsLocationsRepositoriesPackagesListOptions { /** * Optional. An expression for filtering the results of the request. Filter * rules are case insensitive. The fields eligible for filtering are: * `name` * * `annotations` Examples of using a filter: To filter the results of your * request to packages with the name `my-package` in project `my-project` in * the `us-central` region, in repository `my-repo`, append the following * filter expression to your request: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package"` * You can also use wildcards to match any number of characters before or * after the value: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-*"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*package"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/*pack*"` * To filter the results of your request to packages with the annotation * key-value pair [`external_link`: `external_link_value`], append the * following filter expression to your request": * * `"annotations.external_link:external_link_value"` To filter the results * just for a specific annotation key `external_link`, append the following * filter expression to your request: * `"annotations.external_link"` If the * annotation key or value contains special characters, you can escape them by * surrounding the value with backticks. For example, to filter the results of * your request to packages with the annotation key-value pair * [`external.link`:`https://example.com/my-package`], append the following * filter expression to your request: * `` * "annotations.`external.link`:`https://example.com/my-package`" `` You can * also filter with annotations with a wildcard to match any number of * characters before or after the value: * `` * "annotations.*_link:`*example.com*`" `` */ filter?: string; /** * Optional. The field to order the results by. */ orderBy?: string; /** * The maximum number of packages to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesPatch. */ export interface ProjectsLocationsRepositoriesPackagesPatchOptions { /** * The update mask applies to the resource. For the `FieldMask` definition, * see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesPackagesPatchOptions(data: any): ProjectsLocationsRepositoriesPackagesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesPackagesPatchOptions(data: any): ProjectsLocationsRepositoriesPackagesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesTagsCreate. */ export interface ProjectsLocationsRepositoriesPackagesTagsCreateOptions { /** * The tag id to use for this repository. */ tagId?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesTagsList. */ export interface ProjectsLocationsRepositoriesPackagesTagsListOptions { /** * An expression for filtering the results of the request. Filter rules are * case insensitive. The fields eligible for filtering are: * `name` * * `version` Examples of using a filter: To filter the results of your request * to tags with the name `my-tag` in package `my-package` in repository * `my-repo` in project "`y-project` in the us-central region, append the * following filter expression to your request: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my-tag"` * You can also use wildcards to match any number of characters before or * after the value: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/my*"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/tags/*tag*"` * To filter the results of your request to tags applied to the version `1.0` * in package `my-package`, append the following filter expression to your * request: * * `version="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/1.0"` */ filter?: string; /** * The maximum number of tags to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesTagsPatch. */ export interface ProjectsLocationsRepositoriesPackagesTagsPatchOptions { /** * The update mask applies to the resource. For the `FieldMask` definition, * see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesPackagesTagsPatchOptions(data: any): ProjectsLocationsRepositoriesPackagesTagsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesPackagesTagsPatchOptions(data: any): ProjectsLocationsRepositoriesPackagesTagsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesVersionsDelete. */ export interface ProjectsLocationsRepositoriesPackagesVersionsDeleteOptions { /** * By default, a version that is tagged may not be deleted. If force=true, * the version and any tags pointing to the version are deleted. */ force?: boolean; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesVersionsGet. */ export interface ProjectsLocationsRepositoriesPackagesVersionsGetOptions { /** * The view that should be returned in the response. */ view?: | "VERSION_VIEW_UNSPECIFIED" | "BASIC" | "FULL"; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesVersionsList. */ export interface ProjectsLocationsRepositoriesPackagesVersionsListOptions { /** * Optional. An expression for filtering the results of the request. Filter * rules are case insensitive. The fields eligible for filtering are: * `name` * * `annotations` Examples of using a filter: To filter the results of your * request to versions with the name `my-version` in project `my-project` in * the `us-central` region, in repository `my-repo`, append the following * filter expression to your request: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my-version"` * You can also use wildcards to match any number of characters before or * after the value: * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/my*"` * * * `name="projects/my-project/locations/us-central1/repositories/my-repo/packages/my-package/versions/*version*"` * To filter the results of your request to versions with the annotation * key-value pair [`external_link`: `external_link_value`], append the * following filter expression to your request: * * `"annotations.external_link:external_link_value"` To filter just for a * specific annotation key `external_link`, append the following filter * expression to your request: * `"annotations.external_link"` If the * annotation key or value contains special characters, you can escape them by * surrounding the value with backticks. For example, to filter the results of * your request to versions with the annotation key-value pair * [`external.link`:`https://example.com/my-version`], append the following * filter expression to your request: * `` * "annotations.`external.link`:`https://example.com/my-version`" `` You can * also filter with annotations with a wildcard to match any number of * characters before or after the value: * `` * "annotations.*_link:`*example.com*`" `` */ filter?: string; /** * Optional. The field to order the results by. */ orderBy?: string; /** * The maximum number of versions to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; /** * The view that should be returned in the response. */ view?: | "VERSION_VIEW_UNSPECIFIED" | "BASIC" | "FULL"; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPackagesVersionsPatch. */ export interface ProjectsLocationsRepositoriesPackagesVersionsPatchOptions { /** * The update mask applies to the resource. For the `FieldMask` definition, * see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesPackagesVersionsPatchOptions(data: any): ProjectsLocationsRepositoriesPackagesVersionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesPackagesVersionsPatchOptions(data: any): ProjectsLocationsRepositoriesPackagesVersionsPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ArtifactRegistry#projectsLocationsRepositoriesPatch. */ export interface ProjectsLocationsRepositoriesPatchOptions { /** * The update mask applies to the resource. For the `FieldMask` definition, * see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesPatchOptions(data: any): ProjectsLocationsRepositoriesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesPatchOptions(data: any): ProjectsLocationsRepositoriesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesPythonPackagesList. */ export interface ProjectsLocationsRepositoriesPythonPackagesListOptions { /** * The maximum number of artifacts to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesRulesCreate. */ export interface ProjectsLocationsRepositoriesRulesCreateOptions { /** * The rule id to use for this repository. */ ruleId?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesRulesList. */ export interface ProjectsLocationsRepositoriesRulesListOptions { /** * The maximum number of rules to return. Maximum page size is 1,000. */ pageSize?: number; /** * The next_page_token value returned from a previous list request, if any. */ pageToken?: string; } /** * Additional options for * ArtifactRegistry#projectsLocationsRepositoriesRulesPatch. */ export interface ProjectsLocationsRepositoriesRulesPatchOptions { /** * The update mask applies to the resource. For the `FieldMask` definition, * see * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsRepositoriesRulesPatchOptions(data: any): ProjectsLocationsRepositoriesRulesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsRepositoriesRulesPatchOptions(data: any): ProjectsLocationsRepositoriesRulesPatchOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ArtifactRegistry#projectsLocationsUpdateVpcscConfig. */ export interface ProjectsLocationsUpdateVpcscConfigOptions { /** * Field mask to support partial updates. */ updateMask?: string /* FieldMask */; } function serializeProjectsLocationsUpdateVpcscConfigOptions(data: any): ProjectsLocationsUpdateVpcscConfigOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsLocationsUpdateVpcscConfigOptions(data: any): ProjectsLocationsUpdateVpcscConfigOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * Additional options for ArtifactRegistry#projectsUpdateProjectSettings. */ export interface ProjectsUpdateProjectSettingsOptions { /** * Field mask to support partial updates. */ updateMask?: string /* FieldMask */; } function serializeProjectsUpdateProjectSettingsOptions(data: any): ProjectsUpdateProjectSettingsOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } function deserializeProjectsUpdateProjectSettingsOptions(data: any): ProjectsUpdateProjectSettingsOptions { return { ...data, updateMask: data["updateMask"] !== undefined ? data["updateMask"] : undefined, }; } /** * PythonPackage represents a python artifact. */ export interface PythonPackage { /** * Output only. Time the package was created. */ readonly createTime?: Date; /** * Required. registry_location, project_id, repository_name and * python_package forms a unique package * name:`projects//locations//repository//pythonPackages/`. For example, * "projects/test-project/locations/us-west4/repositories/test-repo/pythonPackages/ * python_package:1.0.0", where "us-west4" is the registry_location, * "test-project" is the project_id, "test-repo" is the repository_name and * python_package:1.0.0" is the python package. */ name?: string; /** * Package for the artifact. */ packageName?: string; /** * Output only. Time the package was updated. */ readonly updateTime?: Date; /** * Required. URL to access the package. Example: * us-west4-python.pkg.dev/test-project/test-repo/python_package/file-name-1.0.0.tar.gz */ uri?: string; /** * Version of this package. */ version?: string; } /** * Configuration for a Python remote repository. */ export interface PythonRepository { /** * Customer-specified remote repository. */ customRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigPythonRepositoryCustomRepository; /** * One of the publicly available Python repositories supported by Artifact * Registry. */ publicRepository?: | "PUBLIC_REPOSITORY_UNSPECIFIED" | "PYPI"; } /** * Remote repository configuration. */ export interface RemoteRepositoryConfig { /** * Specific settings for an Apt remote repository. */ aptRepository?: AptRepository; /** * Common remote repository settings. Used as the remote repository upstream * URL. */ commonRepository?: CommonRemoteRepository; /** * The description of the remote source. */ description?: string; /** * Input only. A create/update remote repo option to avoid making a HEAD/GET * request to validate a remote repo and any supplied upstream credentials. */ disableUpstreamValidation?: boolean; /** * Specific settings for a Docker remote repository. */ dockerRepository?: DockerRepository; /** * Specific settings for a Maven remote repository. */ mavenRepository?: MavenRepository; /** * Specific settings for an Npm remote repository. */ npmRepository?: NpmRepository; /** * Specific settings for a Python remote repository. */ pythonRepository?: PythonRepository; /** * Optional. The credentials used to access the remote repository. */ upstreamCredentials?: UpstreamCredentials; /** * Specific settings for a Yum remote repository. */ yumRepository?: YumRepository; } /** * A Repository for storing artifacts with a specific format. */ export interface Repository { /** * Optional. Cleanup policies for this repository. Cleanup policies indicate * when certain package versions can be automatically deleted. Map keys are * policy IDs supplied by users during policy creation. They must unique * within a repository and be under 128 characters in length. */ cleanupPolicies?: { [key: string]: CleanupPolicy }; /** * Optional. If true, the cleanup pipeline is prevented from deleting * versions in this repository. */ cleanupPolicyDryRun?: boolean; /** * Output only. The time when the repository was created. */ readonly createTime?: Date; /** * The user-provided description of the repository. */ description?: string; /** * Optional. If this is true, an unspecified repo type will be treated as * error rather than defaulting to standard. */ disallowUnspecifiedMode?: boolean; /** * Docker repository config contains repository level configuration for the * repositories of docker type. */ dockerConfig?: DockerRepositoryConfig; /** * Optional. The format of packages that are stored in the repository. */ format?: | "FORMAT_UNSPECIFIED" | "DOCKER" | "MAVEN" | "NPM" | "APT" | "YUM" | "GOOGET" | "PYTHON" | "KFP" | "GO" | "GENERIC"; /** * The Cloud KMS resource name of the customer managed encryption key that's * used to encrypt the contents of the Repository. Has the form: * `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. * This value may not be changed after the Repository has been created. */ kmsKeyName?: string; /** * Labels with user-defined metadata. This field may contain up to 64 * entries. Label keys and values may be no longer than 63 characters. Label * keys must begin with a lowercase letter and may only contain lowercase * letters, numeric characters, underscores, and dashes. */ labels?: { [key: string]: string }; /** * Maven repository config contains repository level configuration for the * repositories of maven type. */ mavenConfig?: MavenRepositoryConfig; /** * Optional. The mode of the repository. */ mode?: | "MODE_UNSPECIFIED" | "STANDARD_REPOSITORY" | "VIRTUAL_REPOSITORY" | "REMOTE_REPOSITORY" | "AOSS_REPOSITORY" | "ASSURED_OSS_REPOSITORY"; /** * 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; /** * Configuration specific for a Remote Repository. */ remoteRepositoryConfig?: RemoteRepositoryConfig; /** * Output only. If set, the repository satisfies physical zone isolation. */ readonly satisfiesPzi?: boolean; /** * Output only. If set, the repository satisfies physical zone separation. */ readonly satisfiesPzs?: boolean; /** * Output only. The size, in bytes, of all artifact storage in this * repository. Repositories that are generally available or in public preview * use this to calculate storage costs. */ readonly sizeBytes?: bigint; /** * Output only. The time when the repository was last updated. */ readonly updateTime?: Date; /** * Configuration specific for a Virtual Repository. */ virtualRepositoryConfig?: VirtualRepositoryConfig; /** * Optional. Config and state for vulnerability scanning of resources within * this Repository. */ vulnerabilityScanningConfig?: VulnerabilityScanningConfig; } function serializeRepository(data: any): Repository { return { ...data, cleanupPolicies: data["cleanupPolicies"] !== undefined ? Object.fromEntries(Object.entries(data["cleanupPolicies"]).map(([k, v]: [string, any]) => ([k, serializeCleanupPolicy(v)]))) : undefined, }; } function deserializeRepository(data: any): Repository { return { ...data, cleanupPolicies: data["cleanupPolicies"] !== undefined ? Object.fromEntries(Object.entries(data["cleanupPolicies"]).map(([k, v]: [string, any]) => ([k, deserializeCleanupPolicy(v)]))) : undefined, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, sizeBytes: data["sizeBytes"] !== undefined ? BigInt(data["sizeBytes"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Request message for `SetIamPolicy` method. */ export interface SetIamPolicyRequest { /** * REQUIRED: The complete policy to be applied to the `resource`. The size of * the policy is limited to a few 10s of KB. An empty policy is a valid policy * but certain Google Cloud services (such as Projects) might reject them. */ policy?: Policy; } function serializeSetIamPolicyRequest(data: any): SetIamPolicyRequest { return { ...data, policy: data["policy"] !== undefined ? serializePolicy(data["policy"]) : undefined, }; } function deserializeSetIamPolicyRequest(data: any): SetIamPolicyRequest { return { ...data, policy: data["policy"] !== undefined ? deserializePolicy(data["policy"]) : undefined, }; } /** * The `Status` type defines a logical error model that is suitable for * different programming environments, including REST APIs and RPC APIs. It is * used by [gRPC](https://github.com/grpc). Each `Status` message contains three * pieces of data: error code, error message, and error details. You can find * out more about this error model and how to work with it in the [API Design * Guide](https://cloud.google.com/apis/design/errors). */ export interface Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number; /** * A list of messages that carry the error details. There is a common set of * message types for APIs to use. */ details?: { [key: string]: any }[]; /** * A developer-facing error message, which should be in English. Any * user-facing error message should be localized and sent in the * google.rpc.Status.details field, or localized by the client. */ message?: string; } /** * Tags point to a version and represent an alternative name that can be used * to access the version. */ export interface Tag { /** * The name of the tag, for example: * "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/tags/tag1". * If the package part contains slashes, the slashes are escaped. The tag part * can only have characters in [a-zA-Z0-9\-._~:@], anything else must be URL * encoded. */ name?: string; /** * The name of the version the tag refers to, for example: * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/sha256:5243811` * If the package or version ID parts contain slashes, the slashes are * escaped. */ version?: string; } /** * Request message for `TestIamPermissions` method. */ export interface TestIamPermissionsRequest { /** * The set of permissions to check for the `resource`. Permissions with * wildcards (such as `*` or `storage.*`) are not allowed. For more * information see [IAM * Overview](https://cloud.google.com/iam/docs/overview#permissions). */ permissions?: string[]; } /** * Response message for `TestIamPermissions` method. */ export interface TestIamPermissionsResponse { /** * A subset of `TestPermissionsRequest.permissions` that the caller is * allowed. */ permissions?: string[]; } /** * The response to upload an artifact. */ export interface UploadAptArtifactMediaResponse { /** * Operation to be returned to the user. */ operation?: Operation; } /** * The operation metadata for uploading artifacts. */ export interface UploadAptArtifactMetadata { } /** * The request to upload an artifact. */ export interface UploadAptArtifactRequest { } /** * The response of the completed artifact upload operation. This response is * contained in the Operation and available to users. */ export interface UploadAptArtifactResponse { /** * The Apt artifacts updated. */ aptArtifacts?: AptArtifact[]; } /** * The response to upload a generic artifact. */ export interface UploadFileMediaResponse { /** * Operation that will be returned to the user. */ operation?: Operation; } /** * The request to upload a file. */ export interface UploadFileRequest { /** * Optional. The ID of the file. If left empty will default to sha256 digest * of the content uploaded. */ fileId?: string; } /** * The response to upload a generic artifact. */ export interface UploadGenericArtifactMediaResponse { /** * Operation that will be returned to the user. */ operation?: Operation; } /** * The operation metadata for uploading generic artifacts. */ export interface UploadGenericArtifactMetadata { } /** * The request to upload a generic artifact. The created GenericArtifact will * have the resource name {parent}/genericArtifacts/package_id:version_id. The * created file will have the resource name * {parent}/files/package_id:version_id:filename. */ export interface UploadGenericArtifactRequest { /** * The name of the file of the generic artifact to be uploaded. E.g. * `example-file.zip` The filename is limited to letters, numbers, and url * safe characters, i.e. [a-zA-Z0-9-_.~@]. */ filename?: string; /** * The ID of the package of the generic artifact. If the package does not * exist, a new package will be created. The `package_id` should start and end * with a letter or number, only contain letters, numbers, hyphens, * underscores, and periods, and not exceed 256 characters. */ packageId?: string; /** * The ID of the version of the generic artifact. If the version does not * exist, a new version will be created. The version_id must start and end * with a letter or number, can only contain lowercase letters, numbers, * hyphens and periods, i.e. [a-z0-9-.] and cannot exceed a total of 128 * characters. Creating a version called `latest` is not allowed. */ versionId?: string; } /** * The response to upload a Go module. */ export interface UploadGoModuleMediaResponse { /** * Operation to be returned to the user. */ operation?: Operation; } /** * The operation metadata for uploading go modules. */ export interface UploadGoModuleMetadata { } /** * The request to upload a Go module. */ export interface UploadGoModuleRequest { } /** * The response to upload an artifact. */ export interface UploadGoogetArtifactMediaResponse { /** * Operation to be returned to the user. */ operation?: Operation; } /** * The operation metadata for uploading artifacts. */ export interface UploadGoogetArtifactMetadata { } /** * The request to upload an artifact. */ export interface UploadGoogetArtifactRequest { } /** * The response of the completed artifact upload operation. This response is * contained in the Operation and available to users. */ export interface UploadGoogetArtifactResponse { /** * The GooGet artifacts updated. */ googetArtifacts?: GoogetArtifact[]; } /** * The response to upload an artifact. */ export interface UploadKfpArtifactMediaResponse { /** * Operation that will be returned to the user. */ operation?: Operation; } /** * The operation metadata for uploading KFP artifacts. */ export interface UploadKfpArtifactMetadata { } /** * The request to upload an artifact. */ export interface UploadKfpArtifactRequest { /** * Description of the package version. */ description?: string; /** * Tags to be created with the version. */ tags?: string[]; } /** * The response to upload an artifact. */ export interface UploadYumArtifactMediaResponse { /** * Operation to be returned to the user. */ operation?: Operation; } /** * The operation metadata for uploading artifacts. */ export interface UploadYumArtifactMetadata { } /** * The request to upload an artifact. */ export interface UploadYumArtifactRequest { } /** * The response of the completed artifact upload operation. This response is * contained in the Operation and available to users. */ export interface UploadYumArtifactResponse { /** * The Yum artifacts updated. */ yumArtifacts?: YumArtifact[]; } /** * The credentials to access the remote repository. */ export interface UpstreamCredentials { /** * Use username and password to access the remote repository. */ usernamePasswordCredentials?: UsernamePasswordCredentials; } /** * Artifact policy configuration for the repository contents. */ export interface UpstreamPolicy { /** * The user-provided ID of the upstream policy. */ id?: string; /** * Entries with a greater priority value take precedence in the pull order. */ priority?: number; /** * A reference to the repository resource, for example: * `projects/p1/locations/us-central1/repositories/repo1`. */ repository?: string; } /** * Username and password credentials. */ export interface UsernamePasswordCredentials { /** * The Secret Manager key version that holds the password to access the * remote repository. Must be in the format of * `projects/{project}/secrets/{secret}/versions/{version}`. */ passwordSecretVersion?: string; /** * The username to access the remote repository. */ username?: string; } /** * The body of a version resource. A version resource represents a collection * of components, such as files and other data. This may correspond to a version * in many package management schemes. */ export interface Version { /** * Optional. Client specified annotations. */ annotations?: { [key: string]: string }; /** * The time when the version was created. */ createTime?: Date; /** * Optional. Description of the version, as specified in its metadata. */ description?: string; /** * Output only. Repository-specific Metadata stored against this version. The * fields returned are defined by the underlying repository-specific resource. * Currently, the resources could be: DockerImage MavenArtifact */ readonly metadata?: { [key: string]: any }; /** * The name of the version, for example: * `projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1`. * If the package or version ID parts contain slashes, the slashes are * escaped. */ name?: string; /** * Output only. A list of related tags. Will contain up to 100 tags that * reference this version. */ relatedTags?: Tag[]; /** * The time when the version was last updated. */ updateTime?: Date; } function serializeVersion(data: any): Version { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeVersion(data: any): Version { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Virtual repository configuration. */ export interface VirtualRepositoryConfig { /** * Policies that configure the upstream artifacts distributed by the Virtual * Repository. Upstream policies cannot be set on a standard repository. */ upstreamPolicies?: UpstreamPolicy[]; } /** * The Artifact Registry VPC SC config that apply to a Project. */ export interface VPCSCConfig { /** * The name of the project's VPC SC Config. Always of the form: * projects/{projectID}/locations/{location}/vpcscConfig In update request: * never set In response: always set */ name?: string; /** * The project per location VPC SC policy that defines the VPC SC behavior * for the Remote Repository (Allow/Deny). */ vpcscPolicy?: | "VPCSC_POLICY_UNSPECIFIED" | "DENY" | "ALLOW"; } /** * Config on whether to perform vulnerability scanning for resources in this * repository, as well as output fields describing current state. */ export interface VulnerabilityScanningConfig { /** * Optional. Config for whether this repository has vulnerability scanning * disabled. */ enablementConfig?: | "ENABLEMENT_CONFIG_UNSPECIFIED" | "INHERITED" | "DISABLED"; /** * Output only. State of feature enablement, combining repository enablement * config and API enablement state. */ readonly enablementState?: | "ENABLEMENT_STATE_UNSPECIFIED" | "SCANNING_UNSUPPORTED" | "SCANNING_DISABLED" | "SCANNING_ACTIVE"; /** * Output only. Reason for the repository state. */ readonly enablementStateReason?: string; /** * Output only. The last time this repository config was enabled. */ readonly lastEnableTime?: Date; } /** * A detailed representation of a Yum artifact. */ export interface YumArtifact { /** * Output only. Operating system architecture of the artifact. */ readonly architecture?: string; /** * Output only. The Artifact Registry resource name of the artifact. */ readonly name?: string; /** * Output only. The yum package name of the artifact. */ readonly packageName?: string; /** * Output only. An artifact is a binary or source package. */ readonly packageType?: | "PACKAGE_TYPE_UNSPECIFIED" | "BINARY" | "SOURCE"; } /** * Configuration for a Yum remote repository. */ export interface YumRepository { /** * Customer-specified remote repository. */ customRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryCustomRepository; /** * One of the publicly available Yum repositories supported by Artifact * Registry. */ publicRepository?: GoogleDevtoolsArtifactregistryV1RemoteRepositoryConfigYumRepositoryPublicRepository; } function decodeBase64(b64: string): Uint8Array { const binString = atob(b64); const size = binString.length; const bytes = new Uint8Array(size); for (let i = 0; i < size; i++) { bytes[i] = binString.charCodeAt(i); } return bytes; } const base64abc = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"]; /** * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727 * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation * @param data */ function encodeBase64(uint8: Uint8Array): string { let result = "", i; const l = uint8.length; for (i = 2; i < l; i += 3) { result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]; result += base64abc[uint8[i] & 0x3f]; } if (i === l + 1) { // 1 octet yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[(uint8[i - 2] & 0x03) << 4]; result += "=="; } if (i === l) { // 2 octets yet to write result += base64abc[uint8[i - 2] >> 2]; result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]; result += base64abc[(uint8[i - 1] & 0x0f) << 2]; result += "="; } return result; }