operation.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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.v1beta2;
  17. import "google/firestore/admin/v1beta2/index.proto";
  18. import "google/protobuf/timestamp.proto";
  19. import "google/api/annotations.proto";
  20. option csharp_namespace = "Google.Cloud.Firestore.Admin.V1Beta2";
  21. option go_package = "google.golang.org/genproto/googleapis/firestore/admin/v1beta2;admin";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "OperationProto";
  24. option java_package = "com.google.firestore.admin.v1beta2";
  25. option objc_class_prefix = "GCFS";
  26. // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
  27. // [FirestoreAdmin.CreateIndex][google.firestore.admin.v1beta2.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.v1beta2.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. // The time this operation started.
  64. google.protobuf.Timestamp start_time = 1;
  65. // The time this operation completed. Will be unset if operation still in
  66. // progress.
  67. google.protobuf.Timestamp end_time = 2;
  68. // The field resource that this operation is acting on. For example:
  69. // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`
  70. string field = 3;
  71. // A list of [IndexConfigDelta][google.firestore.admin.v1beta2.FieldOperationMetadata.IndexConfigDelta], which describe the intent of this
  72. // operation.
  73. repeated IndexConfigDelta index_config_deltas = 4;
  74. // The state of the operation.
  75. OperationState state = 5;
  76. // The progress, in documents, of this operation.
  77. Progress document_progress = 6;
  78. // The progress, in bytes, of this operation.
  79. Progress bytes_progress = 7;
  80. }
  81. // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
  82. // [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1beta2.FirestoreAdmin.ExportDocuments].
  83. message ExportDocumentsMetadata {
  84. // The time this operation started.
  85. google.protobuf.Timestamp start_time = 1;
  86. // The time this operation completed. Will be unset if operation still in
  87. // progress.
  88. google.protobuf.Timestamp end_time = 2;
  89. // The state of the export operation.
  90. OperationState operation_state = 3;
  91. // The progress, in documents, of this operation.
  92. Progress progress_documents = 4;
  93. // The progress, in bytes, of this operation.
  94. Progress progress_bytes = 5;
  95. // Which collection ids are being exported.
  96. repeated string collection_ids = 6;
  97. // Where the entities are being exported to.
  98. string output_uri_prefix = 7;
  99. }
  100. // Metadata for [google.longrunning.Operation][google.longrunning.Operation] results from
  101. // [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1beta2.FirestoreAdmin.ImportDocuments].
  102. message ImportDocumentsMetadata {
  103. // The time this operation started.
  104. google.protobuf.Timestamp start_time = 1;
  105. // The time this operation completed. Will be unset if operation still in
  106. // progress.
  107. google.protobuf.Timestamp end_time = 2;
  108. // The state of the import operation.
  109. OperationState operation_state = 3;
  110. // The progress, in documents, of this operation.
  111. Progress progress_documents = 4;
  112. // The progress, in bytes, of this operation.
  113. Progress progress_bytes = 5;
  114. // Which collection ids are being imported.
  115. repeated string collection_ids = 6;
  116. // The location of the documents being imported.
  117. string input_uri_prefix = 7;
  118. }
  119. // Returned in the [google.longrunning.Operation][google.longrunning.Operation] response field.
  120. message ExportDocumentsResponse {
  121. // Location of the output files. This can be used to begin an import
  122. // into Cloud Firestore (this project or another project) after the operation
  123. // completes successfully.
  124. string output_uri_prefix = 1;
  125. }
  126. // Describes the state of the operation.
  127. enum OperationState {
  128. // Unspecified.
  129. OPERATION_STATE_UNSPECIFIED = 0;
  130. // Request is being prepared for processing.
  131. INITIALIZING = 1;
  132. // Request is actively being processed.
  133. PROCESSING = 2;
  134. // Request is in the process of being cancelled after user called
  135. // google.longrunning.Operations.CancelOperation on the operation.
  136. CANCELLING = 3;
  137. // Request has been processed and is in its finalization stage.
  138. FINALIZING = 4;
  139. // Request has completed successfully.
  140. SUCCESSFUL = 5;
  141. // Request has finished being processed, but encountered an error.
  142. FAILED = 6;
  143. // Request has finished being cancelled after user called
  144. // google.longrunning.Operations.CancelOperation.
  145. CANCELLED = 7;
  146. }
  147. // Describes the progress of the operation.
  148. // Unit of work is generic and must be interpreted based on where [Progress][google.firestore.admin.v1beta2.Progress]
  149. // is used.
  150. message Progress {
  151. // The amount of work estimated.
  152. int64 estimated_work = 1;
  153. // The amount of work completed.
  154. int64 completed_work = 2;
  155. }