operation.proto 6.6 KB

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