xref: /aosp_15_r20/external/googleapis/google/devtools/artifactregistry/v1/version.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.devtools.artifactregistry.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/devtools/artifactregistry/v1/tag.proto";
22import "google/protobuf/struct.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1";
26option go_package = "cloud.google.com/go/artifactregistry/apiv1/artifactregistrypb;artifactregistrypb";
27option java_multiple_files = true;
28option java_outer_classname = "VersionProto";
29option java_package = "com.google.devtools.artifactregistry.v1";
30option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1";
31option ruby_package = "Google::Cloud::ArtifactRegistry::V1";
32
33// The view, which determines what version information is returned in a
34// response.
35enum VersionView {
36  // The default / unset value.
37  // The API will default to the BASIC view.
38  VERSION_VIEW_UNSPECIFIED = 0;
39
40  // Includes basic information about the version, but not any related tags.
41  BASIC = 1;
42
43  // Include everything.
44  FULL = 2;
45}
46
47// The body of a version resource. A version resource represents a
48// collection of components, such as files and other data. This may correspond
49// to a version in many package management schemes.
50message Version {
51  option (google.api.resource) = {
52    type: "artifactregistry.googleapis.com/Version"
53    pattern: "projects/{project}/locations/{location}/repositories/{repository}/packages/{package}/versions/{version}"
54  };
55
56  // The name of the version, for example:
57  // "projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/art1".
58  // If the package or version ID parts contain slashes, the slashes are
59  // escaped.
60  string name = 1;
61
62  // Optional. Description of the version, as specified in its metadata.
63  string description = 3;
64
65  // The time when the version was created.
66  google.protobuf.Timestamp create_time = 5;
67
68  // The time when the version was last updated.
69  google.protobuf.Timestamp update_time = 6;
70
71  // Output only. A list of related tags. Will contain up to 100 tags that
72  // reference this version.
73  repeated Tag related_tags = 7;
74
75  // Output only. Repository-specific Metadata stored against this version.
76  // The fields returned are defined by the underlying repository-specific
77  // resource. Currently, the resources could be:
78  // [DockerImage][google.devtools.artifactregistry.v1.DockerImage]
79  // [MavenArtifact][google.devtools.artifactregistry.v1.MavenArtifact]
80  google.protobuf.Struct metadata = 8
81      [(google.api.field_behavior) = OUTPUT_ONLY];
82}
83
84// The request to list versions.
85message ListVersionsRequest {
86  // The name of the parent resource whose versions will be listed.
87  string parent = 1;
88
89  // The maximum number of versions to return. Maximum page size is 1,000.
90  int32 page_size = 2;
91
92  // The next_page_token value returned from a previous list request, if any.
93  string page_token = 3;
94
95  // The view that should be returned in the response.
96  VersionView view = 4;
97
98  // Optional. The field to order the results by.
99  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
100}
101
102// The response from listing versions.
103message ListVersionsResponse {
104  // The versions returned.
105  repeated Version versions = 1;
106
107  // The token to retrieve the next page of versions, or empty if there are no
108  // more versions to return.
109  string next_page_token = 2;
110}
111
112// The request to retrieve a version.
113message GetVersionRequest {
114  // The name of the version to retrieve.
115  string name = 1;
116
117  // The view that should be returned in the response.
118  VersionView view = 2;
119}
120
121// The request to delete a version.
122message DeleteVersionRequest {
123  // The name of the version to delete.
124  string name = 1;
125
126  // By default, a version that is tagged may not be deleted. If force=true, the
127  // version and any tags pointing to the version are deleted.
128  bool force = 2;
129}
130
131// The request to delete multiple versions across a repository.
132message BatchDeleteVersionsRequest {
133  // The name of the repository holding all requested versions.
134  string parent = 1 [(google.api.resource_reference) = {
135    child_type: "artifactregistry.googleapis.com/Version"
136  }];
137
138  // Required. The names of the versions to delete.
139  // A maximum of 10000 versions can be deleted in a batch.
140  repeated string names = 2 [
141    (google.api.field_behavior) = REQUIRED,
142    (google.api.resource_reference) = {
143      type: "artifactregistry.googleapis.com/Version"
144    }
145  ];
146
147  // If true, the request is performed without deleting data, following AIP-163.
148  bool validate_only = 3;
149}
150
151// The metadata of an LRO from deleting multiple versions.
152message BatchDeleteVersionsMetadata {
153  // The versions the operation failed to delete.
154  repeated string failed_versions = 2;
155}
156