• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2023 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
15syntax = "proto3";
16
17package google.firestore.admin.v1;
18
19import "google/api/annotations.proto";
20import "google/api/client.proto";
21import "google/api/field_behavior.proto";
22import "google/api/resource.proto";
23import "google/firestore/admin/v1/backup.proto";
24import "google/firestore/admin/v1/database.proto";
25import "google/firestore/admin/v1/field.proto";
26import "google/firestore/admin/v1/index.proto";
27import "google/firestore/admin/v1/operation.proto";
28import "google/firestore/admin/v1/schedule.proto";
29import "google/longrunning/operations.proto";
30import "google/protobuf/empty.proto";
31import "google/protobuf/field_mask.proto";
32import "google/protobuf/timestamp.proto";
33
34option csharp_namespace = "Google.Cloud.Firestore.Admin.V1";
35option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb";
36option java_multiple_files = true;
37option java_outer_classname = "FirestoreAdminProto";
38option java_package = "com.google.firestore.admin.v1";
39option objc_class_prefix = "GCFS";
40option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1";
41option ruby_package = "Google::Cloud::Firestore::Admin::V1";
42option (google.api.resource_definition) = {
43  type: "firestore.googleapis.com/Location"
44  pattern: "projects/{project}/locations/{location}"
45};
46option (google.api.resource_definition) = {
47  type: "firestore.googleapis.com/CollectionGroup"
48  pattern: "projects/{project}/databases/{database}/collectionGroups/{collection}"
49};
50
51// The Cloud Firestore Admin API.
52//
53// This API provides several administrative services for Cloud Firestore.
54//
55// Project, Database, Namespace, Collection, Collection Group, and Document are
56// used as defined in the Google Cloud Firestore API.
57//
58// Operation: An Operation represents work being performed in the background.
59//
60// The index service manages Cloud Firestore indexes.
61//
62// Index creation is performed asynchronously.
63// An Operation resource is created for each such asynchronous operation.
64// The state of the operation (including any errors encountered)
65// may be queried via the Operation resource.
66//
67// The Operations collection provides a record of actions performed for the
68// specified Project (including any Operations in progress). Operations are not
69// created directly but through calls on other collections or resources.
70//
71// An Operation that is done may be deleted so that it is no longer listed as
72// part of the Operation collection. Operations are garbage collected after
73// 30 days. By default, ListOperations will only return in progress and failed
74// operations. To list completed operation, issue a ListOperations request with
75// the filter `done: true`.
76//
77// Operations are created by service `FirestoreAdmin`, but are accessed via
78// service `google.longrunning.Operations`.
79service FirestoreAdmin {
80  option (google.api.default_host) = "firestore.googleapis.com";
81  option (google.api.oauth_scopes) =
82      "https://www.googleapis.com/auth/cloud-platform,"
83      "https://www.googleapis.com/auth/datastore";
84
85  // Creates a composite index. This returns a
86  // [google.longrunning.Operation][google.longrunning.Operation] which may be
87  // used to track the status of the creation. The metadata for the operation
88  // will be the type
89  // [IndexOperationMetadata][google.firestore.admin.v1.IndexOperationMetadata].
90  rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) {
91    option (google.api.http) = {
92      post: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes"
93      body: "index"
94    };
95    option (google.api.method_signature) = "parent,index";
96    option (google.longrunning.operation_info) = {
97      response_type: "Index"
98      metadata_type: "IndexOperationMetadata"
99    };
100  }
101
102  // Lists composite indexes.
103  rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) {
104    option (google.api.http) = {
105      get: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/indexes"
106    };
107    option (google.api.method_signature) = "parent";
108  }
109
110  // Gets a composite index.
111  rpc GetIndex(GetIndexRequest) returns (Index) {
112    option (google.api.http) = {
113      get: "/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}"
114    };
115    option (google.api.method_signature) = "name";
116  }
117
118  // Deletes a composite index.
119  rpc DeleteIndex(DeleteIndexRequest) returns (google.protobuf.Empty) {
120    option (google.api.http) = {
121      delete: "/v1/{name=projects/*/databases/*/collectionGroups/*/indexes/*}"
122    };
123    option (google.api.method_signature) = "name";
124  }
125
126  // Gets the metadata and configuration for a Field.
127  rpc GetField(GetFieldRequest) returns (Field) {
128    option (google.api.http) = {
129      get: "/v1/{name=projects/*/databases/*/collectionGroups/*/fields/*}"
130    };
131    option (google.api.method_signature) = "name";
132  }
133
134  // Updates a field configuration. Currently, field updates apply only to
135  // single field index configuration. However, calls to
136  // [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField]
137  // should provide a field mask to avoid changing any configuration that the
138  // caller isn't aware of. The field mask should be specified as: `{ paths:
139  // "index_config" }`.
140  //
141  // This call returns a
142  // [google.longrunning.Operation][google.longrunning.Operation] which may be
143  // used to track the status of the field update. The metadata for the
144  // operation will be the type
145  // [FieldOperationMetadata][google.firestore.admin.v1.FieldOperationMetadata].
146  //
147  // To configure the default field settings for the database, use
148  // the special `Field` with resource name:
149  // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.
150  rpc UpdateField(UpdateFieldRequest) returns (google.longrunning.Operation) {
151    option (google.api.http) = {
152      patch: "/v1/{field.name=projects/*/databases/*/collectionGroups/*/fields/*}"
153      body: "field"
154    };
155    option (google.api.method_signature) = "field";
156    option (google.longrunning.operation_info) = {
157      response_type: "Field"
158      metadata_type: "FieldOperationMetadata"
159    };
160  }
161
162  // Lists the field configuration and metadata for this database.
163  //
164  // Currently,
165  // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
166  // only supports listing fields that have been explicitly overridden. To issue
167  // this query, call
168  // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
169  // with the filter set to `indexConfig.usesAncestorConfig:false` or
170  // `ttlConfig:*`.
171  rpc ListFields(ListFieldsRequest) returns (ListFieldsResponse) {
172    option (google.api.http) = {
173      get: "/v1/{parent=projects/*/databases/*/collectionGroups/*}/fields"
174    };
175    option (google.api.method_signature) = "parent";
176  }
177
178  // Exports a copy of all or a subset of documents from Google Cloud Firestore
179  // to another storage system, such as Google Cloud Storage. Recent updates to
180  // documents may not be reflected in the export. The export occurs in the
181  // background and its progress can be monitored and managed via the
182  // Operation resource that is created. The output of an export may only be
183  // used once the associated operation is done. If an export operation is
184  // cancelled before completion it may leave partial data behind in Google
185  // Cloud Storage.
186  //
187  // For more details on export behavior and output format, refer to:
188  // https://cloud.google.com/firestore/docs/manage-data/export-import
189  rpc ExportDocuments(ExportDocumentsRequest)
190      returns (google.longrunning.Operation) {
191    option (google.api.http) = {
192      post: "/v1/{name=projects/*/databases/*}:exportDocuments"
193      body: "*"
194    };
195    option (google.api.method_signature) = "name";
196    option (google.longrunning.operation_info) = {
197      response_type: "ExportDocumentsResponse"
198      metadata_type: "ExportDocumentsMetadata"
199    };
200  }
201
202  // Imports documents into Google Cloud Firestore. Existing documents with the
203  // same name are overwritten. The import occurs in the background and its
204  // progress can be monitored and managed via the Operation resource that is
205  // created. If an ImportDocuments operation is cancelled, it is possible
206  // that a subset of the data has already been imported to Cloud Firestore.
207  rpc ImportDocuments(ImportDocumentsRequest)
208      returns (google.longrunning.Operation) {
209    option (google.api.http) = {
210      post: "/v1/{name=projects/*/databases/*}:importDocuments"
211      body: "*"
212    };
213    option (google.api.method_signature) = "name";
214    option (google.longrunning.operation_info) = {
215      response_type: "google.protobuf.Empty"
216      metadata_type: "ImportDocumentsMetadata"
217    };
218  }
219
220  // Create a database.
221  rpc CreateDatabase(CreateDatabaseRequest)
222      returns (google.longrunning.Operation) {
223    option (google.api.http) = {
224      post: "/v1/{parent=projects/*}/databases"
225      body: "database"
226    };
227    option (google.api.method_signature) = "parent,database,database_id";
228    option (google.longrunning.operation_info) = {
229      response_type: "Database"
230      metadata_type: "CreateDatabaseMetadata"
231    };
232  }
233
234  // Gets information about a database.
235  rpc GetDatabase(GetDatabaseRequest) returns (Database) {
236    option (google.api.http) = {
237      get: "/v1/{name=projects/*/databases/*}"
238    };
239    option (google.api.method_signature) = "name";
240  }
241
242  // List all the databases in the project.
243  rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) {
244    option (google.api.http) = {
245      get: "/v1/{parent=projects/*}/databases"
246    };
247    option (google.api.method_signature) = "parent";
248  }
249
250  // Updates a database.
251  rpc UpdateDatabase(UpdateDatabaseRequest)
252      returns (google.longrunning.Operation) {
253    option (google.api.http) = {
254      patch: "/v1/{database.name=projects/*/databases/*}"
255      body: "database"
256    };
257    option (google.api.method_signature) = "database,update_mask";
258    option (google.longrunning.operation_info) = {
259      response_type: "Database"
260      metadata_type: "UpdateDatabaseMetadata"
261    };
262  }
263
264  // Deletes a database.
265  rpc DeleteDatabase(DeleteDatabaseRequest)
266      returns (google.longrunning.Operation) {
267    option (google.api.http) = {
268      delete: "/v1/{name=projects/*/databases/*}"
269    };
270    option (google.api.method_signature) = "name";
271    option (google.longrunning.operation_info) = {
272      response_type: "Database"
273      metadata_type: "DeleteDatabaseMetadata"
274    };
275  }
276
277  // Gets information about a backup.
278  rpc GetBackup(GetBackupRequest) returns (Backup) {
279    option (google.api.http) = {
280      get: "/v1/{name=projects/*/locations/*/backups/*}"
281    };
282    option (google.api.method_signature) = "name";
283  }
284
285  // Lists all the backups.
286  rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) {
287    option (google.api.http) = {
288      get: "/v1/{parent=projects/*/locations/*}/backups"
289    };
290    option (google.api.method_signature) = "parent";
291  }
292
293  // Deletes a backup.
294  rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) {
295    option (google.api.http) = {
296      delete: "/v1/{name=projects/*/locations/*/backups/*}"
297    };
298    option (google.api.method_signature) = "name";
299  }
300
301  // Creates a new database by restoring from an existing backup.
302  //
303  // The new database must be in the same cloud region or multi-region location
304  // as the existing backup. This behaves similar to
305  // [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase]
306  // except instead of creating a new empty database, a new database is created
307  // with the database type, index configuration, and documents from an existing
308  // backup.
309  //
310  // The [long-running operation][google.longrunning.Operation] can be used to
311  // track the progress of the restore, with the Operation's
312  // [metadata][google.longrunning.Operation.metadata] field type being the
313  // [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata].
314  // The [response][google.longrunning.Operation.response] type is the
315  // [Database][google.firestore.admin.v1.Database] if the restore was
316  // successful. The new database is not readable or writeable until the LRO has
317  // completed.
318  rpc RestoreDatabase(RestoreDatabaseRequest)
319      returns (google.longrunning.Operation) {
320    option (google.api.http) = {
321      post: "/v1/{parent=projects/*}/databases:restore"
322      body: "*"
323    };
324    option (google.longrunning.operation_info) = {
325      response_type: "Database"
326      metadata_type: "RestoreDatabaseMetadata"
327    };
328  }
329
330  // Creates a backup schedule on a database.
331  // At most two backup schedules can be configured on a database, one daily
332  // backup schedule and one weekly backup schedule.
333  rpc CreateBackupSchedule(CreateBackupScheduleRequest)
334      returns (BackupSchedule) {
335    option (google.api.http) = {
336      post: "/v1/{parent=projects/*/databases/*}/backupSchedules"
337      body: "backup_schedule"
338    };
339    option (google.api.method_signature) = "parent,backup_schedule";
340  }
341
342  // Gets information about a backup schedule.
343  rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) {
344    option (google.api.http) = {
345      get: "/v1/{name=projects/*/databases/*/backupSchedules/*}"
346    };
347    option (google.api.method_signature) = "name";
348  }
349
350  // List backup schedules.
351  rpc ListBackupSchedules(ListBackupSchedulesRequest)
352      returns (ListBackupSchedulesResponse) {
353    option (google.api.http) = {
354      get: "/v1/{parent=projects/*/databases/*}/backupSchedules"
355    };
356    option (google.api.method_signature) = "parent";
357  }
358
359  // Updates a backup schedule.
360  rpc UpdateBackupSchedule(UpdateBackupScheduleRequest)
361      returns (BackupSchedule) {
362    option (google.api.http) = {
363      patch: "/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}"
364      body: "backup_schedule"
365    };
366    option (google.api.method_signature) = "backup_schedule,update_mask";
367  }
368
369  // Deletes a backup schedule.
370  rpc DeleteBackupSchedule(DeleteBackupScheduleRequest)
371      returns (google.protobuf.Empty) {
372    option (google.api.http) = {
373      delete: "/v1/{name=projects/*/databases/*/backupSchedules/*}"
374    };
375    option (google.api.method_signature) = "name";
376  }
377}
378
379// A request to list the Firestore Databases in all locations for a project.
380message ListDatabasesRequest {
381  // Required. A parent name of the form
382  // `projects/{project_id}`
383  string parent = 1 [
384    (google.api.field_behavior) = REQUIRED,
385    (google.api.resource_reference) = {
386      child_type: "firestore.googleapis.com/Database"
387    }
388  ];
389}
390
391// The request for
392// [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.FirestoreAdmin.CreateDatabase].
393message CreateDatabaseRequest {
394  // Required. A parent name of the form
395  // `projects/{project_id}`
396  string parent = 1 [
397    (google.api.field_behavior) = REQUIRED,
398    (google.api.resource_reference) = {
399      child_type: "firestore.googleapis.com/Database"
400    }
401  ];
402
403  // Required. The Database to create.
404  Database database = 2 [(google.api.field_behavior) = REQUIRED];
405
406  // Required. The ID to use for the database, which will become the final
407  // component of the database's resource name.
408  //
409  // This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
410  // with first character a letter and the last a letter or a number. Must not
411  // be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
412  //
413  // "(default)" database id is also valid.
414  string database_id = 3 [(google.api.field_behavior) = REQUIRED];
415}
416
417// Metadata related to the create database operation.
418message CreateDatabaseMetadata {}
419
420// The list of databases for a project.
421message ListDatabasesResponse {
422  // The databases in the project.
423  repeated Database databases = 1;
424
425  // In the event that data about individual databases cannot be listed they
426  // will be recorded here.
427  //
428  // An example entry might be: projects/some_project/locations/some_location
429  // This can happen if the Cloud Region that the Database resides in is
430  // currently unavailable.  In this case we can't fetch all the details about
431  // the database. You may be able to get a more detailed error message
432  // (or possibly fetch the resource) by sending a 'Get' request for the
433  // resource or a 'List' request for the specific location.
434  repeated string unreachable = 3;
435}
436
437// The request for
438// [FirestoreAdmin.GetDatabase][google.firestore.admin.v1.FirestoreAdmin.GetDatabase].
439message GetDatabaseRequest {
440  // Required. A name of the form
441  // `projects/{project_id}/databases/{database_id}`
442  string name = 1 [
443    (google.api.field_behavior) = REQUIRED,
444    (google.api.resource_reference) = {
445      type: "firestore.googleapis.com/Database"
446    }
447  ];
448}
449
450// The request for
451// [FirestoreAdmin.UpdateDatabase][google.firestore.admin.v1.FirestoreAdmin.UpdateDatabase].
452message UpdateDatabaseRequest {
453  // Required. The database to update.
454  Database database = 1 [(google.api.field_behavior) = REQUIRED];
455
456  // The list of fields to be updated.
457  google.protobuf.FieldMask update_mask = 2;
458}
459
460// Metadata related to the update database operation.
461message UpdateDatabaseMetadata {}
462
463// The request for
464// [FirestoreAdmin.DeleteDatabase][google.firestore.admin.v1.FirestoreAdmin.DeleteDatabase].
465message DeleteDatabaseRequest {
466  // Required. A name of the form
467  // `projects/{project_id}/databases/{database_id}`
468  string name = 1 [
469    (google.api.field_behavior) = REQUIRED,
470    (google.api.resource_reference) = {
471      type: "firestore.googleapis.com/Database"
472    }
473  ];
474
475  // The current etag of the Database.
476  // If an etag is provided and does not match the current etag of the database,
477  // deletion will be blocked and a FAILED_PRECONDITION error will be returned.
478  string etag = 3;
479}
480
481// Metadata related to the delete database operation.
482message DeleteDatabaseMetadata {}
483
484// The request for
485// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule].
486message CreateBackupScheduleRequest {
487  // Required. The parent database.
488  //
489  //  Format `projects/{project}/databases/{database}`
490  string parent = 1 [
491    (google.api.field_behavior) = REQUIRED,
492    (google.api.resource_reference) = {
493      type: "firestore.googleapis.com/Database"
494    }
495  ];
496
497  // Required. The backup schedule to create.
498  BackupSchedule backup_schedule = 2 [(google.api.field_behavior) = REQUIRED];
499}
500
501// The request for
502// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule].
503message GetBackupScheduleRequest {
504  // Required. The name of the backup schedule.
505  //
506  // Format
507  // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
508  string name = 1 [
509    (google.api.field_behavior) = REQUIRED,
510    (google.api.resource_reference) = {
511      type: "firestore.googleapis.com/BackupSchedule"
512    }
513  ];
514}
515
516// The request for
517// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule].
518message UpdateBackupScheduleRequest {
519  // Required. The backup schedule to update.
520  BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED];
521
522  // The list of fields to be updated.
523  google.protobuf.FieldMask update_mask = 2;
524}
525
526// The request for
527// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
528message ListBackupSchedulesRequest {
529  // Required. The parent database.
530  //
531  // Format is `projects/{project}/databases/{database}`.
532  string parent = 1 [
533    (google.api.field_behavior) = REQUIRED,
534    (google.api.resource_reference) = {
535      type: "firestore.googleapis.com/Database"
536    }
537  ];
538}
539
540// The response for
541// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules].
542message ListBackupSchedulesResponse {
543  // List of all backup schedules.
544  repeated BackupSchedule backup_schedules = 1;
545}
546
547// The request for [FirestoreAdmin.DeleteBackupSchedules][].
548message DeleteBackupScheduleRequest {
549  // Required. The name of the backup schedule.
550  //
551  // Format
552  // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}`
553  string name = 1 [
554    (google.api.field_behavior) = REQUIRED,
555    (google.api.resource_reference) = {
556      type: "firestore.googleapis.com/BackupSchedule"
557    }
558  ];
559}
560
561// The request for
562// [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex].
563message CreateIndexRequest {
564  // Required. A parent name of the form
565  // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
566  string parent = 1 [
567    (google.api.field_behavior) = REQUIRED,
568    (google.api.resource_reference) = {
569      type: "firestore.googleapis.com/CollectionGroup"
570    }
571  ];
572
573  // Required. The composite index to create.
574  Index index = 2 [(google.api.field_behavior) = REQUIRED];
575}
576
577// The request for
578// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
579message ListIndexesRequest {
580  // Required. A parent name of the form
581  // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
582  string parent = 1 [
583    (google.api.field_behavior) = REQUIRED,
584    (google.api.resource_reference) = {
585      type: "firestore.googleapis.com/CollectionGroup"
586    }
587  ];
588
589  // The filter to apply to list results.
590  string filter = 2;
591
592  // The number of results to return.
593  int32 page_size = 3;
594
595  // A page token, returned from a previous call to
596  // [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes],
597  // that may be used to get the next page of results.
598  string page_token = 4;
599}
600
601// The response for
602// [FirestoreAdmin.ListIndexes][google.firestore.admin.v1.FirestoreAdmin.ListIndexes].
603message ListIndexesResponse {
604  // The requested indexes.
605  repeated Index indexes = 1;
606
607  // A page token that may be used to request another page of results. If blank,
608  // this is the last page.
609  string next_page_token = 2;
610}
611
612// The request for
613// [FirestoreAdmin.GetIndex][google.firestore.admin.v1.FirestoreAdmin.GetIndex].
614message GetIndexRequest {
615  // Required. A name of the form
616  // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
617  string name = 1 [
618    (google.api.field_behavior) = REQUIRED,
619    (google.api.resource_reference) = { type: "firestore.googleapis.com/Index" }
620  ];
621}
622
623// The request for
624// [FirestoreAdmin.DeleteIndex][google.firestore.admin.v1.FirestoreAdmin.DeleteIndex].
625message DeleteIndexRequest {
626  // Required. A name of the form
627  // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`
628  string name = 1 [
629    (google.api.field_behavior) = REQUIRED,
630    (google.api.resource_reference) = { type: "firestore.googleapis.com/Index" }
631  ];
632}
633
634// The request for
635// [FirestoreAdmin.UpdateField][google.firestore.admin.v1.FirestoreAdmin.UpdateField].
636message UpdateFieldRequest {
637  // Required. The field to be updated.
638  Field field = 1 [(google.api.field_behavior) = REQUIRED];
639
640  // A mask, relative to the field. If specified, only configuration specified
641  // by this field_mask will be updated in the field.
642  google.protobuf.FieldMask update_mask = 2;
643}
644
645// The request for
646// [FirestoreAdmin.GetField][google.firestore.admin.v1.FirestoreAdmin.GetField].
647message GetFieldRequest {
648  // Required. A name of the form
649  // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`
650  string name = 1 [
651    (google.api.field_behavior) = REQUIRED,
652    (google.api.resource_reference) = { type: "firestore.googleapis.com/Field" }
653  ];
654}
655
656// The request for
657// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
658message ListFieldsRequest {
659  // Required. A parent name of the form
660  // `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
661  string parent = 1 [
662    (google.api.field_behavior) = REQUIRED,
663    (google.api.resource_reference) = {
664      type: "firestore.googleapis.com/CollectionGroup"
665    }
666  ];
667
668  // The filter to apply to list results. Currently,
669  // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
670  // only supports listing fields that have been explicitly overridden. To issue
671  // this query, call
672  // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields]
673  // with a filter that includes `indexConfig.usesAncestorConfig:false` .
674  string filter = 2;
675
676  // The number of results to return.
677  int32 page_size = 3;
678
679  // A page token, returned from a previous call to
680  // [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields],
681  // that may be used to get the next page of results.
682  string page_token = 4;
683}
684
685// The response for
686// [FirestoreAdmin.ListFields][google.firestore.admin.v1.FirestoreAdmin.ListFields].
687message ListFieldsResponse {
688  // The requested fields.
689  repeated Field fields = 1;
690
691  // A page token that may be used to request another page of results. If blank,
692  // this is the last page.
693  string next_page_token = 2;
694}
695
696// The request for
697// [FirestoreAdmin.ExportDocuments][google.firestore.admin.v1.FirestoreAdmin.ExportDocuments].
698message ExportDocumentsRequest {
699  // Required. Database to export. Should be of the form:
700  // `projects/{project_id}/databases/{database_id}`.
701  string name = 1 [
702    (google.api.field_behavior) = REQUIRED,
703    (google.api.resource_reference) = {
704      type: "firestore.googleapis.com/Database"
705    }
706  ];
707
708  // Which collection ids to export. Unspecified means all collections.
709  repeated string collection_ids = 2;
710
711  // The output URI. Currently only supports Google Cloud Storage URIs of the
712  // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name
713  // of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an optional
714  // Google Cloud Storage namespace path. When
715  // choosing a name, be sure to consider Google Cloud Storage naming
716  // guidelines: https://cloud.google.com/storage/docs/naming.
717  // If the URI is a bucket (without a namespace path), a prefix will be
718  // generated based on the start time.
719  string output_uri_prefix = 3;
720
721  // An empty list represents all namespaces. This is the preferred
722  // usage for databases that don't use namespaces.
723  //
724  // An empty string element represents the default namespace. This should be
725  // used if the database has data in non-default namespaces, but doesn't want
726  // to include them. Each namespace in this list must be unique.
727  repeated string namespace_ids = 4;
728
729  // The timestamp that corresponds to the version of the database to be
730  // exported. The timestamp must be in the past, rounded to the minute and not
731  // older than
732  // [earliestVersionTime][google.firestore.admin.v1.Database.earliest_version_time].
733  // If specified, then the exported documents will represent a consistent view
734  // of the database at the provided time. Otherwise, there are no guarantees
735  // about the consistency of the exported documents.
736  google.protobuf.Timestamp snapshot_time = 5;
737}
738
739// The request for
740// [FirestoreAdmin.ImportDocuments][google.firestore.admin.v1.FirestoreAdmin.ImportDocuments].
741message ImportDocumentsRequest {
742  // Required. Database to import into. Should be of the form:
743  // `projects/{project_id}/databases/{database_id}`.
744  string name = 1 [
745    (google.api.field_behavior) = REQUIRED,
746    (google.api.resource_reference) = {
747      type: "firestore.googleapis.com/Database"
748    }
749  ];
750
751  // Which collection ids to import. Unspecified means all collections included
752  // in the import.
753  repeated string collection_ids = 2;
754
755  // Location of the exported files.
756  // This must match the output_uri_prefix of an ExportDocumentsResponse from
757  // an export that has completed successfully.
758  // See:
759  // [google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix][google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix].
760  string input_uri_prefix = 3;
761
762  // An empty list represents all namespaces. This is the preferred
763  // usage for databases that don't use namespaces.
764  //
765  // An empty string element represents the default namespace. This should be
766  // used if the database has data in non-default namespaces, but doesn't want
767  // to include them. Each namespace in this list must be unique.
768  repeated string namespace_ids = 4;
769}
770
771// The request for
772// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup].
773message GetBackupRequest {
774  // Required. Name of the backup to fetch.
775  //
776  // Format is `projects/{project}/locations/{location}/backups/{backup}`.
777  string name = 1 [
778    (google.api.field_behavior) = REQUIRED,
779    (google.api.resource_reference) = {
780      type: "firestore.googleapis.com/Backup"
781    }
782  ];
783}
784
785// The request for
786// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
787message ListBackupsRequest {
788  // Required. The location to list backups from.
789  //
790  // Format is `projects/{project}/locations/{location}`.
791  // Use `{location} = '-'` to list backups from all locations for the given
792  // project. This allows listing backups from a single location or from all
793  // locations.
794  string parent = 1 [
795    (google.api.field_behavior) = REQUIRED,
796    (google.api.resource_reference) = {
797      type: "firestore.googleapis.com/Location"
798    }
799  ];
800}
801
802// The response for
803// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups].
804message ListBackupsResponse {
805  // List of all backups for the project.
806  repeated Backup backups = 1;
807
808  // List of locations that existing backups were not able to be fetched from.
809  //
810  // Instead of failing the entire requests when a single location is
811  // unreachable, this response returns a partial result set and list of
812  // locations unable to be reached here. The request can be retried against a
813  // single location to get a concrete error.
814  repeated string unreachable = 3;
815}
816
817// The request for
818// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup].
819message DeleteBackupRequest {
820  // Required. Name of the backup to delete.
821  //
822  // format is `projects/{project}/locations/{location}/backups/{backup}`.
823  string name = 1 [
824    (google.api.field_behavior) = REQUIRED,
825    (google.api.resource_reference) = {
826      type: "firestore.googleapis.com/Backup"
827    }
828  ];
829}
830
831// The request message for
832// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase].
833message RestoreDatabaseRequest {
834  // Required. The project to restore the database in. Format is
835  // `projects/{project_id}`.
836  string parent = 1 [
837    (google.api.field_behavior) = REQUIRED,
838    (google.api.resource_reference) = {
839      child_type: "firestore.googleapis.com/Database"
840    }
841  ];
842
843  // Required. The ID to use for the database, which will become the final
844  // component of the database's resource name. This database id must not be
845  // associated with an existing database.
846  //
847  // This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
848  // with first character a letter and the last a letter or a number. Must not
849  // be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/.
850  //
851  // "(default)" database id is also valid.
852  string database_id = 2 [(google.api.field_behavior) = REQUIRED];
853
854  // Required. Backup to restore from. Must be from the same project as the
855  // parent.
856  //
857  // Format is: `projects/{project_id}/locations/{location}/backups/{backup}`
858  string backup = 3 [
859    (google.api.field_behavior) = REQUIRED,
860    (google.api.resource_reference) = {
861      type: "firestore.googleapis.com/Backup"
862    }
863  ];
864}
865