xref: /aosp_15_r20/external/googleapis/google/devtools/artifactregistry/v1beta2/file.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/resource.proto";
20import "google/protobuf/timestamp.proto";
21
22option csharp_namespace = "Google.Cloud.ArtifactRegistry.V1Beta2";
23option go_package = "cloud.google.com/go/artifactregistry/apiv1beta2/artifactregistrypb;artifactregistrypb";
24option java_multiple_files = true;
25option java_outer_classname = "FileProto";
26option java_package = "com.google.devtools.artifactregistry.v1beta2";
27option php_namespace = "Google\\Cloud\\ArtifactRegistry\\V1beta2";
28option ruby_package = "Google::Cloud::ArtifactRegistry::V1beta2";
29
30// A hash of file content.
31message Hash {
32  // The algorithm used to compute the hash.
33  enum HashType {
34    // Unspecified.
35    HASH_TYPE_UNSPECIFIED = 0;
36
37    // SHA256 hash.
38    SHA256 = 1;
39
40    // MD5 hash.
41    MD5 = 2;
42  }
43
44  // The algorithm used to compute the hash value.
45  HashType type = 1;
46
47  // The hash value.
48  bytes value = 2;
49}
50
51// Files store content that is potentially associated with Packages or Versions.
52message File {
53  option (google.api.resource) = {
54    type: "artifactregistry.googleapis.com/File"
55    pattern: "projects/{project}/locations/{location}/repositories/{repository}/files/{file}"
56  };
57
58  // The name of the file, for example:
59  // "projects/p1/locations/us-central1/repositories/repo1/files/a%2Fb%2Fc.txt".
60  // If the file ID part contains slashes, they are escaped.
61  string name = 1;
62
63  // The size of the File in bytes.
64  int64 size_bytes = 3;
65
66  // The hashes of the file content.
67  repeated Hash hashes = 4;
68
69  // The time when the File was created.
70  google.protobuf.Timestamp create_time = 5;
71
72  // The time when the File was last updated.
73  google.protobuf.Timestamp update_time = 6;
74
75  // The name of the Package or Version that owns this file, if any.
76  string owner = 7;
77}
78
79// The request to list files.
80message ListFilesRequest {
81  // The name of the repository whose files will be listed. For example:
82  // "projects/p1/locations/us-central1/repositories/repo1
83  string parent = 1;
84
85  // An expression for filtering the results of the request. Filter rules are
86  // case insensitive. The fields eligible for filtering are:
87  //
88  //   * `name`
89  //   * `owner`
90  //
91  //  An example of using a filter:
92  //
93  //   * `name="projects/p1/locations/us-central1/repositories/repo1/files/a/b/*"` --> Files with an
94  //   ID starting with "a/b/".
95  //   * `owner="projects/p1/locations/us-central1/repositories/repo1/packages/pkg1/versions/1.0"` -->
96  //   Files owned by the version `1.0` in package `pkg1`.
97  string filter = 4;
98
99  // The maximum number of files to return.
100  int32 page_size = 2;
101
102  // The next_page_token value returned from a previous list request, if any.
103  string page_token = 3;
104}
105
106// The response from listing files.
107message ListFilesResponse {
108  // The files returned.
109  repeated File files = 1;
110
111  // The token to retrieve the next page of files, or empty if there are no
112  // more files to return.
113  string next_page_token = 2;
114}
115
116// The request to retrieve a file.
117message GetFileRequest {
118  // The name of the file to retrieve.
119  string name = 1;
120}
121