file.proto 3.7 KB

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