operation.proto 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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.firestore.admin.v1;
  16. import "google/firestore/admin/v1/index.proto";
  17. import "google/protobuf/timestamp.proto";
  18. option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
  19. option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1;admin";
  20. option java_multiple_files = true;
  21. option java_outer_classname = "OperationProto";
  22. option java_package = "com.google.firestore.admin.v1";
  23. option objc_class_prefix = "GCFS";
  24. option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
  25. option ruby_package = "Google::Cloud::Firestore::Admin::V1";
  26. // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
  27. // [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
  28. message IndexOperationMetadata {
  29. // The time this operation started.
  30. google.protobuf.Timestamp start_time = 1;
  31. // The time this operation completed. Will be unset if operation still in
  32. // progress.
  33. google.protobuf.Timestamp end_time = 2;
  34. // The index resource that this operation is acting on. For example:
  35. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
  36. string index = 3;
  37. // The state of the operation.
  38. OperationState state = 4;
  39. // The progress, in documents, of this operation.
  40. Progress progress_documents = 5;
  41. // The progress, in bytes, of this operation.
  42. Progress progress_bytes = 6;
  43. }
  44. // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
  45. // [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
  46. message FieldOperationMetadata {
  47. // Information about an index configuration change.
  48. message IndexConfigDelta {
  49. // Specifies how the index is changing.
  50. enum ChangeType {
  51. // The type of change is not specified or known.
  52. CHANGE_TYPE_UNSPECIFIED = 0;
  53. // The single field index is being added.
  54. ADD = 1;
  55. // The single field index is being removed.
  56. REMOVE = 2;
  57. }
  58. // Specifies how the index is changing.
  59. ChangeType change_type = 1;
  60. // The index being changed.
  61. Index index = 2;
  62. }
  63. // Information about an TTL configuration change.
  64. message TtlConfigDelta {
  65. // Specifies how the TTL config is changing.
  66. enum ChangeType {
  67. // The type of change is not specified or known.
  68. CHANGE_TYPE_UNSPECIFIED = 0;
  69. // The TTL config is being added.
  70. ADD = 1;
  71. // The TTL config is being removed.
  72. REMOVE = 2;
  73. }
  74. // Specifies how the TTL configuration is changing.
  75. ChangeType change_type = 1;
  76. }
  77. // The time this operation started.
  78. google.protobuf.Timestamp start_time = 1;
  79. // The time this operation completed. Will be unset if operation still in
  80. // progress.
  81. google.protobuf.Timestamp end_time = 2;
  82. // The field resource that this operation is acting on. For example:
  83. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
  84. string field = 3;
  85. // A list of [IndexConfigDelta][google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
  86. // operation.
  87. repeated IndexConfigDelta index_config_deltas = 4;
  88. // The state of the operation.
  89. OperationState state = 5;
  90. // The progress, in documents, of this operation.
  91. Progress progress_documents = 6;
  92. // The progress, in bytes, of this operation.
  93. Progress progress_bytes = 7;
  94. // Describes the deltas of TTL configuration.
  95. TtlConfigDelta ttl_config_delta = 8;
  96. }
  97. // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
  98. // [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
  99. message ExportDocumentsMetadata {
  100. // The time this operation started.
  101. google.protobuf.Timestamp start_time = 1;
  102. // The time this operation completed. Will be unset if operation still in
  103. // progress.
  104. google.protobuf.Timestamp end_time = 2;
  105. // The state of the export operation.
  106. OperationState operation_state = 3;
  107. // The progress, in documents, of this operation.
  108. Progress progress_documents = 4;
  109. // The progress, in bytes, of this operation.
  110. Progress progress_bytes = 5;
  111. // Which collection ids are being exported.
  112. repeated string collection_ids = 6;
  113. // Where the entities are being exported to.
  114. string output_uri_prefix = 7;
  115. }
  116. // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
  117. // [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
  118. message ImportDocumentsMetadata {
  119. // The time this operation started.
  120. google.protobuf.Timestamp start_time = 1;
  121. // The time this operation completed. Will be unset if operation still in
  122. // progress.
  123. google.protobuf.Timestamp end_time = 2;
  124. // The state of the import operation.
  125. OperationState operation_state = 3;
  126. // The progress, in documents, of this operation.
  127. Progress progress_documents = 4;
  128. // The progress, in bytes, of this operation.
  129. Progress progress_bytes = 5;
  130. // Which collection ids are being imported.
  131. repeated string collection_ids = 6;
  132. // The location of the documents being imported.
  133. string input_uri_prefix = 7;
  134. }
  135. // Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field.
  136. message ExportDocumentsResponse {
  137. // Location of the output files. This can be used to begin an import
  138. // into Cloud Firestore (this project or another project) after the operation
  139. // completes successfully.
  140. string output_uri_prefix = 1;
  141. }
  142. // Describes the state of the operation.
  143. enum OperationState {
  144. // Unspecified.
  145. OPERATION_STATE_UNSPECIFIED = 0;
  146. // Request is being prepared for processing.
  147. INITIALIZING = 1;
  148. // Request is actively being processed.
  149. PROCESSING = 2;
  150. // Request is in the process of being cancelled after user called
  151. // google.longrunning.Operations.CancelOperation on the operation.
  152. CANCELLING = 3;
  153. // Request has been processed and is in its finalization stage.
  154. FINALIZING = 4;
  155. // Request has completed successfully.
  156. SUCCESSFUL = 5;
  157. // Request has finished being processed, but encountered an error.
  158. FAILED = 6;
  159. // Request has finished being cancelled after user called
  160. // google.longrunning.Operations.CancelOperation.
  161. CANCELLED = 7;
  162. }
  163. // Describes the progress of the operation.
  164. // Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1.Progress]
  165. // is used.
  166. message Progress {
  167. // The amount of work estimated.
  168. int64 estimated_work = 1;
  169. // The amount of work completed.
  170. int64 completed_work = 2;
  171. }