file.proto 3.5 KB

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