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