From 6bced86eabd143947e94e83872f20d7ed9d964dc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 20:46:16 +0000 Subject: [PATCH] feat: A new message `Backup` is added (#2021) - [ ] Regenerate this pull request now. feat: A new resource_definition `firestore.googleapis.com/Backup` is added feat: A new method `GetBackup` is added to service `FirestoreAdmin` feat: A new method `ListBackups` is added to service `FirestoreAdmin` feat: A new method `DeleteBackup` is added to service `FirestoreAdmin` feat: A new method `RestoreDatabase` is added to service `FirestoreAdmin` feat: A new method `CreateBackupSchedule` is added to service `FirestoreAdmin` feat: A new method `GetBackupSchedule` is added to service `FirestoreAdmin` feat: A new method `ListBackupSchedules` is added to service `FirestoreAdmin` feat: A new method `UpdateBackupSchedule` is added to service `FirestoreAdmin` feat: A new method `DeleteBackupSchedule` is added to service `FirestoreAdmin` feat: A new message `CreateBackupScheduleRequest` is added feat: A new message `GetBackupScheduleRequest` is added feat: A new message `UpdateBackupScheduleRequest` is added feat: A new message `ListBackupSchedulesRequest` is added feat: A new message `ListBackupSchedulesResponse` is added feat: A new message `DeleteBackupScheduleRequest` is added feat: A new message `GetBackupRequest` is added feat: A new message `ListBackupsRequest` is added feat: A new message `ListBackupsResponse` is added feat: A new message `DeleteBackupRequest` is added feat: A new message `RestoreDatabaseRequest` is added feat: A new message `RestoreDatabaseMetadata` is added feat: A new message `BackupSchedule` is added feat: A new resource_definition `firestore.googleapis.com/BackupSchedule` is added feat: A new message `DailyRecurrence` is added feat: A new message `WeeklyRecurrence` is added PiperOrigin-RevId: 616127901 Source-Link: https://togithub.com/googleapis/googleapis/commit/b5debc8c3ab92770208fc928f3383f47f68ab378 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/abcd45505adbfc778e2a1075367504e12890ef16 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWJjZDQ1NTA1YWRiZmM3NzhlMmExMDc1MzY3NTA0ZTEyODkwZWYxNiJ9 --- dev/protos/admin_v1.json | 591 +- dev/protos/firestore_admin_v1_proto_api.d.ts | 1601 +++- dev/protos/firestore_admin_v1_proto_api.js | 6585 ++++++++++++----- dev/protos/firestore_v1_proto_api.d.ts | 4 + dev/protos/firestore_v1_proto_api.js | 26 + dev/protos/firestore_v1beta1_proto_api.d.ts | 4 + dev/protos/firestore_v1beta1_proto_api.js | 26 + .../google/firestore/admin/v1/backup.proto | 107 + .../firestore/admin/v1/firestore_admin.proto | 276 + .../google/firestore/admin/v1/operation.proto | 48 +- .../google/firestore/admin/v1/schedule.proto | 93 + dev/protos/google/type/dayofweek.proto | 50 + dev/protos/v1.json | 16 +- dev/protos/v1beta1.json | 16 +- dev/src/v1/firestore_admin_client.ts | 1145 ++- dev/src/v1/firestore_admin_client_config.json | 36 + dev/src/v1/firestore_admin_proto_list.json | 4 +- dev/test/gapic_firestore_admin_v1.ts | 1589 +++- 18 files changed, 9802 insertions(+), 2415 deletions(-) create mode 100644 dev/protos/google/firestore/admin/v1/backup.proto create mode 100644 dev/protos/google/firestore/admin/v1/schedule.proto create mode 100644 dev/protos/google/type/dayofweek.proto diff --git a/dev/protos/admin_v1.json b/dev/protos/admin_v1.json index 931859101..bdebe2b50 100644 --- a/dev/protos/admin_v1.json +++ b/dev/protos/admin_v1.json @@ -20,6 +20,99 @@ "(google.api.resource_definition).pattern": "projects/{project}/databases/{database}/collectionGroups/{collection}" }, "nested": { + "Backup": { + "options": { + "(google.api.resource).type": "firestore.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "database": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "firestore.googleapis.com/Database" + } + }, + "databaseUid": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "snapshotTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stats": { + "type": "Stats", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Stats": { + "fields": { + "sizeBytes": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "documentCount": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "indexCount": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "NOT_AVAILABLE": 3 + } + } + } + }, "Database": { "options": { "(google.api.resource).type": "firestore.googleapis.com/Database", @@ -625,6 +718,178 @@ } } ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "RestoreDatabase": { + "requestType": "RestoreDatabaseRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*}/databases:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Database", + "(google.longrunning.operation_info).metadata_type": "RestoreDatabaseMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*}/databases:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Database", + "metadata_type": "RestoreDatabaseMetadata" + } + } + ] + }, + "CreateBackupSchedule": { + "requestType": "CreateBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/databases/*}/backupSchedules", + "(google.api.http).body": "backup_schedule", + "(google.api.method_signature)": "parent,backup_schedule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/databases/*}/backupSchedules", + "body": "backup_schedule" + } + }, + { + "(google.api.method_signature)": "parent,backup_schedule" + } + ] + }, + "GetBackupSchedule": { + "requestType": "GetBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/databases/*/backupSchedules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/databases/*/backupSchedules/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupSchedules": { + "requestType": "ListBackupSchedulesRequest", + "responseType": "ListBackupSchedulesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/databases/*}/backupSchedules", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/databases/*}/backupSchedules" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateBackupSchedule": { + "requestType": "UpdateBackupScheduleRequest", + "responseType": "BackupSchedule", + "options": { + "(google.api.http).patch": "/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}", + "(google.api.http).body": "backup_schedule", + "(google.api.method_signature)": "backup_schedule,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}", + "body": "backup_schedule" + } + }, + { + "(google.api.method_signature)": "backup_schedule,update_mask" + } + ] + }, + "DeleteBackupSchedule": { + "requestType": "DeleteBackupScheduleRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/databases/*/backupSchedules/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/databases/*/backupSchedules/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -732,6 +997,85 @@ "DeleteDatabaseMetadata": { "fields": {} }, + "CreateBackupScheduleRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/Database" + } + }, + "backupSchedule": { + "type": "BackupSchedule", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupScheduleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/BackupSchedule" + } + } + } + }, + "UpdateBackupScheduleRequest": { + "fields": { + "backupSchedule": { + "type": "BackupSchedule", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "ListBackupSchedulesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/Database" + } + } + } + }, + "ListBackupSchedulesResponse": { + "fields": { + "backupSchedules": { + "rule": "repeated", + "type": "BackupSchedule", + "id": 1 + } + } + }, + "DeleteBackupScheduleRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/BackupSchedule" + } + } + } + }, "CreateIndexRequest": { "fields": { "parent": { @@ -932,6 +1276,83 @@ } } }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/Backup" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/Location" + } + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/Backup" + } + } + } + }, + "RestoreDatabaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "firestore.googleapis.com/Database" + } + }, + "databaseId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "firestore.googleapis.com/Backup" + } + } + } + }, "IndexOperationMetadata": { "fields": { "startTime": { @@ -1125,6 +1546,52 @@ } } }, + "RestoreDatabaseMetadata": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "operationState": { + "type": "OperationState", + "id": 3 + }, + "database": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "firestore.googleapis.com/Database" + } + }, + "backup": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "firestore.googleapis.com/Backup" + } + }, + "progressPercentage": { + "type": "Progress", + "id": 8 + } + } + }, + "Progress": { + "fields": { + "estimatedWork": { + "type": "int64", + "id": 1 + }, + "completedWork": { + "type": "int64", + "id": 2 + } + } + }, "OperationState": { "values": { "OPERATION_STATE_UNSPECIFIED": 0, @@ -1137,14 +1604,62 @@ "CANCELLED": 7 } }, - "Progress": { + "BackupSchedule": { + "options": { + "(google.api.resource).type": "firestore.googleapis.com/BackupSchedule", + "(google.api.resource).pattern": "projects/{project}/databases/{database}/backupSchedules/{backup_schedule}" + }, + "oneofs": { + "recurrence": { + "oneof": [ + "dailyRecurrence", + "weeklyRecurrence" + ] + } + }, "fields": { - "estimatedWork": { - "type": "int64", - "id": 1 + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "completedWork": { - "type": "int64", + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "retention": { + "type": "google.protobuf.Duration", + "id": 6 + }, + "dailyRecurrence": { + "type": "DailyRecurrence", + "id": 7 + }, + "weeklyRecurrence": { + "type": "WeeklyRecurrence", + "id": 8 + } + } + }, + "DailyRecurrence": { + "fields": {} + }, + "WeeklyRecurrence": { + "fields": { + "day": { + "type": "google.type.DayOfWeek", "id": 2 } } @@ -2943,7 +3458,7 @@ } } }, - "Duration": { + "Timestamp": { "fields": { "seconds": { "type": "int64", @@ -2955,7 +3470,7 @@ } } }, - "Timestamp": { + "Duration": { "fields": { "seconds": { "type": "int64", @@ -3128,6 +3643,42 @@ } } }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "java_multiple_files": true, + "java_outer_classname": "LatLngProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP", + "cc_enable_arenas": true + }, + "nested": { + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + } + } + }, "longrunning": { "options": { "cc_enable_arenas": true, @@ -3372,30 +3923,6 @@ } } } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", - "java_multiple_files": true, - "java_outer_classname": "LatLngProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "LatLng": { - "fields": { - "latitude": { - "type": "double", - "id": 1 - }, - "longitude": { - "type": "double", - "id": 2 - } - } - } - } } } } diff --git a/dev/protos/firestore_admin_v1_proto_api.d.ts b/dev/protos/firestore_admin_v1_proto_api.d.ts index 6b7859096..6348ee27b 100644 --- a/dev/protos/firestore_admin_v1_proto_api.d.ts +++ b/dev/protos/firestore_admin_v1_proto_api.d.ts @@ -28,6 +28,157 @@ export namespace google { /** Namespace v1. */ namespace v1 { + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup database */ + database?: (string|null); + + /** Backup databaseUid */ + databaseUid?: (string|null); + + /** Backup snapshotTime */ + snapshotTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup stats */ + stats?: (google.firestore.admin.v1.Backup.IStats|null); + + /** Backup state */ + state?: (google.firestore.admin.v1.Backup.State|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup database. */ + public database: string; + + /** Backup databaseUid. */ + public databaseUid: string; + + /** Backup snapshotTime. */ + public snapshotTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup stats. */ + public stats?: (google.firestore.admin.v1.Backup.IStats|null); + + /** Backup state. */ + public state: google.firestore.admin.v1.Backup.State; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** Properties of a Stats. */ + interface IStats { + + /** Stats sizeBytes */ + sizeBytes?: (number|string|null); + + /** Stats documentCount */ + documentCount?: (number|string|null); + + /** Stats indexCount */ + indexCount?: (number|string|null); + } + + /** Represents a Stats. */ + class Stats implements IStats { + + /** + * Constructs a new Stats. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.Backup.IStats); + + /** Stats sizeBytes. */ + public sizeBytes: (number|string); + + /** Stats documentCount. */ + public documentCount: (number|string); + + /** Stats indexCount. */ + public indexCount: (number|string); + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Stats + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Backup.Stats; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @param message Stats + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.Backup.Stats, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Stats to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Stats + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** State enum. */ + type State = + "STATE_UNSPECIFIED"| "CREATING"| "READY"| "NOT_AVAILABLE"; + } + /** Properties of a Database. */ interface IDatabase { @@ -728,6 +879,132 @@ export namespace google { * @returns Promise */ public deleteDatabase(request: google.firestore.admin.v1.IDeleteDatabaseRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.firestore.admin.v1.IGetBackupRequest, callback: google.firestore.admin.v1.FirestoreAdmin.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.firestore.admin.v1.IGetBackupRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.firestore.admin.v1.IListBackupsRequest, callback: google.firestore.admin.v1.FirestoreAdmin.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.firestore.admin.v1.IListBackupsRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackup(request: google.firestore.admin.v1.IDeleteBackupRequest, callback: google.firestore.admin.v1.FirestoreAdmin.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.firestore.admin.v1.IDeleteBackupRequest): Promise; + + /** + * Calls RestoreDatabase. + * @param request RestoreDatabaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreDatabase(request: google.firestore.admin.v1.IRestoreDatabaseRequest, callback: google.firestore.admin.v1.FirestoreAdmin.RestoreDatabaseCallback): void; + + /** + * Calls RestoreDatabase. + * @param request RestoreDatabaseRequest message or plain object + * @returns Promise + */ + public restoreDatabase(request: google.firestore.admin.v1.IRestoreDatabaseRequest): Promise; + + /** + * Calls CreateBackupSchedule. + * @param request CreateBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public createBackupSchedule(request: google.firestore.admin.v1.ICreateBackupScheduleRequest, callback: google.firestore.admin.v1.FirestoreAdmin.CreateBackupScheduleCallback): void; + + /** + * Calls CreateBackupSchedule. + * @param request CreateBackupScheduleRequest message or plain object + * @returns Promise + */ + public createBackupSchedule(request: google.firestore.admin.v1.ICreateBackupScheduleRequest): Promise; + + /** + * Calls GetBackupSchedule. + * @param request GetBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public getBackupSchedule(request: google.firestore.admin.v1.IGetBackupScheduleRequest, callback: google.firestore.admin.v1.FirestoreAdmin.GetBackupScheduleCallback): void; + + /** + * Calls GetBackupSchedule. + * @param request GetBackupScheduleRequest message or plain object + * @returns Promise + */ + public getBackupSchedule(request: google.firestore.admin.v1.IGetBackupScheduleRequest): Promise; + + /** + * Calls ListBackupSchedules. + * @param request ListBackupSchedulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse + */ + public listBackupSchedules(request: google.firestore.admin.v1.IListBackupSchedulesRequest, callback: google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedulesCallback): void; + + /** + * Calls ListBackupSchedules. + * @param request ListBackupSchedulesRequest message or plain object + * @returns Promise + */ + public listBackupSchedules(request: google.firestore.admin.v1.IListBackupSchedulesRequest): Promise; + + /** + * Calls UpdateBackupSchedule. + * @param request UpdateBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupSchedule + */ + public updateBackupSchedule(request: google.firestore.admin.v1.IUpdateBackupScheduleRequest, callback: google.firestore.admin.v1.FirestoreAdmin.UpdateBackupScheduleCallback): void; + + /** + * Calls UpdateBackupSchedule. + * @param request UpdateBackupScheduleRequest message or plain object + * @returns Promise + */ + public updateBackupSchedule(request: google.firestore.admin.v1.IUpdateBackupScheduleRequest): Promise; + + /** + * Calls DeleteBackupSchedule. + * @param request DeleteBackupScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteBackupSchedule(request: google.firestore.admin.v1.IDeleteBackupScheduleRequest, callback: google.firestore.admin.v1.FirestoreAdmin.DeleteBackupScheduleCallback): void; + + /** + * Calls DeleteBackupSchedule. + * @param request DeleteBackupScheduleRequest message or plain object + * @returns Promise + */ + public deleteBackupSchedule(request: google.firestore.admin.v1.IDeleteBackupScheduleRequest): Promise; } namespace FirestoreAdmin { @@ -829,6 +1106,69 @@ export namespace google { * @param [response] Operation */ type DeleteDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.firestore.admin.v1.Backup) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.firestore.admin.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#deleteBackup}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#restoreDatabase}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreDatabaseCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#createBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type CreateBackupScheduleCallback = (error: (Error|null), response?: google.firestore.admin.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#getBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type GetBackupScheduleCallback = (error: (Error|null), response?: google.firestore.admin.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#listBackupSchedules}. + * @param error Error, if any + * @param [response] ListBackupSchedulesResponse + */ + type ListBackupSchedulesCallback = (error: (Error|null), response?: google.firestore.admin.v1.ListBackupSchedulesResponse) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#updateBackupSchedule}. + * @param error Error, if any + * @param [response] BackupSchedule + */ + type UpdateBackupScheduleCallback = (error: (Error|null), response?: google.firestore.admin.v1.BackupSchedule) => void; + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#deleteBackupSchedule}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteBackupScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Properties of a ListDatabasesRequest. */ @@ -1275,137 +1615,437 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateIndexRequest. */ - interface ICreateIndexRequest { + /** Properties of a CreateBackupScheduleRequest. */ + interface ICreateBackupScheduleRequest { - /** CreateIndexRequest parent */ + /** CreateBackupScheduleRequest parent */ parent?: (string|null); - /** CreateIndexRequest index */ - index?: (google.firestore.admin.v1.IIndex|null); + /** CreateBackupScheduleRequest backupSchedule */ + backupSchedule?: (google.firestore.admin.v1.IBackupSchedule|null); } - /** Represents a CreateIndexRequest. */ - class CreateIndexRequest implements ICreateIndexRequest { + /** Represents a CreateBackupScheduleRequest. */ + class CreateBackupScheduleRequest implements ICreateBackupScheduleRequest { /** - * Constructs a new CreateIndexRequest. + * Constructs a new CreateBackupScheduleRequest. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.admin.v1.ICreateIndexRequest); + constructor(properties?: google.firestore.admin.v1.ICreateBackupScheduleRequest); - /** CreateIndexRequest parent. */ + /** CreateBackupScheduleRequest parent. */ public parent: string; - /** CreateIndexRequest index. */ - public index?: (google.firestore.admin.v1.IIndex|null); + /** CreateBackupScheduleRequest backupSchedule. */ + public backupSchedule?: (google.firestore.admin.v1.IBackupSchedule|null); /** - * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateIndexRequest + * @returns CreateBackupScheduleRequest */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.CreateIndexRequest; + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.CreateBackupScheduleRequest; /** - * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. - * @param message CreateIndexRequest + * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. + * @param message CreateBackupScheduleRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.admin.v1.CreateIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.admin.v1.CreateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateIndexRequest to JSON. + * Converts this CreateBackupScheduleRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateIndexRequest + * Gets the default type url for CreateBackupScheduleRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListIndexesRequest. */ - interface IListIndexesRequest { - - /** ListIndexesRequest parent */ - parent?: (string|null); - - /** ListIndexesRequest filter */ - filter?: (string|null); - - /** ListIndexesRequest pageSize */ - pageSize?: (number|null); + /** Properties of a GetBackupScheduleRequest. */ + interface IGetBackupScheduleRequest { - /** ListIndexesRequest pageToken */ - pageToken?: (string|null); + /** GetBackupScheduleRequest name */ + name?: (string|null); } - /** Represents a ListIndexesRequest. */ - class ListIndexesRequest implements IListIndexesRequest { + /** Represents a GetBackupScheduleRequest. */ + class GetBackupScheduleRequest implements IGetBackupScheduleRequest { /** - * Constructs a new ListIndexesRequest. + * Constructs a new GetBackupScheduleRequest. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.admin.v1.IListIndexesRequest); - - /** ListIndexesRequest parent. */ - public parent: string; - - /** ListIndexesRequest filter. */ - public filter: string; - - /** ListIndexesRequest pageSize. */ - public pageSize: number; + constructor(properties?: google.firestore.admin.v1.IGetBackupScheduleRequest); - /** ListIndexesRequest pageToken. */ - public pageToken: string; + /** GetBackupScheduleRequest name. */ + public name: string; /** - * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListIndexesRequest + * @returns GetBackupScheduleRequest */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListIndexesRequest; + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.GetBackupScheduleRequest; /** - * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. - * @param message ListIndexesRequest + * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. + * @param message GetBackupScheduleRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.admin.v1.ListIndexesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.admin.v1.GetBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListIndexesRequest to JSON. + * Converts this GetBackupScheduleRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListIndexesRequest + * Gets the default type url for GetBackupScheduleRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListIndexesResponse. */ - interface IListIndexesResponse { + /** Properties of an UpdateBackupScheduleRequest. */ + interface IUpdateBackupScheduleRequest { - /** ListIndexesResponse indexes */ - indexes?: (google.firestore.admin.v1.IIndex[]|null); + /** UpdateBackupScheduleRequest backupSchedule */ + backupSchedule?: (google.firestore.admin.v1.IBackupSchedule|null); - /** ListIndexesResponse nextPageToken */ - nextPageToken?: (string|null); + /** UpdateBackupScheduleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a ListIndexesResponse. */ + /** Represents an UpdateBackupScheduleRequest. */ + class UpdateBackupScheduleRequest implements IUpdateBackupScheduleRequest { + + /** + * Constructs a new UpdateBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IUpdateBackupScheduleRequest); + + /** UpdateBackupScheduleRequest backupSchedule. */ + public backupSchedule?: (google.firestore.admin.v1.IBackupSchedule|null); + + /** UpdateBackupScheduleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.UpdateBackupScheduleRequest; + + /** + * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. + * @param message UpdateBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.UpdateBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupSchedulesRequest. */ + interface IListBackupSchedulesRequest { + + /** ListBackupSchedulesRequest parent */ + parent?: (string|null); + } + + /** Represents a ListBackupSchedulesRequest. */ + class ListBackupSchedulesRequest implements IListBackupSchedulesRequest { + + /** + * Constructs a new ListBackupSchedulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IListBackupSchedulesRequest); + + /** ListBackupSchedulesRequest parent. */ + public parent: string; + + /** + * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupSchedulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListBackupSchedulesRequest; + + /** + * Creates a plain object from a ListBackupSchedulesRequest message. Also converts values to other types if specified. + * @param message ListBackupSchedulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.ListBackupSchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupSchedulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupSchedulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupSchedulesResponse. */ + interface IListBackupSchedulesResponse { + + /** ListBackupSchedulesResponse backupSchedules */ + backupSchedules?: (google.firestore.admin.v1.IBackupSchedule[]|null); + } + + /** Represents a ListBackupSchedulesResponse. */ + class ListBackupSchedulesResponse implements IListBackupSchedulesResponse { + + /** + * Constructs a new ListBackupSchedulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IListBackupSchedulesResponse); + + /** ListBackupSchedulesResponse backupSchedules. */ + public backupSchedules: google.firestore.admin.v1.IBackupSchedule[]; + + /** + * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupSchedulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListBackupSchedulesResponse; + + /** + * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. + * @param message ListBackupSchedulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.ListBackupSchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupSchedulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupSchedulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupScheduleRequest. */ + interface IDeleteBackupScheduleRequest { + + /** DeleteBackupScheduleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupScheduleRequest. */ + class DeleteBackupScheduleRequest implements IDeleteBackupScheduleRequest { + + /** + * Constructs a new DeleteBackupScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IDeleteBackupScheduleRequest); + + /** DeleteBackupScheduleRequest name. */ + public name: string; + + /** + * Creates a DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.DeleteBackupScheduleRequest; + + /** + * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. + * @param message DeleteBackupScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.DeleteBackupScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateIndexRequest. */ + interface ICreateIndexRequest { + + /** CreateIndexRequest parent */ + parent?: (string|null); + + /** CreateIndexRequest index */ + index?: (google.firestore.admin.v1.IIndex|null); + } + + /** Represents a CreateIndexRequest. */ + class CreateIndexRequest implements ICreateIndexRequest { + + /** + * Constructs a new CreateIndexRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.ICreateIndexRequest); + + /** CreateIndexRequest parent. */ + public parent: string; + + /** CreateIndexRequest index. */ + public index?: (google.firestore.admin.v1.IIndex|null); + + /** + * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateIndexRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.CreateIndexRequest; + + /** + * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. + * @param message CreateIndexRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.CreateIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateIndexRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateIndexRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListIndexesRequest. */ + interface IListIndexesRequest { + + /** ListIndexesRequest parent */ + parent?: (string|null); + + /** ListIndexesRequest filter */ + filter?: (string|null); + + /** ListIndexesRequest pageSize */ + pageSize?: (number|null); + + /** ListIndexesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListIndexesRequest. */ + class ListIndexesRequest implements IListIndexesRequest { + + /** + * Constructs a new ListIndexesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IListIndexesRequest); + + /** ListIndexesRequest parent. */ + public parent: string; + + /** ListIndexesRequest filter. */ + public filter: string; + + /** ListIndexesRequest pageSize. */ + public pageSize: number; + + /** ListIndexesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIndexesRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListIndexesRequest; + + /** + * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. + * @param message ListIndexesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.ListIndexesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListIndexesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListIndexesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListIndexesResponse. */ + interface IListIndexesResponse { + + /** ListIndexesResponse indexes */ + indexes?: (google.firestore.admin.v1.IIndex[]|null); + + /** ListIndexesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListIndexesResponse. */ class ListIndexesResponse implements IListIndexesResponse { /** @@ -1905,8 +2545,266 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an IndexOperationMetadata. */ - interface IIndexOperationMetadata { + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.firestore.admin.v1.IBackup[]|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.firestore.admin.v1.IBackup[]; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDatabaseRequest. */ + interface IRestoreDatabaseRequest { + + /** RestoreDatabaseRequest parent */ + parent?: (string|null); + + /** RestoreDatabaseRequest databaseId */ + databaseId?: (string|null); + + /** RestoreDatabaseRequest backup */ + backup?: (string|null); + } + + /** Represents a RestoreDatabaseRequest. */ + class RestoreDatabaseRequest implements IRestoreDatabaseRequest { + + /** + * Constructs a new RestoreDatabaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IRestoreDatabaseRequest); + + /** RestoreDatabaseRequest parent. */ + public parent: string; + + /** RestoreDatabaseRequest databaseId. */ + public databaseId: string; + + /** RestoreDatabaseRequest backup. */ + public backup: string; + + /** + * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.RestoreDatabaseRequest; + + /** + * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. + * @param message RestoreDatabaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.RestoreDatabaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an IndexOperationMetadata. */ + interface IIndexOperationMetadata { /** IndexOperationMetadata startTime */ startTime?: (google.protobuf.ITimestamp|null); @@ -2334,150 +3232,399 @@ export namespace google { /** ImportDocumentsMetadata operationState. */ public operationState: google.firestore.admin.v1.OperationState; - /** ImportDocumentsMetadata progressDocuments. */ - public progressDocuments?: (google.firestore.admin.v1.IProgress|null); + /** ImportDocumentsMetadata progressDocuments. */ + public progressDocuments?: (google.firestore.admin.v1.IProgress|null); + + /** ImportDocumentsMetadata progressBytes. */ + public progressBytes?: (google.firestore.admin.v1.IProgress|null); + + /** ImportDocumentsMetadata collectionIds. */ + public collectionIds: string[]; + + /** ImportDocumentsMetadata inputUriPrefix. */ + public inputUriPrefix: string; + + /** ImportDocumentsMetadata namespaceIds. */ + public namespaceIds: string[]; + + /** + * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportDocumentsMetadata + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ImportDocumentsMetadata; + + /** + * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * @param message ImportDocumentsMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.ImportDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportDocumentsMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ImportDocumentsMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportDocumentsResponse. */ + interface IExportDocumentsResponse { + + /** ExportDocumentsResponse outputUriPrefix */ + outputUriPrefix?: (string|null); + } + + /** Represents an ExportDocumentsResponse. */ + class ExportDocumentsResponse implements IExportDocumentsResponse { + + /** + * Constructs a new ExportDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IExportDocumentsResponse); + + /** ExportDocumentsResponse outputUriPrefix. */ + public outputUriPrefix: string; + + /** + * Creates an ExportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ExportDocumentsResponse; + + /** + * Creates a plain object from an ExportDocumentsResponse message. Also converts values to other types if specified. + * @param message ExportDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.ExportDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreDatabaseMetadata. */ + interface IRestoreDatabaseMetadata { + + /** RestoreDatabaseMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata operationState */ + operationState?: (google.firestore.admin.v1.OperationState|null); + + /** RestoreDatabaseMetadata database */ + database?: (string|null); + + /** RestoreDatabaseMetadata backup */ + backup?: (string|null); + + /** RestoreDatabaseMetadata progressPercentage */ + progressPercentage?: (google.firestore.admin.v1.IProgress|null); + } + + /** Represents a RestoreDatabaseMetadata. */ + class RestoreDatabaseMetadata implements IRestoreDatabaseMetadata { + + /** + * Constructs a new RestoreDatabaseMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IRestoreDatabaseMetadata); + + /** RestoreDatabaseMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** RestoreDatabaseMetadata operationState. */ + public operationState: google.firestore.admin.v1.OperationState; + + /** RestoreDatabaseMetadata database. */ + public database: string; + + /** RestoreDatabaseMetadata backup. */ + public backup: string; + + /** RestoreDatabaseMetadata progressPercentage. */ + public progressPercentage?: (google.firestore.admin.v1.IProgress|null); + + /** + * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreDatabaseMetadata + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.RestoreDatabaseMetadata; + + /** + * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. + * @param message RestoreDatabaseMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.RestoreDatabaseMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreDatabaseMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreDatabaseMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Progress. */ + interface IProgress { + + /** Progress estimatedWork */ + estimatedWork?: (number|string|null); + + /** Progress completedWork */ + completedWork?: (number|string|null); + } + + /** Represents a Progress. */ + class Progress implements IProgress { + + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IProgress); + + /** Progress estimatedWork. */ + public estimatedWork: (number|string); + + /** Progress completedWork. */ + public completedWork: (number|string); + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Progress; + + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.firestore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Progress + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** OperationState enum. */ + type OperationState = + "OPERATION_STATE_UNSPECIFIED"| "INITIALIZING"| "PROCESSING"| "CANCELLING"| "FINALIZING"| "SUCCESSFUL"| "FAILED"| "CANCELLED"; + + /** Properties of a BackupSchedule. */ + interface IBackupSchedule { + + /** BackupSchedule name */ + name?: (string|null); + + /** BackupSchedule createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupSchedule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupSchedule retention */ + retention?: (google.protobuf.IDuration|null); + + /** BackupSchedule dailyRecurrence */ + dailyRecurrence?: (google.firestore.admin.v1.IDailyRecurrence|null); + + /** BackupSchedule weeklyRecurrence */ + weeklyRecurrence?: (google.firestore.admin.v1.IWeeklyRecurrence|null); + } + + /** Represents a BackupSchedule. */ + class BackupSchedule implements IBackupSchedule { + + /** + * Constructs a new BackupSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.firestore.admin.v1.IBackupSchedule); + + /** BackupSchedule name. */ + public name: string; + + /** BackupSchedule createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupSchedule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** ImportDocumentsMetadata progressBytes. */ - public progressBytes?: (google.firestore.admin.v1.IProgress|null); + /** BackupSchedule retention. */ + public retention?: (google.protobuf.IDuration|null); - /** ImportDocumentsMetadata collectionIds. */ - public collectionIds: string[]; + /** BackupSchedule dailyRecurrence. */ + public dailyRecurrence?: (google.firestore.admin.v1.IDailyRecurrence|null); - /** ImportDocumentsMetadata inputUriPrefix. */ - public inputUriPrefix: string; + /** BackupSchedule weeklyRecurrence. */ + public weeklyRecurrence?: (google.firestore.admin.v1.IWeeklyRecurrence|null); - /** ImportDocumentsMetadata namespaceIds. */ - public namespaceIds: string[]; + /** BackupSchedule recurrence. */ + public recurrence?: ("dailyRecurrence"|"weeklyRecurrence"); /** - * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportDocumentsMetadata + * @returns BackupSchedule */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ImportDocumentsMetadata; + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.BackupSchedule; /** - * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. - * @param message ImportDocumentsMetadata + * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. + * @param message BackupSchedule * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.admin.v1.ImportDocumentsMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.admin.v1.BackupSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportDocumentsMetadata to JSON. + * Converts this BackupSchedule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImportDocumentsMetadata + * Gets the default type url for BackupSchedule * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExportDocumentsResponse. */ - interface IExportDocumentsResponse { - - /** ExportDocumentsResponse outputUriPrefix */ - outputUriPrefix?: (string|null); + /** Properties of a DailyRecurrence. */ + interface IDailyRecurrence { } - /** Represents an ExportDocumentsResponse. */ - class ExportDocumentsResponse implements IExportDocumentsResponse { + /** Represents a DailyRecurrence. */ + class DailyRecurrence implements IDailyRecurrence { /** - * Constructs a new ExportDocumentsResponse. + * Constructs a new DailyRecurrence. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.admin.v1.IExportDocumentsResponse); - - /** ExportDocumentsResponse outputUriPrefix. */ - public outputUriPrefix: string; + constructor(properties?: google.firestore.admin.v1.IDailyRecurrence); /** - * Creates an ExportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DailyRecurrence message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportDocumentsResponse + * @returns DailyRecurrence */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.ExportDocumentsResponse; + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.DailyRecurrence; /** - * Creates a plain object from an ExportDocumentsResponse message. Also converts values to other types if specified. - * @param message ExportDocumentsResponse + * Creates a plain object from a DailyRecurrence message. Also converts values to other types if specified. + * @param message DailyRecurrence * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.admin.v1.ExportDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.admin.v1.DailyRecurrence, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportDocumentsResponse to JSON. + * Converts this DailyRecurrence to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExportDocumentsResponse + * Gets the default type url for DailyRecurrence * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** OperationState enum. */ - type OperationState = - "OPERATION_STATE_UNSPECIFIED"| "INITIALIZING"| "PROCESSING"| "CANCELLING"| "FINALIZING"| "SUCCESSFUL"| "FAILED"| "CANCELLED"; - - /** Properties of a Progress. */ - interface IProgress { - - /** Progress estimatedWork */ - estimatedWork?: (number|string|null); + /** Properties of a WeeklyRecurrence. */ + interface IWeeklyRecurrence { - /** Progress completedWork */ - completedWork?: (number|string|null); + /** WeeklyRecurrence day */ + day?: (google.type.DayOfWeek|null); } - /** Represents a Progress. */ - class Progress implements IProgress { + /** Represents a WeeklyRecurrence. */ + class WeeklyRecurrence implements IWeeklyRecurrence { /** - * Constructs a new Progress. + * Constructs a new WeeklyRecurrence. * @param [properties] Properties to set */ - constructor(properties?: google.firestore.admin.v1.IProgress); - - /** Progress estimatedWork. */ - public estimatedWork: (number|string); + constructor(properties?: google.firestore.admin.v1.IWeeklyRecurrence); - /** Progress completedWork. */ - public completedWork: (number|string); + /** WeeklyRecurrence day. */ + public day: google.type.DayOfWeek; /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * Creates a WeeklyRecurrence message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Progress + * @returns WeeklyRecurrence */ - public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.Progress; + public static fromObject(object: { [k: string]: any }): google.firestore.admin.v1.WeeklyRecurrence; /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @param message Progress + * Creates a plain object from a WeeklyRecurrence message. Also converts values to other types if specified. + * @param message WeeklyRecurrence * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.firestore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.firestore.admin.v1.WeeklyRecurrence, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Progress to JSON. + * Converts this WeeklyRecurrence to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Progress + * Gets the default type url for WeeklyRecurrence * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -6198,108 +7345,108 @@ export namespace google { } } - /** Properties of a Duration. */ - interface IDuration { + /** Properties of a Timestamp. */ + interface ITimestamp { - /** Duration seconds */ + /** Timestamp seconds */ seconds?: (number|string|null); - /** Duration nanos */ + /** Timestamp nanos */ nanos?: (number|null); } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new Duration. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDuration); + constructor(properties?: google.protobuf.ITimestamp); - /** Duration seconds. */ + /** Timestamp seconds. */ public seconds: (number|string); - /** Duration nanos. */ + /** Timestamp nanos. */ public nanos: number; /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Duration + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Duration to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Duration + * Gets the default type url for Timestamp * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Timestamp. */ - interface ITimestamp { + /** Properties of a Duration. */ + interface IDuration { - /** Timestamp seconds */ + /** Duration seconds */ seconds?: (number|string|null); - /** Timestamp nanos */ + /** Duration nanos */ nanos?: (number|null); } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents a Duration. */ + class Duration implements IDuration { /** - * Constructs a new Timestamp. + * Constructs a new Duration. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); + constructor(properties?: google.protobuf.IDuration); - /** Timestamp seconds. */ + /** Duration seconds. */ public seconds: (number|string); - /** Timestamp nanos. */ + /** Duration nanos. */ public nanos: number; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Duration * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -7064,6 +8211,68 @@ export namespace google { } } + /** Namespace type. */ + namespace type { + + /** DayOfWeek enum. */ + type DayOfWeek = + "DAY_OF_WEEK_UNSPECIFIED"| "MONDAY"| "TUESDAY"| "WEDNESDAY"| "THURSDAY"| "FRIDAY"| "SATURDAY"| "SUNDAY"; + + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatLng + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace longrunning. */ namespace longrunning { @@ -7698,62 +8907,4 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } - - /** Namespace type. */ - namespace type { - - /** Properties of a LatLng. */ - interface ILatLng { - - /** LatLng latitude */ - latitude?: (number|null); - - /** LatLng longitude */ - longitude?: (number|null); - } - - /** Represents a LatLng. */ - class LatLng implements ILatLng { - - /** - * Constructs a new LatLng. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ILatLng); - - /** LatLng latitude. */ - public latitude: number; - - /** LatLng longitude. */ - public longitude: number; - - /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatLng - */ - public static fromObject(object: { [k: string]: any }): google.type.LatLng; - - /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @param message LatLng - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LatLng to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LatLng - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } } diff --git a/dev/protos/firestore_admin_v1_proto_api.js b/dev/protos/firestore_admin_v1_proto_api.js index 8e4ec1c81..d0ccf3092 100644 --- a/dev/protos/firestore_admin_v1_proto_api.js +++ b/dev/protos/firestore_admin_v1_proto_api.js @@ -68,6 +68,407 @@ */ var v1 = {}; + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.firestore.admin.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [database] Backup database + * @property {string|null} [databaseUid] Backup databaseUid + * @property {google.protobuf.ITimestamp|null} [snapshotTime] Backup snapshotTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {google.firestore.admin.v1.Backup.IStats|null} [stats] Backup stats + * @property {google.firestore.admin.v1.Backup.State|null} [state] Backup state + */ + + /** + * Constructs a new Backup. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.firestore.admin.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.firestore.admin.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup database. + * @member {string} database + * @memberof google.firestore.admin.v1.Backup + * @instance + */ + Backup.prototype.database = ""; + + /** + * Backup databaseUid. + * @member {string} databaseUid + * @memberof google.firestore.admin.v1.Backup + * @instance + */ + Backup.prototype.databaseUid = ""; + + /** + * Backup snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.firestore.admin.v1.Backup + * @instance + */ + Backup.prototype.snapshotTime = null; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.firestore.admin.v1.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup stats. + * @member {google.firestore.admin.v1.Backup.IStats|null|undefined} stats + * @memberof google.firestore.admin.v1.Backup + * @instance + */ + Backup.prototype.stats = null; + + /** + * Backup state. + * @member {google.firestore.admin.v1.Backup.State} state + * @memberof google.firestore.admin.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.Backup) + return object; + var message = new $root.google.firestore.admin.v1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.database != null) + message.database = String(object.database); + if (object.databaseUid != null) + message.databaseUid = String(object.databaseUid); + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.firestore.admin.v1.Backup.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.firestore.admin.v1.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.stats != null) { + if (typeof object.stats !== "object") + throw TypeError(".google.firestore.admin.v1.Backup.stats: object expected"); + message.stats = $root.google.firestore.admin.v1.Backup.Stats.fromObject(object.stats); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "NOT_AVAILABLE": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.Backup + * @static + * @param {google.firestore.admin.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.database = ""; + object.snapshotTime = null; + object.expireTime = null; + object.stats = null; + object.databaseUid = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.stats != null && message.hasOwnProperty("stats")) + object.stats = $root.google.firestore.admin.v1.Backup.Stats.toObject(message.stats, options); + if (message.databaseUid != null && message.hasOwnProperty("databaseUid")) + object.databaseUid = message.databaseUid; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.firestore.admin.v1.Backup.State[message.state] === undefined ? message.state : $root.google.firestore.admin.v1.Backup.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.firestore.admin.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.Backup"; + }; + + Backup.Stats = (function() { + + /** + * Properties of a Stats. + * @memberof google.firestore.admin.v1.Backup + * @interface IStats + * @property {number|string|null} [sizeBytes] Stats sizeBytes + * @property {number|string|null} [documentCount] Stats documentCount + * @property {number|string|null} [indexCount] Stats indexCount + */ + + /** + * Constructs a new Stats. + * @memberof google.firestore.admin.v1.Backup + * @classdesc Represents a Stats. + * @implements IStats + * @constructor + * @param {google.firestore.admin.v1.Backup.IStats=} [properties] Properties to set + */ + function Stats(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Stats sizeBytes. + * @member {number|string} sizeBytes + * @memberof google.firestore.admin.v1.Backup.Stats + * @instance + */ + Stats.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stats documentCount. + * @member {number|string} documentCount + * @memberof google.firestore.admin.v1.Backup.Stats + * @instance + */ + Stats.prototype.documentCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Stats indexCount. + * @member {number|string} indexCount + * @memberof google.firestore.admin.v1.Backup.Stats + * @instance + */ + Stats.prototype.indexCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a Stats message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.Backup.Stats + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.Backup.Stats} Stats + */ + Stats.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.Backup.Stats) + return object; + var message = new $root.google.firestore.admin.v1.Backup.Stats(); + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.documentCount != null) + if ($util.Long) + (message.documentCount = $util.Long.fromValue(object.documentCount)).unsigned = false; + else if (typeof object.documentCount === "string") + message.documentCount = parseInt(object.documentCount, 10); + else if (typeof object.documentCount === "number") + message.documentCount = object.documentCount; + else if (typeof object.documentCount === "object") + message.documentCount = new $util.LongBits(object.documentCount.low >>> 0, object.documentCount.high >>> 0).toNumber(); + if (object.indexCount != null) + if ($util.Long) + (message.indexCount = $util.Long.fromValue(object.indexCount)).unsigned = false; + else if (typeof object.indexCount === "string") + message.indexCount = parseInt(object.indexCount, 10); + else if (typeof object.indexCount === "number") + message.indexCount = object.indexCount; + else if (typeof object.indexCount === "object") + message.indexCount = new $util.LongBits(object.indexCount.low >>> 0, object.indexCount.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Stats message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.Backup.Stats + * @static + * @param {google.firestore.admin.v1.Backup.Stats} message Stats + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Stats.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.documentCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.documentCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.indexCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.indexCount = options.longs === String ? "0" : 0; + } + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + if (message.documentCount != null && message.hasOwnProperty("documentCount")) + if (typeof message.documentCount === "number") + object.documentCount = options.longs === String ? String(message.documentCount) : message.documentCount; + else + object.documentCount = options.longs === String ? $util.Long.prototype.toString.call(message.documentCount) : options.longs === Number ? new $util.LongBits(message.documentCount.low >>> 0, message.documentCount.high >>> 0).toNumber() : message.documentCount; + if (message.indexCount != null && message.hasOwnProperty("indexCount")) + if (typeof message.indexCount === "number") + object.indexCount = options.longs === String ? String(message.indexCount) : message.indexCount; + else + object.indexCount = options.longs === String ? $util.Long.prototype.toString.call(message.indexCount) : options.longs === Number ? new $util.LongBits(message.indexCount.low >>> 0, message.indexCount.high >>> 0).toNumber() : message.indexCount; + return object; + }; + + /** + * Converts this Stats to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.Backup.Stats + * @instance + * @returns {Object.} JSON object + */ + Stats.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Stats + * @function getTypeUrl + * @memberof google.firestore.admin.v1.Backup.Stats + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Stats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.Backup.Stats"; + }; + + return Stats; + })(); + + /** + * State enum. + * @name google.firestore.admin.v1.Backup.State + * @enum {string} + * @property {string} STATE_UNSPECIFIED=STATE_UNSPECIFIED STATE_UNSPECIFIED value + * @property {string} CREATING=CREATING CREATING value + * @property {string} READY=READY READY value + * @property {string} NOT_AVAILABLE=NOT_AVAILABLE NOT_AVAILABLE value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = "STATE_UNSPECIFIED"; + values[valuesById[1] = "CREATING"] = "CREATING"; + values[valuesById[2] = "READY"] = "READY"; + values[valuesById[3] = "NOT_AVAILABLE"] = "NOT_AVAILABLE"; + return values; + })(); + + return Backup; + })(); + v1.Database = (function() { /** @@ -1924,43 +2325,340 @@ * @variation 2 */ - return FirestoreAdmin; - })(); + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#getBackup}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.firestore.admin.v1.Backup} [response] Backup + */ - v1.ListDatabasesRequest = (function() { + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.firestore.admin.v1.GetBackupRequest, $root.google.firestore.admin.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); /** - * Properties of a ListDatabasesRequest. - * @memberof google.firestore.admin.v1 - * @interface IListDatabasesRequest - * @property {string|null} [parent] ListDatabasesRequest parent + * Calls GetBackup. + * @function getBackup + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListDatabasesRequest. - * @memberof google.firestore.admin.v1 - * @classdesc Represents a ListDatabasesRequest. - * @implements IListDatabasesRequest - * @constructor - * @param {google.firestore.admin.v1.IListDatabasesRequest=} [properties] Properties to set + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#listBackups}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.firestore.admin.v1.ListBackupsResponse} [response] ListBackupsResponse */ - function ListDatabasesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ListDatabasesRequest parent. - * @member {string} parent - * @memberof google.firestore.admin.v1.ListDatabasesRequest + * Calls ListBackups. + * @function listBackups + * @memberof google.firestore.admin.v1.FirestoreAdmin * @instance + * @param {google.firestore.admin.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 */ - ListDatabasesRequest.prototype.parent = ""; + Object.defineProperty(FirestoreAdmin.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.firestore.admin.v1.ListBackupsRequest, $root.google.firestore.admin.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); /** - * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. + * Calls ListBackups. + * @function listBackups + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#deleteBackup}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.firestore.admin.v1.DeleteBackupRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#restoreDatabase}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef RestoreDatabaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreDatabase. + * @function restoreDatabase + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.RestoreDatabaseCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.restoreDatabase = function restoreDatabase(request, callback) { + return this.rpcCall(restoreDatabase, $root.google.firestore.admin.v1.RestoreDatabaseRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreDatabase" }); + + /** + * Calls RestoreDatabase. + * @function restoreDatabase + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IRestoreDatabaseRequest} request RestoreDatabaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#createBackupSchedule}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef CreateBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.firestore.admin.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls CreateBackupSchedule. + * @function createBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.CreateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.createBackupSchedule = function createBackupSchedule(request, callback) { + return this.rpcCall(createBackupSchedule, $root.google.firestore.admin.v1.CreateBackupScheduleRequest, $root.google.firestore.admin.v1.BackupSchedule, request, callback); + }, "name", { value: "CreateBackupSchedule" }); + + /** + * Calls CreateBackupSchedule. + * @function createBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.ICreateBackupScheduleRequest} request CreateBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#getBackupSchedule}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef GetBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.firestore.admin.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls GetBackupSchedule. + * @function getBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.GetBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.getBackupSchedule = function getBackupSchedule(request, callback) { + return this.rpcCall(getBackupSchedule, $root.google.firestore.admin.v1.GetBackupScheduleRequest, $root.google.firestore.admin.v1.BackupSchedule, request, callback); + }, "name", { value: "GetBackupSchedule" }); + + /** + * Calls GetBackupSchedule. + * @function getBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IGetBackupScheduleRequest} request GetBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#listBackupSchedules}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef ListBackupSchedulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.firestore.admin.v1.ListBackupSchedulesResponse} [response] ListBackupSchedulesResponse + */ + + /** + * Calls ListBackupSchedules. + * @function listBackupSchedules + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedulesCallback} callback Node-style callback called with the error, if any, and ListBackupSchedulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.listBackupSchedules = function listBackupSchedules(request, callback) { + return this.rpcCall(listBackupSchedules, $root.google.firestore.admin.v1.ListBackupSchedulesRequest, $root.google.firestore.admin.v1.ListBackupSchedulesResponse, request, callback); + }, "name", { value: "ListBackupSchedules" }); + + /** + * Calls ListBackupSchedules. + * @function listBackupSchedules + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IListBackupSchedulesRequest} request ListBackupSchedulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#updateBackupSchedule}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef UpdateBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.firestore.admin.v1.BackupSchedule} [response] BackupSchedule + */ + + /** + * Calls UpdateBackupSchedule. + * @function updateBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.UpdateBackupScheduleCallback} callback Node-style callback called with the error, if any, and BackupSchedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.updateBackupSchedule = function updateBackupSchedule(request, callback) { + return this.rpcCall(updateBackupSchedule, $root.google.firestore.admin.v1.UpdateBackupScheduleRequest, $root.google.firestore.admin.v1.BackupSchedule, request, callback); + }, "name", { value: "UpdateBackupSchedule" }); + + /** + * Calls UpdateBackupSchedule. + * @function updateBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IUpdateBackupScheduleRequest} request UpdateBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.firestore.admin.v1.FirestoreAdmin#deleteBackupSchedule}. + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @typedef DeleteBackupScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteBackupSchedule. + * @function deleteBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object + * @param {google.firestore.admin.v1.FirestoreAdmin.DeleteBackupScheduleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FirestoreAdmin.prototype.deleteBackupSchedule = function deleteBackupSchedule(request, callback) { + return this.rpcCall(deleteBackupSchedule, $root.google.firestore.admin.v1.DeleteBackupScheduleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteBackupSchedule" }); + + /** + * Calls DeleteBackupSchedule. + * @function deleteBackupSchedule + * @memberof google.firestore.admin.v1.FirestoreAdmin + * @instance + * @param {google.firestore.admin.v1.IDeleteBackupScheduleRequest} request DeleteBackupScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return FirestoreAdmin; + })(); + + v1.ListDatabasesRequest = (function() { + + /** + * Properties of a ListDatabasesRequest. + * @memberof google.firestore.admin.v1 + * @interface IListDatabasesRequest + * @property {string|null} [parent] ListDatabasesRequest parent + */ + + /** + * Constructs a new ListDatabasesRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a ListDatabasesRequest. + * @implements IListDatabasesRequest + * @constructor + * @param {google.firestore.admin.v1.IListDatabasesRequest=} [properties] Properties to set + */ + function ListDatabasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDatabasesRequest parent. + * @member {string} parent + * @memberof google.firestore.admin.v1.ListDatabasesRequest + * @instance + */ + ListDatabasesRequest.prototype.parent = ""; + + /** + * Creates a ListDatabasesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.firestore.admin.v1.ListDatabasesRequest * @static @@ -2856,25 +3554,25 @@ return DeleteDatabaseMetadata; })(); - v1.CreateIndexRequest = (function() { + v1.CreateBackupScheduleRequest = (function() { /** - * Properties of a CreateIndexRequest. + * Properties of a CreateBackupScheduleRequest. * @memberof google.firestore.admin.v1 - * @interface ICreateIndexRequest - * @property {string|null} [parent] CreateIndexRequest parent - * @property {google.firestore.admin.v1.IIndex|null} [index] CreateIndexRequest index + * @interface ICreateBackupScheduleRequest + * @property {string|null} [parent] CreateBackupScheduleRequest parent + * @property {google.firestore.admin.v1.IBackupSchedule|null} [backupSchedule] CreateBackupScheduleRequest backupSchedule */ /** - * Constructs a new CreateIndexRequest. + * Constructs a new CreateBackupScheduleRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents a CreateIndexRequest. - * @implements ICreateIndexRequest + * @classdesc Represents a CreateBackupScheduleRequest. + * @implements ICreateBackupScheduleRequest * @constructor - * @param {google.firestore.admin.v1.ICreateIndexRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.ICreateBackupScheduleRequest=} [properties] Properties to set */ - function CreateIndexRequest(properties) { + function CreateBackupScheduleRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2882,117 +3580,114 @@ } /** - * CreateIndexRequest parent. + * CreateBackupScheduleRequest parent. * @member {string} parent - * @memberof google.firestore.admin.v1.CreateIndexRequest + * @memberof google.firestore.admin.v1.CreateBackupScheduleRequest * @instance */ - CreateIndexRequest.prototype.parent = ""; + CreateBackupScheduleRequest.prototype.parent = ""; /** - * CreateIndexRequest index. - * @member {google.firestore.admin.v1.IIndex|null|undefined} index - * @memberof google.firestore.admin.v1.CreateIndexRequest + * CreateBackupScheduleRequest backupSchedule. + * @member {google.firestore.admin.v1.IBackupSchedule|null|undefined} backupSchedule + * @memberof google.firestore.admin.v1.CreateBackupScheduleRequest * @instance */ - CreateIndexRequest.prototype.index = null; + CreateBackupScheduleRequest.prototype.backupSchedule = null; /** - * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.CreateIndexRequest + * @memberof google.firestore.admin.v1.CreateBackupScheduleRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.CreateIndexRequest} CreateIndexRequest + * @returns {google.firestore.admin.v1.CreateBackupScheduleRequest} CreateBackupScheduleRequest */ - CreateIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.CreateIndexRequest) + CreateBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.CreateBackupScheduleRequest) return object; - var message = new $root.google.firestore.admin.v1.CreateIndexRequest(); + var message = new $root.google.firestore.admin.v1.CreateBackupScheduleRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.index != null) { - if (typeof object.index !== "object") - throw TypeError(".google.firestore.admin.v1.CreateIndexRequest.index: object expected"); - message.index = $root.google.firestore.admin.v1.Index.fromObject(object.index); + if (object.backupSchedule != null) { + if (typeof object.backupSchedule !== "object") + throw TypeError(".google.firestore.admin.v1.CreateBackupScheduleRequest.backupSchedule: object expected"); + message.backupSchedule = $root.google.firestore.admin.v1.BackupSchedule.fromObject(object.backupSchedule); } return message; }; /** - * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateBackupScheduleRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.CreateIndexRequest + * @memberof google.firestore.admin.v1.CreateBackupScheduleRequest * @static - * @param {google.firestore.admin.v1.CreateIndexRequest} message CreateIndexRequest + * @param {google.firestore.admin.v1.CreateBackupScheduleRequest} message CreateBackupScheduleRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateIndexRequest.toObject = function toObject(message, options) { + CreateBackupScheduleRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.index = null; + object.backupSchedule = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.index != null && message.hasOwnProperty("index")) - object.index = $root.google.firestore.admin.v1.Index.toObject(message.index, options); + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) + object.backupSchedule = $root.google.firestore.admin.v1.BackupSchedule.toObject(message.backupSchedule, options); return object; }; /** - * Converts this CreateIndexRequest to JSON. + * Converts this CreateBackupScheduleRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.CreateIndexRequest + * @memberof google.firestore.admin.v1.CreateBackupScheduleRequest * @instance * @returns {Object.} JSON object */ - CreateIndexRequest.prototype.toJSON = function toJSON() { + CreateBackupScheduleRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateIndexRequest + * Gets the default type url for CreateBackupScheduleRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.CreateIndexRequest + * @memberof google.firestore.admin.v1.CreateBackupScheduleRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.CreateIndexRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.CreateBackupScheduleRequest"; }; - return CreateIndexRequest; + return CreateBackupScheduleRequest; })(); - v1.ListIndexesRequest = (function() { + v1.GetBackupScheduleRequest = (function() { /** - * Properties of a ListIndexesRequest. + * Properties of a GetBackupScheduleRequest. * @memberof google.firestore.admin.v1 - * @interface IListIndexesRequest - * @property {string|null} [parent] ListIndexesRequest parent - * @property {string|null} [filter] ListIndexesRequest filter - * @property {number|null} [pageSize] ListIndexesRequest pageSize - * @property {string|null} [pageToken] ListIndexesRequest pageToken + * @interface IGetBackupScheduleRequest + * @property {string|null} [name] GetBackupScheduleRequest name */ /** - * Constructs a new ListIndexesRequest. + * Constructs a new GetBackupScheduleRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents a ListIndexesRequest. - * @implements IListIndexesRequest + * @classdesc Represents a GetBackupScheduleRequest. + * @implements IGetBackupScheduleRequest * @constructor - * @param {google.firestore.admin.v1.IListIndexesRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.IGetBackupScheduleRequest=} [properties] Properties to set */ - function ListIndexesRequest(properties) { + function GetBackupScheduleRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3000,139 +3695,216 @@ } /** - * ListIndexesRequest parent. - * @member {string} parent - * @memberof google.firestore.admin.v1.ListIndexesRequest + * GetBackupScheduleRequest name. + * @member {string} name + * @memberof google.firestore.admin.v1.GetBackupScheduleRequest * @instance */ - ListIndexesRequest.prototype.parent = ""; + GetBackupScheduleRequest.prototype.name = ""; /** - * ListIndexesRequest filter. - * @member {string} filter - * @memberof google.firestore.admin.v1.ListIndexesRequest - * @instance + * Creates a GetBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.GetBackupScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.GetBackupScheduleRequest} GetBackupScheduleRequest */ - ListIndexesRequest.prototype.filter = ""; + GetBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.GetBackupScheduleRequest) + return object; + var message = new $root.google.firestore.admin.v1.GetBackupScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * ListIndexesRequest pageSize. - * @member {number} pageSize - * @memberof google.firestore.admin.v1.ListIndexesRequest + * Creates a plain object from a GetBackupScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.GetBackupScheduleRequest + * @static + * @param {google.firestore.admin.v1.GetBackupScheduleRequest} message GetBackupScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupScheduleRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.GetBackupScheduleRequest * @instance + * @returns {Object.} JSON object */ - ListIndexesRequest.prototype.pageSize = 0; + GetBackupScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * ListIndexesRequest pageToken. - * @member {string} pageToken - * @memberof google.firestore.admin.v1.ListIndexesRequest + * Gets the default type url for GetBackupScheduleRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.GetBackupScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.GetBackupScheduleRequest"; + }; + + return GetBackupScheduleRequest; + })(); + + v1.UpdateBackupScheduleRequest = (function() { + + /** + * Properties of an UpdateBackupScheduleRequest. + * @memberof google.firestore.admin.v1 + * @interface IUpdateBackupScheduleRequest + * @property {google.firestore.admin.v1.IBackupSchedule|null} [backupSchedule] UpdateBackupScheduleRequest backupSchedule + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupScheduleRequest updateMask + */ + + /** + * Constructs a new UpdateBackupScheduleRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents an UpdateBackupScheduleRequest. + * @implements IUpdateBackupScheduleRequest + * @constructor + * @param {google.firestore.admin.v1.IUpdateBackupScheduleRequest=} [properties] Properties to set + */ + function UpdateBackupScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupScheduleRequest backupSchedule. + * @member {google.firestore.admin.v1.IBackupSchedule|null|undefined} backupSchedule + * @memberof google.firestore.admin.v1.UpdateBackupScheduleRequest * @instance */ - ListIndexesRequest.prototype.pageToken = ""; + UpdateBackupScheduleRequest.prototype.backupSchedule = null; /** - * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. + * UpdateBackupScheduleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.firestore.admin.v1.UpdateBackupScheduleRequest + * @instance + */ + UpdateBackupScheduleRequest.prototype.updateMask = null; + + /** + * Creates an UpdateBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.ListIndexesRequest + * @memberof google.firestore.admin.v1.UpdateBackupScheduleRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ListIndexesRequest} ListIndexesRequest + * @returns {google.firestore.admin.v1.UpdateBackupScheduleRequest} UpdateBackupScheduleRequest */ - ListIndexesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ListIndexesRequest) + UpdateBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.UpdateBackupScheduleRequest) return object; - var message = new $root.google.firestore.admin.v1.ListIndexesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.firestore.admin.v1.UpdateBackupScheduleRequest(); + if (object.backupSchedule != null) { + if (typeof object.backupSchedule !== "object") + throw TypeError(".google.firestore.admin.v1.UpdateBackupScheduleRequest.backupSchedule: object expected"); + message.backupSchedule = $root.google.firestore.admin.v1.BackupSchedule.fromObject(object.backupSchedule); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.firestore.admin.v1.UpdateBackupScheduleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateBackupScheduleRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ListIndexesRequest + * @memberof google.firestore.admin.v1.UpdateBackupScheduleRequest * @static - * @param {google.firestore.admin.v1.ListIndexesRequest} message ListIndexesRequest + * @param {google.firestore.admin.v1.UpdateBackupScheduleRequest} message UpdateBackupScheduleRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIndexesRequest.toObject = function toObject(message, options) { + UpdateBackupScheduleRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; + object.backupSchedule = null; + object.updateMask = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.backupSchedule != null && message.hasOwnProperty("backupSchedule")) + object.backupSchedule = $root.google.firestore.admin.v1.BackupSchedule.toObject(message.backupSchedule, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ListIndexesRequest to JSON. + * Converts this UpdateBackupScheduleRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ListIndexesRequest + * @memberof google.firestore.admin.v1.UpdateBackupScheduleRequest * @instance * @returns {Object.} JSON object */ - ListIndexesRequest.prototype.toJSON = function toJSON() { + UpdateBackupScheduleRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListIndexesRequest + * Gets the default type url for UpdateBackupScheduleRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.ListIndexesRequest + * @memberof google.firestore.admin.v1.UpdateBackupScheduleRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListIndexesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ListIndexesRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.UpdateBackupScheduleRequest"; }; - return ListIndexesRequest; + return UpdateBackupScheduleRequest; })(); - v1.ListIndexesResponse = (function() { + v1.ListBackupSchedulesRequest = (function() { /** - * Properties of a ListIndexesResponse. + * Properties of a ListBackupSchedulesRequest. * @memberof google.firestore.admin.v1 - * @interface IListIndexesResponse - * @property {Array.|null} [indexes] ListIndexesResponse indexes - * @property {string|null} [nextPageToken] ListIndexesResponse nextPageToken + * @interface IListBackupSchedulesRequest + * @property {string|null} [parent] ListBackupSchedulesRequest parent */ /** - * Constructs a new ListIndexesResponse. + * Constructs a new ListBackupSchedulesRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents a ListIndexesResponse. - * @implements IListIndexesResponse + * @classdesc Represents a ListBackupSchedulesRequest. + * @implements IListBackupSchedulesRequest * @constructor - * @param {google.firestore.admin.v1.IListIndexesResponse=} [properties] Properties to set + * @param {google.firestore.admin.v1.IListBackupSchedulesRequest=} [properties] Properties to set */ - function ListIndexesResponse(properties) { - this.indexes = []; + function ListBackupSchedulesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3140,122 +3912,98 @@ } /** - * ListIndexesResponse indexes. - * @member {Array.} indexes - * @memberof google.firestore.admin.v1.ListIndexesResponse - * @instance - */ - ListIndexesResponse.prototype.indexes = $util.emptyArray; - - /** - * ListIndexesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.firestore.admin.v1.ListIndexesResponse + * ListBackupSchedulesRequest parent. + * @member {string} parent + * @memberof google.firestore.admin.v1.ListBackupSchedulesRequest * @instance */ - ListIndexesResponse.prototype.nextPageToken = ""; + ListBackupSchedulesRequest.prototype.parent = ""; /** - * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupSchedulesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.ListIndexesResponse + * @memberof google.firestore.admin.v1.ListBackupSchedulesRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ListIndexesResponse} ListIndexesResponse + * @returns {google.firestore.admin.v1.ListBackupSchedulesRequest} ListBackupSchedulesRequest */ - ListIndexesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ListIndexesResponse) + ListBackupSchedulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListBackupSchedulesRequest) return object; - var message = new $root.google.firestore.admin.v1.ListIndexesResponse(); - if (object.indexes) { - if (!Array.isArray(object.indexes)) - throw TypeError(".google.firestore.admin.v1.ListIndexesResponse.indexes: array expected"); - message.indexes = []; - for (var i = 0; i < object.indexes.length; ++i) { - if (typeof object.indexes[i] !== "object") - throw TypeError(".google.firestore.admin.v1.ListIndexesResponse.indexes: object expected"); - message.indexes[i] = $root.google.firestore.admin.v1.Index.fromObject(object.indexes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.firestore.admin.v1.ListBackupSchedulesRequest(); + if (object.parent != null) + message.parent = String(object.parent); return message; }; /** - * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupSchedulesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ListIndexesResponse + * @memberof google.firestore.admin.v1.ListBackupSchedulesRequest * @static - * @param {google.firestore.admin.v1.ListIndexesResponse} message ListIndexesResponse + * @param {google.firestore.admin.v1.ListBackupSchedulesRequest} message ListBackupSchedulesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIndexesResponse.toObject = function toObject(message, options) { + ListBackupSchedulesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.indexes = []; if (options.defaults) - object.nextPageToken = ""; - if (message.indexes && message.indexes.length) { - object.indexes = []; - for (var j = 0; j < message.indexes.length; ++j) - object.indexes[j] = $root.google.firestore.admin.v1.Index.toObject(message.indexes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; return object; }; /** - * Converts this ListIndexesResponse to JSON. + * Converts this ListBackupSchedulesRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ListIndexesResponse + * @memberof google.firestore.admin.v1.ListBackupSchedulesRequest * @instance * @returns {Object.} JSON object */ - ListIndexesResponse.prototype.toJSON = function toJSON() { + ListBackupSchedulesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListIndexesResponse + * Gets the default type url for ListBackupSchedulesRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.ListIndexesResponse + * @memberof google.firestore.admin.v1.ListBackupSchedulesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListIndexesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupSchedulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ListIndexesResponse"; + return typeUrlPrefix + "/google.firestore.admin.v1.ListBackupSchedulesRequest"; }; - return ListIndexesResponse; + return ListBackupSchedulesRequest; })(); - v1.GetIndexRequest = (function() { + v1.ListBackupSchedulesResponse = (function() { /** - * Properties of a GetIndexRequest. + * Properties of a ListBackupSchedulesResponse. * @memberof google.firestore.admin.v1 - * @interface IGetIndexRequest - * @property {string|null} [name] GetIndexRequest name + * @interface IListBackupSchedulesResponse + * @property {Array.|null} [backupSchedules] ListBackupSchedulesResponse backupSchedules */ /** - * Constructs a new GetIndexRequest. + * Constructs a new ListBackupSchedulesResponse. * @memberof google.firestore.admin.v1 - * @classdesc Represents a GetIndexRequest. - * @implements IGetIndexRequest + * @classdesc Represents a ListBackupSchedulesResponse. + * @implements IListBackupSchedulesResponse * @constructor - * @param {google.firestore.admin.v1.IGetIndexRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.IListBackupSchedulesResponse=} [properties] Properties to set */ - function GetIndexRequest(properties) { + function ListBackupSchedulesResponse(properties) { + this.backupSchedules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3263,97 +4011,108 @@ } /** - * GetIndexRequest name. - * @member {string} name - * @memberof google.firestore.admin.v1.GetIndexRequest + * ListBackupSchedulesResponse backupSchedules. + * @member {Array.} backupSchedules + * @memberof google.firestore.admin.v1.ListBackupSchedulesResponse * @instance */ - GetIndexRequest.prototype.name = ""; + ListBackupSchedulesResponse.prototype.backupSchedules = $util.emptyArray; /** - * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListBackupSchedulesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.GetIndexRequest + * @memberof google.firestore.admin.v1.ListBackupSchedulesResponse * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.GetIndexRequest} GetIndexRequest + * @returns {google.firestore.admin.v1.ListBackupSchedulesResponse} ListBackupSchedulesResponse */ - GetIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.GetIndexRequest) + ListBackupSchedulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListBackupSchedulesResponse) return object; - var message = new $root.google.firestore.admin.v1.GetIndexRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.firestore.admin.v1.ListBackupSchedulesResponse(); + if (object.backupSchedules) { + if (!Array.isArray(object.backupSchedules)) + throw TypeError(".google.firestore.admin.v1.ListBackupSchedulesResponse.backupSchedules: array expected"); + message.backupSchedules = []; + for (var i = 0; i < object.backupSchedules.length; ++i) { + if (typeof object.backupSchedules[i] !== "object") + throw TypeError(".google.firestore.admin.v1.ListBackupSchedulesResponse.backupSchedules: object expected"); + message.backupSchedules[i] = $root.google.firestore.admin.v1.BackupSchedule.fromObject(object.backupSchedules[i]); + } + } return message; }; /** - * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListBackupSchedulesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.GetIndexRequest + * @memberof google.firestore.admin.v1.ListBackupSchedulesResponse * @static - * @param {google.firestore.admin.v1.GetIndexRequest} message GetIndexRequest + * @param {google.firestore.admin.v1.ListBackupSchedulesResponse} message ListBackupSchedulesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIndexRequest.toObject = function toObject(message, options) { + ListBackupSchedulesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.arrays || options.defaults) + object.backupSchedules = []; + if (message.backupSchedules && message.backupSchedules.length) { + object.backupSchedules = []; + for (var j = 0; j < message.backupSchedules.length; ++j) + object.backupSchedules[j] = $root.google.firestore.admin.v1.BackupSchedule.toObject(message.backupSchedules[j], options); + } return object; }; /** - * Converts this GetIndexRequest to JSON. + * Converts this ListBackupSchedulesResponse to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.GetIndexRequest + * @memberof google.firestore.admin.v1.ListBackupSchedulesResponse * @instance * @returns {Object.} JSON object */ - GetIndexRequest.prototype.toJSON = function toJSON() { + ListBackupSchedulesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetIndexRequest + * Gets the default type url for ListBackupSchedulesResponse * @function getTypeUrl - * @memberof google.firestore.admin.v1.GetIndexRequest + * @memberof google.firestore.admin.v1.ListBackupSchedulesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListBackupSchedulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.GetIndexRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.ListBackupSchedulesResponse"; }; - return GetIndexRequest; + return ListBackupSchedulesResponse; })(); - v1.DeleteIndexRequest = (function() { + v1.DeleteBackupScheduleRequest = (function() { /** - * Properties of a DeleteIndexRequest. + * Properties of a DeleteBackupScheduleRequest. * @memberof google.firestore.admin.v1 - * @interface IDeleteIndexRequest - * @property {string|null} [name] DeleteIndexRequest name + * @interface IDeleteBackupScheduleRequest + * @property {string|null} [name] DeleteBackupScheduleRequest name */ /** - * Constructs a new DeleteIndexRequest. + * Constructs a new DeleteBackupScheduleRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents a DeleteIndexRequest. - * @implements IDeleteIndexRequest + * @classdesc Represents a DeleteBackupScheduleRequest. + * @implements IDeleteBackupScheduleRequest * @constructor - * @param {google.firestore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.IDeleteBackupScheduleRequest=} [properties] Properties to set */ - function DeleteIndexRequest(properties) { + function DeleteBackupScheduleRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3361,40 +4120,40 @@ } /** - * DeleteIndexRequest name. + * DeleteBackupScheduleRequest name. * @member {string} name - * @memberof google.firestore.admin.v1.DeleteIndexRequest + * @memberof google.firestore.admin.v1.DeleteBackupScheduleRequest * @instance */ - DeleteIndexRequest.prototype.name = ""; + DeleteBackupScheduleRequest.prototype.name = ""; /** - * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteBackupScheduleRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.DeleteIndexRequest + * @memberof google.firestore.admin.v1.DeleteBackupScheduleRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.DeleteIndexRequest} DeleteIndexRequest + * @returns {google.firestore.admin.v1.DeleteBackupScheduleRequest} DeleteBackupScheduleRequest */ - DeleteIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.DeleteIndexRequest) + DeleteBackupScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.DeleteBackupScheduleRequest) return object; - var message = new $root.google.firestore.admin.v1.DeleteIndexRequest(); + var message = new $root.google.firestore.admin.v1.DeleteBackupScheduleRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteBackupScheduleRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.DeleteIndexRequest + * @memberof google.firestore.admin.v1.DeleteBackupScheduleRequest * @static - * @param {google.firestore.admin.v1.DeleteIndexRequest} message DeleteIndexRequest + * @param {google.firestore.admin.v1.DeleteBackupScheduleRequest} message DeleteBackupScheduleRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteIndexRequest.toObject = function toObject(message, options) { + DeleteBackupScheduleRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -3406,53 +4165,53 @@ }; /** - * Converts this DeleteIndexRequest to JSON. + * Converts this DeleteBackupScheduleRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.DeleteIndexRequest + * @memberof google.firestore.admin.v1.DeleteBackupScheduleRequest * @instance * @returns {Object.} JSON object */ - DeleteIndexRequest.prototype.toJSON = function toJSON() { + DeleteBackupScheduleRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteIndexRequest + * Gets the default type url for DeleteBackupScheduleRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.DeleteIndexRequest + * @memberof google.firestore.admin.v1.DeleteBackupScheduleRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteBackupScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.DeleteIndexRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.DeleteBackupScheduleRequest"; }; - return DeleteIndexRequest; + return DeleteBackupScheduleRequest; })(); - v1.UpdateFieldRequest = (function() { + v1.CreateIndexRequest = (function() { /** - * Properties of an UpdateFieldRequest. + * Properties of a CreateIndexRequest. * @memberof google.firestore.admin.v1 - * @interface IUpdateFieldRequest - * @property {google.firestore.admin.v1.IField|null} [field] UpdateFieldRequest field - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFieldRequest updateMask + * @interface ICreateIndexRequest + * @property {string|null} [parent] CreateIndexRequest parent + * @property {google.firestore.admin.v1.IIndex|null} [index] CreateIndexRequest index */ /** - * Constructs a new UpdateFieldRequest. + * Constructs a new CreateIndexRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents an UpdateFieldRequest. - * @implements IUpdateFieldRequest + * @classdesc Represents a CreateIndexRequest. + * @implements ICreateIndexRequest * @constructor - * @param {google.firestore.admin.v1.IUpdateFieldRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.ICreateIndexRequest=} [properties] Properties to set */ - function UpdateFieldRequest(properties) { + function CreateIndexRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3460,117 +4219,117 @@ } /** - * UpdateFieldRequest field. - * @member {google.firestore.admin.v1.IField|null|undefined} field - * @memberof google.firestore.admin.v1.UpdateFieldRequest + * CreateIndexRequest parent. + * @member {string} parent + * @memberof google.firestore.admin.v1.CreateIndexRequest * @instance */ - UpdateFieldRequest.prototype.field = null; + CreateIndexRequest.prototype.parent = ""; /** - * UpdateFieldRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.firestore.admin.v1.UpdateFieldRequest + * CreateIndexRequest index. + * @member {google.firestore.admin.v1.IIndex|null|undefined} index + * @memberof google.firestore.admin.v1.CreateIndexRequest * @instance */ - UpdateFieldRequest.prototype.updateMask = null; + CreateIndexRequest.prototype.index = null; /** - * Creates an UpdateFieldRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.UpdateFieldRequest + * @memberof google.firestore.admin.v1.CreateIndexRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.UpdateFieldRequest} UpdateFieldRequest + * @returns {google.firestore.admin.v1.CreateIndexRequest} CreateIndexRequest */ - UpdateFieldRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.UpdateFieldRequest) + CreateIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.CreateIndexRequest) return object; - var message = new $root.google.firestore.admin.v1.UpdateFieldRequest(); - if (object.field != null) { - if (typeof object.field !== "object") - throw TypeError(".google.firestore.admin.v1.UpdateFieldRequest.field: object expected"); - message.field = $root.google.firestore.admin.v1.Field.fromObject(object.field); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.firestore.admin.v1.UpdateFieldRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.firestore.admin.v1.CreateIndexRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.index != null) { + if (typeof object.index !== "object") + throw TypeError(".google.firestore.admin.v1.CreateIndexRequest.index: object expected"); + message.index = $root.google.firestore.admin.v1.Index.fromObject(object.index); } return message; }; /** - * Creates a plain object from an UpdateFieldRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.UpdateFieldRequest + * @memberof google.firestore.admin.v1.CreateIndexRequest * @static - * @param {google.firestore.admin.v1.UpdateFieldRequest} message UpdateFieldRequest + * @param {google.firestore.admin.v1.CreateIndexRequest} message CreateIndexRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateFieldRequest.toObject = function toObject(message, options) { + CreateIndexRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.field = null; - object.updateMask = null; + object.parent = ""; + object.index = null; } - if (message.field != null && message.hasOwnProperty("field")) - object.field = $root.google.firestore.admin.v1.Field.toObject(message.field, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.index != null && message.hasOwnProperty("index")) + object.index = $root.google.firestore.admin.v1.Index.toObject(message.index, options); return object; }; /** - * Converts this UpdateFieldRequest to JSON. + * Converts this CreateIndexRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.UpdateFieldRequest + * @memberof google.firestore.admin.v1.CreateIndexRequest * @instance * @returns {Object.} JSON object */ - UpdateFieldRequest.prototype.toJSON = function toJSON() { + CreateIndexRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateFieldRequest + * Gets the default type url for CreateIndexRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.UpdateFieldRequest + * @memberof google.firestore.admin.v1.CreateIndexRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateFieldRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.UpdateFieldRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.CreateIndexRequest"; }; - return UpdateFieldRequest; + return CreateIndexRequest; })(); - v1.GetFieldRequest = (function() { + v1.ListIndexesRequest = (function() { /** - * Properties of a GetFieldRequest. + * Properties of a ListIndexesRequest. * @memberof google.firestore.admin.v1 - * @interface IGetFieldRequest - * @property {string|null} [name] GetFieldRequest name + * @interface IListIndexesRequest + * @property {string|null} [parent] ListIndexesRequest parent + * @property {string|null} [filter] ListIndexesRequest filter + * @property {number|null} [pageSize] ListIndexesRequest pageSize + * @property {string|null} [pageToken] ListIndexesRequest pageToken */ /** - * Constructs a new GetFieldRequest. + * Constructs a new ListIndexesRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents a GetFieldRequest. - * @implements IGetFieldRequest + * @classdesc Represents a ListIndexesRequest. + * @implements IListIndexesRequest * @constructor - * @param {google.firestore.admin.v1.IGetFieldRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.IListIndexesRequest=} [properties] Properties to set */ - function GetFieldRequest(properties) { + function ListIndexesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3578,100 +4337,139 @@ } /** - * GetFieldRequest name. - * @member {string} name - * @memberof google.firestore.admin.v1.GetFieldRequest + * ListIndexesRequest parent. + * @member {string} parent + * @memberof google.firestore.admin.v1.ListIndexesRequest * @instance */ - GetFieldRequest.prototype.name = ""; + ListIndexesRequest.prototype.parent = ""; /** - * Creates a GetFieldRequest message from a plain object. Also converts values to their respective internal types. + * ListIndexesRequest filter. + * @member {string} filter + * @memberof google.firestore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.filter = ""; + + /** + * ListIndexesRequest pageSize. + * @member {number} pageSize + * @memberof google.firestore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.pageSize = 0; + + /** + * ListIndexesRequest pageToken. + * @member {string} pageToken + * @memberof google.firestore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.pageToken = ""; + + /** + * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.GetFieldRequest + * @memberof google.firestore.admin.v1.ListIndexesRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.GetFieldRequest} GetFieldRequest + * @returns {google.firestore.admin.v1.ListIndexesRequest} ListIndexesRequest */ - GetFieldRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.GetFieldRequest) + ListIndexesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListIndexesRequest) return object; - var message = new $root.google.firestore.admin.v1.GetFieldRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.firestore.admin.v1.ListIndexesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GetFieldRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.GetFieldRequest + * @memberof google.firestore.admin.v1.ListIndexesRequest * @static - * @param {google.firestore.admin.v1.GetFieldRequest} message GetFieldRequest + * @param {google.firestore.admin.v1.ListIndexesRequest} message ListIndexesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetFieldRequest.toObject = function toObject(message, options) { + ListIndexesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GetFieldRequest to JSON. + * Converts this ListIndexesRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.GetFieldRequest + * @memberof google.firestore.admin.v1.ListIndexesRequest * @instance * @returns {Object.} JSON object */ - GetFieldRequest.prototype.toJSON = function toJSON() { + ListIndexesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetFieldRequest + * Gets the default type url for ListIndexesRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.GetFieldRequest + * @memberof google.firestore.admin.v1.ListIndexesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetFieldRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListIndexesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.GetFieldRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.ListIndexesRequest"; }; - return GetFieldRequest; + return ListIndexesRequest; })(); - v1.ListFieldsRequest = (function() { + v1.ListIndexesResponse = (function() { /** - * Properties of a ListFieldsRequest. + * Properties of a ListIndexesResponse. * @memberof google.firestore.admin.v1 - * @interface IListFieldsRequest - * @property {string|null} [parent] ListFieldsRequest parent - * @property {string|null} [filter] ListFieldsRequest filter - * @property {number|null} [pageSize] ListFieldsRequest pageSize - * @property {string|null} [pageToken] ListFieldsRequest pageToken + * @interface IListIndexesResponse + * @property {Array.|null} [indexes] ListIndexesResponse indexes + * @property {string|null} [nextPageToken] ListIndexesResponse nextPageToken */ /** - * Constructs a new ListFieldsRequest. + * Constructs a new ListIndexesResponse. * @memberof google.firestore.admin.v1 - * @classdesc Represents a ListFieldsRequest. - * @implements IListFieldsRequest + * @classdesc Represents a ListIndexesResponse. + * @implements IListIndexesResponse * @constructor - * @param {google.firestore.admin.v1.IListFieldsRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.IListIndexesResponse=} [properties] Properties to set */ - function ListFieldsRequest(properties) { + function ListIndexesResponse(properties) { + this.indexes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3679,139 +4477,122 @@ } /** - * ListFieldsRequest parent. - * @member {string} parent - * @memberof google.firestore.admin.v1.ListFieldsRequest + * ListIndexesResponse indexes. + * @member {Array.} indexes + * @memberof google.firestore.admin.v1.ListIndexesResponse * @instance */ - ListFieldsRequest.prototype.parent = ""; + ListIndexesResponse.prototype.indexes = $util.emptyArray; /** - * ListFieldsRequest filter. - * @member {string} filter - * @memberof google.firestore.admin.v1.ListFieldsRequest + * ListIndexesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.firestore.admin.v1.ListIndexesResponse * @instance */ - ListFieldsRequest.prototype.filter = ""; + ListIndexesResponse.prototype.nextPageToken = ""; /** - * ListFieldsRequest pageSize. - * @member {number} pageSize - * @memberof google.firestore.admin.v1.ListFieldsRequest - * @instance + * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ListIndexesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ListIndexesResponse} ListIndexesResponse */ - ListFieldsRequest.prototype.pageSize = 0; - - /** - * ListFieldsRequest pageToken. - * @member {string} pageToken - * @memberof google.firestore.admin.v1.ListFieldsRequest - * @instance - */ - ListFieldsRequest.prototype.pageToken = ""; - - /** - * Creates a ListFieldsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.admin.v1.ListFieldsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ListFieldsRequest} ListFieldsRequest - */ - ListFieldsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ListFieldsRequest) + ListIndexesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListIndexesResponse) return object; - var message = new $root.google.firestore.admin.v1.ListFieldsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.firestore.admin.v1.ListIndexesResponse(); + if (object.indexes) { + if (!Array.isArray(object.indexes)) + throw TypeError(".google.firestore.admin.v1.ListIndexesResponse.indexes: array expected"); + message.indexes = []; + for (var i = 0; i < object.indexes.length; ++i) { + if (typeof object.indexes[i] !== "object") + throw TypeError(".google.firestore.admin.v1.ListIndexesResponse.indexes: object expected"); + message.indexes[i] = $root.google.firestore.admin.v1.Index.fromObject(object.indexes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListFieldsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ListFieldsRequest + * @memberof google.firestore.admin.v1.ListIndexesResponse * @static - * @param {google.firestore.admin.v1.ListFieldsRequest} message ListFieldsRequest + * @param {google.firestore.admin.v1.ListIndexesResponse} message ListIndexesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFieldsRequest.toObject = function toObject(message, options) { + ListIndexesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; + if (options.arrays || options.defaults) + object.indexes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.indexes && message.indexes.length) { + object.indexes = []; + for (var j = 0; j < message.indexes.length; ++j) + object.indexes[j] = $root.google.firestore.admin.v1.Index.toObject(message.indexes[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListFieldsRequest to JSON. + * Converts this ListIndexesResponse to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ListFieldsRequest + * @memberof google.firestore.admin.v1.ListIndexesResponse * @instance * @returns {Object.} JSON object */ - ListFieldsRequest.prototype.toJSON = function toJSON() { + ListIndexesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListFieldsRequest + * Gets the default type url for ListIndexesResponse * @function getTypeUrl - * @memberof google.firestore.admin.v1.ListFieldsRequest + * @memberof google.firestore.admin.v1.ListIndexesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListFieldsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListIndexesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ListFieldsRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.ListIndexesResponse"; }; - return ListFieldsRequest; + return ListIndexesResponse; })(); - v1.ListFieldsResponse = (function() { + v1.GetIndexRequest = (function() { /** - * Properties of a ListFieldsResponse. + * Properties of a GetIndexRequest. * @memberof google.firestore.admin.v1 - * @interface IListFieldsResponse - * @property {Array.|null} [fields] ListFieldsResponse fields - * @property {string|null} [nextPageToken] ListFieldsResponse nextPageToken + * @interface IGetIndexRequest + * @property {string|null} [name] GetIndexRequest name */ /** - * Constructs a new ListFieldsResponse. + * Constructs a new GetIndexRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents a ListFieldsResponse. - * @implements IListFieldsResponse + * @classdesc Represents a GetIndexRequest. + * @implements IGetIndexRequest * @constructor - * @param {google.firestore.admin.v1.IListFieldsResponse=} [properties] Properties to set + * @param {google.firestore.admin.v1.IGetIndexRequest=} [properties] Properties to set */ - function ListFieldsResponse(properties) { - this.fields = []; + function GetIndexRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3819,128 +4600,97 @@ } /** - * ListFieldsResponse fields. - * @member {Array.} fields - * @memberof google.firestore.admin.v1.ListFieldsResponse - * @instance - */ - ListFieldsResponse.prototype.fields = $util.emptyArray; - - /** - * ListFieldsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.firestore.admin.v1.ListFieldsResponse + * GetIndexRequest name. + * @member {string} name + * @memberof google.firestore.admin.v1.GetIndexRequest * @instance */ - ListFieldsResponse.prototype.nextPageToken = ""; + GetIndexRequest.prototype.name = ""; /** - * Creates a ListFieldsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.ListFieldsResponse + * @memberof google.firestore.admin.v1.GetIndexRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ListFieldsResponse} ListFieldsResponse + * @returns {google.firestore.admin.v1.GetIndexRequest} GetIndexRequest */ - ListFieldsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ListFieldsResponse) + GetIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.GetIndexRequest) return object; - var message = new $root.google.firestore.admin.v1.ListFieldsResponse(); - if (object.fields) { - if (!Array.isArray(object.fields)) - throw TypeError(".google.firestore.admin.v1.ListFieldsResponse.fields: array expected"); - message.fields = []; - for (var i = 0; i < object.fields.length; ++i) { - if (typeof object.fields[i] !== "object") - throw TypeError(".google.firestore.admin.v1.ListFieldsResponse.fields: object expected"); - message.fields[i] = $root.google.firestore.admin.v1.Field.fromObject(object.fields[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.firestore.admin.v1.GetIndexRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListFieldsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ListFieldsResponse + * @memberof google.firestore.admin.v1.GetIndexRequest * @static - * @param {google.firestore.admin.v1.ListFieldsResponse} message ListFieldsResponse + * @param {google.firestore.admin.v1.GetIndexRequest} message GetIndexRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListFieldsResponse.toObject = function toObject(message, options) { + GetIndexRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.fields = []; if (options.defaults) - object.nextPageToken = ""; - if (message.fields && message.fields.length) { - object.fields = []; - for (var j = 0; j < message.fields.length; ++j) - object.fields[j] = $root.google.firestore.admin.v1.Field.toObject(message.fields[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListFieldsResponse to JSON. + * Converts this GetIndexRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ListFieldsResponse + * @memberof google.firestore.admin.v1.GetIndexRequest * @instance * @returns {Object.} JSON object */ - ListFieldsResponse.prototype.toJSON = function toJSON() { + GetIndexRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListFieldsResponse + * Gets the default type url for GetIndexRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.ListFieldsResponse + * @memberof google.firestore.admin.v1.GetIndexRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListFieldsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ListFieldsResponse"; + return typeUrlPrefix + "/google.firestore.admin.v1.GetIndexRequest"; }; - return ListFieldsResponse; + return GetIndexRequest; })(); - v1.ExportDocumentsRequest = (function() { + v1.DeleteIndexRequest = (function() { /** - * Properties of an ExportDocumentsRequest. + * Properties of a DeleteIndexRequest. * @memberof google.firestore.admin.v1 - * @interface IExportDocumentsRequest - * @property {string|null} [name] ExportDocumentsRequest name - * @property {Array.|null} [collectionIds] ExportDocumentsRequest collectionIds - * @property {string|null} [outputUriPrefix] ExportDocumentsRequest outputUriPrefix - * @property {Array.|null} [namespaceIds] ExportDocumentsRequest namespaceIds - * @property {google.protobuf.ITimestamp|null} [snapshotTime] ExportDocumentsRequest snapshotTime + * @interface IDeleteIndexRequest + * @property {string|null} [name] DeleteIndexRequest name */ /** - * Constructs a new ExportDocumentsRequest. + * Constructs a new DeleteIndexRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents an ExportDocumentsRequest. - * @implements IExportDocumentsRequest + * @classdesc Represents a DeleteIndexRequest. + * @implements IDeleteIndexRequest * @constructor - * @param {google.firestore.admin.v1.IExportDocumentsRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set */ - function ExportDocumentsRequest(properties) { - this.collectionIds = []; - this.namespaceIds = []; + function DeleteIndexRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3948,176 +4698,98 @@ } /** - * ExportDocumentsRequest name. + * DeleteIndexRequest name. * @member {string} name - * @memberof google.firestore.admin.v1.ExportDocumentsRequest - * @instance - */ - ExportDocumentsRequest.prototype.name = ""; - - /** - * ExportDocumentsRequest collectionIds. - * @member {Array.} collectionIds - * @memberof google.firestore.admin.v1.ExportDocumentsRequest - * @instance - */ - ExportDocumentsRequest.prototype.collectionIds = $util.emptyArray; - - /** - * ExportDocumentsRequest outputUriPrefix. - * @member {string} outputUriPrefix - * @memberof google.firestore.admin.v1.ExportDocumentsRequest - * @instance - */ - ExportDocumentsRequest.prototype.outputUriPrefix = ""; - - /** - * ExportDocumentsRequest namespaceIds. - * @member {Array.} namespaceIds - * @memberof google.firestore.admin.v1.ExportDocumentsRequest - * @instance - */ - ExportDocumentsRequest.prototype.namespaceIds = $util.emptyArray; - - /** - * ExportDocumentsRequest snapshotTime. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime - * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @memberof google.firestore.admin.v1.DeleteIndexRequest * @instance */ - ExportDocumentsRequest.prototype.snapshotTime = null; + DeleteIndexRequest.prototype.name = ""; /** - * Creates an ExportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @memberof google.firestore.admin.v1.DeleteIndexRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ExportDocumentsRequest} ExportDocumentsRequest + * @returns {google.firestore.admin.v1.DeleteIndexRequest} DeleteIndexRequest */ - ExportDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ExportDocumentsRequest) + DeleteIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.DeleteIndexRequest) return object; - var message = new $root.google.firestore.admin.v1.ExportDocumentsRequest(); + var message = new $root.google.firestore.admin.v1.DeleteIndexRequest(); if (object.name != null) message.name = String(object.name); - if (object.collectionIds) { - if (!Array.isArray(object.collectionIds)) - throw TypeError(".google.firestore.admin.v1.ExportDocumentsRequest.collectionIds: array expected"); - message.collectionIds = []; - for (var i = 0; i < object.collectionIds.length; ++i) - message.collectionIds[i] = String(object.collectionIds[i]); - } - if (object.outputUriPrefix != null) - message.outputUriPrefix = String(object.outputUriPrefix); - if (object.namespaceIds) { - if (!Array.isArray(object.namespaceIds)) - throw TypeError(".google.firestore.admin.v1.ExportDocumentsRequest.namespaceIds: array expected"); - message.namespaceIds = []; - for (var i = 0; i < object.namespaceIds.length; ++i) - message.namespaceIds[i] = String(object.namespaceIds[i]); - } - if (object.snapshotTime != null) { - if (typeof object.snapshotTime !== "object") - throw TypeError(".google.firestore.admin.v1.ExportDocumentsRequest.snapshotTime: object expected"); - message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); - } return message; }; /** - * Creates a plain object from an ExportDocumentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @memberof google.firestore.admin.v1.DeleteIndexRequest * @static - * @param {google.firestore.admin.v1.ExportDocumentsRequest} message ExportDocumentsRequest + * @param {google.firestore.admin.v1.DeleteIndexRequest} message DeleteIndexRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportDocumentsRequest.toObject = function toObject(message, options) { + DeleteIndexRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.collectionIds = []; - object.namespaceIds = []; - } - if (options.defaults) { + if (options.defaults) object.name = ""; - object.outputUriPrefix = ""; - object.snapshotTime = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.collectionIds && message.collectionIds.length) { - object.collectionIds = []; - for (var j = 0; j < message.collectionIds.length; ++j) - object.collectionIds[j] = message.collectionIds[j]; - } - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) - object.outputUriPrefix = message.outputUriPrefix; - if (message.namespaceIds && message.namespaceIds.length) { - object.namespaceIds = []; - for (var j = 0; j < message.namespaceIds.length; ++j) - object.namespaceIds[j] = message.namespaceIds[j]; - } - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) - object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); return object; }; /** - * Converts this ExportDocumentsRequest to JSON. + * Converts this DeleteIndexRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @memberof google.firestore.admin.v1.DeleteIndexRequest * @instance * @returns {Object.} JSON object */ - ExportDocumentsRequest.prototype.toJSON = function toJSON() { + DeleteIndexRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExportDocumentsRequest + * Gets the default type url for DeleteIndexRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @memberof google.firestore.admin.v1.DeleteIndexRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ExportDocumentsRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.DeleteIndexRequest"; }; - return ExportDocumentsRequest; + return DeleteIndexRequest; })(); - v1.ImportDocumentsRequest = (function() { + v1.UpdateFieldRequest = (function() { /** - * Properties of an ImportDocumentsRequest. + * Properties of an UpdateFieldRequest. * @memberof google.firestore.admin.v1 - * @interface IImportDocumentsRequest - * @property {string|null} [name] ImportDocumentsRequest name - * @property {Array.|null} [collectionIds] ImportDocumentsRequest collectionIds - * @property {string|null} [inputUriPrefix] ImportDocumentsRequest inputUriPrefix - * @property {Array.|null} [namespaceIds] ImportDocumentsRequest namespaceIds + * @interface IUpdateFieldRequest + * @property {google.firestore.admin.v1.IField|null} [field] UpdateFieldRequest field + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFieldRequest updateMask */ /** - * Constructs a new ImportDocumentsRequest. + * Constructs a new UpdateFieldRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents an ImportDocumentsRequest. - * @implements IImportDocumentsRequest + * @classdesc Represents an UpdateFieldRequest. + * @implements IUpdateFieldRequest * @constructor - * @param {google.firestore.admin.v1.IImportDocumentsRequest=} [properties] Properties to set + * @param {google.firestore.admin.v1.IUpdateFieldRequest=} [properties] Properties to set */ - function ImportDocumentsRequest(properties) { - this.collectionIds = []; - this.namespaceIds = []; + function UpdateFieldRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4125,160 +4797,117 @@ } /** - * ImportDocumentsRequest name. - * @member {string} name - * @memberof google.firestore.admin.v1.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.name = ""; - - /** - * ImportDocumentsRequest collectionIds. - * @member {Array.} collectionIds - * @memberof google.firestore.admin.v1.ImportDocumentsRequest - * @instance - */ - ImportDocumentsRequest.prototype.collectionIds = $util.emptyArray; - - /** - * ImportDocumentsRequest inputUriPrefix. - * @member {string} inputUriPrefix - * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * UpdateFieldRequest field. + * @member {google.firestore.admin.v1.IField|null|undefined} field + * @memberof google.firestore.admin.v1.UpdateFieldRequest * @instance */ - ImportDocumentsRequest.prototype.inputUriPrefix = ""; + UpdateFieldRequest.prototype.field = null; /** - * ImportDocumentsRequest namespaceIds. - * @member {Array.} namespaceIds - * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * UpdateFieldRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.firestore.admin.v1.UpdateFieldRequest * @instance */ - ImportDocumentsRequest.prototype.namespaceIds = $util.emptyArray; + UpdateFieldRequest.prototype.updateMask = null; /** - * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateFieldRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @memberof google.firestore.admin.v1.UpdateFieldRequest * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ImportDocumentsRequest} ImportDocumentsRequest + * @returns {google.firestore.admin.v1.UpdateFieldRequest} UpdateFieldRequest */ - ImportDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ImportDocumentsRequest) + UpdateFieldRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.UpdateFieldRequest) return object; - var message = new $root.google.firestore.admin.v1.ImportDocumentsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.collectionIds) { - if (!Array.isArray(object.collectionIds)) - throw TypeError(".google.firestore.admin.v1.ImportDocumentsRequest.collectionIds: array expected"); - message.collectionIds = []; - for (var i = 0; i < object.collectionIds.length; ++i) - message.collectionIds[i] = String(object.collectionIds[i]); + var message = new $root.google.firestore.admin.v1.UpdateFieldRequest(); + if (object.field != null) { + if (typeof object.field !== "object") + throw TypeError(".google.firestore.admin.v1.UpdateFieldRequest.field: object expected"); + message.field = $root.google.firestore.admin.v1.Field.fromObject(object.field); } - if (object.inputUriPrefix != null) - message.inputUriPrefix = String(object.inputUriPrefix); - if (object.namespaceIds) { - if (!Array.isArray(object.namespaceIds)) - throw TypeError(".google.firestore.admin.v1.ImportDocumentsRequest.namespaceIds: array expected"); - message.namespaceIds = []; - for (var i = 0; i < object.namespaceIds.length; ++i) - message.namespaceIds[i] = String(object.namespaceIds[i]); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.firestore.admin.v1.UpdateFieldRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateFieldRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @memberof google.firestore.admin.v1.UpdateFieldRequest * @static - * @param {google.firestore.admin.v1.ImportDocumentsRequest} message ImportDocumentsRequest + * @param {google.firestore.admin.v1.UpdateFieldRequest} message UpdateFieldRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportDocumentsRequest.toObject = function toObject(message, options) { + UpdateFieldRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.collectionIds = []; - object.namespaceIds = []; - } if (options.defaults) { - object.name = ""; - object.inputUriPrefix = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.collectionIds && message.collectionIds.length) { - object.collectionIds = []; - for (var j = 0; j < message.collectionIds.length; ++j) - object.collectionIds[j] = message.collectionIds[j]; - } - if (message.inputUriPrefix != null && message.hasOwnProperty("inputUriPrefix")) - object.inputUriPrefix = message.inputUriPrefix; - if (message.namespaceIds && message.namespaceIds.length) { - object.namespaceIds = []; - for (var j = 0; j < message.namespaceIds.length; ++j) - object.namespaceIds[j] = message.namespaceIds[j]; + object.field = null; + object.updateMask = null; } + if (message.field != null && message.hasOwnProperty("field")) + object.field = $root.google.firestore.admin.v1.Field.toObject(message.field, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ImportDocumentsRequest to JSON. + * Converts this UpdateFieldRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @memberof google.firestore.admin.v1.UpdateFieldRequest * @instance * @returns {Object.} JSON object */ - ImportDocumentsRequest.prototype.toJSON = function toJSON() { + UpdateFieldRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportDocumentsRequest + * Gets the default type url for UpdateFieldRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @memberof google.firestore.admin.v1.UpdateFieldRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateFieldRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ImportDocumentsRequest"; + return typeUrlPrefix + "/google.firestore.admin.v1.UpdateFieldRequest"; }; - return ImportDocumentsRequest; + return UpdateFieldRequest; })(); - v1.IndexOperationMetadata = (function() { + v1.GetFieldRequest = (function() { /** - * Properties of an IndexOperationMetadata. + * Properties of a GetFieldRequest. * @memberof google.firestore.admin.v1 - * @interface IIndexOperationMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] IndexOperationMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] IndexOperationMetadata endTime - * @property {string|null} [index] IndexOperationMetadata index - * @property {google.firestore.admin.v1.OperationState|null} [state] IndexOperationMetadata state - * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] IndexOperationMetadata progressDocuments - * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] IndexOperationMetadata progressBytes + * @interface IGetFieldRequest + * @property {string|null} [name] GetFieldRequest name */ /** - * Constructs a new IndexOperationMetadata. + * Constructs a new GetFieldRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents an IndexOperationMetadata. - * @implements IIndexOperationMetadata + * @classdesc Represents a GetFieldRequest. + * @implements IGetFieldRequest * @constructor - * @param {google.firestore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set + * @param {google.firestore.admin.v1.IGetFieldRequest=} [properties] Properties to set */ - function IndexOperationMetadata(properties) { + function GetFieldRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4286,221 +4915,100 @@ } /** - * IndexOperationMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.firestore.admin.v1.IndexOperationMetadata + * GetFieldRequest name. + * @member {string} name + * @memberof google.firestore.admin.v1.GetFieldRequest * @instance */ - IndexOperationMetadata.prototype.startTime = null; + GetFieldRequest.prototype.name = ""; /** - * IndexOperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.firestore.admin.v1.IndexOperationMetadata - * @instance + * Creates a GetFieldRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.GetFieldRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.GetFieldRequest} GetFieldRequest */ - IndexOperationMetadata.prototype.endTime = null; - - /** - * IndexOperationMetadata index. - * @member {string} index - * @memberof google.firestore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.index = ""; - - /** - * IndexOperationMetadata state. - * @member {google.firestore.admin.v1.OperationState} state - * @memberof google.firestore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.state = 0; - - /** - * IndexOperationMetadata progressDocuments. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments - * @memberof google.firestore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.progressDocuments = null; - - /** - * IndexOperationMetadata progressBytes. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.firestore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.progressBytes = null; - - /** - * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.admin.v1.IndexOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.IndexOperationMetadata} IndexOperationMetadata - */ - IndexOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.IndexOperationMetadata) + GetFieldRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.GetFieldRequest) return object; - var message = new $root.google.firestore.admin.v1.IndexOperationMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.index != null) - message.index = String(object.index); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "OPERATION_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "INITIALIZING": - case 1: - message.state = 1; - break; - case "PROCESSING": - case 2: - message.state = 2; - break; - case "CANCELLING": - case 3: - message.state = 3; - break; - case "FINALIZING": - case 4: - message.state = 4; - break; - case "SUCCESSFUL": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.progressDocuments != null) { - if (typeof object.progressDocuments !== "object") - throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.progressDocuments: object expected"); - message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); - } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); - } + var message = new $root.google.firestore.admin.v1.GetFieldRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a GetFieldRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @memberof google.firestore.admin.v1.GetFieldRequest * @static - * @param {google.firestore.admin.v1.IndexOperationMetadata} message IndexOperationMetadata + * @param {google.firestore.admin.v1.GetFieldRequest} message GetFieldRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IndexOperationMetadata.toObject = function toObject(message, options) { + GetFieldRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.index = ""; - object.state = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; - object.progressDocuments = null; - object.progressBytes = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.index != null && message.hasOwnProperty("index")) - object.index = message.index; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.state] === undefined ? message.state : $root.google.firestore.admin.v1.OperationState[message.state] : message.state; - if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) - object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this IndexOperationMetadata to JSON. + * Converts this GetFieldRequest to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @memberof google.firestore.admin.v1.GetFieldRequest * @instance * @returns {Object.} JSON object */ - IndexOperationMetadata.prototype.toJSON = function toJSON() { + GetFieldRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for IndexOperationMetadata + * Gets the default type url for GetFieldRequest * @function getTypeUrl - * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @memberof google.firestore.admin.v1.GetFieldRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - IndexOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetFieldRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.IndexOperationMetadata"; + return typeUrlPrefix + "/google.firestore.admin.v1.GetFieldRequest"; }; - return IndexOperationMetadata; + return GetFieldRequest; })(); - v1.FieldOperationMetadata = (function() { + v1.ListFieldsRequest = (function() { /** - * Properties of a FieldOperationMetadata. + * Properties of a ListFieldsRequest. * @memberof google.firestore.admin.v1 - * @interface IFieldOperationMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] FieldOperationMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] FieldOperationMetadata endTime - * @property {string|null} [field] FieldOperationMetadata field - * @property {Array.|null} [indexConfigDeltas] FieldOperationMetadata indexConfigDeltas - * @property {google.firestore.admin.v1.OperationState|null} [state] FieldOperationMetadata state - * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] FieldOperationMetadata progressDocuments - * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] FieldOperationMetadata progressBytes - * @property {google.firestore.admin.v1.FieldOperationMetadata.ITtlConfigDelta|null} [ttlConfigDelta] FieldOperationMetadata ttlConfigDelta + * @interface IListFieldsRequest + * @property {string|null} [parent] ListFieldsRequest parent + * @property {string|null} [filter] ListFieldsRequest filter + * @property {number|null} [pageSize] ListFieldsRequest pageSize + * @property {string|null} [pageToken] ListFieldsRequest pageToken */ /** - * Constructs a new FieldOperationMetadata. + * Constructs a new ListFieldsRequest. * @memberof google.firestore.admin.v1 - * @classdesc Represents a FieldOperationMetadata. - * @implements IFieldOperationMetadata + * @classdesc Represents a ListFieldsRequest. + * @implements IListFieldsRequest * @constructor - * @param {google.firestore.admin.v1.IFieldOperationMetadata=} [properties] Properties to set + * @param {google.firestore.admin.v1.IListFieldsRequest=} [properties] Properties to set */ - function FieldOperationMetadata(properties) { - this.indexConfigDeltas = []; + function ListFieldsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4508,546 +5016,2471 @@ } /** - * FieldOperationMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.firestore.admin.v1.FieldOperationMetadata - * @instance - */ - FieldOperationMetadata.prototype.startTime = null; - - /** - * FieldOperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * ListFieldsRequest parent. + * @member {string} parent + * @memberof google.firestore.admin.v1.ListFieldsRequest * @instance */ - FieldOperationMetadata.prototype.endTime = null; + ListFieldsRequest.prototype.parent = ""; /** - * FieldOperationMetadata field. - * @member {string} field - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * ListFieldsRequest filter. + * @member {string} filter + * @memberof google.firestore.admin.v1.ListFieldsRequest * @instance */ - FieldOperationMetadata.prototype.field = ""; + ListFieldsRequest.prototype.filter = ""; /** - * FieldOperationMetadata indexConfigDeltas. - * @member {Array.} indexConfigDeltas - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * ListFieldsRequest pageSize. + * @member {number} pageSize + * @memberof google.firestore.admin.v1.ListFieldsRequest * @instance */ - FieldOperationMetadata.prototype.indexConfigDeltas = $util.emptyArray; + ListFieldsRequest.prototype.pageSize = 0; /** - * FieldOperationMetadata state. - * @member {google.firestore.admin.v1.OperationState} state - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * ListFieldsRequest pageToken. + * @member {string} pageToken + * @memberof google.firestore.admin.v1.ListFieldsRequest * @instance */ - FieldOperationMetadata.prototype.state = 0; + ListFieldsRequest.prototype.pageToken = ""; /** - * FieldOperationMetadata progressDocuments. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments - * @memberof google.firestore.admin.v1.FieldOperationMetadata - * @instance + * Creates a ListFieldsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ListFieldsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ListFieldsRequest} ListFieldsRequest */ - FieldOperationMetadata.prototype.progressDocuments = null; + ListFieldsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListFieldsRequest) + return object; + var message = new $root.google.firestore.admin.v1.ListFieldsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; /** - * FieldOperationMetadata progressBytes. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * Creates a plain object from a ListFieldsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ListFieldsRequest + * @static + * @param {google.firestore.admin.v1.ListFieldsRequest} message ListFieldsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFieldsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListFieldsRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ListFieldsRequest * @instance + * @returns {Object.} JSON object */ - FieldOperationMetadata.prototype.progressBytes = null; + ListFieldsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * FieldOperationMetadata ttlConfigDelta. - * @member {google.firestore.admin.v1.FieldOperationMetadata.ITtlConfigDelta|null|undefined} ttlConfigDelta - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * Gets the default type url for ListFieldsRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ListFieldsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFieldsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ListFieldsRequest"; + }; + + return ListFieldsRequest; + })(); + + v1.ListFieldsResponse = (function() { + + /** + * Properties of a ListFieldsResponse. + * @memberof google.firestore.admin.v1 + * @interface IListFieldsResponse + * @property {Array.|null} [fields] ListFieldsResponse fields + * @property {string|null} [nextPageToken] ListFieldsResponse nextPageToken + */ + + /** + * Constructs a new ListFieldsResponse. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a ListFieldsResponse. + * @implements IListFieldsResponse + * @constructor + * @param {google.firestore.admin.v1.IListFieldsResponse=} [properties] Properties to set + */ + function ListFieldsResponse(properties) { + this.fields = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFieldsResponse fields. + * @member {Array.} fields + * @memberof google.firestore.admin.v1.ListFieldsResponse * @instance */ - FieldOperationMetadata.prototype.ttlConfigDelta = null; + ListFieldsResponse.prototype.fields = $util.emptyArray; /** - * Creates a FieldOperationMetadata message from a plain object. Also converts values to their respective internal types. + * ListFieldsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.firestore.admin.v1.ListFieldsResponse + * @instance + */ + ListFieldsResponse.prototype.nextPageToken = ""; + + /** + * Creates a ListFieldsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @memberof google.firestore.admin.v1.ListFieldsResponse * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.FieldOperationMetadata} FieldOperationMetadata + * @returns {google.firestore.admin.v1.ListFieldsResponse} ListFieldsResponse */ - FieldOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.FieldOperationMetadata) + ListFieldsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListFieldsResponse) return object; - var message = new $root.google.firestore.admin.v1.FieldOperationMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.field != null) - message.field = String(object.field); - if (object.indexConfigDeltas) { - if (!Array.isArray(object.indexConfigDeltas)) - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.indexConfigDeltas: array expected"); - message.indexConfigDeltas = []; - for (var i = 0; i < object.indexConfigDeltas.length; ++i) { - if (typeof object.indexConfigDeltas[i] !== "object") - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.indexConfigDeltas: object expected"); - message.indexConfigDeltas[i] = $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.fromObject(object.indexConfigDeltas[i]); - } - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; + var message = new $root.google.firestore.admin.v1.ListFieldsResponse(); + if (object.fields) { + if (!Array.isArray(object.fields)) + throw TypeError(".google.firestore.admin.v1.ListFieldsResponse.fields: array expected"); + message.fields = []; + for (var i = 0; i < object.fields.length; ++i) { + if (typeof object.fields[i] !== "object") + throw TypeError(".google.firestore.admin.v1.ListFieldsResponse.fields: object expected"); + message.fields[i] = $root.google.firestore.admin.v1.Field.fromObject(object.fields[i]); } - break; - case "OPERATION_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "INITIALIZING": - case 1: - message.state = 1; - break; - case "PROCESSING": - case 2: - message.state = 2; - break; - case "CANCELLING": - case 3: - message.state = 3; - break; - case "FINALIZING": - case 4: - message.state = 4; - break; - case "SUCCESSFUL": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - if (object.progressDocuments != null) { - if (typeof object.progressDocuments !== "object") - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.progressDocuments: object expected"); - message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); - } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); - } - if (object.ttlConfigDelta != null) { - if (typeof object.ttlConfigDelta !== "object") - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.ttlConfigDelta: object expected"); - message.ttlConfigDelta = $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.fromObject(object.ttlConfigDelta); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a FieldOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListFieldsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @memberof google.firestore.admin.v1.ListFieldsResponse * @static - * @param {google.firestore.admin.v1.FieldOperationMetadata} message FieldOperationMetadata + * @param {google.firestore.admin.v1.ListFieldsResponse} message ListFieldsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FieldOperationMetadata.toObject = function toObject(message, options) { + ListFieldsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.indexConfigDeltas = []; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.field = ""; - object.state = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; - object.progressDocuments = null; - object.progressBytes = null; - object.ttlConfigDelta = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.indexConfigDeltas && message.indexConfigDeltas.length) { - object.indexConfigDeltas = []; - for (var j = 0; j < message.indexConfigDeltas.length; ++j) - object.indexConfigDeltas[j] = $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.toObject(message.indexConfigDeltas[j], options); + object.fields = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.fields && message.fields.length) { + object.fields = []; + for (var j = 0; j < message.fields.length; ++j) + object.fields[j] = $root.google.firestore.admin.v1.Field.toObject(message.fields[j], options); } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.state] === undefined ? message.state : $root.google.firestore.admin.v1.OperationState[message.state] : message.state; - if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) - object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); - if (message.ttlConfigDelta != null && message.hasOwnProperty("ttlConfigDelta")) - object.ttlConfigDelta = $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.toObject(message.ttlConfigDelta, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this FieldOperationMetadata to JSON. + * Converts this ListFieldsResponse to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @memberof google.firestore.admin.v1.ListFieldsResponse * @instance * @returns {Object.} JSON object */ - FieldOperationMetadata.prototype.toJSON = function toJSON() { + ListFieldsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FieldOperationMetadata + * Gets the default type url for ListFieldsResponse * @function getTypeUrl - * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @memberof google.firestore.admin.v1.ListFieldsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FieldOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListFieldsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.FieldOperationMetadata"; + return typeUrlPrefix + "/google.firestore.admin.v1.ListFieldsResponse"; }; - FieldOperationMetadata.IndexConfigDelta = (function() { - - /** - * Properties of an IndexConfigDelta. - * @memberof google.firestore.admin.v1.FieldOperationMetadata - * @interface IIndexConfigDelta - * @property {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType|null} [changeType] IndexConfigDelta changeType - * @property {google.firestore.admin.v1.IIndex|null} [index] IndexConfigDelta index - */ - - /** - * Constructs a new IndexConfigDelta. - * @memberof google.firestore.admin.v1.FieldOperationMetadata - * @classdesc Represents an IndexConfigDelta. - * @implements IIndexConfigDelta - * @constructor - * @param {google.firestore.admin.v1.FieldOperationMetadata.IIndexConfigDelta=} [properties] Properties to set - */ - function IndexConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndexConfigDelta changeType. - * @member {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType} changeType - * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta - * @instance - */ - IndexConfigDelta.prototype.changeType = 0; - - /** - * IndexConfigDelta index. - * @member {google.firestore.admin.v1.IIndex|null|undefined} index - * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta - * @instance - */ - IndexConfigDelta.prototype.index = null; + return ListFieldsResponse; + })(); - /** - * Creates an IndexConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta} IndexConfigDelta - */ - IndexConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) - return object; - var message = new $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta(); - switch (object.changeType) { - default: - if (typeof object.changeType === "number") { - message.changeType = object.changeType; - break; - } - break; - case "CHANGE_TYPE_UNSPECIFIED": - case 0: - message.changeType = 0; - break; - case "ADD": - case 1: - message.changeType = 1; - break; - case "REMOVE": - case 2: - message.changeType = 2; - break; - } - if (object.index != null) { - if (typeof object.index !== "object") - throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.index: object expected"); - message.index = $root.google.firestore.admin.v1.Index.fromObject(object.index); - } - return message; - }; + v1.ExportDocumentsRequest = (function() { - /** - * Creates a plain object from an IndexConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta - * @static - * @param {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta} message IndexConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndexConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.changeType = options.enums === String ? "CHANGE_TYPE_UNSPECIFIED" : 0; - object.index = null; - } - if (message.changeType != null && message.hasOwnProperty("changeType")) - object.changeType = options.enums === String ? $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType[message.changeType] === undefined ? message.changeType : $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType[message.changeType] : message.changeType; - if (message.index != null && message.hasOwnProperty("index")) - object.index = $root.google.firestore.admin.v1.Index.toObject(message.index, options); - return object; - }; + /** + * Properties of an ExportDocumentsRequest. + * @memberof google.firestore.admin.v1 + * @interface IExportDocumentsRequest + * @property {string|null} [name] ExportDocumentsRequest name + * @property {Array.|null} [collectionIds] ExportDocumentsRequest collectionIds + * @property {string|null} [outputUriPrefix] ExportDocumentsRequest outputUriPrefix + * @property {Array.|null} [namespaceIds] ExportDocumentsRequest namespaceIds + * @property {google.protobuf.ITimestamp|null} [snapshotTime] ExportDocumentsRequest snapshotTime + */ - /** - * Converts this IndexConfigDelta to JSON. - * @function toJSON - * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta - * @instance - * @returns {Object.} JSON object - */ - IndexConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new ExportDocumentsRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents an ExportDocumentsRequest. + * @implements IExportDocumentsRequest + * @constructor + * @param {google.firestore.admin.v1.IExportDocumentsRequest=} [properties] Properties to set + */ + function ExportDocumentsRequest(properties) { + this.collectionIds = []; + this.namespaceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Gets the default type url for IndexConfigDelta - * @function getTypeUrl - * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndexConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta"; - }; + /** + * ExportDocumentsRequest name. + * @member {string} name + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @instance + */ + ExportDocumentsRequest.prototype.name = ""; - /** - * ChangeType enum. - * @name google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType - * @enum {string} - * @property {string} CHANGE_TYPE_UNSPECIFIED=CHANGE_TYPE_UNSPECIFIED CHANGE_TYPE_UNSPECIFIED value - * @property {string} ADD=ADD ADD value - * @property {string} REMOVE=REMOVE REMOVE value - */ - IndexConfigDelta.ChangeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHANGE_TYPE_UNSPECIFIED"] = "CHANGE_TYPE_UNSPECIFIED"; - values[valuesById[1] = "ADD"] = "ADD"; - values[valuesById[2] = "REMOVE"] = "REMOVE"; - return values; - })(); + /** + * ExportDocumentsRequest collectionIds. + * @member {Array.} collectionIds + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @instance + */ + ExportDocumentsRequest.prototype.collectionIds = $util.emptyArray; - return IndexConfigDelta; - })(); + /** + * ExportDocumentsRequest outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @instance + */ + ExportDocumentsRequest.prototype.outputUriPrefix = ""; - FieldOperationMetadata.TtlConfigDelta = (function() { + /** + * ExportDocumentsRequest namespaceIds. + * @member {Array.} namespaceIds + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @instance + */ + ExportDocumentsRequest.prototype.namespaceIds = $util.emptyArray; - /** - * Properties of a TtlConfigDelta. - * @memberof google.firestore.admin.v1.FieldOperationMetadata - * @interface ITtlConfigDelta - * @property {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType|null} [changeType] TtlConfigDelta changeType - */ + /** + * ExportDocumentsRequest snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @instance + */ + ExportDocumentsRequest.prototype.snapshotTime = null; - /** - * Constructs a new TtlConfigDelta. - * @memberof google.firestore.admin.v1.FieldOperationMetadata - * @classdesc Represents a TtlConfigDelta. - * @implements ITtlConfigDelta - * @constructor - * @param {google.firestore.admin.v1.FieldOperationMetadata.ITtlConfigDelta=} [properties] Properties to set - */ - function TtlConfigDelta(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates an ExportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ExportDocumentsRequest} ExportDocumentsRequest + */ + ExportDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ExportDocumentsRequest) + return object; + var message = new $root.google.firestore.admin.v1.ExportDocumentsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.collectionIds) { + if (!Array.isArray(object.collectionIds)) + throw TypeError(".google.firestore.admin.v1.ExportDocumentsRequest.collectionIds: array expected"); + message.collectionIds = []; + for (var i = 0; i < object.collectionIds.length; ++i) + message.collectionIds[i] = String(object.collectionIds[i]); } + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + if (object.namespaceIds) { + if (!Array.isArray(object.namespaceIds)) + throw TypeError(".google.firestore.admin.v1.ExportDocumentsRequest.namespaceIds: array expected"); + message.namespaceIds = []; + for (var i = 0; i < object.namespaceIds.length; ++i) + message.namespaceIds[i] = String(object.namespaceIds[i]); + } + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.firestore.admin.v1.ExportDocumentsRequest.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + return message; + }; - /** - * TtlConfigDelta changeType. - * @member {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType} changeType - * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta - * @instance - */ - TtlConfigDelta.prototype.changeType = 0; - - /** - * Creates a TtlConfigDelta message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta} TtlConfigDelta - */ - TtlConfigDelta.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta) - return object; - var message = new $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta(); - switch (object.changeType) { - default: - if (typeof object.changeType === "number") { - message.changeType = object.changeType; - break; - } - break; - case "CHANGE_TYPE_UNSPECIFIED": - case 0: - message.changeType = 0; - break; - case "ADD": - case 1: - message.changeType = 1; - break; - case "REMOVE": - case 2: - message.changeType = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a TtlConfigDelta message. Also converts values to other types if specified. - * @function toObject - * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta - * @static - * @param {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta} message TtlConfigDelta - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TtlConfigDelta.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.changeType = options.enums === String ? "CHANGE_TYPE_UNSPECIFIED" : 0; - if (message.changeType != null && message.hasOwnProperty("changeType")) - object.changeType = options.enums === String ? $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType[message.changeType] === undefined ? message.changeType : $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType[message.changeType] : message.changeType; - return object; - }; - - /** - * Converts this TtlConfigDelta to JSON. - * @function toJSON - * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta - * @instance - * @returns {Object.} JSON object - */ - TtlConfigDelta.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TtlConfigDelta - * @function getTypeUrl - * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TtlConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta"; - }; + /** + * Creates a plain object from an ExportDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @static + * @param {google.firestore.admin.v1.ExportDocumentsRequest} message ExportDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collectionIds = []; + object.namespaceIds = []; + } + if (options.defaults) { + object.name = ""; + object.outputUriPrefix = ""; + object.snapshotTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.collectionIds && message.collectionIds.length) { + object.collectionIds = []; + for (var j = 0; j < message.collectionIds.length; ++j) + object.collectionIds[j] = message.collectionIds[j]; + } + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + if (message.namespaceIds && message.namespaceIds.length) { + object.namespaceIds = []; + for (var j = 0; j < message.namespaceIds.length; ++j) + object.namespaceIds[j] = message.namespaceIds[j]; + } + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + return object; + }; - /** - * ChangeType enum. - * @name google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType - * @enum {string} - * @property {string} CHANGE_TYPE_UNSPECIFIED=CHANGE_TYPE_UNSPECIFIED CHANGE_TYPE_UNSPECIFIED value - * @property {string} ADD=ADD ADD value - * @property {string} REMOVE=REMOVE REMOVE value - */ - TtlConfigDelta.ChangeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CHANGE_TYPE_UNSPECIFIED"] = "CHANGE_TYPE_UNSPECIFIED"; - values[valuesById[1] = "ADD"] = "ADD"; - values[valuesById[2] = "REMOVE"] = "REMOVE"; - return values; - })(); + /** + * Converts this ExportDocumentsRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ExportDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return TtlConfigDelta; - })(); + /** + * Gets the default type url for ExportDocumentsRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ExportDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ExportDocumentsRequest"; + }; - return FieldOperationMetadata; + return ExportDocumentsRequest; })(); - v1.ExportDocumentsMetadata = (function() { + v1.ImportDocumentsRequest = (function() { /** - * Properties of an ExportDocumentsMetadata. + * Properties of an ImportDocumentsRequest. * @memberof google.firestore.admin.v1 - * @interface IExportDocumentsMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] ExportDocumentsMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] ExportDocumentsMetadata endTime - * @property {google.firestore.admin.v1.OperationState|null} [operationState] ExportDocumentsMetadata operationState - * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] ExportDocumentsMetadata progressDocuments - * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] ExportDocumentsMetadata progressBytes - * @property {Array.|null} [collectionIds] ExportDocumentsMetadata collectionIds - * @property {string|null} [outputUriPrefix] ExportDocumentsMetadata outputUriPrefix - * @property {Array.|null} [namespaceIds] ExportDocumentsMetadata namespaceIds - * @property {google.protobuf.ITimestamp|null} [snapshotTime] ExportDocumentsMetadata snapshotTime + * @interface IImportDocumentsRequest + * @property {string|null} [name] ImportDocumentsRequest name + * @property {Array.|null} [collectionIds] ImportDocumentsRequest collectionIds + * @property {string|null} [inputUriPrefix] ImportDocumentsRequest inputUriPrefix + * @property {Array.|null} [namespaceIds] ImportDocumentsRequest namespaceIds + */ + + /** + * Constructs a new ImportDocumentsRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents an ImportDocumentsRequest. + * @implements IImportDocumentsRequest + * @constructor + * @param {google.firestore.admin.v1.IImportDocumentsRequest=} [properties] Properties to set + */ + function ImportDocumentsRequest(properties) { + this.collectionIds = []; + this.namespaceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsRequest name. + * @member {string} name + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.name = ""; + + /** + * ImportDocumentsRequest collectionIds. + * @member {Array.} collectionIds + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.collectionIds = $util.emptyArray; + + /** + * ImportDocumentsRequest inputUriPrefix. + * @member {string} inputUriPrefix + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.inputUriPrefix = ""; + + /** + * ImportDocumentsRequest namespaceIds. + * @member {Array.} namespaceIds + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @instance + */ + ImportDocumentsRequest.prototype.namespaceIds = $util.emptyArray; + + /** + * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ImportDocumentsRequest} ImportDocumentsRequest + */ + ImportDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ImportDocumentsRequest) + return object; + var message = new $root.google.firestore.admin.v1.ImportDocumentsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.collectionIds) { + if (!Array.isArray(object.collectionIds)) + throw TypeError(".google.firestore.admin.v1.ImportDocumentsRequest.collectionIds: array expected"); + message.collectionIds = []; + for (var i = 0; i < object.collectionIds.length; ++i) + message.collectionIds[i] = String(object.collectionIds[i]); + } + if (object.inputUriPrefix != null) + message.inputUriPrefix = String(object.inputUriPrefix); + if (object.namespaceIds) { + if (!Array.isArray(object.namespaceIds)) + throw TypeError(".google.firestore.admin.v1.ImportDocumentsRequest.namespaceIds: array expected"); + message.namespaceIds = []; + for (var i = 0; i < object.namespaceIds.length; ++i) + message.namespaceIds[i] = String(object.namespaceIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @static + * @param {google.firestore.admin.v1.ImportDocumentsRequest} message ImportDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collectionIds = []; + object.namespaceIds = []; + } + if (options.defaults) { + object.name = ""; + object.inputUriPrefix = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.collectionIds && message.collectionIds.length) { + object.collectionIds = []; + for (var j = 0; j < message.collectionIds.length; ++j) + object.collectionIds[j] = message.collectionIds[j]; + } + if (message.inputUriPrefix != null && message.hasOwnProperty("inputUriPrefix")) + object.inputUriPrefix = message.inputUriPrefix; + if (message.namespaceIds && message.namespaceIds.length) { + object.namespaceIds = []; + for (var j = 0; j < message.namespaceIds.length; ++j) + object.namespaceIds[j] = message.namespaceIds[j]; + } + return object; + }; + + /** + * Converts this ImportDocumentsRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ImportDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ImportDocumentsRequest"; + }; + + return ImportDocumentsRequest; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.firestore.admin.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.firestore.admin.v1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.firestore.admin.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.GetBackupRequest) + return object; + var message = new $root.google.firestore.admin.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.GetBackupRequest + * @static + * @param {google.firestore.admin.v1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.firestore.admin.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.firestore.admin.v1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.firestore.admin.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListBackupsRequest) + return object; + var message = new $root.google.firestore.admin.v1.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ListBackupsRequest + * @static + * @param {google.firestore.admin.v1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.firestore.admin.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.firestore.admin.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.firestore.admin.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.firestore.admin.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ListBackupsResponse) + return object; + var message = new $root.google.firestore.admin.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.firestore.admin.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.firestore.admin.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.firestore.admin.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.firestore.admin.v1.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ListBackupsResponse + * @static + * @param {google.firestore.admin.v1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.firestore.admin.v1.Backup.toObject(message.backups[j], options); + } + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.firestore.admin.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.firestore.admin.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.firestore.admin.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.DeleteBackupRequest) + return object; + var message = new $root.google.firestore.admin.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.DeleteBackupRequest + * @static + * @param {google.firestore.admin.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.RestoreDatabaseRequest = (function() { + + /** + * Properties of a RestoreDatabaseRequest. + * @memberof google.firestore.admin.v1 + * @interface IRestoreDatabaseRequest + * @property {string|null} [parent] RestoreDatabaseRequest parent + * @property {string|null} [databaseId] RestoreDatabaseRequest databaseId + * @property {string|null} [backup] RestoreDatabaseRequest backup + */ + + /** + * Constructs a new RestoreDatabaseRequest. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a RestoreDatabaseRequest. + * @implements IRestoreDatabaseRequest + * @constructor + * @param {google.firestore.admin.v1.IRestoreDatabaseRequest=} [properties] Properties to set + */ + function RestoreDatabaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseRequest parent. + * @member {string} parent + * @memberof google.firestore.admin.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.parent = ""; + + /** + * RestoreDatabaseRequest databaseId. + * @member {string} databaseId + * @memberof google.firestore.admin.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.databaseId = ""; + + /** + * RestoreDatabaseRequest backup. + * @member {string} backup + * @memberof google.firestore.admin.v1.RestoreDatabaseRequest + * @instance + */ + RestoreDatabaseRequest.prototype.backup = ""; + + /** + * Creates a RestoreDatabaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.RestoreDatabaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.RestoreDatabaseRequest} RestoreDatabaseRequest + */ + RestoreDatabaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.RestoreDatabaseRequest) + return object; + var message = new $root.google.firestore.admin.v1.RestoreDatabaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.backup != null) + message.backup = String(object.backup); + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.RestoreDatabaseRequest + * @static + * @param {google.firestore.admin.v1.RestoreDatabaseRequest} message RestoreDatabaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.databaseId = ""; + object.backup = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = message.backup; + return object; + }; + + /** + * Converts this RestoreDatabaseRequest to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.RestoreDatabaseRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseRequest + * @function getTypeUrl + * @memberof google.firestore.admin.v1.RestoreDatabaseRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.RestoreDatabaseRequest"; + }; + + return RestoreDatabaseRequest; + })(); + + v1.IndexOperationMetadata = (function() { + + /** + * Properties of an IndexOperationMetadata. + * @memberof google.firestore.admin.v1 + * @interface IIndexOperationMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] IndexOperationMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] IndexOperationMetadata endTime + * @property {string|null} [index] IndexOperationMetadata index + * @property {google.firestore.admin.v1.OperationState|null} [state] IndexOperationMetadata state + * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] IndexOperationMetadata progressDocuments + * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] IndexOperationMetadata progressBytes + */ + + /** + * Constructs a new IndexOperationMetadata. + * @memberof google.firestore.admin.v1 + * @classdesc Represents an IndexOperationMetadata. + * @implements IIndexOperationMetadata + * @constructor + * @param {google.firestore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set + */ + function IndexOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexOperationMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.startTime = null; + + /** + * IndexOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.endTime = null; + + /** + * IndexOperationMetadata index. + * @member {string} index + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.index = ""; + + /** + * IndexOperationMetadata state. + * @member {google.firestore.admin.v1.OperationState} state + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.state = 0; + + /** + * IndexOperationMetadata progressDocuments. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.progressDocuments = null; + + /** + * IndexOperationMetadata progressBytes. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.progressBytes = null; + + /** + * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.IndexOperationMetadata} IndexOperationMetadata + */ + IndexOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.IndexOperationMetadata) + return object; + var message = new $root.google.firestore.admin.v1.IndexOperationMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.index != null) + message.index = String(object.index); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "OPERATION_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "INITIALIZING": + case 1: + message.state = 1; + break; + case "PROCESSING": + case 2: + message.state = 2; + break; + case "CANCELLING": + case 3: + message.state = 3; + break; + case "FINALIZING": + case 4: + message.state = 4; + break; + case "SUCCESSFUL": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.progressDocuments != null) { + if (typeof object.progressDocuments !== "object") + throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.progressDocuments: object expected"); + message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.firestore.admin.v1.IndexOperationMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); + } + return message; + }; + + /** + * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @static + * @param {google.firestore.admin.v1.IndexOperationMetadata} message IndexOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.index = ""; + object.state = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + object.progressDocuments = null; + object.progressBytes = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.state] === undefined ? message.state : $root.google.firestore.admin.v1.OperationState[message.state] : message.state; + if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) + object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); + return object; + }; + + /** + * Converts this IndexOperationMetadata to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + IndexOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexOperationMetadata + * @function getTypeUrl + * @memberof google.firestore.admin.v1.IndexOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.IndexOperationMetadata"; + }; + + return IndexOperationMetadata; + })(); + + v1.FieldOperationMetadata = (function() { + + /** + * Properties of a FieldOperationMetadata. + * @memberof google.firestore.admin.v1 + * @interface IFieldOperationMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] FieldOperationMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] FieldOperationMetadata endTime + * @property {string|null} [field] FieldOperationMetadata field + * @property {Array.|null} [indexConfigDeltas] FieldOperationMetadata indexConfigDeltas + * @property {google.firestore.admin.v1.OperationState|null} [state] FieldOperationMetadata state + * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] FieldOperationMetadata progressDocuments + * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] FieldOperationMetadata progressBytes + * @property {google.firestore.admin.v1.FieldOperationMetadata.ITtlConfigDelta|null} [ttlConfigDelta] FieldOperationMetadata ttlConfigDelta + */ + + /** + * Constructs a new FieldOperationMetadata. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a FieldOperationMetadata. + * @implements IFieldOperationMetadata + * @constructor + * @param {google.firestore.admin.v1.IFieldOperationMetadata=} [properties] Properties to set + */ + function FieldOperationMetadata(properties) { + this.indexConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOperationMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.startTime = null; + + /** + * FieldOperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.endTime = null; + + /** + * FieldOperationMetadata field. + * @member {string} field + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.field = ""; + + /** + * FieldOperationMetadata indexConfigDeltas. + * @member {Array.} indexConfigDeltas + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.indexConfigDeltas = $util.emptyArray; + + /** + * FieldOperationMetadata state. + * @member {google.firestore.admin.v1.OperationState} state + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.state = 0; + + /** + * FieldOperationMetadata progressDocuments. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.progressDocuments = null; + + /** + * FieldOperationMetadata progressBytes. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.progressBytes = null; + + /** + * FieldOperationMetadata ttlConfigDelta. + * @member {google.firestore.admin.v1.FieldOperationMetadata.ITtlConfigDelta|null|undefined} ttlConfigDelta + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + */ + FieldOperationMetadata.prototype.ttlConfigDelta = null; + + /** + * Creates a FieldOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.FieldOperationMetadata} FieldOperationMetadata + */ + FieldOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.FieldOperationMetadata) + return object; + var message = new $root.google.firestore.admin.v1.FieldOperationMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.field != null) + message.field = String(object.field); + if (object.indexConfigDeltas) { + if (!Array.isArray(object.indexConfigDeltas)) + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.indexConfigDeltas: array expected"); + message.indexConfigDeltas = []; + for (var i = 0; i < object.indexConfigDeltas.length; ++i) { + if (typeof object.indexConfigDeltas[i] !== "object") + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.indexConfigDeltas: object expected"); + message.indexConfigDeltas[i] = $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.fromObject(object.indexConfigDeltas[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "OPERATION_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "INITIALIZING": + case 1: + message.state = 1; + break; + case "PROCESSING": + case 2: + message.state = 2; + break; + case "CANCELLING": + case 3: + message.state = 3; + break; + case "FINALIZING": + case 4: + message.state = 4; + break; + case "SUCCESSFUL": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + if (object.progressDocuments != null) { + if (typeof object.progressDocuments !== "object") + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.progressDocuments: object expected"); + message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); + } + if (object.ttlConfigDelta != null) { + if (typeof object.ttlConfigDelta !== "object") + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.ttlConfigDelta: object expected"); + message.ttlConfigDelta = $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.fromObject(object.ttlConfigDelta); + } + return message; + }; + + /** + * Creates a plain object from a FieldOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @static + * @param {google.firestore.admin.v1.FieldOperationMetadata} message FieldOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexConfigDeltas = []; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.field = ""; + object.state = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + object.progressDocuments = null; + object.progressBytes = null; + object.ttlConfigDelta = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.field != null && message.hasOwnProperty("field")) + object.field = message.field; + if (message.indexConfigDeltas && message.indexConfigDeltas.length) { + object.indexConfigDeltas = []; + for (var j = 0; j < message.indexConfigDeltas.length; ++j) + object.indexConfigDeltas[j] = $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.toObject(message.indexConfigDeltas[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.state] === undefined ? message.state : $root.google.firestore.admin.v1.OperationState[message.state] : message.state; + if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) + object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); + if (message.ttlConfigDelta != null && message.hasOwnProperty("ttlConfigDelta")) + object.ttlConfigDelta = $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.toObject(message.ttlConfigDelta, options); + return object; + }; + + /** + * Converts this FieldOperationMetadata to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + FieldOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOperationMetadata + * @function getTypeUrl + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.FieldOperationMetadata"; + }; + + FieldOperationMetadata.IndexConfigDelta = (function() { + + /** + * Properties of an IndexConfigDelta. + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @interface IIndexConfigDelta + * @property {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType|null} [changeType] IndexConfigDelta changeType + * @property {google.firestore.admin.v1.IIndex|null} [index] IndexConfigDelta index + */ + + /** + * Constructs a new IndexConfigDelta. + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @classdesc Represents an IndexConfigDelta. + * @implements IIndexConfigDelta + * @constructor + * @param {google.firestore.admin.v1.FieldOperationMetadata.IIndexConfigDelta=} [properties] Properties to set + */ + function IndexConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IndexConfigDelta changeType. + * @member {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType} changeType + * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + * @instance + */ + IndexConfigDelta.prototype.changeType = 0; + + /** + * IndexConfigDelta index. + * @member {google.firestore.admin.v1.IIndex|null|undefined} index + * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + * @instance + */ + IndexConfigDelta.prototype.index = null; + + /** + * Creates an IndexConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta} IndexConfigDelta + */ + IndexConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta) + return object; + var message = new $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta(); + switch (object.changeType) { + default: + if (typeof object.changeType === "number") { + message.changeType = object.changeType; + break; + } + break; + case "CHANGE_TYPE_UNSPECIFIED": + case 0: + message.changeType = 0; + break; + case "ADD": + case 1: + message.changeType = 1; + break; + case "REMOVE": + case 2: + message.changeType = 2; + break; + } + if (object.index != null) { + if (typeof object.index !== "object") + throw TypeError(".google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.index: object expected"); + message.index = $root.google.firestore.admin.v1.Index.fromObject(object.index); + } + return message; + }; + + /** + * Creates a plain object from an IndexConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + * @static + * @param {google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta} message IndexConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.changeType = options.enums === String ? "CHANGE_TYPE_UNSPECIFIED" : 0; + object.index = null; + } + if (message.changeType != null && message.hasOwnProperty("changeType")) + object.changeType = options.enums === String ? $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType[message.changeType] === undefined ? message.changeType : $root.google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType[message.changeType] : message.changeType; + if (message.index != null && message.hasOwnProperty("index")) + object.index = $root.google.firestore.admin.v1.Index.toObject(message.index, options); + return object; + }; + + /** + * Converts this IndexConfigDelta to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + * @instance + * @returns {Object.} JSON object + */ + IndexConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for IndexConfigDelta + * @function getTypeUrl + * @memberof google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IndexConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta"; + }; + + /** + * ChangeType enum. + * @name google.firestore.admin.v1.FieldOperationMetadata.IndexConfigDelta.ChangeType + * @enum {string} + * @property {string} CHANGE_TYPE_UNSPECIFIED=CHANGE_TYPE_UNSPECIFIED CHANGE_TYPE_UNSPECIFIED value + * @property {string} ADD=ADD ADD value + * @property {string} REMOVE=REMOVE REMOVE value + */ + IndexConfigDelta.ChangeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANGE_TYPE_UNSPECIFIED"] = "CHANGE_TYPE_UNSPECIFIED"; + values[valuesById[1] = "ADD"] = "ADD"; + values[valuesById[2] = "REMOVE"] = "REMOVE"; + return values; + })(); + + return IndexConfigDelta; + })(); + + FieldOperationMetadata.TtlConfigDelta = (function() { + + /** + * Properties of a TtlConfigDelta. + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @interface ITtlConfigDelta + * @property {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType|null} [changeType] TtlConfigDelta changeType + */ + + /** + * Constructs a new TtlConfigDelta. + * @memberof google.firestore.admin.v1.FieldOperationMetadata + * @classdesc Represents a TtlConfigDelta. + * @implements ITtlConfigDelta + * @constructor + * @param {google.firestore.admin.v1.FieldOperationMetadata.ITtlConfigDelta=} [properties] Properties to set + */ + function TtlConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TtlConfigDelta changeType. + * @member {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType} changeType + * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta + * @instance + */ + TtlConfigDelta.prototype.changeType = 0; + + /** + * Creates a TtlConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta} TtlConfigDelta + */ + TtlConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta) + return object; + var message = new $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta(); + switch (object.changeType) { + default: + if (typeof object.changeType === "number") { + message.changeType = object.changeType; + break; + } + break; + case "CHANGE_TYPE_UNSPECIFIED": + case 0: + message.changeType = 0; + break; + case "ADD": + case 1: + message.changeType = 1; + break; + case "REMOVE": + case 2: + message.changeType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TtlConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta + * @static + * @param {google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta} message TtlConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TtlConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.changeType = options.enums === String ? "CHANGE_TYPE_UNSPECIFIED" : 0; + if (message.changeType != null && message.hasOwnProperty("changeType")) + object.changeType = options.enums === String ? $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType[message.changeType] === undefined ? message.changeType : $root.google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType[message.changeType] : message.changeType; + return object; + }; + + /** + * Converts this TtlConfigDelta to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta + * @instance + * @returns {Object.} JSON object + */ + TtlConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TtlConfigDelta + * @function getTypeUrl + * @memberof google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TtlConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta"; + }; + + /** + * ChangeType enum. + * @name google.firestore.admin.v1.FieldOperationMetadata.TtlConfigDelta.ChangeType + * @enum {string} + * @property {string} CHANGE_TYPE_UNSPECIFIED=CHANGE_TYPE_UNSPECIFIED CHANGE_TYPE_UNSPECIFIED value + * @property {string} ADD=ADD ADD value + * @property {string} REMOVE=REMOVE REMOVE value + */ + TtlConfigDelta.ChangeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CHANGE_TYPE_UNSPECIFIED"] = "CHANGE_TYPE_UNSPECIFIED"; + values[valuesById[1] = "ADD"] = "ADD"; + values[valuesById[2] = "REMOVE"] = "REMOVE"; + return values; + })(); + + return TtlConfigDelta; + })(); + + return FieldOperationMetadata; + })(); + + v1.ExportDocumentsMetadata = (function() { + + /** + * Properties of an ExportDocumentsMetadata. + * @memberof google.firestore.admin.v1 + * @interface IExportDocumentsMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] ExportDocumentsMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ExportDocumentsMetadata endTime + * @property {google.firestore.admin.v1.OperationState|null} [operationState] ExportDocumentsMetadata operationState + * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] ExportDocumentsMetadata progressDocuments + * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] ExportDocumentsMetadata progressBytes + * @property {Array.|null} [collectionIds] ExportDocumentsMetadata collectionIds + * @property {string|null} [outputUriPrefix] ExportDocumentsMetadata outputUriPrefix + * @property {Array.|null} [namespaceIds] ExportDocumentsMetadata namespaceIds + * @property {google.protobuf.ITimestamp|null} [snapshotTime] ExportDocumentsMetadata snapshotTime + */ + + /** + * Constructs a new ExportDocumentsMetadata. + * @memberof google.firestore.admin.v1 + * @classdesc Represents an ExportDocumentsMetadata. + * @implements IExportDocumentsMetadata + * @constructor + * @param {google.firestore.admin.v1.IExportDocumentsMetadata=} [properties] Properties to set + */ + function ExportDocumentsMetadata(properties) { + this.collectionIds = []; + this.namespaceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportDocumentsMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.startTime = null; + + /** + * ExportDocumentsMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.endTime = null; + + /** + * ExportDocumentsMetadata operationState. + * @member {google.firestore.admin.v1.OperationState} operationState + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.operationState = 0; + + /** + * ExportDocumentsMetadata progressDocuments. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.progressDocuments = null; + + /** + * ExportDocumentsMetadata progressBytes. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.progressBytes = null; + + /** + * ExportDocumentsMetadata collectionIds. + * @member {Array.} collectionIds + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.collectionIds = $util.emptyArray; + + /** + * ExportDocumentsMetadata outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.outputUriPrefix = ""; + + /** + * ExportDocumentsMetadata namespaceIds. + * @member {Array.} namespaceIds + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.namespaceIds = $util.emptyArray; + + /** + * ExportDocumentsMetadata snapshotTime. + * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + */ + ExportDocumentsMetadata.prototype.snapshotTime = null; + + /** + * Creates an ExportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ExportDocumentsMetadata} ExportDocumentsMetadata + */ + ExportDocumentsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ExportDocumentsMetadata) + return object; + var message = new $root.google.firestore.admin.v1.ExportDocumentsMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.operationState) { + default: + if (typeof object.operationState === "number") { + message.operationState = object.operationState; + break; + } + break; + case "OPERATION_STATE_UNSPECIFIED": + case 0: + message.operationState = 0; + break; + case "INITIALIZING": + case 1: + message.operationState = 1; + break; + case "PROCESSING": + case 2: + message.operationState = 2; + break; + case "CANCELLING": + case 3: + message.operationState = 3; + break; + case "FINALIZING": + case 4: + message.operationState = 4; + break; + case "SUCCESSFUL": + case 5: + message.operationState = 5; + break; + case "FAILED": + case 6: + message.operationState = 6; + break; + case "CANCELLED": + case 7: + message.operationState = 7; + break; + } + if (object.progressDocuments != null) { + if (typeof object.progressDocuments !== "object") + throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.progressDocuments: object expected"); + message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); + } + if (object.collectionIds) { + if (!Array.isArray(object.collectionIds)) + throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.collectionIds: array expected"); + message.collectionIds = []; + for (var i = 0; i < object.collectionIds.length; ++i) + message.collectionIds[i] = String(object.collectionIds[i]); + } + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + if (object.namespaceIds) { + if (!Array.isArray(object.namespaceIds)) + throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.namespaceIds: array expected"); + message.namespaceIds = []; + for (var i = 0; i < object.namespaceIds.length; ++i) + message.namespaceIds[i] = String(object.namespaceIds[i]); + } + if (object.snapshotTime != null) { + if (typeof object.snapshotTime !== "object") + throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.snapshotTime: object expected"); + message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + } + return message; + }; + + /** + * Creates a plain object from an ExportDocumentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @static + * @param {google.firestore.admin.v1.ExportDocumentsMetadata} message ExportDocumentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDocumentsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collectionIds = []; + object.namespaceIds = []; + } + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.operationState = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + object.progressDocuments = null; + object.progressBytes = null; + object.outputUriPrefix = ""; + object.snapshotTime = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.operationState != null && message.hasOwnProperty("operationState")) + object.operationState = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.operationState] === undefined ? message.operationState : $root.google.firestore.admin.v1.OperationState[message.operationState] : message.operationState; + if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) + object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); + if (message.collectionIds && message.collectionIds.length) { + object.collectionIds = []; + for (var j = 0; j < message.collectionIds.length; ++j) + object.collectionIds[j] = message.collectionIds[j]; + } + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + if (message.namespaceIds && message.namespaceIds.length) { + object.namespaceIds = []; + for (var j = 0; j < message.namespaceIds.length; ++j) + object.namespaceIds[j] = message.namespaceIds[j]; + } + if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) + object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + return object; + }; + + /** + * Converts this ExportDocumentsMetadata to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportDocumentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportDocumentsMetadata + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ExportDocumentsMetadata"; + }; + + return ExportDocumentsMetadata; + })(); + + v1.ImportDocumentsMetadata = (function() { + + /** + * Properties of an ImportDocumentsMetadata. + * @memberof google.firestore.admin.v1 + * @interface IImportDocumentsMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] ImportDocumentsMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ImportDocumentsMetadata endTime + * @property {google.firestore.admin.v1.OperationState|null} [operationState] ImportDocumentsMetadata operationState + * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] ImportDocumentsMetadata progressDocuments + * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] ImportDocumentsMetadata progressBytes + * @property {Array.|null} [collectionIds] ImportDocumentsMetadata collectionIds + * @property {string|null} [inputUriPrefix] ImportDocumentsMetadata inputUriPrefix + * @property {Array.|null} [namespaceIds] ImportDocumentsMetadata namespaceIds + */ + + /** + * Constructs a new ImportDocumentsMetadata. + * @memberof google.firestore.admin.v1 + * @classdesc Represents an ImportDocumentsMetadata. + * @implements IImportDocumentsMetadata + * @constructor + * @param {google.firestore.admin.v1.IImportDocumentsMetadata=} [properties] Properties to set + */ + function ImportDocumentsMetadata(properties) { + this.collectionIds = []; + this.namespaceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportDocumentsMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.startTime = null; + + /** + * ImportDocumentsMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.endTime = null; + + /** + * ImportDocumentsMetadata operationState. + * @member {google.firestore.admin.v1.OperationState} operationState + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.operationState = 0; + + /** + * ImportDocumentsMetadata progressDocuments. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.progressDocuments = null; + + /** + * ImportDocumentsMetadata progressBytes. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.progressBytes = null; + + /** + * ImportDocumentsMetadata collectionIds. + * @member {Array.} collectionIds + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.collectionIds = $util.emptyArray; + + /** + * ImportDocumentsMetadata inputUriPrefix. + * @member {string} inputUriPrefix + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.inputUriPrefix = ""; + + /** + * ImportDocumentsMetadata namespaceIds. + * @member {Array.} namespaceIds + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + */ + ImportDocumentsMetadata.prototype.namespaceIds = $util.emptyArray; + + /** + * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ImportDocumentsMetadata} ImportDocumentsMetadata + */ + ImportDocumentsMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ImportDocumentsMetadata) + return object; + var message = new $root.google.firestore.admin.v1.ImportDocumentsMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.operationState) { + default: + if (typeof object.operationState === "number") { + message.operationState = object.operationState; + break; + } + break; + case "OPERATION_STATE_UNSPECIFIED": + case 0: + message.operationState = 0; + break; + case "INITIALIZING": + case 1: + message.operationState = 1; + break; + case "PROCESSING": + case 2: + message.operationState = 2; + break; + case "CANCELLING": + case 3: + message.operationState = 3; + break; + case "FINALIZING": + case 4: + message.operationState = 4; + break; + case "SUCCESSFUL": + case 5: + message.operationState = 5; + break; + case "FAILED": + case 6: + message.operationState = 6; + break; + case "CANCELLED": + case 7: + message.operationState = 7; + break; + } + if (object.progressDocuments != null) { + if (typeof object.progressDocuments !== "object") + throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.progressDocuments: object expected"); + message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); + } + if (object.collectionIds) { + if (!Array.isArray(object.collectionIds)) + throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.collectionIds: array expected"); + message.collectionIds = []; + for (var i = 0; i < object.collectionIds.length; ++i) + message.collectionIds[i] = String(object.collectionIds[i]); + } + if (object.inputUriPrefix != null) + message.inputUriPrefix = String(object.inputUriPrefix); + if (object.namespaceIds) { + if (!Array.isArray(object.namespaceIds)) + throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.namespaceIds: array expected"); + message.namespaceIds = []; + for (var i = 0; i < object.namespaceIds.length; ++i) + message.namespaceIds[i] = String(object.namespaceIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @static + * @param {google.firestore.admin.v1.ImportDocumentsMetadata} message ImportDocumentsMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportDocumentsMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.collectionIds = []; + object.namespaceIds = []; + } + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.operationState = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + object.progressDocuments = null; + object.progressBytes = null; + object.inputUriPrefix = ""; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.operationState != null && message.hasOwnProperty("operationState")) + object.operationState = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.operationState] === undefined ? message.operationState : $root.google.firestore.admin.v1.OperationState[message.operationState] : message.operationState; + if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) + object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); + if (message.collectionIds && message.collectionIds.length) { + object.collectionIds = []; + for (var j = 0; j < message.collectionIds.length; ++j) + object.collectionIds[j] = message.collectionIds[j]; + } + if (message.inputUriPrefix != null && message.hasOwnProperty("inputUriPrefix")) + object.inputUriPrefix = message.inputUriPrefix; + if (message.namespaceIds && message.namespaceIds.length) { + object.namespaceIds = []; + for (var j = 0; j < message.namespaceIds.length; ++j) + object.namespaceIds[j] = message.namespaceIds[j]; + } + return object; + }; + + /** + * Converts this ImportDocumentsMetadata to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportDocumentsMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportDocumentsMetadata + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ImportDocumentsMetadata"; + }; + + return ImportDocumentsMetadata; + })(); + + v1.ExportDocumentsResponse = (function() { + + /** + * Properties of an ExportDocumentsResponse. + * @memberof google.firestore.admin.v1 + * @interface IExportDocumentsResponse + * @property {string|null} [outputUriPrefix] ExportDocumentsResponse outputUriPrefix */ /** - * Constructs a new ExportDocumentsMetadata. + * Constructs a new ExportDocumentsResponse. * @memberof google.firestore.admin.v1 - * @classdesc Represents an ExportDocumentsMetadata. - * @implements IExportDocumentsMetadata + * @classdesc Represents an ExportDocumentsResponse. + * @implements IExportDocumentsResponse * @constructor - * @param {google.firestore.admin.v1.IExportDocumentsMetadata=} [properties] Properties to set + * @param {google.firestore.admin.v1.IExportDocumentsResponse=} [properties] Properties to set */ - function ExportDocumentsMetadata(properties) { - this.collectionIds = []; - this.namespaceIds = []; + function ExportDocumentsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5055,97 +7488,176 @@ } /** - * ExportDocumentsMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * ExportDocumentsResponse outputUriPrefix. + * @member {string} outputUriPrefix + * @memberof google.firestore.admin.v1.ExportDocumentsResponse * @instance */ - ExportDocumentsMetadata.prototype.startTime = null; + ExportDocumentsResponse.prototype.outputUriPrefix = ""; /** - * ExportDocumentsMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata - * @instance + * Creates an ExportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.ExportDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.ExportDocumentsResponse} ExportDocumentsResponse */ - ExportDocumentsMetadata.prototype.endTime = null; + ExportDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.ExportDocumentsResponse) + return object; + var message = new $root.google.firestore.admin.v1.ExportDocumentsResponse(); + if (object.outputUriPrefix != null) + message.outputUriPrefix = String(object.outputUriPrefix); + return message; + }; /** - * ExportDocumentsMetadata operationState. - * @member {google.firestore.admin.v1.OperationState} operationState - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * Creates a plain object from an ExportDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.ExportDocumentsResponse + * @static + * @param {google.firestore.admin.v1.ExportDocumentsResponse} message ExportDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUriPrefix = ""; + if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) + object.outputUriPrefix = message.outputUriPrefix; + return object; + }; + + /** + * Converts this ExportDocumentsResponse to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.ExportDocumentsResponse * @instance + * @returns {Object.} JSON object */ - ExportDocumentsMetadata.prototype.operationState = 0; + ExportDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * ExportDocumentsMetadata progressDocuments. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * Gets the default type url for ExportDocumentsResponse + * @function getTypeUrl + * @memberof google.firestore.admin.v1.ExportDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.firestore.admin.v1.ExportDocumentsResponse"; + }; + + return ExportDocumentsResponse; + })(); + + v1.RestoreDatabaseMetadata = (function() { + + /** + * Properties of a RestoreDatabaseMetadata. + * @memberof google.firestore.admin.v1 + * @interface IRestoreDatabaseMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] RestoreDatabaseMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] RestoreDatabaseMetadata endTime + * @property {google.firestore.admin.v1.OperationState|null} [operationState] RestoreDatabaseMetadata operationState + * @property {string|null} [database] RestoreDatabaseMetadata database + * @property {string|null} [backup] RestoreDatabaseMetadata backup + * @property {google.firestore.admin.v1.IProgress|null} [progressPercentage] RestoreDatabaseMetadata progressPercentage + */ + + /** + * Constructs a new RestoreDatabaseMetadata. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a RestoreDatabaseMetadata. + * @implements IRestoreDatabaseMetadata + * @constructor + * @param {google.firestore.admin.v1.IRestoreDatabaseMetadata=} [properties] Properties to set + */ + function RestoreDatabaseMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreDatabaseMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata * @instance */ - ExportDocumentsMetadata.prototype.progressDocuments = null; + RestoreDatabaseMetadata.prototype.startTime = null; /** - * ExportDocumentsMetadata progressBytes. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * RestoreDatabaseMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata * @instance */ - ExportDocumentsMetadata.prototype.progressBytes = null; + RestoreDatabaseMetadata.prototype.endTime = null; /** - * ExportDocumentsMetadata collectionIds. - * @member {Array.} collectionIds - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * RestoreDatabaseMetadata operationState. + * @member {google.firestore.admin.v1.OperationState} operationState + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata * @instance */ - ExportDocumentsMetadata.prototype.collectionIds = $util.emptyArray; + RestoreDatabaseMetadata.prototype.operationState = 0; /** - * ExportDocumentsMetadata outputUriPrefix. - * @member {string} outputUriPrefix - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * RestoreDatabaseMetadata database. + * @member {string} database + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata * @instance */ - ExportDocumentsMetadata.prototype.outputUriPrefix = ""; + RestoreDatabaseMetadata.prototype.database = ""; /** - * ExportDocumentsMetadata namespaceIds. - * @member {Array.} namespaceIds - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * RestoreDatabaseMetadata backup. + * @member {string} backup + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata * @instance */ - ExportDocumentsMetadata.prototype.namespaceIds = $util.emptyArray; + RestoreDatabaseMetadata.prototype.backup = ""; /** - * ExportDocumentsMetadata snapshotTime. - * @member {google.protobuf.ITimestamp|null|undefined} snapshotTime - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * RestoreDatabaseMetadata progressPercentage. + * @member {google.firestore.admin.v1.IProgress|null|undefined} progressPercentage + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata * @instance */ - ExportDocumentsMetadata.prototype.snapshotTime = null; + RestoreDatabaseMetadata.prototype.progressPercentage = null; /** - * Creates an ExportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a RestoreDatabaseMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ExportDocumentsMetadata} ExportDocumentsMetadata + * @returns {google.firestore.admin.v1.RestoreDatabaseMetadata} RestoreDatabaseMetadata */ - ExportDocumentsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ExportDocumentsMetadata) + RestoreDatabaseMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.RestoreDatabaseMetadata) return object; - var message = new $root.google.firestore.admin.v1.ExportDocumentsMetadata(); + var message = new $root.google.firestore.admin.v1.RestoreDatabaseMetadata(); if (object.startTime != null) { if (typeof object.startTime !== "object") - throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.startTime: object expected"); + throw TypeError(".google.firestore.admin.v1.RestoreDatabaseMetadata.startTime: object expected"); message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); } if (object.endTime != null) { if (typeof object.endTime !== "object") - throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.endTime: object expected"); + throw TypeError(".google.firestore.admin.v1.RestoreDatabaseMetadata.endTime: object expected"); message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } switch (object.operationState) { @@ -5188,149 +7700,273 @@ message.operationState = 7; break; } - if (object.progressDocuments != null) { - if (typeof object.progressDocuments !== "object") - throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.progressDocuments: object expected"); - message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); - } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); - } - if (object.collectionIds) { - if (!Array.isArray(object.collectionIds)) - throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.collectionIds: array expected"); - message.collectionIds = []; - for (var i = 0; i < object.collectionIds.length; ++i) - message.collectionIds[i] = String(object.collectionIds[i]); + if (object.database != null) + message.database = String(object.database); + if (object.backup != null) + message.backup = String(object.backup); + if (object.progressPercentage != null) { + if (typeof object.progressPercentage !== "object") + throw TypeError(".google.firestore.admin.v1.RestoreDatabaseMetadata.progressPercentage: object expected"); + message.progressPercentage = $root.google.firestore.admin.v1.Progress.fromObject(object.progressPercentage); } - if (object.outputUriPrefix != null) - message.outputUriPrefix = String(object.outputUriPrefix); - if (object.namespaceIds) { - if (!Array.isArray(object.namespaceIds)) - throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.namespaceIds: array expected"); - message.namespaceIds = []; - for (var i = 0; i < object.namespaceIds.length; ++i) - message.namespaceIds[i] = String(object.namespaceIds[i]); + return message; + }; + + /** + * Creates a plain object from a RestoreDatabaseMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata + * @static + * @param {google.firestore.admin.v1.RestoreDatabaseMetadata} message RestoreDatabaseMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreDatabaseMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.operationState = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; + object.database = ""; + object.backup = ""; + object.progressPercentage = null; } - if (object.snapshotTime != null) { - if (typeof object.snapshotTime !== "object") - throw TypeError(".google.firestore.admin.v1.ExportDocumentsMetadata.snapshotTime: object expected"); - message.snapshotTime = $root.google.protobuf.Timestamp.fromObject(object.snapshotTime); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.operationState != null && message.hasOwnProperty("operationState")) + object.operationState = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.operationState] === undefined ? message.operationState : $root.google.firestore.admin.v1.OperationState[message.operationState] : message.operationState; + if (message.database != null && message.hasOwnProperty("database")) + object.database = message.database; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = message.backup; + if (message.progressPercentage != null && message.hasOwnProperty("progressPercentage")) + object.progressPercentage = $root.google.firestore.admin.v1.Progress.toObject(message.progressPercentage, options); + return object; + }; + + /** + * Converts this RestoreDatabaseMetadata to JSON. + * @function toJSON + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata + * @instance + * @returns {Object.} JSON object + */ + RestoreDatabaseMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreDatabaseMetadata + * @function getTypeUrl + * @memberof google.firestore.admin.v1.RestoreDatabaseMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreDatabaseMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.firestore.admin.v1.RestoreDatabaseMetadata"; + }; + + return RestoreDatabaseMetadata; + })(); + + v1.Progress = (function() { + + /** + * Properties of a Progress. + * @memberof google.firestore.admin.v1 + * @interface IProgress + * @property {number|string|null} [estimatedWork] Progress estimatedWork + * @property {number|string|null} [completedWork] Progress completedWork + */ + + /** + * Constructs a new Progress. + * @memberof google.firestore.admin.v1 + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.firestore.admin.v1.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Progress estimatedWork. + * @member {number|string} estimatedWork + * @memberof google.firestore.admin.v1.Progress + * @instance + */ + Progress.prototype.estimatedWork = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Progress completedWork. + * @member {number|string} completedWork + * @memberof google.firestore.admin.v1.Progress + * @instance + */ + Progress.prototype.completedWork = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.Progress) + return object; + var message = new $root.google.firestore.admin.v1.Progress(); + if (object.estimatedWork != null) + if ($util.Long) + (message.estimatedWork = $util.Long.fromValue(object.estimatedWork)).unsigned = false; + else if (typeof object.estimatedWork === "string") + message.estimatedWork = parseInt(object.estimatedWork, 10); + else if (typeof object.estimatedWork === "number") + message.estimatedWork = object.estimatedWork; + else if (typeof object.estimatedWork === "object") + message.estimatedWork = new $util.LongBits(object.estimatedWork.low >>> 0, object.estimatedWork.high >>> 0).toNumber(); + if (object.completedWork != null) + if ($util.Long) + (message.completedWork = $util.Long.fromValue(object.completedWork)).unsigned = false; + else if (typeof object.completedWork === "string") + message.completedWork = parseInt(object.completedWork, 10); + else if (typeof object.completedWork === "number") + message.completedWork = object.completedWork; + else if (typeof object.completedWork === "object") + message.completedWork = new $util.LongBits(object.completedWork.low >>> 0, object.completedWork.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from an ExportDocumentsMetadata message. Also converts values to other types if specified. + * Creates a plain object from a Progress message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @memberof google.firestore.admin.v1.Progress * @static - * @param {google.firestore.admin.v1.ExportDocumentsMetadata} message ExportDocumentsMetadata + * @param {google.firestore.admin.v1.Progress} message Progress * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportDocumentsMetadata.toObject = function toObject(message, options) { + Progress.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.collectionIds = []; - object.namespaceIds = []; - } if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.operationState = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; - object.progressDocuments = null; - object.progressBytes = null; - object.outputUriPrefix = ""; - object.snapshotTime = null; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.operationState != null && message.hasOwnProperty("operationState")) - object.operationState = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.operationState] === undefined ? message.operationState : $root.google.firestore.admin.v1.OperationState[message.operationState] : message.operationState; - if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) - object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); - if (message.collectionIds && message.collectionIds.length) { - object.collectionIds = []; - for (var j = 0; j < message.collectionIds.length; ++j) - object.collectionIds[j] = message.collectionIds[j]; - } - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) - object.outputUriPrefix = message.outputUriPrefix; - if (message.namespaceIds && message.namespaceIds.length) { - object.namespaceIds = []; - for (var j = 0; j < message.namespaceIds.length; ++j) - object.namespaceIds[j] = message.namespaceIds[j]; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.estimatedWork = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.estimatedWork = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.completedWork = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.completedWork = options.longs === String ? "0" : 0; } - if (message.snapshotTime != null && message.hasOwnProperty("snapshotTime")) - object.snapshotTime = $root.google.protobuf.Timestamp.toObject(message.snapshotTime, options); + if (message.estimatedWork != null && message.hasOwnProperty("estimatedWork")) + if (typeof message.estimatedWork === "number") + object.estimatedWork = options.longs === String ? String(message.estimatedWork) : message.estimatedWork; + else + object.estimatedWork = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedWork) : options.longs === Number ? new $util.LongBits(message.estimatedWork.low >>> 0, message.estimatedWork.high >>> 0).toNumber() : message.estimatedWork; + if (message.completedWork != null && message.hasOwnProperty("completedWork")) + if (typeof message.completedWork === "number") + object.completedWork = options.longs === String ? String(message.completedWork) : message.completedWork; + else + object.completedWork = options.longs === String ? $util.Long.prototype.toString.call(message.completedWork) : options.longs === Number ? new $util.LongBits(message.completedWork.low >>> 0, message.completedWork.high >>> 0).toNumber() : message.completedWork; return object; }; /** - * Converts this ExportDocumentsMetadata to JSON. + * Converts this Progress to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @memberof google.firestore.admin.v1.Progress * @instance * @returns {Object.} JSON object */ - ExportDocumentsMetadata.prototype.toJSON = function toJSON() { + Progress.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExportDocumentsMetadata + * Gets the default type url for Progress * @function getTypeUrl - * @memberof google.firestore.admin.v1.ExportDocumentsMetadata + * @memberof google.firestore.admin.v1.Progress * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ExportDocumentsMetadata"; + return typeUrlPrefix + "/google.firestore.admin.v1.Progress"; }; - return ExportDocumentsMetadata; + return Progress; })(); - v1.ImportDocumentsMetadata = (function() { + /** + * OperationState enum. + * @name google.firestore.admin.v1.OperationState + * @enum {string} + * @property {string} OPERATION_STATE_UNSPECIFIED=OPERATION_STATE_UNSPECIFIED OPERATION_STATE_UNSPECIFIED value + * @property {string} INITIALIZING=INITIALIZING INITIALIZING value + * @property {string} PROCESSING=PROCESSING PROCESSING value + * @property {string} CANCELLING=CANCELLING CANCELLING value + * @property {string} FINALIZING=FINALIZING FINALIZING value + * @property {string} SUCCESSFUL=SUCCESSFUL SUCCESSFUL value + * @property {string} FAILED=FAILED FAILED value + * @property {string} CANCELLED=CANCELLED CANCELLED value + */ + v1.OperationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_STATE_UNSPECIFIED"] = "OPERATION_STATE_UNSPECIFIED"; + values[valuesById[1] = "INITIALIZING"] = "INITIALIZING"; + values[valuesById[2] = "PROCESSING"] = "PROCESSING"; + values[valuesById[3] = "CANCELLING"] = "CANCELLING"; + values[valuesById[4] = "FINALIZING"] = "FINALIZING"; + values[valuesById[5] = "SUCCESSFUL"] = "SUCCESSFUL"; + values[valuesById[6] = "FAILED"] = "FAILED"; + values[valuesById[7] = "CANCELLED"] = "CANCELLED"; + return values; + })(); + + v1.BackupSchedule = (function() { /** - * Properties of an ImportDocumentsMetadata. + * Properties of a BackupSchedule. * @memberof google.firestore.admin.v1 - * @interface IImportDocumentsMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] ImportDocumentsMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] ImportDocumentsMetadata endTime - * @property {google.firestore.admin.v1.OperationState|null} [operationState] ImportDocumentsMetadata operationState - * @property {google.firestore.admin.v1.IProgress|null} [progressDocuments] ImportDocumentsMetadata progressDocuments - * @property {google.firestore.admin.v1.IProgress|null} [progressBytes] ImportDocumentsMetadata progressBytes - * @property {Array.|null} [collectionIds] ImportDocumentsMetadata collectionIds - * @property {string|null} [inputUriPrefix] ImportDocumentsMetadata inputUriPrefix - * @property {Array.|null} [namespaceIds] ImportDocumentsMetadata namespaceIds + * @interface IBackupSchedule + * @property {string|null} [name] BackupSchedule name + * @property {google.protobuf.ITimestamp|null} [createTime] BackupSchedule createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupSchedule updateTime + * @property {google.protobuf.IDuration|null} [retention] BackupSchedule retention + * @property {google.firestore.admin.v1.IDailyRecurrence|null} [dailyRecurrence] BackupSchedule dailyRecurrence + * @property {google.firestore.admin.v1.IWeeklyRecurrence|null} [weeklyRecurrence] BackupSchedule weeklyRecurrence */ /** - * Constructs a new ImportDocumentsMetadata. + * Constructs a new BackupSchedule. * @memberof google.firestore.admin.v1 - * @classdesc Represents an ImportDocumentsMetadata. - * @implements IImportDocumentsMetadata + * @classdesc Represents a BackupSchedule. + * @implements IBackupSchedule * @constructor - * @param {google.firestore.admin.v1.IImportDocumentsMetadata=} [properties] Properties to set + * @param {google.firestore.admin.v1.IBackupSchedule=} [properties] Properties to set */ - function ImportDocumentsMetadata(properties) { - this.collectionIds = []; - this.namespaceIds = []; + function BackupSchedule(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5338,257 +7974,195 @@ } /** - * ImportDocumentsMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * BackupSchedule name. + * @member {string} name + * @memberof google.firestore.admin.v1.BackupSchedule * @instance */ - ImportDocumentsMetadata.prototype.startTime = null; + BackupSchedule.prototype.name = ""; /** - * ImportDocumentsMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * BackupSchedule createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.firestore.admin.v1.BackupSchedule * @instance */ - ImportDocumentsMetadata.prototype.endTime = null; + BackupSchedule.prototype.createTime = null; /** - * ImportDocumentsMetadata operationState. - * @member {google.firestore.admin.v1.OperationState} operationState - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * BackupSchedule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.firestore.admin.v1.BackupSchedule * @instance */ - ImportDocumentsMetadata.prototype.operationState = 0; + BackupSchedule.prototype.updateTime = null; /** - * ImportDocumentsMetadata progressDocuments. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressDocuments - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * BackupSchedule retention. + * @member {google.protobuf.IDuration|null|undefined} retention + * @memberof google.firestore.admin.v1.BackupSchedule * @instance */ - ImportDocumentsMetadata.prototype.progressDocuments = null; + BackupSchedule.prototype.retention = null; /** - * ImportDocumentsMetadata progressBytes. - * @member {google.firestore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * BackupSchedule dailyRecurrence. + * @member {google.firestore.admin.v1.IDailyRecurrence|null|undefined} dailyRecurrence + * @memberof google.firestore.admin.v1.BackupSchedule * @instance */ - ImportDocumentsMetadata.prototype.progressBytes = null; + BackupSchedule.prototype.dailyRecurrence = null; /** - * ImportDocumentsMetadata collectionIds. - * @member {Array.} collectionIds - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * BackupSchedule weeklyRecurrence. + * @member {google.firestore.admin.v1.IWeeklyRecurrence|null|undefined} weeklyRecurrence + * @memberof google.firestore.admin.v1.BackupSchedule * @instance */ - ImportDocumentsMetadata.prototype.collectionIds = $util.emptyArray; + BackupSchedule.prototype.weeklyRecurrence = null; - /** - * ImportDocumentsMetadata inputUriPrefix. - * @member {string} inputUriPrefix - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata - * @instance - */ - ImportDocumentsMetadata.prototype.inputUriPrefix = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ImportDocumentsMetadata namespaceIds. - * @member {Array.} namespaceIds - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * BackupSchedule recurrence. + * @member {"dailyRecurrence"|"weeklyRecurrence"|undefined} recurrence + * @memberof google.firestore.admin.v1.BackupSchedule * @instance */ - ImportDocumentsMetadata.prototype.namespaceIds = $util.emptyArray; + Object.defineProperty(BackupSchedule.prototype, "recurrence", { + get: $util.oneOfGetter($oneOfFields = ["dailyRecurrence", "weeklyRecurrence"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates an ImportDocumentsMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ImportDocumentsMetadata} ImportDocumentsMetadata - */ - ImportDocumentsMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ImportDocumentsMetadata) - return object; - var message = new $root.google.firestore.admin.v1.ImportDocumentsMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - switch (object.operationState) { - default: - if (typeof object.operationState === "number") { - message.operationState = object.operationState; - break; - } - break; - case "OPERATION_STATE_UNSPECIFIED": - case 0: - message.operationState = 0; - break; - case "INITIALIZING": - case 1: - message.operationState = 1; - break; - case "PROCESSING": - case 2: - message.operationState = 2; - break; - case "CANCELLING": - case 3: - message.operationState = 3; - break; - case "FINALIZING": - case 4: - message.operationState = 4; - break; - case "SUCCESSFUL": - case 5: - message.operationState = 5; - break; - case "FAILED": - case 6: - message.operationState = 6; - break; - case "CANCELLED": - case 7: - message.operationState = 7; - break; + * Creates a BackupSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.firestore.admin.v1.BackupSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.firestore.admin.v1.BackupSchedule} BackupSchedule + */ + BackupSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.BackupSchedule) + return object; + var message = new $root.google.firestore.admin.v1.BackupSchedule(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.firestore.admin.v1.BackupSchedule.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.progressDocuments != null) { - if (typeof object.progressDocuments !== "object") - throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.progressDocuments: object expected"); - message.progressDocuments = $root.google.firestore.admin.v1.Progress.fromObject(object.progressDocuments); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.firestore.admin.v1.BackupSchedule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.firestore.admin.v1.Progress.fromObject(object.progressBytes); + if (object.retention != null) { + if (typeof object.retention !== "object") + throw TypeError(".google.firestore.admin.v1.BackupSchedule.retention: object expected"); + message.retention = $root.google.protobuf.Duration.fromObject(object.retention); } - if (object.collectionIds) { - if (!Array.isArray(object.collectionIds)) - throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.collectionIds: array expected"); - message.collectionIds = []; - for (var i = 0; i < object.collectionIds.length; ++i) - message.collectionIds[i] = String(object.collectionIds[i]); + if (object.dailyRecurrence != null) { + if (typeof object.dailyRecurrence !== "object") + throw TypeError(".google.firestore.admin.v1.BackupSchedule.dailyRecurrence: object expected"); + message.dailyRecurrence = $root.google.firestore.admin.v1.DailyRecurrence.fromObject(object.dailyRecurrence); } - if (object.inputUriPrefix != null) - message.inputUriPrefix = String(object.inputUriPrefix); - if (object.namespaceIds) { - if (!Array.isArray(object.namespaceIds)) - throw TypeError(".google.firestore.admin.v1.ImportDocumentsMetadata.namespaceIds: array expected"); - message.namespaceIds = []; - for (var i = 0; i < object.namespaceIds.length; ++i) - message.namespaceIds[i] = String(object.namespaceIds[i]); + if (object.weeklyRecurrence != null) { + if (typeof object.weeklyRecurrence !== "object") + throw TypeError(".google.firestore.admin.v1.BackupSchedule.weeklyRecurrence: object expected"); + message.weeklyRecurrence = $root.google.firestore.admin.v1.WeeklyRecurrence.fromObject(object.weeklyRecurrence); } return message; }; /** - * Creates a plain object from an ImportDocumentsMetadata message. Also converts values to other types if specified. + * Creates a plain object from a BackupSchedule message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @memberof google.firestore.admin.v1.BackupSchedule * @static - * @param {google.firestore.admin.v1.ImportDocumentsMetadata} message ImportDocumentsMetadata + * @param {google.firestore.admin.v1.BackupSchedule} message BackupSchedule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportDocumentsMetadata.toObject = function toObject(message, options) { + BackupSchedule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.collectionIds = []; - object.namespaceIds = []; - } if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.operationState = options.enums === String ? "OPERATION_STATE_UNSPECIFIED" : 0; - object.progressDocuments = null; - object.progressBytes = null; - object.inputUriPrefix = ""; + object.name = ""; + object.createTime = null; + object.retention = null; + object.updateTime = null; } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.operationState != null && message.hasOwnProperty("operationState")) - object.operationState = options.enums === String ? $root.google.firestore.admin.v1.OperationState[message.operationState] === undefined ? message.operationState : $root.google.firestore.admin.v1.OperationState[message.operationState] : message.operationState; - if (message.progressDocuments != null && message.hasOwnProperty("progressDocuments")) - object.progressDocuments = $root.google.firestore.admin.v1.Progress.toObject(message.progressDocuments, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.firestore.admin.v1.Progress.toObject(message.progressBytes, options); - if (message.collectionIds && message.collectionIds.length) { - object.collectionIds = []; - for (var j = 0; j < message.collectionIds.length; ++j) - object.collectionIds[j] = message.collectionIds[j]; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = $root.google.protobuf.Duration.toObject(message.retention, options); + if (message.dailyRecurrence != null && message.hasOwnProperty("dailyRecurrence")) { + object.dailyRecurrence = $root.google.firestore.admin.v1.DailyRecurrence.toObject(message.dailyRecurrence, options); + if (options.oneofs) + object.recurrence = "dailyRecurrence"; } - if (message.inputUriPrefix != null && message.hasOwnProperty("inputUriPrefix")) - object.inputUriPrefix = message.inputUriPrefix; - if (message.namespaceIds && message.namespaceIds.length) { - object.namespaceIds = []; - for (var j = 0; j < message.namespaceIds.length; ++j) - object.namespaceIds[j] = message.namespaceIds[j]; + if (message.weeklyRecurrence != null && message.hasOwnProperty("weeklyRecurrence")) { + object.weeklyRecurrence = $root.google.firestore.admin.v1.WeeklyRecurrence.toObject(message.weeklyRecurrence, options); + if (options.oneofs) + object.recurrence = "weeklyRecurrence"; } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this ImportDocumentsMetadata to JSON. + * Converts this BackupSchedule to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @memberof google.firestore.admin.v1.BackupSchedule * @instance * @returns {Object.} JSON object */ - ImportDocumentsMetadata.prototype.toJSON = function toJSON() { + BackupSchedule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ImportDocumentsMetadata + * Gets the default type url for BackupSchedule * @function getTypeUrl - * @memberof google.firestore.admin.v1.ImportDocumentsMetadata + * @memberof google.firestore.admin.v1.BackupSchedule * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ImportDocumentsMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BackupSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ImportDocumentsMetadata"; + return typeUrlPrefix + "/google.firestore.admin.v1.BackupSchedule"; }; - return ImportDocumentsMetadata; + return BackupSchedule; })(); - v1.ExportDocumentsResponse = (function() { + v1.DailyRecurrence = (function() { /** - * Properties of an ExportDocumentsResponse. + * Properties of a DailyRecurrence. * @memberof google.firestore.admin.v1 - * @interface IExportDocumentsResponse - * @property {string|null} [outputUriPrefix] ExportDocumentsResponse outputUriPrefix + * @interface IDailyRecurrence */ /** - * Constructs a new ExportDocumentsResponse. + * Constructs a new DailyRecurrence. * @memberof google.firestore.admin.v1 - * @classdesc Represents an ExportDocumentsResponse. - * @implements IExportDocumentsResponse + * @classdesc Represents a DailyRecurrence. + * @implements IDailyRecurrence * @constructor - * @param {google.firestore.admin.v1.IExportDocumentsResponse=} [properties] Properties to set + * @param {google.firestore.admin.v1.IDailyRecurrence=} [properties] Properties to set */ - function ExportDocumentsResponse(properties) { + function DailyRecurrence(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5596,124 +8170,79 @@ } /** - * ExportDocumentsResponse outputUriPrefix. - * @member {string} outputUriPrefix - * @memberof google.firestore.admin.v1.ExportDocumentsResponse - * @instance - */ - ExportDocumentsResponse.prototype.outputUriPrefix = ""; - - /** - * Creates an ExportDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DailyRecurrence message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.ExportDocumentsResponse + * @memberof google.firestore.admin.v1.DailyRecurrence * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.ExportDocumentsResponse} ExportDocumentsResponse + * @returns {google.firestore.admin.v1.DailyRecurrence} DailyRecurrence */ - ExportDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.ExportDocumentsResponse) + DailyRecurrence.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.DailyRecurrence) return object; - var message = new $root.google.firestore.admin.v1.ExportDocumentsResponse(); - if (object.outputUriPrefix != null) - message.outputUriPrefix = String(object.outputUriPrefix); - return message; + return new $root.google.firestore.admin.v1.DailyRecurrence(); }; /** - * Creates a plain object from an ExportDocumentsResponse message. Also converts values to other types if specified. + * Creates a plain object from a DailyRecurrence message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.ExportDocumentsResponse + * @memberof google.firestore.admin.v1.DailyRecurrence * @static - * @param {google.firestore.admin.v1.ExportDocumentsResponse} message ExportDocumentsResponse + * @param {google.firestore.admin.v1.DailyRecurrence} message DailyRecurrence * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.outputUriPrefix = ""; - if (message.outputUriPrefix != null && message.hasOwnProperty("outputUriPrefix")) - object.outputUriPrefix = message.outputUriPrefix; - return object; + DailyRecurrence.toObject = function toObject() { + return {}; }; /** - * Converts this ExportDocumentsResponse to JSON. + * Converts this DailyRecurrence to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.ExportDocumentsResponse + * @memberof google.firestore.admin.v1.DailyRecurrence * @instance * @returns {Object.} JSON object */ - ExportDocumentsResponse.prototype.toJSON = function toJSON() { + DailyRecurrence.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExportDocumentsResponse + * Gets the default type url for DailyRecurrence * @function getTypeUrl - * @memberof google.firestore.admin.v1.ExportDocumentsResponse + * @memberof google.firestore.admin.v1.DailyRecurrence * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExportDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DailyRecurrence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.ExportDocumentsResponse"; + return typeUrlPrefix + "/google.firestore.admin.v1.DailyRecurrence"; }; - return ExportDocumentsResponse; - })(); - - /** - * OperationState enum. - * @name google.firestore.admin.v1.OperationState - * @enum {string} - * @property {string} OPERATION_STATE_UNSPECIFIED=OPERATION_STATE_UNSPECIFIED OPERATION_STATE_UNSPECIFIED value - * @property {string} INITIALIZING=INITIALIZING INITIALIZING value - * @property {string} PROCESSING=PROCESSING PROCESSING value - * @property {string} CANCELLING=CANCELLING CANCELLING value - * @property {string} FINALIZING=FINALIZING FINALIZING value - * @property {string} SUCCESSFUL=SUCCESSFUL SUCCESSFUL value - * @property {string} FAILED=FAILED FAILED value - * @property {string} CANCELLED=CANCELLED CANCELLED value - */ - v1.OperationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_STATE_UNSPECIFIED"] = "OPERATION_STATE_UNSPECIFIED"; - values[valuesById[1] = "INITIALIZING"] = "INITIALIZING"; - values[valuesById[2] = "PROCESSING"] = "PROCESSING"; - values[valuesById[3] = "CANCELLING"] = "CANCELLING"; - values[valuesById[4] = "FINALIZING"] = "FINALIZING"; - values[valuesById[5] = "SUCCESSFUL"] = "SUCCESSFUL"; - values[valuesById[6] = "FAILED"] = "FAILED"; - values[valuesById[7] = "CANCELLED"] = "CANCELLED"; - return values; + return DailyRecurrence; })(); - v1.Progress = (function() { + v1.WeeklyRecurrence = (function() { /** - * Properties of a Progress. + * Properties of a WeeklyRecurrence. * @memberof google.firestore.admin.v1 - * @interface IProgress - * @property {number|string|null} [estimatedWork] Progress estimatedWork - * @property {number|string|null} [completedWork] Progress completedWork + * @interface IWeeklyRecurrence + * @property {google.type.DayOfWeek|null} [day] WeeklyRecurrence day */ /** - * Constructs a new Progress. + * Constructs a new WeeklyRecurrence. * @memberof google.firestore.admin.v1 - * @classdesc Represents a Progress. - * @implements IProgress + * @classdesc Represents a WeeklyRecurrence. + * @implements IWeeklyRecurrence * @constructor - * @param {google.firestore.admin.v1.IProgress=} [properties] Properties to set + * @param {google.firestore.admin.v1.IWeeklyRecurrence=} [properties] Properties to set */ - function Progress(properties) { + function WeeklyRecurrence(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5721,119 +8250,115 @@ } /** - * Progress estimatedWork. - * @member {number|string} estimatedWork - * @memberof google.firestore.admin.v1.Progress - * @instance - */ - Progress.prototype.estimatedWork = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Progress completedWork. - * @member {number|string} completedWork - * @memberof google.firestore.admin.v1.Progress + * WeeklyRecurrence day. + * @member {google.type.DayOfWeek} day + * @memberof google.firestore.admin.v1.WeeklyRecurrence * @instance */ - Progress.prototype.completedWork = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + WeeklyRecurrence.prototype.day = 0; /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * Creates a WeeklyRecurrence message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.firestore.admin.v1.Progress + * @memberof google.firestore.admin.v1.WeeklyRecurrence * @static * @param {Object.} object Plain object - * @returns {google.firestore.admin.v1.Progress} Progress + * @returns {google.firestore.admin.v1.WeeklyRecurrence} WeeklyRecurrence */ - Progress.fromObject = function fromObject(object) { - if (object instanceof $root.google.firestore.admin.v1.Progress) + WeeklyRecurrence.fromObject = function fromObject(object) { + if (object instanceof $root.google.firestore.admin.v1.WeeklyRecurrence) return object; - var message = new $root.google.firestore.admin.v1.Progress(); - if (object.estimatedWork != null) - if ($util.Long) - (message.estimatedWork = $util.Long.fromValue(object.estimatedWork)).unsigned = false; - else if (typeof object.estimatedWork === "string") - message.estimatedWork = parseInt(object.estimatedWork, 10); - else if (typeof object.estimatedWork === "number") - message.estimatedWork = object.estimatedWork; - else if (typeof object.estimatedWork === "object") - message.estimatedWork = new $util.LongBits(object.estimatedWork.low >>> 0, object.estimatedWork.high >>> 0).toNumber(); - if (object.completedWork != null) - if ($util.Long) - (message.completedWork = $util.Long.fromValue(object.completedWork)).unsigned = false; - else if (typeof object.completedWork === "string") - message.completedWork = parseInt(object.completedWork, 10); - else if (typeof object.completedWork === "number") - message.completedWork = object.completedWork; - else if (typeof object.completedWork === "object") - message.completedWork = new $util.LongBits(object.completedWork.low >>> 0, object.completedWork.high >>> 0).toNumber(); + var message = new $root.google.firestore.admin.v1.WeeklyRecurrence(); + switch (object.day) { + default: + if (typeof object.day === "number") { + message.day = object.day; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.day = 0; + break; + case "MONDAY": + case 1: + message.day = 1; + break; + case "TUESDAY": + case 2: + message.day = 2; + break; + case "WEDNESDAY": + case 3: + message.day = 3; + break; + case "THURSDAY": + case 4: + message.day = 4; + break; + case "FRIDAY": + case 5: + message.day = 5; + break; + case "SATURDAY": + case 6: + message.day = 6; + break; + case "SUNDAY": + case 7: + message.day = 7; + break; + } return message; }; /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. + * Creates a plain object from a WeeklyRecurrence message. Also converts values to other types if specified. * @function toObject - * @memberof google.firestore.admin.v1.Progress + * @memberof google.firestore.admin.v1.WeeklyRecurrence * @static - * @param {google.firestore.admin.v1.Progress} message Progress + * @param {google.firestore.admin.v1.WeeklyRecurrence} message WeeklyRecurrence * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object - */ - Progress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.estimatedWork = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.estimatedWork = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.completedWork = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.completedWork = options.longs === String ? "0" : 0; - } - if (message.estimatedWork != null && message.hasOwnProperty("estimatedWork")) - if (typeof message.estimatedWork === "number") - object.estimatedWork = options.longs === String ? String(message.estimatedWork) : message.estimatedWork; - else - object.estimatedWork = options.longs === String ? $util.Long.prototype.toString.call(message.estimatedWork) : options.longs === Number ? new $util.LongBits(message.estimatedWork.low >>> 0, message.estimatedWork.high >>> 0).toNumber() : message.estimatedWork; - if (message.completedWork != null && message.hasOwnProperty("completedWork")) - if (typeof message.completedWork === "number") - object.completedWork = options.longs === String ? String(message.completedWork) : message.completedWork; - else - object.completedWork = options.longs === String ? $util.Long.prototype.toString.call(message.completedWork) : options.longs === Number ? new $util.LongBits(message.completedWork.low >>> 0, message.completedWork.high >>> 0).toNumber() : message.completedWork; + */ + WeeklyRecurrence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.day = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + if (message.day != null && message.hasOwnProperty("day")) + object.day = options.enums === String ? $root.google.type.DayOfWeek[message.day] === undefined ? message.day : $root.google.type.DayOfWeek[message.day] : message.day; return object; }; /** - * Converts this Progress to JSON. + * Converts this WeeklyRecurrence to JSON. * @function toJSON - * @memberof google.firestore.admin.v1.Progress + * @memberof google.firestore.admin.v1.WeeklyRecurrence * @instance * @returns {Object.} JSON object */ - Progress.prototype.toJSON = function toJSON() { + WeeklyRecurrence.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Progress + * Gets the default type url for WeeklyRecurrence * @function getTypeUrl - * @memberof google.firestore.admin.v1.Progress + * @memberof google.firestore.admin.v1.WeeklyRecurrence * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WeeklyRecurrence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.firestore.admin.v1.Progress"; + return typeUrlPrefix + "/google.firestore.admin.v1.WeeklyRecurrence"; }; - return Progress; + return WeeklyRecurrence; })(); v1.LocationMetadata = (function() { @@ -15687,25 +18212,25 @@ return GeneratedCodeInfo; })(); - protobuf.Duration = (function() { + protobuf.Timestamp = (function() { /** - * Properties of a Duration. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IDuration - * @property {number|string|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * @interface ITimestamp + * @property {number|string|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new Duration. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function Duration(properties) { + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15713,33 +18238,33 @@ } /** - * Duration seconds. + * Timestamp seconds. * @member {number|string} seconds - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Duration nanos. + * Timestamp nanos. * @member {number} nanos - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance */ - Duration.prototype.nanos = 0; + Timestamp.prototype.nanos = 0; /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Timestamp} Timestamp */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) return object; - var message = new $root.google.protobuf.Duration(); + var message = new $root.google.protobuf.Timestamp(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; @@ -15755,15 +18280,15 @@ }; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + Timestamp.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -15786,53 +18311,53 @@ }; /** - * Converts this Duration to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - return Duration; + return Timestamp; })(); - protobuf.Timestamp = (function() { + protobuf.Duration = (function() { /** - * Properties of a Timestamp. + * Properties of a Duration. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|string|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IDuration + * @property {number|string|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ /** - * Constructs a new Timestamp. + * Constructs a new Duration. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents a Duration. + * @implements IDuration * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - function Timestamp(properties) { + function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15840,33 +18365,33 @@ } /** - * Timestamp seconds. + * Duration seconds. * @member {number|string} seconds - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @instance */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Timestamp nanos. + * Duration nanos. * @member {number} nanos - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @instance */ - Timestamp.prototype.nanos = 0; + Duration.prototype.nanos = 0; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Duration} Duration */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) return object; - var message = new $root.google.protobuf.Timestamp(); + var message = new $root.google.protobuf.Duration(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; @@ -15882,15 +18407,15 @@ }; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.Timestamp} message Timestamp + * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -15913,32 +18438,32 @@ }; /** - * Converts this Timestamp to JSON. + * Converts this Duration to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Duration * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Duration * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return typeUrlPrefix + "/google.protobuf.Duration"; }; - return Timestamp; + return Duration; })(); protobuf.Any = (function() { @@ -17488,39 +20013,185 @@ /** * Gets the default type url for StringValue * @function getTypeUrl - * @memberof google.protobuf.StringValue + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.StringValue"; + return typeUrlPrefix + "/google.protobuf.BytesValue"; }; - return StringValue; + return BytesValue; })(); - protobuf.BytesValue = (function() { + return protobuf; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {string} + * @property {string} DAY_OF_WEEK_UNSPECIFIED=DAY_OF_WEEK_UNSPECIFIED DAY_OF_WEEK_UNSPECIFIED value + * @property {string} MONDAY=MONDAY MONDAY value + * @property {string} TUESDAY=TUESDAY TUESDAY value + * @property {string} WEDNESDAY=WEDNESDAY WEDNESDAY value + * @property {string} THURSDAY=THURSDAY THURSDAY value + * @property {string} FRIDAY=FRIDAY FRIDAY value + * @property {string} SATURDAY=SATURDAY SATURDAY value + * @property {string} SUNDAY=SUNDAY SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = "DAY_OF_WEEK_UNSPECIFIED"; + values[valuesById[1] = "MONDAY"] = "MONDAY"; + values[valuesById[2] = "TUESDAY"] = "TUESDAY"; + values[valuesById[3] = "WEDNESDAY"] = "WEDNESDAY"; + values[valuesById[4] = "THURSDAY"] = "THURSDAY"; + values[valuesById[5] = "FRIDAY"] = "FRIDAY"; + values[valuesById[6] = "SATURDAY"] = "SATURDAY"; + values[valuesById[7] = "SUNDAY"] = "SUNDAY"; + return values; + })(); + + type.LatLng = (function() { /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude */ /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @param {google.type.ILatLng=} [properties] Properties to set */ - function BytesValue(properties) { + function LatLng(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17528,89 +20199,94 @@ } /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng * @instance */ - BytesValue.prototype.value = $util.newBuffer([]); + LatLng.prototype.latitude = 0; /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.BytesValue + * @memberof google.type.LatLng * @static * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue + * @returns {google.type.LatLng} LatLng */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); return message; }; /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * Creates a plain object from a LatLng message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.BytesValue + * @memberof google.type.LatLng * @static - * @param {google.protobuf.BytesValue} message BytesValue + * @param {google.type.LatLng} message LatLng * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BytesValue.toObject = function toObject(message, options) { + LatLng.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; return object; }; /** - * Converts this BytesValue to JSON. + * Converts this LatLng to JSON. * @function toJSON - * @memberof google.protobuf.BytesValue + * @memberof google.type.LatLng * @instance * @returns {Object.} JSON object */ - BytesValue.prototype.toJSON = function toJSON() { + LatLng.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BytesValue + * Gets the default type url for LatLng * @function getTypeUrl - * @memberof google.protobuf.BytesValue + * @memberof google.type.LatLng * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.BytesValue"; + return typeUrlPrefix + "/google.type.LatLng"; }; - return BytesValue; + return LatLng; })(); - return protobuf; + return type; })(); google.longrunning = (function() { @@ -18934,131 +21610,6 @@ return rpc; })(); - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.LatLng = (function() { - - /** - * Properties of a LatLng. - * @memberof google.type - * @interface ILatLng - * @property {number|null} [latitude] LatLng latitude - * @property {number|null} [longitude] LatLng longitude - */ - - /** - * Constructs a new LatLng. - * @memberof google.type - * @classdesc Represents a LatLng. - * @implements ILatLng - * @constructor - * @param {google.type.ILatLng=} [properties] Properties to set - */ - function LatLng(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LatLng latitude. - * @member {number} latitude - * @memberof google.type.LatLng - * @instance - */ - LatLng.prototype.latitude = 0; - - /** - * LatLng longitude. - * @member {number} longitude - * @memberof google.type.LatLng - * @instance - */ - LatLng.prototype.longitude = 0; - - /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.LatLng - * @static - * @param {Object.} object Plain object - * @returns {google.type.LatLng} LatLng - */ - LatLng.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.LatLng) - return object; - var message = new $root.google.type.LatLng(); - if (object.latitude != null) - message.latitude = Number(object.latitude); - if (object.longitude != null) - message.longitude = Number(object.longitude); - return message; - }; - - /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.LatLng - * @static - * @param {google.type.LatLng} message LatLng - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LatLng.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.latitude = 0; - object.longitude = 0; - } - if (message.latitude != null && message.hasOwnProperty("latitude")) - object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; - if (message.longitude != null && message.hasOwnProperty("longitude")) - object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; - return object; - }; - - /** - * Converts this LatLng to JSON. - * @function toJSON - * @memberof google.type.LatLng - * @instance - * @returns {Object.} JSON object - */ - LatLng.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LatLng - * @function getTypeUrl - * @memberof google.type.LatLng - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.LatLng"; - }; - - return LatLng; - })(); - - return type; - })(); - return google; })(); diff --git a/dev/protos/firestore_v1_proto_api.d.ts b/dev/protos/firestore_v1_proto_api.d.ts index ad4275cca..eac3a6f12 100644 --- a/dev/protos/firestore_v1_proto_api.d.ts +++ b/dev/protos/firestore_v1_proto_api.d.ts @@ -8507,6 +8507,10 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** DayOfWeek enum. */ + type DayOfWeek = + "DAY_OF_WEEK_UNSPECIFIED"| "MONDAY"| "TUESDAY"| "WEDNESDAY"| "THURSDAY"| "FRIDAY"| "SATURDAY"| "SUNDAY"; } /** Namespace api. */ diff --git a/dev/protos/firestore_v1_proto_api.js b/dev/protos/firestore_v1_proto_api.js index fbf833365..f817f2e9a 100644 --- a/dev/protos/firestore_v1_proto_api.js +++ b/dev/protos/firestore_v1_proto_api.js @@ -20899,6 +20899,32 @@ return LatLng; })(); + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {string} + * @property {string} DAY_OF_WEEK_UNSPECIFIED=DAY_OF_WEEK_UNSPECIFIED DAY_OF_WEEK_UNSPECIFIED value + * @property {string} MONDAY=MONDAY MONDAY value + * @property {string} TUESDAY=TUESDAY TUESDAY value + * @property {string} WEDNESDAY=WEDNESDAY WEDNESDAY value + * @property {string} THURSDAY=THURSDAY THURSDAY value + * @property {string} FRIDAY=FRIDAY FRIDAY value + * @property {string} SATURDAY=SATURDAY SATURDAY value + * @property {string} SUNDAY=SUNDAY SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = "DAY_OF_WEEK_UNSPECIFIED"; + values[valuesById[1] = "MONDAY"] = "MONDAY"; + values[valuesById[2] = "TUESDAY"] = "TUESDAY"; + values[valuesById[3] = "WEDNESDAY"] = "WEDNESDAY"; + values[valuesById[4] = "THURSDAY"] = "THURSDAY"; + values[valuesById[5] = "FRIDAY"] = "FRIDAY"; + values[valuesById[6] = "SATURDAY"] = "SATURDAY"; + values[valuesById[7] = "SUNDAY"] = "SUNDAY"; + return values; + })(); + return type; })(); diff --git a/dev/protos/firestore_v1beta1_proto_api.d.ts b/dev/protos/firestore_v1beta1_proto_api.d.ts index 8aa65b67d..1a37aaa0e 100644 --- a/dev/protos/firestore_v1beta1_proto_api.d.ts +++ b/dev/protos/firestore_v1beta1_proto_api.d.ts @@ -7385,6 +7385,10 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** DayOfWeek enum. */ + type DayOfWeek = + "DAY_OF_WEEK_UNSPECIFIED"| "MONDAY"| "TUESDAY"| "WEDNESDAY"| "THURSDAY"| "FRIDAY"| "SATURDAY"| "SUNDAY"; } /** Namespace api. */ diff --git a/dev/protos/firestore_v1beta1_proto_api.js b/dev/protos/firestore_v1beta1_proto_api.js index 041d59f4d..14cdf1c2a 100644 --- a/dev/protos/firestore_v1beta1_proto_api.js +++ b/dev/protos/firestore_v1beta1_proto_api.js @@ -18288,6 +18288,32 @@ return LatLng; })(); + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {string} + * @property {string} DAY_OF_WEEK_UNSPECIFIED=DAY_OF_WEEK_UNSPECIFIED DAY_OF_WEEK_UNSPECIFIED value + * @property {string} MONDAY=MONDAY MONDAY value + * @property {string} TUESDAY=TUESDAY TUESDAY value + * @property {string} WEDNESDAY=WEDNESDAY WEDNESDAY value + * @property {string} THURSDAY=THURSDAY THURSDAY value + * @property {string} FRIDAY=FRIDAY FRIDAY value + * @property {string} SATURDAY=SATURDAY SATURDAY value + * @property {string} SUNDAY=SUNDAY SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = "DAY_OF_WEEK_UNSPECIFIED"; + values[valuesById[1] = "MONDAY"] = "MONDAY"; + values[valuesById[2] = "TUESDAY"] = "TUESDAY"; + values[valuesById[3] = "WEDNESDAY"] = "WEDNESDAY"; + values[valuesById[4] = "THURSDAY"] = "THURSDAY"; + values[valuesById[5] = "FRIDAY"] = "FRIDAY"; + values[valuesById[6] = "SATURDAY"] = "SATURDAY"; + values[valuesById[7] = "SUNDAY"] = "SUNDAY"; + return values; + })(); + return type; })(); diff --git a/dev/protos/google/firestore/admin/v1/backup.proto b/dev/protos/google/firestore/admin/v1/backup.proto new file mode 100644 index 000000000..e01f81ff8 --- /dev/null +++ b/dev/protos/google/firestore/admin/v1/backup.proto @@ -0,0 +1,107 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.firestore.admin.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; + +// A Backup of a Cloud Firestore Database. +// +// The backup contains all documents and index configurations for the given +// database at a specific point in time. +message Backup { + option (google.api.resource) = { + type: "firestore.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + }; + + // Backup specific statistics. + message Stats { + // Output only. Summation of the size of all documents and index entries in + // the backup, measured in bytes. + int64 size_bytes = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of documents contained in the backup. + int64 document_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of index entries contained in the backup. + int64 index_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Indicate the current state of the backup. + enum State { + // The state is unspecified. + STATE_UNSPECIFIED = 0; + + // The pending backup is still being created. Operations on the + // backup will be rejected in this state. + CREATING = 1; + + // The backup is complete and ready to use. + READY = 2; + + // The backup is not available at this moment. + NOT_AVAILABLE = 3; + } + + // Output only. The unique resource name of the Backup. + // + // Format is `projects/{project}/locations/{location}/backups/{backup}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the Firestore database that the backup is from. + // + // Format is `projects/{project}/databases/{database}`. + string database = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; + + // Output only. The system-generated UUID4 for the Firestore database that the + // backup is from. + string database_uid = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The backup contains an externally consistent copy of the + // database at this time. + google.protobuf.Timestamp snapshot_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this backup expires. + google.protobuf.Timestamp expire_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Statistics about the backup. + // + // This data only becomes available after the backup is fully materialized to + // secondary storage. This field will be empty till then. + Stats stats = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the backup. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/dev/protos/google/firestore/admin/v1/firestore_admin.proto b/dev/protos/google/firestore/admin/v1/firestore_admin.proto index 07cc764b5..bf6c8c451 100644 --- a/dev/protos/google/firestore/admin/v1/firestore_admin.proto +++ b/dev/protos/google/firestore/admin/v1/firestore_admin.proto @@ -20,10 +20,12 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/firestore/admin/v1/backup.proto"; import "google/firestore/admin/v1/database.proto"; import "google/firestore/admin/v1/field.proto"; import "google/firestore/admin/v1/index.proto"; import "google/firestore/admin/v1/operation.proto"; +import "google/firestore/admin/v1/schedule.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; @@ -271,6 +273,108 @@ service FirestoreAdmin { metadata_type: "DeleteDatabaseMetadata" }; } + + // Gets information about a backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all the backups. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new database by restoring from an existing backup. + // + // The new database must be in the same cloud region or multi-region location + // as the existing backup. This behaves similar to + // [FirestoreAdmin.CreateDatabase][google.firestore.admin.v1.CreateDatabase] + // except instead of creating a new empty database, a new database is created + // with the database type, index configuration, and documents from an existing + // backup. + // + // The [long-running operation][google.longrunning.Operation] can be used to + // track the progress of the restore, with the Operation's + // [metadata][google.longrunning.Operation.metadata] field type being the + // [RestoreDatabaseMetadata][google.firestore.admin.v1.RestoreDatabaseMetadata]. + // The [response][google.longrunning.Operation.response] type is the + // [Database][google.firestore.admin.v1.Database] if the restore was + // successful. The new database is not readable or writeable until the LRO has + // completed. + rpc RestoreDatabase(RestoreDatabaseRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/databases:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Database" + metadata_type: "RestoreDatabaseMetadata" + }; + } + + // Creates a backup schedule on a database. + // At most two backup schedules can be configured on a database, one daily + // backup schedule with retention up to 7 days and one weekly backup schedule + // with retention up to 14 weeks. + rpc CreateBackupSchedule(CreateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/databases/*}/backupSchedules" + body: "backup_schedule" + }; + option (google.api.method_signature) = "parent,backup_schedule"; + } + + // Gets information about a backup schedule. + rpc GetBackupSchedule(GetBackupScheduleRequest) returns (BackupSchedule) { + option (google.api.http) = { + get: "/v1/{name=projects/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List backup schedules. + rpc ListBackupSchedules(ListBackupSchedulesRequest) + returns (ListBackupSchedulesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/databases/*}/backupSchedules" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a backup schedule. + rpc UpdateBackupSchedule(UpdateBackupScheduleRequest) + returns (BackupSchedule) { + option (google.api.http) = { + patch: "/v1/{backup_schedule.name=projects/*/databases/*/backupSchedules/*}" + body: "backup_schedule" + }; + option (google.api.method_signature) = "backup_schedule,update_mask"; + } + + // Deletes a backup schedule. + rpc DeleteBackupSchedule(DeleteBackupScheduleRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/databases/*/backupSchedules/*}" + }; + option (google.api.method_signature) = "name"; + } } // A request to list the Firestore Databases in all locations for a project. @@ -378,6 +482,83 @@ message DeleteDatabaseRequest { // Metadata related to the delete database operation. message DeleteDatabaseMetadata {} +// The request for +// [FirestoreAdmin.CreateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.CreateBackupSchedule]. +message CreateBackupScheduleRequest { + // Required. The parent database. + // + // Format `projects/{project}/databases/{database}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; + + // Required. The backup schedule to create. + BackupSchedule backup_schedule = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request for +// [FirestoreAdmin.GetBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.GetBackupSchedule]. +message GetBackupScheduleRequest { + // Required. The name of the backup schedule. + // + // Format + // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/BackupSchedule" + } + ]; +} + +// The request for +// [FirestoreAdmin.UpdateBackupSchedule][google.firestore.admin.v1.FirestoreAdmin.UpdateBackupSchedule]. +message UpdateBackupScheduleRequest { + // Required. The backup schedule to update. + BackupSchedule backup_schedule = 1 [(google.api.field_behavior) = REQUIRED]; + + // The list of fields to be updated. + google.protobuf.FieldMask update_mask = 2; +} + +// The request for +// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]. +message ListBackupSchedulesRequest { + // Required. The parent database. + // + // Format is `projects/{project}/databases/{database}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + } + ]; +} + +// The response for +// [FirestoreAdmin.ListBackupSchedules][google.firestore.admin.v1.FirestoreAdmin.ListBackupSchedules]. +message ListBackupSchedulesResponse { + // List of all backup schedules. + repeated BackupSchedule backup_schedules = 1; +} + +// The request for [FirestoreAdmin.DeleteBackupSchedules][]. +message DeleteBackupScheduleRequest { + // Required. The name of backup schedule. + // + // Format + // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/BackupSchedule" + } + ]; +} + // The request for // [FirestoreAdmin.CreateIndex][google.firestore.admin.v1.FirestoreAdmin.CreateIndex]. message CreateIndexRequest { @@ -587,3 +768,98 @@ message ImportDocumentsRequest { // to include them. Each namespace in this list must be unique. repeated string namespace_ids = 4; } + +// The request for +// [FirestoreAdmin.GetBackup][google.firestore.admin.v1.FirestoreAdmin.GetBackup]. +message GetBackupRequest { + // Required. Name of the backup to fetch. + // + // Format is `projects/{project}/locations/{location}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + } + ]; +} + +// The request for +// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups]. +message ListBackupsRequest { + // Required. The location to list backups from. + // + // Format is `projects/{project}/locations/{location}`. + // Use `{location} = '-'` to list backups from all locations for the given + // project. This allows listing backups from a single location or from all + // locations. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Location" + } + ]; +} + +// The response for +// [FirestoreAdmin.ListBackups][google.firestore.admin.v1.FirestoreAdmin.ListBackups]. +message ListBackupsResponse { + // List of all backups for the project. + repeated Backup backups = 1; + + // List of locations that existing backups were not able to be fetched from. + // + // Instead of failing the entire requests when a single location is + // unreachable, this response returns a partial result set and list of + // locations unable to be reached here. The request can be retried against a + // single location to get a concrete error. + repeated string unreachable = 3; +} + +// The request for +// [FirestoreAdmin.DeleteBackup][google.firestore.admin.v1.FirestoreAdmin.DeleteBackup]. +message DeleteBackupRequest { + // Required. Name of the backup to delete. + // + // format is `projects/{project}/locations/{location}/backups/{backup}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + } + ]; +} + +// The request message for +// [FirestoreAdmin.RestoreDatabase][google.firestore.admin.v1.RestoreDatabase]. +message RestoreDatabaseRequest { + // Required. The project to restore the database in. Format is + // `projects/{project_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "firestore.googleapis.com/Database" + } + ]; + + // Required. The ID to use for the database, which will become the final + // component of the database's resource name. This database id must not be + // associated with an existing database. + // + // This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/ + // with first character a letter and the last a letter or a number. Must not + // be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + // + // "(default)" database id is also valid. + string database_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Backup to restore from. Must be from the same project as the + // parent. + // + // Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + string backup = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + } + ]; +} \ No newline at end of file diff --git a/dev/protos/google/firestore/admin/v1/operation.proto b/dev/protos/google/firestore/admin/v1/operation.proto index 31f63af37..d3d3e43e4 100644 --- a/dev/protos/google/firestore/admin/v1/operation.proto +++ b/dev/protos/google/firestore/admin/v1/operation.proto @@ -200,6 +200,43 @@ message ExportDocumentsResponse { string output_uri_prefix = 1; } +// Metadata for the [long-running operation][google.longrunning.Operation] from +// the [RestoreDatabase][google.firestore.admin.v1.RestoreDatabase] request. +message RestoreDatabaseMetadata { + // The time the restore was started. + google.protobuf.Timestamp start_time = 1; + + // The time the restore finished, unset for ongoing restores. + google.protobuf.Timestamp end_time = 2; + + // The operation state of the restore. + OperationState operation_state = 3; + + // The name of the database being restored to. + string database = 4 [(google.api.resource_reference) = { + type: "firestore.googleapis.com/Database" + }]; + + // The name of the backup restoring from. + string backup = 5 [(google.api.resource_reference) = { + type: "firestore.googleapis.com/Backup" + }]; + + // How far along the restore is as an estimated percentage of remaining time. + Progress progress_percentage = 8; +} + +// Describes the progress of the operation. +// Unit of work is generic and must be interpreted based on where +// [Progress][google.firestore.admin.v1.Progress] is used. +message Progress { + // The amount of work estimated. + int64 estimated_work = 1; + + // The amount of work completed. + int64 completed_work = 2; +} + // Describes the state of the operation. enum OperationState { // Unspecified. @@ -228,14 +265,3 @@ enum OperationState { // google.longrunning.Operations.CancelOperation. CANCELLED = 7; } - -// Describes the progress of the operation. -// Unit of work is generic and must be interpreted based on where -// [Progress][google.firestore.admin.v1.Progress] is used. -message Progress { - // The amount of work estimated. - int64 estimated_work = 1; - - // The amount of work completed. - int64 completed_work = 2; -} diff --git a/dev/protos/google/firestore/admin/v1/schedule.proto b/dev/protos/google/firestore/admin/v1/schedule.proto new file mode 100644 index 000000000..b97566e99 --- /dev/null +++ b/dev/protos/google/firestore/admin/v1/schedule.proto @@ -0,0 +1,93 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.firestore.admin.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/dayofweek.proto"; + +option csharp_namespace = "Google.Cloud.Firestore.Admin.V1"; +option go_package = "cloud.google.com/go/firestore/apiv1/admin/adminpb;adminpb"; +option java_multiple_files = true; +option java_outer_classname = "ScheduleProto"; +option java_package = "com.google.firestore.admin.v1"; +option objc_class_prefix = "GCFS"; +option php_namespace = "Google\\Cloud\\Firestore\\Admin\\V1"; +option ruby_package = "Google::Cloud::Firestore::Admin::V1"; + +// A backup schedule for a Cloud Firestore Database. +// +// This resource is owned by the database it is backing up, and is deleted along +// with the database. The actual backups are not though. +message BackupSchedule { + option (google.api.resource) = { + type: "firestore.googleapis.com/BackupSchedule" + pattern: "projects/{project}/databases/{database}/backupSchedules/{backup_schedule}" + }; + + // Output only. The unique backup schedule identifier across all locations and + // databases for the given project. + // + // This will be auto-assigned. + // + // Format is + // `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this backup schedule was created and + // effective since. + // + // No backups will be created for this schedule before this time. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp at which this backup schedule was most recently + // updated. When a backup schedule is first created, this is the same as + // create_time. + google.protobuf.Timestamp update_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // At what relative time in the future, compared to its creation time, + // the backup should be deleted, e.g. keep backups for 7 days. + google.protobuf.Duration retention = 6; + + // A oneof field to represent when backups will be taken. + oneof recurrence { + // For a schedule that runs daily at a specified time. + DailyRecurrence daily_recurrence = 7; + + // For a schedule that runs weekly on a specific day and time. + WeeklyRecurrence weekly_recurrence = 8; + } +} + +// Represent a recurring schedule that runs at a specific time every day. +// +// The time zone is UTC. +message DailyRecurrence {} + +// Represents a recurring schedule that runs on a specified day of the week. +// +// The time zone is UTC. +message WeeklyRecurrence { + // The day of week to run. + // + // DAY_OF_WEEK_UNSPECIFIED is not allowed. + google.type.DayOfWeek day = 2; +} diff --git a/dev/protos/google/type/dayofweek.proto b/dev/protos/google/type/dayofweek.proto new file mode 100644 index 000000000..4c80c62ec --- /dev/null +++ b/dev/protos/google/type/dayofweek.proto @@ -0,0 +1,50 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.type; + +option go_package = "google.golang.org/genproto/googleapis/type/dayofweek;dayofweek"; +option java_multiple_files = true; +option java_outer_classname = "DayOfWeekProto"; +option java_package = "com.google.type"; +option objc_class_prefix = "GTP"; + +// Represents a day of the week. +enum DayOfWeek { + // The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0; + + // Monday + MONDAY = 1; + + // Tuesday + TUESDAY = 2; + + // Wednesday + WEDNESDAY = 3; + + // Thursday + THURSDAY = 4; + + // Friday + FRIDAY = 5; + + // Saturday + SATURDAY = 6; + + // Sunday + SUNDAY = 7; +} diff --git a/dev/protos/v1.json b/dev/protos/v1.json index 0481fe117..f36d2f46f 100644 --- a/dev/protos/v1.json +++ b/dev/protos/v1.json @@ -3392,9 +3392,9 @@ "type": { "options": { "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "go_package": "google.golang.org/genproto/googleapis/type/dayofweek;dayofweek", "java_multiple_files": true, - "java_outer_classname": "LatLngProto", + "java_outer_classname": "DayOfWeekProto", "java_package": "com.google.type", "objc_class_prefix": "GTP" }, @@ -3410,6 +3410,18 @@ "id": 2 } } + }, + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } } } }, diff --git a/dev/protos/v1beta1.json b/dev/protos/v1beta1.json index 96b4de017..e892f5e33 100644 --- a/dev/protos/v1beta1.json +++ b/dev/protos/v1beta1.json @@ -3108,9 +3108,9 @@ "type": { "options": { "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", + "go_package": "google.golang.org/genproto/googleapis/type/dayofweek;dayofweek", "java_multiple_files": true, - "java_outer_classname": "LatLngProto", + "java_outer_classname": "DayOfWeekProto", "java_package": "com.google.type", "objc_class_prefix": "GTP" }, @@ -3126,6 +3126,18 @@ "id": 2 } } + }, + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } } } }, diff --git a/dev/src/v1/firestore_admin_client.ts b/dev/src/v1/firestore_admin_client.ts index ea3d0a329..e76412878 100644 --- a/dev/src/v1/firestore_admin_client.ts +++ b/dev/src/v1/firestore_admin_client.ts @@ -229,6 +229,12 @@ export class FirestoreAdminClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + backupSchedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/databases/{database}/backupSchedules/{backup_schedule}' + ), collectionGroupPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/databases/{database}/collectionGroups/{collection}' ), @@ -241,6 +247,9 @@ export class FirestoreAdminClient { indexPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/databases/{database}/collectionGroups/{collection}/indexes/{index}' ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), @@ -337,6 +346,12 @@ export class FirestoreAdminClient { const deleteDatabaseMetadata = protoFilesRoot.lookup( '.google.firestore.admin.v1.DeleteDatabaseMetadata' ) as gax.protobuf.Type; + const restoreDatabaseResponse = protoFilesRoot.lookup( + '.google.firestore.admin.v1.Database' + ) as gax.protobuf.Type; + const restoreDatabaseMetadata = protoFilesRoot.lookup( + '.google.firestore.admin.v1.RestoreDatabaseMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createIndex: new this._gaxModule.LongrunningDescriptor( @@ -374,6 +389,11 @@ export class FirestoreAdminClient { deleteDatabaseResponse.decode.bind(deleteDatabaseResponse), deleteDatabaseMetadata.decode.bind(deleteDatabaseMetadata) ), + restoreDatabase: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreDatabaseResponse.decode.bind(restoreDatabaseResponse), + restoreDatabaseMetadata.decode.bind(restoreDatabaseMetadata) + ), }; // Put together the default options sent with requests. @@ -440,6 +460,15 @@ export class FirestoreAdminClient { 'listDatabases', 'updateDatabase', 'deleteDatabase', + 'getBackup', + 'listBackups', + 'deleteBackup', + 'restoreDatabase', + 'createBackupSchedule', + 'getBackupSchedule', + 'listBackupSchedules', + 'updateBackupSchedule', + 'deleteBackupSchedule', ]; for (const methodName of firestoreAdminStubMethods) { const callPromise = this.firestoreAdminStub.then( @@ -855,26 +884,744 @@ export class FirestoreAdminClient { {} | null | undefined > ): void; - getDatabase( - request?: protos.google.firestore.admin.v1.IGetDatabaseRequest, + getDatabase( + request?: protos.google.firestore.admin.v1.IGetDatabaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.firestore.admin.v1.IDatabase, + | protos.google.firestore.admin.v1.IGetDatabaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IGetDatabaseRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IGetDatabaseRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getDatabase(request, options, callback); + } + /** + * List all the databases in the project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. A parent name of the form + * `projects/{project_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.ListDatabasesResponse|ListDatabasesResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.list_databases.js + * region_tag:firestore_v1_generated_FirestoreAdmin_ListDatabases_async + */ + listDatabases( + request?: protos.google.firestore.admin.v1.IListDatabasesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.firestore.admin.v1.IListDatabasesResponse, + protos.google.firestore.admin.v1.IListDatabasesRequest | undefined, + {} | undefined, + ] + >; + listDatabases( + request: protos.google.firestore.admin.v1.IListDatabasesRequest, + options: CallOptions, + callback: Callback< + protos.google.firestore.admin.v1.IListDatabasesResponse, + protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, + {} | null | undefined + > + ): void; + listDatabases( + request: protos.google.firestore.admin.v1.IListDatabasesRequest, + callback: Callback< + protos.google.firestore.admin.v1.IListDatabasesResponse, + protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, + {} | null | undefined + > + ): void; + listDatabases( + request?: protos.google.firestore.admin.v1.IListDatabasesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.firestore.admin.v1.IListDatabasesResponse, + | protos.google.firestore.admin.v1.IListDatabasesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.firestore.admin.v1.IListDatabasesResponse, + protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.firestore.admin.v1.IListDatabasesResponse, + protos.google.firestore.admin.v1.IListDatabasesRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listDatabases(request, options, callback); + } + /** + * Gets information about a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup to fetch. + * + * Format is `projects/{project}/locations/{location}/backups/{backup}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.get_backup.js + * region_tag:firestore_v1_generated_FirestoreAdmin_GetBackup_async + */ + getBackup( + request?: protos.google.firestore.admin.v1.IGetBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.firestore.admin.v1.IBackup, + protos.google.firestore.admin.v1.IGetBackupRequest | undefined, + {} | undefined, + ] + >; + getBackup( + request: protos.google.firestore.admin.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.firestore.admin.v1.IBackup, + protos.google.firestore.admin.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request: protos.google.firestore.admin.v1.IGetBackupRequest, + callback: Callback< + protos.google.firestore.admin.v1.IBackup, + protos.google.firestore.admin.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request?: protos.google.firestore.admin.v1.IGetBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.firestore.admin.v1.IBackup, + protos.google.firestore.admin.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.firestore.admin.v1.IBackup, + protos.google.firestore.admin.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.firestore.admin.v1.IBackup, + protos.google.firestore.admin.v1.IGetBackupRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getBackup(request, options, callback); + } + /** + * Lists all the backups. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The location to list backups from. + * + * Format is `projects/{project}/locations/{location}`. + * Use `{location} = '-'` to list backups from all locations for the given + * project. This allows listing backups from a single location or from all + * locations. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.ListBackupsResponse|ListBackupsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.list_backups.js + * region_tag:firestore_v1_generated_FirestoreAdmin_ListBackups_async + */ + listBackups( + request?: protos.google.firestore.admin.v1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.firestore.admin.v1.IListBackupsResponse, + protos.google.firestore.admin.v1.IListBackupsRequest | undefined, + {} | undefined, + ] + >; + listBackups( + request: protos.google.firestore.admin.v1.IListBackupsRequest, + options: CallOptions, + callback: Callback< + protos.google.firestore.admin.v1.IListBackupsResponse, + protos.google.firestore.admin.v1.IListBackupsRequest | null | undefined, + {} | null | undefined + > + ): void; + listBackups( + request: protos.google.firestore.admin.v1.IListBackupsRequest, + callback: Callback< + protos.google.firestore.admin.v1.IListBackupsResponse, + protos.google.firestore.admin.v1.IListBackupsRequest | null | undefined, + {} | null | undefined + > + ): void; + listBackups( + request?: protos.google.firestore.admin.v1.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.firestore.admin.v1.IListBackupsResponse, + | protos.google.firestore.admin.v1.IListBackupsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.firestore.admin.v1.IListBackupsResponse, + protos.google.firestore.admin.v1.IListBackupsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.firestore.admin.v1.IListBackupsResponse, + protos.google.firestore.admin.v1.IListBackupsRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listBackups(request, options, callback); + } + /** + * Deletes a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup to delete. + * + * format is `projects/{project}/locations/{location}/backups/{backup}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.delete_backup.js + * region_tag:firestore_v1_generated_FirestoreAdmin_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.firestore.admin.v1.IDeleteBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.firestore.admin.v1.IDeleteBackupRequest | undefined, + {} | undefined, + ] + >; + deleteBackup( + request: protos.google.firestore.admin.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.firestore.admin.v1.IDeleteBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request: protos.google.firestore.admin.v1.IDeleteBackupRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.firestore.admin.v1.IDeleteBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request?: protos.google.firestore.admin.v1.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.firestore.admin.v1.IDeleteBackupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.firestore.admin.v1.IDeleteBackupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.firestore.admin.v1.IDeleteBackupRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } + /** + * Creates a backup schedule on a database. + * At most two backup schedules can be configured on a database, one daily + * backup schedule with retention up to 7 days and one weekly backup schedule + * with retention up to 14 weeks. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent database. + * + * Format `projects/{project}/databases/{database}` + * @param {google.firestore.admin.v1.BackupSchedule} request.backupSchedule + * Required. The backup schedule to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.BackupSchedule|BackupSchedule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.create_backup_schedule.js + * region_tag:firestore_v1_generated_FirestoreAdmin_CreateBackupSchedule_async + */ + createBackupSchedule( + request?: protos.google.firestore.admin.v1.ICreateBackupScheduleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.firestore.admin.v1.IBackupSchedule, + protos.google.firestore.admin.v1.ICreateBackupScheduleRequest | undefined, + {} | undefined, + ] + >; + createBackupSchedule( + request: protos.google.firestore.admin.v1.ICreateBackupScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.ICreateBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBackupSchedule( + request: protos.google.firestore.admin.v1.ICreateBackupScheduleRequest, + callback: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.ICreateBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createBackupSchedule( + request?: protos.google.firestore.admin.v1.ICreateBackupScheduleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.ICreateBackupScheduleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.ICreateBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.firestore.admin.v1.IBackupSchedule, + protos.google.firestore.admin.v1.ICreateBackupScheduleRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createBackupSchedule(request, options, callback); + } + /** + * Gets information about a backup schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the backup schedule. + * + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.BackupSchedule|BackupSchedule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.get_backup_schedule.js + * region_tag:firestore_v1_generated_FirestoreAdmin_GetBackupSchedule_async + */ + getBackupSchedule( + request?: protos.google.firestore.admin.v1.IGetBackupScheduleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.firestore.admin.v1.IBackupSchedule, + protos.google.firestore.admin.v1.IGetBackupScheduleRequest | undefined, + {} | undefined, + ] + >; + getBackupSchedule( + request: protos.google.firestore.admin.v1.IGetBackupScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IGetBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBackupSchedule( + request: protos.google.firestore.admin.v1.IGetBackupScheduleRequest, + callback: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IGetBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBackupSchedule( + request?: protos.google.firestore.admin.v1.IGetBackupScheduleRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IGetBackupScheduleRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IGetBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.firestore.admin.v1.IBackupSchedule, + protos.google.firestore.admin.v1.IGetBackupScheduleRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getBackupSchedule(request, options, callback); + } + /** + * List backup schedules. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent database. + * + * Format is `projects/{project}/databases/{database}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.ListBackupSchedulesResponse|ListBackupSchedulesResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.list_backup_schedules.js + * region_tag:firestore_v1_generated_FirestoreAdmin_ListBackupSchedules_async + */ + listBackupSchedules( + request?: protos.google.firestore.admin.v1.IListBackupSchedulesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.firestore.admin.v1.IListBackupSchedulesResponse, + protos.google.firestore.admin.v1.IListBackupSchedulesRequest | undefined, + {} | undefined, + ] + >; + listBackupSchedules( + request: protos.google.firestore.admin.v1.IListBackupSchedulesRequest, + options: CallOptions, + callback: Callback< + protos.google.firestore.admin.v1.IListBackupSchedulesResponse, + | protos.google.firestore.admin.v1.IListBackupSchedulesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listBackupSchedules( + request: protos.google.firestore.admin.v1.IListBackupSchedulesRequest, + callback: Callback< + protos.google.firestore.admin.v1.IListBackupSchedulesResponse, + | protos.google.firestore.admin.v1.IListBackupSchedulesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + listBackupSchedules( + request?: protos.google.firestore.admin.v1.IListBackupSchedulesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.firestore.admin.v1.IListBackupSchedulesResponse, + | protos.google.firestore.admin.v1.IListBackupSchedulesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.firestore.admin.v1.IListBackupSchedulesResponse, + | protos.google.firestore.admin.v1.IListBackupSchedulesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.firestore.admin.v1.IListBackupSchedulesResponse, + protos.google.firestore.admin.v1.IListBackupSchedulesRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listBackupSchedules(request, options, callback); + } + /** + * Updates a backup schedule. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.firestore.admin.v1.BackupSchedule} request.backupSchedule + * Required. The backup schedule to update. + * @param {google.protobuf.FieldMask} request.updateMask + * The list of fields to be updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.BackupSchedule|BackupSchedule}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.update_backup_schedule.js + * region_tag:firestore_v1_generated_FirestoreAdmin_UpdateBackupSchedule_async + */ + updateBackupSchedule( + request?: protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest, + options?: CallOptions + ): Promise< + [ + protos.google.firestore.admin.v1.IBackupSchedule, + protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest | undefined, + {} | undefined, + ] + >; + updateBackupSchedule( + request: protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest, + options: CallOptions, + callback: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBackupSchedule( + request: protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest, + callback: Callback< + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateBackupSchedule( + request?: protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.firestore.admin.v1.IDatabase, - | protos.google.firestore.admin.v1.IGetDatabaseRequest + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IGetDatabaseRequest | null | undefined, + protos.google.firestore.admin.v1.IBackupSchedule, + | protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest + | null + | undefined, {} | null | undefined > ): Promise< [ - protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IGetDatabaseRequest | undefined, + protos.google.firestore.admin.v1.IBackupSchedule, + protos.google.firestore.admin.v1.IUpdateBackupScheduleRequest | undefined, {} | undefined, ] > | void { @@ -891,75 +1638,83 @@ export class FirestoreAdminClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + 'backup_schedule.name': request.backupSchedule!.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDatabase(request, options, callback); + return this.innerApiCalls.updateBackupSchedule(request, options, callback); } /** - * List all the databases in the project. + * Deletes a backup schedule. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. A parent name of the form - * `projects/{project_id}` + * @param {string} request.name + * Required. The name of backup schedule. + * + * Format + * `projects/{project}/databases/{database}/backupSchedules/{backup_schedule}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.firestore.admin.v1.ListDatabasesResponse|ListDatabasesResponse}. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/firestore_admin.list_databases.js - * region_tag:firestore_v1_generated_FirestoreAdmin_ListDatabases_async + * @example include:samples/generated/v1/firestore_admin.delete_backup_schedule.js + * region_tag:firestore_v1_generated_FirestoreAdmin_DeleteBackupSchedule_async */ - listDatabases( - request?: protos.google.firestore.admin.v1.IListDatabasesRequest, + deleteBackupSchedule( + request?: protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest, options?: CallOptions ): Promise< [ - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | undefined, + protos.google.protobuf.IEmpty, + protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest | undefined, {} | undefined, ] >; - listDatabases( - request: protos.google.firestore.admin.v1.IListDatabasesRequest, + deleteBackupSchedule( + request: protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest, options: CallOptions, callback: Callback< - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, + protos.google.protobuf.IEmpty, + | protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest + | null + | undefined, {} | null | undefined > ): void; - listDatabases( - request: protos.google.firestore.admin.v1.IListDatabasesRequest, + deleteBackupSchedule( + request: protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest, callback: Callback< - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, + protos.google.protobuf.IEmpty, + | protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest + | null + | undefined, {} | null | undefined > ): void; - listDatabases( - request?: protos.google.firestore.admin.v1.IListDatabasesRequest, + deleteBackupSchedule( + request?: protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest, optionsOrCallback?: | CallOptions | Callback< - protos.google.firestore.admin.v1.IListDatabasesResponse, - | protos.google.firestore.admin.v1.IListDatabasesRequest + protos.google.protobuf.IEmpty, + | protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest | null | undefined, {} | null | undefined >, callback?: Callback< - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | null | undefined, + protos.google.protobuf.IEmpty, + | protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest + | null + | undefined, {} | null | undefined > ): Promise< [ - protos.google.firestore.admin.v1.IListDatabasesResponse, - protos.google.firestore.admin.v1.IListDatabasesRequest | undefined, + protos.google.protobuf.IEmpty, + protos.google.firestore.admin.v1.IDeleteBackupScheduleRequest | undefined, {} | undefined, ] > | void { @@ -976,10 +1731,10 @@ export class FirestoreAdminClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.listDatabases(request, options, callback); + return this.innerApiCalls.deleteBackupSchedule(request, options, callback); } /** @@ -2036,6 +2791,174 @@ export class FirestoreAdminClient { protos.google.firestore.admin.v1.DeleteDatabaseMetadata >; } + /** + * Creates a new database by restoring from an existing backup. + * + * The new database must be in the same cloud region or multi-region location + * as the existing backup. This behaves similar to + * {@link protos.google.firestore.admin.v1.CreateDatabase|FirestoreAdmin.CreateDatabase} + * except instead of creating a new empty database, a new database is created + * with the database type, index configuration, and documents from an existing + * backup. + * + * The {@link protos.google.longrunning.Operation|long-running operation} can be used to + * track the progress of the restore, with the Operation's + * {@link protos.google.longrunning.Operation.metadata|metadata} field type being the + * {@link protos.google.firestore.admin.v1.RestoreDatabaseMetadata|RestoreDatabaseMetadata}. + * The {@link protos.google.longrunning.Operation.response|response} type is the + * {@link protos.google.firestore.admin.v1.Database|Database} if the restore was + * successful. The new database is not readable or writeable until the LRO has + * completed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to restore the database in. Format is + * `projects/{project_id}`. + * @param {string} request.databaseId + * Required. The ID to use for the database, which will become the final + * component of the database's resource name. This database id must not be + * associated with an existing database. + * + * This value should be 4-63 characters. Valid characters are /{@link protos.0-9|a-z}-/ + * with first character a letter and the last a letter or a number. Must not + * be UUID-like /[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}/. + * + * "(default)" database id is also valid. + * @param {string} request.backup + * Required. Backup to restore from. Must be from the same project as the + * parent. + * + * Format is: `projects/{project_id}/locations/{location}/backups/{backup}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.restore_database.js + * region_tag:firestore_v1_generated_FirestoreAdmin_RestoreDatabase_async + */ + restoreDatabase( + request?: protos.google.firestore.admin.v1.IRestoreDatabaseRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + restoreDatabase( + request: protos.google.firestore.admin.v1.IRestoreDatabaseRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreDatabase( + request: protos.google.firestore.admin.v1.IRestoreDatabaseRequest, + callback: Callback< + LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreDatabase( + request?: protos.google.firestore.admin.v1.IRestoreDatabaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.restoreDatabase(request, options, callback); + } + /** + * Check the status of the long running operation returned by `restoreDatabase()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/firestore_admin.restore_database.js + * region_tag:firestore_v1_generated_FirestoreAdmin_RestoreDatabase_async + */ + async checkRestoreDatabaseProgress( + name: string + ): Promise< + LROperation< + protos.google.firestore.admin.v1.Database, + protos.google.firestore.admin.v1.RestoreDatabaseMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.restoreDatabase, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.firestore.admin.v1.Database, + protos.google.firestore.admin.v1.RestoreDatabaseMetadata + >; + } /** * Lists composite indexes. * @@ -2706,6 +3629,114 @@ export class FirestoreAdminClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project: string, location: string, backup: string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified backupSchedule resource name string. + * + * @param {string} project + * @param {string} database + * @param {string} backup_schedule + * @returns {string} Resource name string. + */ + backupSchedulePath( + project: string, + database: string, + backupSchedule: string + ) { + return this.pathTemplates.backupSchedulePathTemplate.render({ + project: project, + database: database, + backup_schedule: backupSchedule, + }); + } + + /** + * Parse the project from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match( + backupScheduleName + ).project; + } + + /** + * Parse the database from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the database. + */ + matchDatabaseFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match( + backupScheduleName + ).database; + } + + /** + * Parse the backup_schedule from BackupSchedule resource. + * + * @param {string} backupScheduleName + * A fully-qualified path representing BackupSchedule resource. + * @returns {string} A string representing the backup_schedule. + */ + matchBackupScheduleFromBackupScheduleName(backupScheduleName: string) { + return this.pathTemplates.backupSchedulePathTemplate.match( + backupScheduleName + ).backup_schedule; + } + /** * Return a fully-qualified collectionGroup resource name string. * @@ -2931,6 +3962,42 @@ export class FirestoreAdminClient { return this.pathTemplates.indexPathTemplate.match(indexName).index; } + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + /** * Return a fully-qualified project resource name string. * diff --git a/dev/src/v1/firestore_admin_client_config.json b/dev/src/v1/firestore_admin_client_config.json index e434c90c7..e264ab5cf 100644 --- a/dev/src/v1/firestore_admin_client_config.json +++ b/dev/src/v1/firestore_admin_client_config.json @@ -89,6 +89,42 @@ "DeleteDatabase": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "GetBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreDatabase": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupSchedules": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackupSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupSchedule": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/dev/src/v1/firestore_admin_proto_list.json b/dev/src/v1/firestore_admin_proto_list.json index 11c6963e5..eaf3273a7 100644 --- a/dev/src/v1/firestore_admin_proto_list.json +++ b/dev/src/v1/firestore_admin_proto_list.json @@ -1,8 +1,10 @@ [ + "../../protos/google/firestore/admin/v1/backup.proto", "../../protos/google/firestore/admin/v1/database.proto", "../../protos/google/firestore/admin/v1/field.proto", "../../protos/google/firestore/admin/v1/firestore_admin.proto", "../../protos/google/firestore/admin/v1/index.proto", "../../protos/google/firestore/admin/v1/location.proto", - "../../protos/google/firestore/admin/v1/operation.proto" + "../../protos/google/firestore/admin/v1/operation.proto", + "../../protos/google/firestore/admin/v1/schedule.proto" ] diff --git a/dev/test/gapic_firestore_admin_v1.ts b/dev/test/gapic_firestore_admin_v1.ts index 1fcfaf151..1d0d45ab2 100644 --- a/dev/test/gapic_firestore_admin_v1.ts +++ b/dev/test/gapic_firestore_admin_v1.ts @@ -954,6 +954,1051 @@ describe('v1.FirestoreAdminClient', () => { }); }); + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.Backup() + ); + client.innerApiCalls.getBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + ( + err?: Error | null, + result?: protos.google.firestore.admin.v1.IBackup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupsResponse() + ); + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupsResponse() + ); + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.firestore.admin.v1.IListBackupsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listBackups(request), expectedError); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackup = stubSimpleCall(expectedResponse); + const [response] = await client.deleteBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteBackup(request), expectedError); + }); + }); + + describe('createBackupSchedule', () => { + it('invokes createBackupSchedule without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.CreateBackupScheduleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.BackupSchedule() + ); + client.innerApiCalls.createBackupSchedule = + stubSimpleCall(expectedResponse); + const [response] = await client.createBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupSchedule without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.CreateBackupScheduleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.BackupSchedule() + ); + client.innerApiCalls.createBackupSchedule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupSchedule( + request, + ( + err?: Error | null, + result?: protos.google.firestore.admin.v1.IBackupSchedule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupSchedule with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.CreateBackupScheduleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupSchedule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackupSchedule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupSchedule with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.CreateBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.CreateBackupScheduleRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createBackupSchedule(request), expectedError); + }); + }); + + describe('getBackupSchedule', () => { + it('invokes getBackupSchedule without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.BackupSchedule() + ); + client.innerApiCalls.getBackupSchedule = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupSchedule without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.BackupSchedule() + ); + client.innerApiCalls.getBackupSchedule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupSchedule( + request, + ( + err?: Error | null, + result?: protos.google.firestore.admin.v1.IBackupSchedule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupSchedule with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupSchedule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBackupSchedule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupSchedule with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.GetBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.GetBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackupSchedule(request), expectedError); + }); + }); + + describe('listBackupSchedules', () => { + it('invokes listBackupSchedules without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupSchedulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupSchedulesResponse() + ); + client.innerApiCalls.listBackupSchedules = + stubSimpleCall(expectedResponse); + const [response] = await client.listBackupSchedules(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackupSchedules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupSchedules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupSchedules without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupSchedulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupSchedulesResponse() + ); + client.innerApiCalls.listBackupSchedules = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupSchedules( + request, + ( + err?: Error | null, + result?: protos.google.firestore.admin.v1.IListBackupSchedulesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackupSchedules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupSchedules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupSchedules with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupSchedulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupSchedules = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackupSchedules(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBackupSchedules as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupSchedules as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupSchedules with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.ListBackupSchedulesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.ListBackupSchedulesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.listBackupSchedules(request), expectedError); + }); + }); + + describe('updateBackupSchedule', () => { + it('invokes updateBackupSchedule without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.UpdateBackupScheduleRequest', + ['backupSchedule', 'name'] + ); + request.backupSchedule.name = defaultValue1; + const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.BackupSchedule() + ); + client.innerApiCalls.updateBackupSchedule = + stubSimpleCall(expectedResponse); + const [response] = await client.updateBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupSchedule without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.UpdateBackupScheduleRequest', + ['backupSchedule', 'name'] + ); + request.backupSchedule.name = defaultValue1; + const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.firestore.admin.v1.BackupSchedule() + ); + client.innerApiCalls.updateBackupSchedule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackupSchedule( + request, + ( + err?: Error | null, + result?: protos.google.firestore.admin.v1.IBackupSchedule | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupSchedule with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.UpdateBackupScheduleRequest', + ['backupSchedule', 'name'] + ); + request.backupSchedule.name = defaultValue1; + const expectedHeaderRequestParams = `backup_schedule.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupSchedule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackupSchedule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupSchedule with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.UpdateBackupScheduleRequest() + ); + request.backupSchedule ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.UpdateBackupScheduleRequest', + ['backupSchedule', 'name'] + ); + request.backupSchedule.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateBackupSchedule(request), expectedError); + }); + }); + + describe('deleteBackupSchedule', () => { + it('invokes deleteBackupSchedule without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackupSchedule = + stubSimpleCall(expectedResponse); + const [response] = await client.deleteBackupSchedule(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupSchedule without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteBackupSchedule = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupSchedule( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupSchedule with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupSchedule = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackupSchedule(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupSchedule as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupSchedule as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupSchedule with closed client', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteBackupScheduleRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteBackupScheduleRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteBackupSchedule(request), expectedError); + }); + }); + describe('createIndex', () => { it('invokes createIndex without error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ @@ -1955,35 +3000,231 @@ describe('v1.FirestoreAdminClient', () => { assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateDatabase without error using callback', async () => { + it('invokes updateDatabase without error using callback', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.UpdateDatabaseRequest() + ); + request.database ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.UpdateDatabaseRequest', + ['database', 'name'] + ); + request.database.name = defaultValue1; + const expectedHeaderRequestParams = `database.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDatabase = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDatabase( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IUpdateDatabaseMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.firestore.admin.v1.IDatabase, + protos.google.firestore.admin.v1.IUpdateDatabaseMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDatabase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDatabase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabase with call error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.UpdateDatabaseRequest() + ); + request.database ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.UpdateDatabaseRequest', + ['database', 'name'] + ); + request.database.name = defaultValue1; + const expectedHeaderRequestParams = `database.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatabase = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDatabase(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDatabase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDatabase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDatabase with LRO error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.UpdateDatabaseRequest() + ); + request.database ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.UpdateDatabaseRequest', + ['database', 'name'] + ); + request.database.name = defaultValue1; + const expectedHeaderRequestParams = `database.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDatabase = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDatabase(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDatabase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDatabase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDatabaseProgress without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDatabaseProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDatabaseProgress with error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateDatabaseProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDatabase', () => { + it('invokes deleteDatabase without error', async () => { + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.firestore.admin.v1.DeleteDatabaseRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.firestore.admin.v1.DeleteDatabaseRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDatabase = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteDatabase(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDatabase as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDatabase as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDatabase without error using callback', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.firestore.admin.v1.UpdateDatabaseRequest() + new protos.google.firestore.admin.v1.DeleteDatabaseRequest() ); - request.database ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.firestore.admin.v1.UpdateDatabaseRequest', - ['database', 'name'] + '.google.firestore.admin.v1.DeleteDatabaseRequest', + ['name'] ); - request.database.name = defaultValue1; - const expectedHeaderRequestParams = `database.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateDatabase = + client.innerApiCalls.deleteDatabase = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateDatabase( + client.deleteDatabase( request, ( err?: Error | null, result?: LROperation< protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IUpdateDatabaseMetadata + protos.google.firestore.admin.v1.IDeleteDatabaseMetadata > | null ) => { if (err) { @@ -1996,87 +3237,85 @@ describe('v1.FirestoreAdminClient', () => { }); const operation = (await promise) as LROperation< protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IUpdateDatabaseMetadata + protos.google.firestore.admin.v1.IDeleteDatabaseMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateDatabase as SinonStub + client.innerApiCalls.deleteDatabase as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateDatabase as SinonStub + client.innerApiCalls.deleteDatabase as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateDatabase with call error', async () => { + it('invokes deleteDatabase with call error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.firestore.admin.v1.UpdateDatabaseRequest() + new protos.google.firestore.admin.v1.DeleteDatabaseRequest() ); - request.database ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.firestore.admin.v1.UpdateDatabaseRequest', - ['database', 'name'] + '.google.firestore.admin.v1.DeleteDatabaseRequest', + ['name'] ); - request.database.name = defaultValue1; - const expectedHeaderRequestParams = `database.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateDatabase = stubLongRunningCall( + client.innerApiCalls.deleteDatabase = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateDatabase(request), expectedError); + await assert.rejects(client.deleteDatabase(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateDatabase as SinonStub + client.innerApiCalls.deleteDatabase as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateDatabase as SinonStub + client.innerApiCalls.deleteDatabase as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateDatabase with LRO error', async () => { + it('invokes deleteDatabase with LRO error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.firestore.admin.v1.UpdateDatabaseRequest() + new protos.google.firestore.admin.v1.DeleteDatabaseRequest() ); - request.database ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.firestore.admin.v1.UpdateDatabaseRequest', - ['database', 'name'] + '.google.firestore.admin.v1.DeleteDatabaseRequest', + ['name'] ); - request.database.name = defaultValue1; - const expectedHeaderRequestParams = `database.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateDatabase = stubLongRunningCall( + client.innerApiCalls.deleteDatabase = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateDatabase(request); + const [operation] = await client.deleteDatabase(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateDatabase as SinonStub + client.innerApiCalls.deleteDatabase as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateDatabase as SinonStub + client.innerApiCalls.deleteDatabase as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateDatabaseProgress without error', async () => { + it('invokes checkDeleteDatabaseProgress without error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2090,7 +3329,7 @@ describe('v1.FirestoreAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateDatabaseProgress( + const decodedOperation = await client.checkDeleteDatabaseProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2098,7 +3337,7 @@ describe('v1.FirestoreAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateDatabaseProgress with error', async () => { + it('invokes checkDeleteDatabaseProgress with error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2111,75 +3350,75 @@ describe('v1.FirestoreAdminClient', () => { expectedError ); await assert.rejects( - client.checkUpdateDatabaseProgress(''), + client.checkDeleteDatabaseProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteDatabase', () => { - it('invokes deleteDatabase without error', async () => { + describe('restoreDatabase', () => { + it('invokes restoreDatabase without error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.firestore.admin.v1.DeleteDatabaseRequest() + new protos.google.firestore.admin.v1.RestoreDatabaseRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.firestore.admin.v1.DeleteDatabaseRequest', - ['name'] + '.google.firestore.admin.v1.RestoreDatabaseRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteDatabase = + client.innerApiCalls.restoreDatabase = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteDatabase(request); + const [operation] = await client.restoreDatabase(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteDatabase without error using callback', async () => { + it('invokes restoreDatabase without error using callback', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.firestore.admin.v1.DeleteDatabaseRequest() + new protos.google.firestore.admin.v1.RestoreDatabaseRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.firestore.admin.v1.DeleteDatabaseRequest', - ['name'] + '.google.firestore.admin.v1.RestoreDatabaseRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteDatabase = + client.innerApiCalls.restoreDatabase = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteDatabase( + client.restoreDatabase( request, ( err?: Error | null, result?: LROperation< protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IDeleteDatabaseMetadata + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata > | null ) => { if (err) { @@ -2192,85 +3431,85 @@ describe('v1.FirestoreAdminClient', () => { }); const operation = (await promise) as LROperation< protos.google.firestore.admin.v1.IDatabase, - protos.google.firestore.admin.v1.IDeleteDatabaseMetadata + protos.google.firestore.admin.v1.IRestoreDatabaseMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteDatabase with call error', async () => { + it('invokes restoreDatabase with call error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.firestore.admin.v1.DeleteDatabaseRequest() + new protos.google.firestore.admin.v1.RestoreDatabaseRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.firestore.admin.v1.DeleteDatabaseRequest', - ['name'] + '.google.firestore.admin.v1.RestoreDatabaseRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteDatabase = stubLongRunningCall( + client.innerApiCalls.restoreDatabase = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteDatabase(request), expectedError); + await assert.rejects(client.restoreDatabase(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteDatabase with LRO error', async () => { + it('invokes restoreDatabase with LRO error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.firestore.admin.v1.DeleteDatabaseRequest() + new protos.google.firestore.admin.v1.RestoreDatabaseRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.firestore.admin.v1.DeleteDatabaseRequest', - ['name'] + '.google.firestore.admin.v1.RestoreDatabaseRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteDatabase = stubLongRunningCall( + client.innerApiCalls.restoreDatabase = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteDatabase(request); + const [operation] = await client.restoreDatabase(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteDatabase as SinonStub + client.innerApiCalls.restoreDatabase as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteDatabaseProgress without error', async () => { + it('invokes checkRestoreDatabaseProgress without error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2284,7 +3523,7 @@ describe('v1.FirestoreAdminClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteDatabaseProgress( + const decodedOperation = await client.checkRestoreDatabaseProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -2292,7 +3531,7 @@ describe('v1.FirestoreAdminClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteDatabaseProgress with error', async () => { + it('invokes checkRestoreDatabaseProgress with error', async () => { const client = new firestoreadminModule.FirestoreAdminClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -2305,7 +3544,7 @@ describe('v1.FirestoreAdminClient', () => { expectedError ); await assert.rejects( - client.checkDeleteDatabaseProgress(''), + client.checkRestoreDatabaseProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); @@ -3426,6 +4665,135 @@ describe('v1.FirestoreAdminClient', () => { }); describe('Path templates', () => { + describe('backup', () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup: 'backupValue', + }; + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath( + 'projectValue', + 'locationValue', + 'backupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, 'backupValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('backupSchedule', () => { + const fakePath = '/rendered/path/backupSchedule'; + const expectedParameters = { + project: 'projectValue', + database: 'databaseValue', + backup_schedule: 'backupScheduleValue', + }; + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupSchedulePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupSchedulePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupSchedulePath', () => { + const result = client.backupSchedulePath( + 'projectValue', + 'databaseValue', + 'backupScheduleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupSchedulePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupScheduleName', () => { + const result = client.matchProjectFromBackupScheduleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatabaseFromBackupScheduleName', () => { + const result = client.matchDatabaseFromBackupScheduleName(fakePath); + assert.strictEqual(result, 'databaseValue'); + assert( + (client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupScheduleFromBackupScheduleName', () => { + const result = + client.matchBackupScheduleFromBackupScheduleName(fakePath); + assert.strictEqual(result, 'backupScheduleValue'); + assert( + (client.pathTemplates.backupSchedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('collectionGroup', () => { const fakePath = '/rendered/path/collectionGroup'; const expectedParameters = { @@ -3691,6 +5059,55 @@ describe('v1.FirestoreAdminClient', () => { }); }); + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new firestoreadminModule.FirestoreAdminClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('project', () => { const fakePath = '/rendered/path/project'; const expectedParameters = {