xref: /aosp_15_r20/external/googleapis/google/devtools/artifactregistry/v1beta2/repository.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/protobuf/field_mask.proto";
22import "google/protobuf/timestamp.proto";
23
24option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1Beta2";
25option go_package = "cloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypb";
26option java_multiple_files = true;
27option java_outer_classname = "RepositoryProto";
28option java_package = "com.google.devtools.artifactregistry.v1beta2";
29option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1beta2";
30option ruby_package = "Google::Cloud::ArtifactRegistry::V1beta2";
31
32// A Repository for storing artifacts with a specific format.
33message Repository {
34  option (google.api.resource) = {
35    type: "artifactregistry.googleapis.com/Repository"
36    pattern: "projects/{project}/locations/{location}/repositories/{repository}"
37  };
38
39  // MavenRepositoryConfig is maven related repository details.
40  // Provides additional configuration details for repositories of the maven
41  // format type.
42  message MavenRepositoryConfig {
43    // VersionPolicy is the version policy for the repository.
44    enum VersionPolicy {
45      // VERSION_POLICY_UNSPECIFIED - the version policy is not defined.
46      // When the version policy is not defined, no validation is performed
47      // for the versions.
48      VERSION_POLICY_UNSPECIFIED = 0;
49
50      // RELEASE - repository will accept only Release versions.
51      RELEASE = 1;
52
53      // SNAPSHOT - repository will accept only Snapshot versions.
54      SNAPSHOT = 2;
55    }
56
57    // The repository with this flag will allow publishing
58    // the same snapshot versions.
59    bool allow_snapshot_overwrites = 1;
60
61    // Version policy defines the versions that the registry will accept.
62    VersionPolicy version_policy = 2;
63  }
64
65  // A package format.
66  enum Format {
67    // Unspecified package format.
68    FORMAT_UNSPECIFIED = 0;
69
70    // Docker package format.
71    DOCKER = 1;
72
73    // Maven package format.
74    MAVEN = 2;
75
76    // NPM package format.
77    NPM = 3;
78
79    // APT package format.
80    APT = 5;
81
82    // YUM package format.
83    YUM = 6;
84
85    // Python package format.
86    PYTHON = 8;
87  }
88
89  // Repository-specific configurations.
90  oneof format_config {
91    // Maven repository config contains repository level configuration
92    // for the repositories of maven type.
93    MavenRepositoryConfig maven_config = 9;
94  }
95
96  // The name of the repository, for example:
97  // "projects/p1/locations/us-central1/repositories/repo1".
98  string name = 1;
99
100  // The format of packages that are stored in the repository.
101  Format format = 2;
102
103  // The user-provided description of the repository.
104  string description = 3;
105
106  // Labels with user-defined metadata.
107  // This field may contain up to 64 entries. Label keys and values may be no
108  // longer than 63 characters. Label keys must begin with a lowercase letter
109  // and may only contain lowercase letters, numeric characters, underscores,
110  // and dashes.
111  map<string, string> labels = 4;
112
113  // The time when the repository was created.
114  google.protobuf.Timestamp create_time = 5;
115
116  // The time when the repository was last updated.
117  google.protobuf.Timestamp update_time = 6;
118
119  // The Cloud KMS resource name of the customer managed encryption key that’s
120  // used to encrypt the contents of the Repository. Has the form:
121  // `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`.
122  // This value may not be changed after the Repository has been created.
123  string kms_key_name = 8;
124}
125
126// The request to list repositories.
127message ListRepositoriesRequest {
128  // Required. The name of the parent resource whose repositories will be listed.
129  string parent = 1 [
130    (google.api.field_behavior) = REQUIRED,
131    (google.api.resource_reference) = {
132      child_type: "artifactregistry.googleapis.com/Repository"
133    }
134  ];
135
136  // The maximum number of repositories to return. Maximum page size is 1,000.
137  int32 page_size = 2;
138
139  // The next_page_token value returned from a previous list request, if any.
140  string page_token = 3;
141}
142
143// The response from listing repositories.
144message ListRepositoriesResponse {
145  // The repositories returned.
146  repeated Repository repositories = 1;
147
148  // The token to retrieve the next page of repositories, or empty if there are
149  // no more repositories to return.
150  string next_page_token = 2;
151}
152
153// The request to retrieve a repository.
154message GetRepositoryRequest {
155  // Required. The name of the repository to retrieve.
156  string name = 1 [
157    (google.api.field_behavior) = REQUIRED,
158    (google.api.resource_reference) = {
159      type: "artifactregistry.googleapis.com/Repository"
160    }
161  ];
162}
163
164// The request to create a new repository.
165message CreateRepositoryRequest {
166  // Required. The name of the parent resource where the repository will be created.
167  string parent = 1 [
168    (google.api.field_behavior) = REQUIRED,
169    (google.api.resource_reference) = {
170      child_type: "artifactregistry.googleapis.com/Repository"
171    }
172  ];
173
174  // The repository id to use for this repository.
175  string repository_id = 2;
176
177  // The repository to be created.
178  Repository repository = 3;
179}
180
181// The request to update a repository.
182message UpdateRepositoryRequest {
183  // The repository that replaces the resource on the server.
184  Repository repository = 1;
185
186  // The update mask applies to the resource. For the `FieldMask` definition,
187  // see
188  // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
189  google.protobuf.FieldMask update_mask = 2;
190}
191
192// The request to delete a repository.
193message DeleteRepositoryRequest {
194  // Required. The name of the repository to delete.
195  string name = 1 [
196    (google.api.field_behavior) = REQUIRED,
197    (google.api.resource_reference) = {
198      type: "artifactregistry.googleapis.com/Repository"
199    }
200  ];
201}
202