Skip to content

Commit c13919d

Browse files
yoshi-automationfeywind
authored andcommitted
feat(artifactregistry): update the API
#### artifactregistry:v1 The following keys were added: - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.description - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.flatPath - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.httpMethod - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.id - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.parameterOrder - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.parameters.repository.description - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.parameters.repository.location - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.parameters.repository.pattern - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.parameters.repository.required - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.parameters.repository.type - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.path - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.request.$ref - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.response.$ref - resources.projects.resources.locations.resources.repositories.methods.exportArtifact.scopes - schemas.ExportArtifactMetadata.description - schemas.ExportArtifactMetadata.id - schemas.ExportArtifactMetadata.properties.exportedFiles.description - schemas.ExportArtifactMetadata.properties.exportedFiles.items.$ref - schemas.ExportArtifactMetadata.properties.exportedFiles.type - schemas.ExportArtifactMetadata.type - schemas.ExportArtifactRequest.description - schemas.ExportArtifactRequest.id - schemas.ExportArtifactRequest.properties.gcsPath.description - schemas.ExportArtifactRequest.properties.gcsPath.type - schemas.ExportArtifactRequest.properties.sourceTag.description - schemas.ExportArtifactRequest.properties.sourceTag.type - schemas.ExportArtifactRequest.properties.sourceVersion.description - schemas.ExportArtifactRequest.properties.sourceVersion.type - schemas.ExportArtifactRequest.type - schemas.ExportArtifactResponse.description - schemas.ExportArtifactResponse.id - schemas.ExportArtifactResponse.properties.exportedVersion.$ref - schemas.ExportArtifactResponse.properties.exportedVersion.description - schemas.ExportArtifactResponse.type - schemas.ExportedFile.description - schemas.ExportedFile.id - schemas.ExportedFile.properties.gcsObjectPath.description - schemas.ExportedFile.properties.gcsObjectPath.type - schemas.ExportedFile.properties.hashes.description - schemas.ExportedFile.properties.hashes.items.$ref - schemas.ExportedFile.properties.hashes.type - schemas.ExportedFile.properties.name.description - schemas.ExportedFile.properties.name.type - schemas.ExportedFile.type
1 parent 3c2d0e2 commit c13919d

File tree

2 files changed

+314
-1
lines changed

2 files changed

+314
-1
lines changed

discovery/artifactregistry-v1.json

Lines changed: 95 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,34 @@
637637
"https://www.googleapis.com/auth/cloud-platform"
638638
]
639639
},
640+
"exportArtifact": {
641+
"description": "Exports an artifact.",
642+
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}:exportArtifact",
643+
"httpMethod": "POST",
644+
"id": "artifactregistry.projects.locations.repositories.exportArtifact",
645+
"parameterOrder": [
646+
"repository"
647+
],
648+
"parameters": {
649+
"repository": {
650+
"description": "Required. The repository of the artifact to export. Format: projects/{project}/locations/{location}/repositories/{repository}",
651+
"location": "path",
652+
"pattern": "^projects/[^/]+/locations/[^/]+/repositories/[^/]+$",
653+
"required": true,
654+
"type": "string"
655+
}
656+
},
657+
"path": "v1/{+repository}:exportArtifact",
658+
"request": {
659+
"$ref": "ExportArtifactRequest"
660+
},
661+
"response": {
662+
"$ref": "Operation"
663+
},
664+
"scopes": [
665+
"https://www.googleapis.com/auth/cloud-platform"
666+
]
667+
},
640668
"get": {
641669
"description": "Gets a repository.",
642670
"flatPath": "v1/projects/{projectsId}/locations/{locationsId}/repositories/{repositoriesId}",
@@ -2465,7 +2493,7 @@
24652493
}
24662494
}
24672495
},
2468-
"revision": "20251007",
2496+
"revision": "20251017",
24692497
"rootUrl": "https://artifactregistry.googleapis.com/",
24702498
"schemas": {
24712499
"AptArtifact": {
@@ -2849,6 +2877,72 @@
28492877
"properties": {},
28502878
"type": "object"
28512879
},
2880+
"ExportArtifactMetadata": {
2881+
"description": "The LRO metadata for exporting an artifact.",
2882+
"id": "ExportArtifactMetadata",
2883+
"properties": {
2884+
"exportedFiles": {
2885+
"description": "The exported artifact files.",
2886+
"items": {
2887+
"$ref": "ExportedFile"
2888+
},
2889+
"type": "array"
2890+
}
2891+
},
2892+
"type": "object"
2893+
},
2894+
"ExportArtifactRequest": {
2895+
"description": "The request for exporting an artifact to a destination.",
2896+
"id": "ExportArtifactRequest",
2897+
"properties": {
2898+
"gcsPath": {
2899+
"description": "The Cloud Storage path to export the artifact to. Should start with the bucket name, and optionally have a directory path. Examples: `dst_bucket`, `dst_bucket/sub_dir`. Existing objects with the same path will be overwritten.",
2900+
"type": "string"
2901+
},
2902+
"sourceTag": {
2903+
"description": "The artifact tag to export. Format:projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/tags/{tag}",
2904+
"type": "string"
2905+
},
2906+
"sourceVersion": {
2907+
"description": "The artifact version to export. Format: projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}",
2908+
"type": "string"
2909+
}
2910+
},
2911+
"type": "object"
2912+
},
2913+
"ExportArtifactResponse": {
2914+
"description": "The response for exporting an artifact to a destination.",
2915+
"id": "ExportArtifactResponse",
2916+
"properties": {
2917+
"exportedVersion": {
2918+
"$ref": "Version",
2919+
"description": "The exported version. Should be the same as the request version with fingerprint resource name."
2920+
}
2921+
},
2922+
"type": "object"
2923+
},
2924+
"ExportedFile": {
2925+
"description": "The exported artifact file.",
2926+
"id": "ExportedFile",
2927+
"properties": {
2928+
"gcsObjectPath": {
2929+
"description": "Cloud Storage Object path of the exported file. Examples: `dst_bucket/file1`, `dst_bucket/sub_dir/file1`",
2930+
"type": "string"
2931+
},
2932+
"hashes": {
2933+
"description": "The hashes of the file content.",
2934+
"items": {
2935+
"$ref": "Hash"
2936+
},
2937+
"type": "array"
2938+
},
2939+
"name": {
2940+
"description": "Name of the exported artifact file. Format: `projects/p1/locations/us/repositories/repo1/files/file1`",
2941+
"type": "string"
2942+
}
2943+
},
2944+
"type": "object"
2945+
},
28522946
"Expr": {
28532947
"description": "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.",
28542948
"id": "Expr",

src/apis/artifactregistry/v1.ts

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,58 @@ export namespace artifactregistry_v1 {
385385
* 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); \}
386386
*/
387387
export interface Schema$Empty {}
388+
/**
389+
* The LRO metadata for exporting an artifact.
390+
*/
391+
export interface Schema$ExportArtifactMetadata {
392+
/**
393+
* The exported artifact files.
394+
*/
395+
exportedFiles?: Schema$ExportedFile[];
396+
}
397+
/**
398+
* The request for exporting an artifact to a destination.
399+
*/
400+
export interface Schema$ExportArtifactRequest {
401+
/**
402+
* The Cloud Storage path to export the artifact to. Should start with the bucket name, and optionally have a directory path. Examples: `dst_bucket`, `dst_bucket/sub_dir`. Existing objects with the same path will be overwritten.
403+
*/
404+
gcsPath?: string | null;
405+
/**
406+
* The artifact tag to export. Format:projects/{project\}/locations/{location\}/repositories/{repository\}/packages/{package\}/tags/{tag\}
407+
*/
408+
sourceTag?: string | null;
409+
/**
410+
* The artifact version to export. Format: projects/{project\}/locations/{location\}/repositories/{repository\}/packages/{package\}/versions/{version\}
411+
*/
412+
sourceVersion?: string | null;
413+
}
414+
/**
415+
* The response for exporting an artifact to a destination.
416+
*/
417+
export interface Schema$ExportArtifactResponse {
418+
/**
419+
* The exported version. Should be the same as the request version with fingerprint resource name.
420+
*/
421+
exportedVersion?: Schema$Version;
422+
}
423+
/**
424+
* The exported artifact file.
425+
*/
426+
export interface Schema$ExportedFile {
427+
/**
428+
* Cloud Storage Object path of the exported file. Examples: `dst_bucket/file1`, `dst_bucket/sub_dir/file1`
429+
*/
430+
gcsObjectPath?: string | null;
431+
/**
432+
* The hashes of the file content.
433+
*/
434+
hashes?: Schema$Hash[];
435+
/**
436+
* Name of the exported artifact file. Format: `projects/p1/locations/us/repositories/repo1/files/file1`
437+
*/
438+
name?: string | null;
439+
}
388440
/**
389441
* 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.
390442
*/
@@ -3206,6 +3258,161 @@ export namespace artifactregistry_v1 {
32063258
}
32073259
}
32083260

3261+
/**
3262+
* Exports an artifact.
3263+
* @example
3264+
* ```js
3265+
* // Before running the sample:
3266+
* // - Enable the API at:
3267+
* // https://console.developers.google.com/apis/api/artifactregistry.googleapis.com
3268+
* // - Login into gcloud by running:
3269+
* // ```sh
3270+
* // $ gcloud auth application-default login
3271+
* // ```
3272+
* // - Install the npm module by running:
3273+
* // ```sh
3274+
* // $ npm install googleapis
3275+
* // ```
3276+
*
3277+
* const {google} = require('googleapis');
3278+
* const artifactregistry = google.artifactregistry('v1');
3279+
*
3280+
* async function main() {
3281+
* const auth = new google.auth.GoogleAuth({
3282+
* // Scopes can be specified either as an array or as a single, space-delimited string.
3283+
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
3284+
* });
3285+
*
3286+
* // Acquire an auth client, and bind it to all future calls
3287+
* const authClient = await auth.getClient();
3288+
* google.options({auth: authClient});
3289+
*
3290+
* // Do the magic
3291+
* const res =
3292+
* await artifactregistry.projects.locations.repositories.exportArtifact({
3293+
* // Required. The repository of the artifact to export. Format: projects/{project\}/locations/{location\}/repositories/{repository\}
3294+
* repository:
3295+
* 'projects/my-project/locations/my-location/repositories/my-repositorie',
3296+
*
3297+
* // Request body metadata
3298+
* requestBody: {
3299+
* // request body parameters
3300+
* // {
3301+
* // "gcsPath": "my_gcsPath",
3302+
* // "sourceTag": "my_sourceTag",
3303+
* // "sourceVersion": "my_sourceVersion"
3304+
* // }
3305+
* },
3306+
* });
3307+
* console.log(res.data);
3308+
*
3309+
* // Example response
3310+
* // {
3311+
* // "done": false,
3312+
* // "error": {},
3313+
* // "metadata": {},
3314+
* // "name": "my_name",
3315+
* // "response": {}
3316+
* // }
3317+
* }
3318+
*
3319+
* main().catch(e => {
3320+
* console.error(e);
3321+
* throw e;
3322+
* });
3323+
*
3324+
* ```
3325+
*
3326+
* @param params - Parameters for request
3327+
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
3328+
* @param callback - Optional callback that handles the response.
3329+
* @returns A promise if used with async/await, or void if used with a callback.
3330+
*/
3331+
exportArtifact(
3332+
params: Params$Resource$Projects$Locations$Repositories$Exportartifact,
3333+
options: StreamMethodOptions
3334+
): Promise<GaxiosResponseWithHTTP2<Readable>>;
3335+
exportArtifact(
3336+
params?: Params$Resource$Projects$Locations$Repositories$Exportartifact,
3337+
options?: MethodOptions
3338+
): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
3339+
exportArtifact(
3340+
params: Params$Resource$Projects$Locations$Repositories$Exportartifact,
3341+
options: StreamMethodOptions | BodyResponseCallback<Readable>,
3342+
callback: BodyResponseCallback<Readable>
3343+
): void;
3344+
exportArtifact(
3345+
params: Params$Resource$Projects$Locations$Repositories$Exportartifact,
3346+
options: MethodOptions | BodyResponseCallback<Schema$Operation>,
3347+
callback: BodyResponseCallback<Schema$Operation>
3348+
): void;
3349+
exportArtifact(
3350+
params: Params$Resource$Projects$Locations$Repositories$Exportartifact,
3351+
callback: BodyResponseCallback<Schema$Operation>
3352+
): void;
3353+
exportArtifact(callback: BodyResponseCallback<Schema$Operation>): void;
3354+
exportArtifact(
3355+
paramsOrCallback?:
3356+
| Params$Resource$Projects$Locations$Repositories$Exportartifact
3357+
| BodyResponseCallback<Schema$Operation>
3358+
| BodyResponseCallback<Readable>,
3359+
optionsOrCallback?:
3360+
| MethodOptions
3361+
| StreamMethodOptions
3362+
| BodyResponseCallback<Schema$Operation>
3363+
| BodyResponseCallback<Readable>,
3364+
callback?:
3365+
| BodyResponseCallback<Schema$Operation>
3366+
| BodyResponseCallback<Readable>
3367+
):
3368+
| void
3369+
| Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
3370+
| Promise<GaxiosResponseWithHTTP2<Readable>> {
3371+
let params = (paramsOrCallback ||
3372+
{}) as Params$Resource$Projects$Locations$Repositories$Exportartifact;
3373+
let options = (optionsOrCallback || {}) as MethodOptions;
3374+
3375+
if (typeof paramsOrCallback === 'function') {
3376+
callback = paramsOrCallback;
3377+
params =
3378+
{} as Params$Resource$Projects$Locations$Repositories$Exportartifact;
3379+
options = {};
3380+
}
3381+
3382+
if (typeof optionsOrCallback === 'function') {
3383+
callback = optionsOrCallback;
3384+
options = {};
3385+
}
3386+
3387+
const rootUrl =
3388+
options.rootUrl || 'https://artifactregistry.googleapis.com/';
3389+
const parameters = {
3390+
options: Object.assign(
3391+
{
3392+
url: (rootUrl + '/v1/{+repository}:exportArtifact').replace(
3393+
/([^:]\/)\/+/g,
3394+
'$1'
3395+
),
3396+
method: 'POST',
3397+
apiVersion: '',
3398+
},
3399+
options
3400+
),
3401+
params,
3402+
requiredParams: ['repository'],
3403+
pathParams: ['repository'],
3404+
context: this.context,
3405+
};
3406+
if (callback) {
3407+
createAPIRequest<Schema$Operation>(
3408+
parameters,
3409+
callback as BodyResponseCallback<unknown>
3410+
);
3411+
} else {
3412+
return createAPIRequest<Schema$Operation>(parameters);
3413+
}
3414+
}
3415+
32093416
/**
32103417
* Gets a repository.
32113418
* @example
@@ -4177,6 +4384,18 @@ export namespace artifactregistry_v1 {
41774384
*/
41784385
name?: string;
41794386
}
4387+
export interface Params$Resource$Projects$Locations$Repositories$Exportartifact
4388+
extends StandardParameters {
4389+
/**
4390+
* Required. The repository of the artifact to export. Format: projects/{project\}/locations/{location\}/repositories/{repository\}
4391+
*/
4392+
repository?: string;
4393+
4394+
/**
4395+
* Request body metadata
4396+
*/
4397+
requestBody?: Schema$ExportArtifactRequest;
4398+
}
41804399
export interface Params$Resource$Projects$Locations$Repositories$Get
41814400
extends StandardParameters {
41824401
/**

0 commit comments

Comments
 (0)