diff --git a/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/service.proto b/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/service.proto index 7c172020114..b7e7c368092 100644 --- a/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/service.proto +++ b/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/service.proto @@ -543,7 +543,7 @@ service ArtifactRegistry { }; } - // Exports an artifact. + // Exports an artifact to a Cloud Storage bucket. rpc ExportArtifact(ExportArtifactRequest) returns (google.longrunning.Operation) { option (google.api.http) = { diff --git a/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/version.proto b/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/version.proto index ec64db538c9..4efa5c15fec 100644 --- a/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/version.proto +++ b/packages/google-devtools-artifactregistry/protos/google/devtools/artifactregistry/v1/version.proto @@ -18,6 +18,7 @@ package google.devtools.artifactregistry.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/devtools/artifactregistry/v1/file.proto"; import "google/devtools/artifactregistry/v1/tag.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/struct.proto"; @@ -83,6 +84,11 @@ message Version { // Optional. Client specified annotations. map annotations = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Immutable reference for the version, calculated based on the + // version's content. Currently we only support dirsum_sha256 hash algorithm. + // Additional hash algorithms may be added in the future. + repeated Hash fingerprints = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; } // The request to list versions. diff --git a/packages/google-devtools-artifactregistry/protos/protos.d.ts b/packages/google-devtools-artifactregistry/protos/protos.d.ts index b09897990c9..1f77436a9c4 100644 --- a/packages/google-devtools-artifactregistry/protos/protos.d.ts +++ b/packages/google-devtools-artifactregistry/protos/protos.d.ts @@ -4484,6 +4484,9 @@ export namespace google { /** Version annotations */ annotations?: ({ [k: string]: string }|null); + + /** Version fingerprints */ + fingerprints?: (google.devtools.artifactregistry.v1.IHash[]|null); } /** Represents a Version. */ @@ -4516,6 +4519,9 @@ export namespace google { /** Version annotations. */ public annotations: { [k: string]: string }; + /** Version fingerprints. */ + public fingerprints: google.devtools.artifactregistry.v1.IHash[]; + /** * Creates a new Version instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/google-devtools-artifactregistry/protos/protos.js b/packages/google-devtools-artifactregistry/protos/protos.js index 7fae15548d5..c1bbd9102cf 100644 --- a/packages/google-devtools-artifactregistry/protos/protos.js +++ b/packages/google-devtools-artifactregistry/protos/protos.js @@ -11011,6 +11011,7 @@ * @property {Array.|null} [relatedTags] Version relatedTags * @property {google.protobuf.IStruct|null} [metadata] Version metadata * @property {Object.|null} [annotations] Version annotations + * @property {Array.|null} [fingerprints] Version fingerprints */ /** @@ -11024,6 +11025,7 @@ function Version(properties) { this.relatedTags = []; this.annotations = {}; + this.fingerprints = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11086,6 +11088,14 @@ */ Version.prototype.annotations = $util.emptyObject; + /** + * Version fingerprints. + * @member {Array.} fingerprints + * @memberof google.devtools.artifactregistry.v1.Version + * @instance + */ + Version.prototype.fingerprints = $util.emptyArray; + /** * Creates a new Version instance using the specified properties. * @function create @@ -11126,6 +11136,9 @@ if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.fingerprints != null && message.fingerprints.length) + for (var i = 0; i < message.fingerprints.length; ++i) + $root.google.devtools.artifactregistry.v1.Hash.encode(message.fingerprints[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -11211,6 +11224,12 @@ message.annotations[key] = value; break; } + case 10: { + if (!(message.fingerprints && message.fingerprints.length)) + message.fingerprints = []; + message.fingerprints.push($root.google.devtools.artifactregistry.v1.Hash.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -11284,6 +11303,15 @@ if (!$util.isString(message.annotations[key[i]])) return "annotations: string{k:string} expected"; } + if (message.fingerprints != null && message.hasOwnProperty("fingerprints")) { + if (!Array.isArray(message.fingerprints)) + return "fingerprints: array expected"; + for (var i = 0; i < message.fingerprints.length; ++i) { + var error = $root.google.devtools.artifactregistry.v1.Hash.verify(message.fingerprints[i]); + if (error) + return "fingerprints." + error; + } + } return null; }; @@ -11335,6 +11363,16 @@ for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) message.annotations[keys[i]] = String(object.annotations[keys[i]]); } + if (object.fingerprints) { + if (!Array.isArray(object.fingerprints)) + throw TypeError(".google.devtools.artifactregistry.v1.Version.fingerprints: array expected"); + message.fingerprints = []; + for (var i = 0; i < object.fingerprints.length; ++i) { + if (typeof object.fingerprints[i] !== "object") + throw TypeError(".google.devtools.artifactregistry.v1.Version.fingerprints: object expected"); + message.fingerprints[i] = $root.google.devtools.artifactregistry.v1.Hash.fromObject(object.fingerprints[i]); + } + } return message; }; @@ -11351,8 +11389,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.relatedTags = []; + object.fingerprints = []; + } if (options.objects || options.defaults) object.annotations = {}; if (options.defaults) { @@ -11383,6 +11423,11 @@ for (var j = 0; j < keys2.length; ++j) object.annotations[keys2[j]] = message.annotations[keys2[j]]; } + if (message.fingerprints && message.fingerprints.length) { + object.fingerprints = []; + for (var j = 0; j < message.fingerprints.length; ++j) + object.fingerprints[j] = $root.google.devtools.artifactregistry.v1.Hash.toObject(message.fingerprints[j], options); + } return object; }; diff --git a/packages/google-devtools-artifactregistry/protos/protos.json b/packages/google-devtools-artifactregistry/protos/protos.json index f6b34fa74bd..dc9bdac4d2d 100644 --- a/packages/google-devtools-artifactregistry/protos/protos.json +++ b/packages/google-devtools-artifactregistry/protos/protos.json @@ -1029,6 +1029,14 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "fingerprints": { + "rule": "repeated", + "type": "Hash", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, diff --git a/packages/google-devtools-artifactregistry/samples/generated/v1/snippet_metadata_google.devtools.artifactregistry.v1.json b/packages/google-devtools-artifactregistry/samples/generated/v1/snippet_metadata_google.devtools.artifactregistry.v1.json index 25f6766fcda..a8ffbe34418 100644 --- a/packages/google-devtools-artifactregistry/samples/generated/v1/snippet_metadata_google.devtools.artifactregistry.v1.json +++ b/packages/google-devtools-artifactregistry/samples/generated/v1/snippet_metadata_google.devtools.artifactregistry.v1.json @@ -2215,7 +2215,7 @@ "regionTag": "artifactregistry_v1_generated_ArtifactRegistry_ExportArtifact_async", "title": "ArtifactRegistry exportArtifact Sample", "origin": "API_DEFINITION", - "description": " Exports an artifact.", + "description": " Exports an artifact to a Cloud Storage bucket.", "canonical": true, "file": "artifact_registry.export_artifact.js", "language": "JAVASCRIPT", diff --git a/packages/google-devtools-artifactregistry/src/v1/artifact_registry_client.ts b/packages/google-devtools-artifactregistry/src/v1/artifact_registry_client.ts index a62d34e624f..18a7ea0ae36 100644 --- a/packages/google-devtools-artifactregistry/src/v1/artifact_registry_client.ts +++ b/packages/google-devtools-artifactregistry/src/v1/artifact_registry_client.ts @@ -4337,7 +4337,7 @@ export class ArtifactRegistryClient { return decodeOperation as LROperation; } /** - * Exports an artifact. + * Exports an artifact to a Cloud Storage bucket. * * @param {Object} request * The request object that will be sent.