xref: /aosp_15_r20/external/googleapis/google/devtools/artifactregistry/v1beta2/version.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2020 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.v1beta2;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/devtools/artifactregistry/v1beta2/tag.proto";
22import "google/protobuf/struct.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1Beta2";
26option go_package = "cloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypb";
27option java_multiple_files = true;
28option java_outer_classname = "VersionProto";
29option java_package = "com.google.devtools.artifactregistry.v1beta2";
30option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1beta2";
31option ruby_package = "Google::Cloud::ArtifactRegistry::V1beta2";
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 only resource in use is
78  // [DockerImage][google.devtools.artifactregistry.v1.DockerImage]
79  google.protobuf.Struct metadata = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
80}
81
82// The request to list versions.
83message ListVersionsRequest {
84  // The name of the parent resource whose versions will be listed.
85  string parent = 1;
86
87  // The maximum number of versions to return. Maximum page size is 1,000.
88  int32 page_size = 2;
89
90  // The next_page_token value returned from a previous list request, if any.
91  string page_token = 3;
92
93  // The view that should be returned in the response.
94  VersionView view = 4;
95
96  // Optional. The field to order the results by.
97  string order_by = 5 [(google.api.field_behavior) = OPTIONAL];
98}
99
100// The response from listing versions.
101message ListVersionsResponse {
102  // The versions returned.
103  repeated Version versions = 1;
104
105  // The token to retrieve the next page of versions, or empty if there are no
106  // more versions to return.
107  string next_page_token = 2;
108}
109
110// The request to retrieve a version.
111message GetVersionRequest {
112  // The name of the version to retrieve.
113  string name = 1;
114
115  // The view that should be returned in the response.
116  VersionView view = 2;
117}
118
119// The request to delete a version.
120message DeleteVersionRequest {
121  // The name of the version to delete.
122  string name = 1;
123
124  // By default, a version that is tagged may not be deleted. If force=true, the
125  // version and any tags pointing to the version are deleted.
126  bool force = 2;
127}
128