diff --git a/packages/google-cloud-backupdr/README.md b/packages/google-cloud-backupdr/README.md index 3b6f181ce15..ece189b44ea 100644 --- a/packages/google-cloud-backupdr/README.md +++ b/packages/google-cloud-backupdr/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Backup and DR Service API API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -120,10 +120,40 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Backup_d_r.abandon_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.create_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.create_backup_plan_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.create_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.create_management_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup_plan_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.delete_management_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.fetch_access_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.fetch_usable_backup_vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.finalize_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup_plan_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.get_management_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.initiate_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backup_plan_associations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backup_plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backup_vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_data_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.list_management_servers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.remove_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.restore_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.set_internal_status | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.trigger_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.update_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.update_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js,packages/google-cloud-backupdr/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/quickstart.js,packages/google-cloud-backupdr/samples/README.md) | @@ -194,4 +224,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=backupdr.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto index 42b798458b1..d5ae643d6ff 100644 --- a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto @@ -19,7 +19,11 @@ package google.cloud.backupdr.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupplan.proto"; +import "google/cloud/backupdr/v1/backupplanassociation.proto"; +import "google/cloud/backupdr/v1/backupvault.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; @@ -84,6 +88,266 @@ service BackupDR { metadata_type: "OperationMetadata" }; } + + // Creates a new BackupVault in a given project and location. + rpc CreateBackupVault(CreateBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupVaults" + body: "backup_vault" + }; + option (google.api.method_signature) = + "parent,backup_vault,backup_vault_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupVault" + metadata_type: "OperationMetadata" + }; + } + + // Lists BackupVaults in a given project and location. + rpc ListBackupVaults(ListBackupVaultsRequest) + returns (ListBackupVaultsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupVaults" + }; + option (google.api.method_signature) = "parent"; + } + + // FetchUsableBackupVaults lists usable BackupVaults in a given project and + // location. Usable BackupVault are the ones that user has + // backupdr.backupVaults.get permission. + rpc FetchUsableBackupVaults(FetchUsableBackupVaultsRequest) + returns (FetchUsableBackupVaultsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a BackupVault. + rpc GetBackupVault(GetBackupVaultRequest) returns (BackupVault) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a BackupVault. + rpc UpdateBackupVault(UpdateBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}" + body: "backup_vault" + }; + option (google.api.method_signature) = "backup_vault,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "BackupVault" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a BackupVault. + rpc DeleteBackupVault(DeleteBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupVaults/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists DataSources in a given project and location. + rpc ListDataSources(ListDataSourcesRequest) + returns (ListDataSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a DataSource. + rpc GetDataSource(GetDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a DataSource. + rpc UpdateDataSource(UpdateDataSourceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}" + body: "data_source" + }; + option (google.api.method_signature) = "data_source,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DataSource" + metadata_type: "OperationMetadata" + }; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Restore from a Backup + rpc RestoreBackup(RestoreBackupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "RestoreBackupResponse" + metadata_type: "OperationMetadata" + }; + } + + // Create a BackupPlan + rpc CreateBackupPlan(CreateBackupPlanRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupPlans" + body: "backup_plan" + }; + option (google.api.method_signature) = "parent,backup_plan,backup_plan_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlan" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single BackupPlan. + rpc GetBackupPlan(GetBackupPlanRequest) returns (BackupPlan) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlans/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BackupPlans in a given project and location. + rpc ListBackupPlans(ListBackupPlansRequest) + returns (ListBackupPlansResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlans" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single BackupPlan. + rpc DeleteBackupPlan(DeleteBackupPlanRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupPlans/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Create a BackupPlanAssociation + rpc CreateBackupPlanAssociation(CreateBackupPlanAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + body: "backup_plan_association" + }; + option (google.api.method_signature) = + "parent,backup_plan_association,backup_plan_association_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlanAssociation" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single BackupPlanAssociation. + rpc GetBackupPlanAssociation(GetBackupPlanAssociationRequest) + returns (BackupPlanAssociation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BackupPlanAssociations in a given project and location. + rpc ListBackupPlanAssociations(ListBackupPlanAssociationsRequest) + returns (ListBackupPlanAssociationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single BackupPlanAssociation. + rpc DeleteBackupPlanAssociation(DeleteBackupPlanAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Triggers a new Backup. + rpc TriggerBackup(TriggerBackupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup" + body: "*" + }; + option (google.api.method_signature) = "name,rule_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlanAssociation" + metadata_type: "OperationMetadata" + }; + } } // Network configuration for ManagementServer instance. @@ -236,7 +500,7 @@ message ManagementServer { // Output only. The OAuth 2.0 client id is required to make API calls to the // BackupDR instance API of this ManagementServer. This is the value that - // should be provided in the ‘aud’ field of the OIDC ID Token (see openid + // should be provided in the 'aud' field of the OIDC ID Token (see openid // specification // https://openid.net/specs/openid-connect-core-1_0.html#IDToken). string oauth2_client_id = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -261,10 +525,11 @@ message ManagementServer { // Request message for listing management servers. message ListManagementServersRequest { // Required. The project and location for which to retrieve management servers - // information, in the format `projects/{project_id}/locations/{location}`. In - // Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - // To retrieve management servers for all locations, use "-" for the - // `{location}` value. + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud BackupDR, locations map to Google Cloud regions, for example + // **us-central1**. To retrieve management servers for all locations, use "-" + // for the + // '{location}' value. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -291,7 +556,7 @@ message ListManagementServersResponse { // The list of ManagementServer instances in the project for the specified // location. // - // If the `{location}` value in the request is "-", the response contains a + // If the '{location}' value in the request is "-", the response contains a // list of instances from all locations. In case any location is unreachable, // the response will only return management servers in reachable locations and // the 'unreachable' field will be populated with a list of unreachable @@ -308,7 +573,7 @@ message ListManagementServersResponse { // Request message for getting a management server instance. message GetManagementServerRequest { // Required. Name of the management server resource name, in the format - // `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + // 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -320,8 +585,8 @@ message GetManagementServerRequest { // Request message for creating a management server instance. message CreateManagementServerRequest { // Required. The management server project and location in the format - // `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - // locations map to GCP regions, for example **us-central1**. + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + // locations map to Google Cloud regions, for example **us-central1**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -403,7 +668,7 @@ message OperationMetadata { // of the operation. Operations that have successfully been cancelled // have [Operation.error][] value with a // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // 'Code.CANCELLED'. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto new file mode 100644 index 00000000000..c64986bf364 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto @@ -0,0 +1,438 @@ +// Copyright 2024 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.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/dayofweek.proto"; +import "google/type/month.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupPlanProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// A `BackupPlan` specifies some common fields, such as `description` as well +// as one or more `BackupRule` messages. Each `BackupRule` has a retention +// policy and defines a schedule by which the system is to perform backup +// workloads. +message BackupPlan { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupPlan" + pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}" + plural: "backupPlans" + singular: "backupPlan" + }; + + // `State` enumerates the possible states for a `BackupPlan`. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The resource is being created. + CREATING = 1; + + // The resource has been created and is fully usable. + ACTIVE = 2; + + // The resource is being deleted. + DELETING = 3; + + // The resource has been created but is not usable. + INACTIVE = 4; + } + + // Output only. Identifier. The resource name of the `BackupPlan`. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. The description of the `BackupPlan` resource. + // + // The description allows for additional details about `BackupPlan` and its + // use cases to be provided. An example description is the following: "This + // is a backup plan that performs a daily backup at 6pm and retains data for 3 + // months". The description must be at most 2048 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This collection of key/value pairs allows for custom labels to be + // supplied by the user. Example, {"tag": "Weekly"}. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. When the `BackupPlan` was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When the `BackupPlan` was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The backup rules for this `BackupPlan`. There must be at least + // one `BackupRule` message. + repeated BackupRule backup_rules = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The `State` for the `BackupPlan`. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The resource type to which the `BackupPlan` will be applied. + // Examples include, "compute.googleapis.com/Instance" and + // "storage.googleapis.com/Bucket". + string resource_type = 8 [(google.api.field_behavior) = REQUIRED]; + + // Optional. `etag` is returned from the service in the response. As a user of + // the service, you may provide an etag value in this field to prevent stale + // resources. + string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Resource name of backup vault which will be used as storage + // location for backups. Format: + // projects/{project}/locations/{location}/backupVaults/{backupvault} + string backup_vault = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Output only. The Google Cloud Platform Service Account to be used by the + // BackupVault for taking backups. Specify the email address of the Backup + // Vault Service Account. + string backup_vault_service_account = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `BackupRule` binds the backup schedule to a retention policy. +message BackupRule { + // Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + // unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + // followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + // /[a-z][a-z0-9-]{,62}/. + string rule_id = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Configures the duration for which backup data will be kept. It is + // defined in “days”. The value should be greater than or equal to minimum + // enforced retention of the backup vault. + int32 backup_retention_days = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. + // + // The schedule that defines the automated backup workloads for this + // `BackupRule`. + oneof backup_schedule_oneof { + // Required. Defines a schedule that runs within the confines of a defined + // window of time. + StandardSchedule standard_schedule = 5 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// `StandardSchedule` defines a schedule that run within the confines of a +// defined window of days. We can define recurrence type for schedule as +// HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY. +message StandardSchedule { + // `RecurrenceTypes` enumerates the applicable periodicity for the schedule. + enum RecurrenceType { + // recurrence type not set + RECURRENCE_TYPE_UNSPECIFIED = 0; + + // The `BackupRule` is to be applied hourly. + HOURLY = 1; + + // The `BackupRule` is to be applied daily. + DAILY = 2; + + // The `BackupRule` is to be applied weekly. + WEEKLY = 3; + + // The `BackupRule` is to be applied monthly. + MONTHLY = 4; + + // The `BackupRule` is to be applied yearly. + YEARLY = 5; + } + + // Required. Specifies the `RecurrenceType` for the schedule. + RecurrenceType recurrence_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + // means jobs will run every 2 hours from start time till end time defined. + // + // This is required for `recurrence_type`, `HOURLY` and is not applicable + // otherwise. A validation error will occur if a value is supplied and + // `recurrence_type` is not `HOURLY`. + // + // Value of hourly frequency should be between 6 and 23. + // + // Reason for limit : We found that there is bandwidth limitation of 3GB/S for + // GMI while taking a backup and 5GB/S while doing a restore. Given the amount + // of parallel backups and restore we are targeting, this will potentially + // take the backup time to mins and hours (in worst case scenario). + int32 hourly_frequency = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + // will run. + // + // This is required for `recurrence_type`, `WEEKLY` and is not applicable + // otherwise. A validation error will occur if a value is supplied and + // `recurrence_type` is not `WEEKLY`. + repeated google.type.DayOfWeek days_of_week = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + // + // Values for `days_of_month` are only applicable for `recurrence_type`, + // `MONTHLY` and `YEARLY`. A validation error will occur if other values are + // supplied. + repeated int32 days_of_month = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + // MONDAY, on which jobs will run. This will be specified by two fields in + // `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + // e.g. `LAST`. + // + // This field is only applicable for `recurrence_type`, `MONTHLY` and + // `YEARLY`. A validation error will occur if other values are supplied. + WeekDayOfMonth week_day_of_month = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + // which jobs will run. + // + // This field is only applicable when `recurrence_type` is `YEARLY`. A + // validation error will occur if other values are supplied. + repeated google.type.Month months = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. A BackupWindow defines the window of day during which backup jobs + // will run. Jobs are queued at the beginning of the window and will be marked + // as `NOT_RUN` if they do not start by the end of the window. + // + // Note: running jobs will not be cancelled at the end of the window. + BackupWindow backup_window = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time zone to be used when interpreting the schedule. + // The value of this field must be a time zone name from the IANA tz database. + // See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + // list of valid timezone names. For e.g., Europe/Paris. + string time_zone = 8 [(google.api.field_behavior) = REQUIRED]; +} + +// `BackupWindow` defines a window of the day during which backup jobs will run. +message BackupWindow { + // Required. The hour of day (0-23) when the window starts for e.g. if value + // of start hour of day is 6 that mean backup window start at 6:00. + int32 start_hour_of_day = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The hour of day (1-24) when the window end for e.g. if value of + // end hour of day is 10 that mean backup window end time is 10:00. + // + // End hour of day should be greater than start hour of day. + // 0 <= start_hour_of_day < end_hour_of_day <= 24 + // + // End hour of day is not include in backup window that mean if + // end_hour_of_day= 10 jobs should start before 10:00. + int32 end_hour_of_day = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `WeekDayOfMonth` defines the week day of the month on which the backups will +// run. The message combines a `WeekOfMonth` and `DayOfWeek` to produce values +// like `FIRST`/`MONDAY` or `LAST`/`FRIDAY`. +message WeekDayOfMonth { + // `WeekOfMonth` enumerates possible weeks in the month, e.g. the first, + // third, or last week of the month. + enum WeekOfMonth { + // The zero value. Do not use. + WEEK_OF_MONTH_UNSPECIFIED = 0; + + // The first week of the month. + FIRST = 1; + + // The second week of the month. + SECOND = 2; + + // The third week of the month. + THIRD = 3; + + // The fourth week of the month. + FOURTH = 4; + + // The last week of the month. + LAST = 5; + } + + // Required. Specifies the week of the month. + WeekOfMonth week_of_month = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for creating a `BackupPlan`. +message CreateBackupPlanRequest { + // Required. The `BackupPlan` project and location in the format + // `projects/{project}/locations/{location}`. In Cloud BackupDR locations + // map to GCP regions, for example **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Required. The name of the `BackupPlan` to create. The name must be unique + // for the specified project and location.The name must start with a lowercase + // letter followed by up to 62 lowercase letters, numbers, or hyphens. + // Pattern, /[a-z][a-z0-9-]{,62}/. + string backup_plan_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `BackupPlan` resource object to create. + BackupPlan backup_plan = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The request message for getting a list `BackupPlan`. +message ListBackupPlansRequest { + // Required. The project and location for which to retrieve `BackupPlans` + // information. Format: `projects/{project}/locations/{location}`. In Cloud + // BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + // retrieve backup plans for all locations, use "-" for the + // `{location}` value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Optional. The maximum number of `BackupPlans` to return in a single + // response. If not specified, a default value will be chosen by the service. + // Note that the response may include a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value of + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // received from a previous `ListBackupPlans` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListBackupPlans` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field match expression used to filter the results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field by which to sort the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for getting a list of `BackupPlan`. +message ListBackupPlansResponse { + // The list of `BackupPlans` in the project for the specified + // location. + // + // If the `{location}` value in the request is "-", the response contains a + // list of resources from all locations. In case any location is unreachable, + // the response will only return backup plans in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + // BackupPlan + repeated BackupPlan backup_plans = 1; + + // A token which may be sent as + // [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + // a subsequent `ListBackupPlans` call to retrieve the next page of results. + // If this field is omitted or empty, then there are no more results to + // return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request message for getting a `BackupPlan`. +message GetBackupPlanRequest { + // Required. The resource name of the `BackupPlan` to retrieve. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; +} + +// The request message for deleting a `BackupPlan`. +message DeleteBackupPlanRequest { + // Required. The resource name of the `BackupPlan` to delete. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto new file mode 100644 index 00000000000..b807a2b916c --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto @@ -0,0 +1,313 @@ +// Copyright 2024 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.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupPlanAssociationProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// A BackupPlanAssociation represents a single BackupPlanAssociation which +// contains details like workload, backup plan etc +message BackupPlanAssociation { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + pattern: "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}" + plural: "backupPlanAssociations" + singular: "backupPlanAssociation" + }; + + // Enum for State of BackupPlan Association + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The resource is being created. + CREATING = 1; + + // The resource has been created and is fully usable. + ACTIVE = 2; + + // The resource is being deleted. + DELETING = 3; + + // The resource has been created but is not usable. + INACTIVE = 4; + } + + // Output only. Identifier. The resource name of BackupPlanAssociation in + // below format Format : + // projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Resource type of workload on which backupplan is applied + string resource_type = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. Resource name of workload on which backupplan is + // applied + string resource = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Resource name of backup plan which needs to be applied on + // workload. Format: + // projects/{project}/locations/{location}/backupPlans/{backupPlanId} + string backup_plan = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The BackupPlanAssociation resource state. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The config info related to backup rules. + repeated RuleConfigInfo rules_config_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Output Only. + // + // Resource name of data source which will be used as storage location for + // backups taken. + // Format : + // projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + string data_source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for rules config info. +message RuleConfigInfo { + // Enum for LastBackupState + enum LastBackupState { + // State not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0; + + // The first backup is pending. + FIRST_BACKUP_PENDING = 1; + + // The most recent backup could not be run/failed because of the lack of + // permissions. + PERMISSION_DENIED = 2; + + // The last backup operation succeeded. + SUCCEEDED = 3; + + // The last backup operation failed. + FAILED = 4; + } + + // Output only. Output Only. + // + // Backup Rule id fetched from backup plan. + string rule_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last backup state for rule. + LastBackupState last_backup_state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Output Only. + // + // google.rpc.Status object to store the last backup error. + google.rpc.Status last_backup_error = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The point in time when the last successful backup was captured + // from the source. + google.protobuf.Timestamp last_successful_backup_consistency_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for creating a backup plan. +message CreateBackupPlanAssociationRequest { + // Required. The backup plan association project and location in the format + // `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + // map to GCP regions, for example **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Required. The name of the backup plan association to create. The name must + // be unique for the specified project and location. + string backup_plan_association_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + BackupPlanAssociation backup_plan_association = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for List BackupPlanAssociation +message ListBackupPlanAssociationsRequest { + // Required. The project and location for which to retrieve backup Plan + // Associations information, in the format + // `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + // map to GCP regions, for example **us-central1**. To retrieve backup plan + // associations for all locations, use "-" for the + // `{location}` value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for List BackupPlanAssociation +message ListBackupPlanAssociationsResponse { + // The list of Backup Plan Associations in the project for the specified + // location. + // + // If the `{location}` value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup plan associations in reachable + // locations and the 'unreachable' field will be populated with a list of + // unreachable locations. + repeated BackupPlanAssociation backup_plan_associations = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a BackupPlanAssociation resource. +message GetBackupPlanAssociationRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; +} + +// Request message for deleting a backup plan association. +message DeleteBackupPlanAssociationRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for triggering a backup. +message TriggerBackupRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Required. backup rule_id for which a backup needs to be triggered. + string rule_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto new file mode 100644 index 00000000000..f9b46b5bff0 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto @@ -0,0 +1,1146 @@ +// Copyright 2024 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.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupvault_ba.proto"; +import "google/cloud/backupdr/v1/backupvault_gce.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupVaultProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// Message describing a BackupVault object. +message BackupVault { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupVault" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}" + plural: "backupVaults" + singular: "backupVault" + }; + + // Holds the state of the backup vault resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The backup vault is being created. + CREATING = 1; + + // The backup vault has been created and is fully usable. + ACTIVE = 2; + + // The backup vault is being deleted. + DELETING = 3; + + // The backup vault is experiencing an issue and might be unusable. + ERROR = 4; + } + + // Holds the access restriction for the backup vault. + enum AccessRestriction { + // Access restriction not set. + ACCESS_RESTRICTION_UNSPECIFIED = 0; + + // Access to or from resources outside your current project will be denied. + WITHIN_PROJECT = 1; + + // Access to or from resources outside your current organization will be + // denied. + WITHIN_ORGANIZATION = 2; + + // No access restriction. + UNRESTRICTED = 3; + } + + // Output only. Identifier. Name of the backup vault to create. It must have + // the + // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + // `{backupvault}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the project and location. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. The description of the BackupVault instance (2048 characters or + // less). + optional string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined: + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The default and minimum enforced retention for each backup within + // the backup vault. The enforced retention for each backup can be extended. + optional google.protobuf.Duration backup_minimum_enforced_retention_duration = + 20 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Set to true when there are no backups nested under this + // resource. + optional bool deletable = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Server specified ETag for the backup vault resource to + // prevent simultaneous updates from overwiting each other. + optional string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The BackupVault resource instance state. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Time after which the BackupVault resource is locked. + optional google.protobuf.Timestamp effective_time = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of backups in this backup vault. + int64 backup_count = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service account used by the BackupVault Service for this + // BackupVault. The user should grant this account permissions in their + // workload project to enable the service to run backups and restores there. + string service_account = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total size of the storage used by all backup resources. + int64 total_stored_bytes = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Output only + // Immutable after resource creation until resource deletion. + string uid = 21 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. User annotations. See https://google.aip.dev/128#annotations + // Stores small amounts of arbitrary data. + map annotations = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Note: This field is added for future use case and will not be + // supported in the current release. + // + // Optional. + // + // Access restriction for the backup vault. + // Default value is WITHIN_ORGANIZATION if not provided during creation. + AccessRestriction access_restriction = 24 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing a DataSource object. +// Datasource object used to represent Datasource details for both admin and +// basic view. +message DataSource { + option (google.api.resource) = { + type: "backupdr.googleapis.com/DataSource" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}" + plural: "dataSources" + singular: "dataSource" + }; + + // Holds the state of the data source resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The data source is being created. + CREATING = 1; + + // The data source has been created and is fully usable. + ACTIVE = 2; + + // The data source is being deleted. + DELETING = 3; + + // The data source is experiencing an issue and might be unusable. + ERROR = 4; + } + + // Output only. Identifier. Name of the datasource to create. + // It must have the + // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + // `{datasource}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the backup vault. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The DataSource resource instance state. + State state = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined: + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of backups in the data source. + optional int64 backup_count = 7; + + // Server specified ETag for the ManagementServer resource to prevent + // simultaneous updates from overwiting each other. + optional string etag = 14; + + // The number of bytes (metadata and data) stored in this datasource. + optional int64 total_stored_bytes = 23; + + // Output only. The backup configuration state. + BackupConfigState config_state = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Details of how the resource is configured for backup. + BackupConfigInfo backup_config_info = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The source resource that is represented by this DataSource. It can be a + // Google Cloud resource, or one backed up by a Backup Appliance. + oneof source_resource { + // The backed up resource is a Google Cloud resource. + // The word 'DataSource' was included in the names to indicate that this is + // the representation of the Google Cloud resource used within the + // DataSource object. + DataSourceGcpResource data_source_gcp_resource = 26; + + // The backed up resource is a backup appliance application. + DataSourceBackupApplianceApplication + data_source_backup_appliance_application = 27; + } +} + +// BackupConfigInfo has information about how the resource is configured +// for Backup and about the most recent backup to this vault. +message BackupConfigInfo { + // LastBackupstate tracks whether the last backup was not yet started, + // successful, failed, or could not be run because of the lack of permissions. + enum LastBackupState { + // Status not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0; + + // The first backup has not yet completed + FIRST_BACKUP_PENDING = 1; + + // The most recent backup was successful + SUCCEEDED = 2; + + // The most recent backup failed + FAILED = 3; + + // The most recent backup could not be run/failed because of the lack of + // permissions + PERMISSION_DENIED = 4; + } + + // Output only. The status of the last backup to this BackupVault + LastBackupState last_backup_state = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the last backup were successful, this field has the + // consistency date. + google.protobuf.Timestamp last_successful_backup_consistency_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the last backup failed, this field has the error message. + google.rpc.Status last_backup_error = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration Info has the resource format-specific configuration. + oneof backup_config { + // Configuration for a Google Cloud resource. + GcpBackupConfig gcp_backup_config = 4; + + // Configuration for an application backed up by a Backup Appliance. + BackupApplianceBackupConfig backup_appliance_backup_config = 5; + } +} + +// GcpBackupConfig captures the Backup configuration details for Google Cloud +// resources. All Google Cloud resources regardless of type are protected with +// backup plan associations. +message GcpBackupConfig { + // The name of the backup plan. + string backup_plan = 1 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + }]; + + // The description of the backup plan. + string backup_plan_description = 2; + + // The name of the backup plan association. + string backup_plan_association = 3 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + }]; + + // The names of the backup plan rules which point to this backupvault + repeated string backup_plan_rules = 4; +} + +// BackupApplianceBackupConfig captures the backup configuration for +// applications that are protected by Backup Appliances. +message BackupApplianceBackupConfig { + // The name of the backup appliance. + string backup_appliance_name = 1; + + // The ID of the backup appliance. + int64 backup_appliance_id = 2; + + // The ID of the SLA of this application. + int64 sla_id = 3; + + // The name of the application. + string application_name = 4; + + // The name of the host where the application is running. + string host_name = 5; + + // The name of the SLT associated with the application. + string slt_name = 6; + + // The name of the SLP associated with the application. + string slp_name = 7; +} + +// DataSourceGcpResource is used for protected resources that are Google Cloud +// Resources. This name is easeier to understand than GcpResourceDataSource or +// GcpDataSourceResource +message DataSourceGcpResource { + // Output only. Full resource pathname URL of the source Google Cloud + // resource. + string gcp_resourcename = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Location of the resource: //"global"/"unspecified". + string location = 2; + + // The type of the Google Cloud resource. Use the Unified Resource Type, + // eg. compute.googleapis.com/Instance. + string type = 3; + + // gcp_Properties has properties of the Google Cloud Resource. + oneof gcp_resource_properties { + // ComputeInstanceDataSourceProperties has a subset of Compute Instance + // properties that are useful at the Datasource level. + ComputeInstanceDataSourceProperties compute_instance_datasource_properties = + 4; + } +} + +// BackupApplianceApplication describes a Source Resource when it is an +// application backed up by a BackupAppliance. +message DataSourceBackupApplianceApplication { + // The name of the Application as known to the Backup Appliance. + string application_name = 1; + + // Appliance name. + string backup_appliance = 2; + + // Appliance Id of the Backup Appliance. + int64 appliance_id = 3; + + // The type of the application. e.g. VMBackup + string type = 4; + + // The appid field of the application within the Backup Appliance. + int64 application_id = 8; + + // Hostname of the host where the application is running. + string hostname = 6; + + // Hostid of the application host. + int64 host_id = 7; +} + +// ServiceLockInfo represents the details of a lock taken by the service on a +// Backup resource. +message ServiceLockInfo { + // Output only. The name of the operation that created this lock. + // The lock will automatically be released when the operation completes. + string operation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// BackupApplianceLockInfo contains metadata about the backupappliance that +// created the lock. +message BackupApplianceLockInfo { + // Required. The ID of the backup/recovery appliance that created this lock. + int64 backup_appliance_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the backup/recovery appliance that created this lock. + string backup_appliance_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + // value of this string is only meaningful to the client and it is not + // interpreted by the BackupVault service. + string lock_reason = 5 [(google.api.field_behavior) = REQUIRED]; + + // The information about this lock. + oneof lock_source { + // The job name on the backup/recovery appliance that created this lock. + string job_name = 6; + + // The image name that depends on this Backup. + string backup_image = 7; + + // The SLA on the backup/recovery appliance that owns the lock. + int64 sla_id = 8; + } +} + +// BackupLock represents a single lock on a Backup resource. An unexpired +// lock on a Backup prevents the Backup from being deleted. +message BackupLock { + // Required. The time after which this lock is not considered valid and will + // no longer protect the Backup from deletion. + google.protobuf.Timestamp lock_until_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Metadata about the owner and reason for the lock. + oneof ClientLockInfo { + // If the client is a backup and recovery appliance, this + // contains metadata about why the lock exists. + BackupApplianceLockInfo backup_appliance_lock_info = 3; + + // Output only. Contains metadata about the lock exist for Google Cloud + // native backups. + ServiceLockInfo service_lock_info = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Message describing a Backup object. +message Backup { + option (google.api.resource) = { + type: "backupdr.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}" + plural: "backups" + singular: "backup" + }; + + // Holds the state of the backup resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The backup is being created. + CREATING = 1; + + // The backup has been created and is fully usable. + ACTIVE = 2; + + // The backup is being deleted. + DELETING = 3; + + // The backup is experiencing an issue and might be unusable. + ERROR = 4; + } + + // Type of the backup, scheduled or ondemand. + enum BackupType { + // Backup type is unspecified. + BACKUP_TYPE_UNSPECIFIED = 0; + + // Scheduled backup. + SCHEDULED = 1; + + // On demand backup. + ON_DEMAND = 2; + } + + // GCPBackupPlanInfo captures the plan configuration details of Google Cloud + // resources at the time of backup. + message GCPBackupPlanInfo { + // Resource name of backup plan by which workload is protected at the time + // of the backup. + // Format: + // projects/{project}/locations/{location}/backupPlans/{backupPlanId} + string backup_plan = 1 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + }]; + + // The rule id of the backup plan which triggered this backup in case of + // scheduled backup or used for + string backup_plan_rule_id = 2; + } + + // Output only. Identifier. Name of the backup to create. It must have the + // format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + // `{backup}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the datasource. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The description of the Backup instance (2048 characters or + // less). + optional string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The backup can not be deleted before this time. + optional google.protobuf.Timestamp enforced_retention_end_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When this backup is automatically expired. + optional google.protobuf.Timestamp expire_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The point in time when this backup was captured from the + // source. + optional google.protobuf.Timestamp consistency_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Server specified ETag to prevent updates from overwriting each + // other. + optional string etag = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Backup resource instance state. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of BackupLocks taken by the service to prevent the + // deletion of the backup. + repeated BackupLock service_locks = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of BackupLocks taken by the accessor Backup Appliance. + repeated BackupLock backup_appliance_locks = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Workload specific backup properties. + oneof backup_properties { + // Output only. Compute Engine specific backup properties. + ComputeInstanceBackupProperties compute_instance_backup_properties = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Backup Appliance specific backup properties. + BackupApplianceBackupProperties backup_appliance_backup_properties = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Type of the backup, unspecified, scheduled or ondemand. + BackupType backup_type = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration Info has the resource format-specific configuration. + oneof plan_info { + // Output only. Configuration for a Google Cloud resource. + GCPBackupPlanInfo gcp_backup_plan_info = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. source resource size in bytes at the time of the backup. + int64 resource_size_bytes = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for creating a BackupVault. +message CreateBackupVaultRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Required. ID of the requesting object + // If auto-generating ID server-side, remove this field and + // backup_vault_id from the method_signature of Create RPC + string backup_vault_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + BackupVault backup_vault = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing backupvault stores. +message ListBackupVaultsRequest { + // Required. The project and location for which to retrieve backupvault stores + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud Backup and DR, locations map to Google Cloud regions, for example + // **us-central1**. + // To retrieve backupvault stores for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // Vault. + BackupVaultView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing BackupVaults. +message ListBackupVaultsResponse { + // The list of BackupVault instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup vaults in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated BackupVault backup_vaults = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for fetching usable BackupVaults. +message FetchUsableBackupVaultsRequest { + // Required. The project and location for which to retrieve backupvault stores + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud Backup and DR, locations map to Google Cloud regions, for example + // **us-central1**. + // To retrieve backupvault stores for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for fetching usable BackupVaults. +message FetchUsableBackupVaultsResponse { + // The list of BackupVault instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup vaults in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated BackupVault backup_vaults = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a BackupVault. +message GetBackupVaultRequest { + // Required. Name of the backupvault store resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // Vault + BackupVaultView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for updating a BackupVault. +message UpdateBackupVaultRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // BackupVault resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + BackupVault backup_vault = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, will not check plan duration against backup vault + // enforcement duration. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a BackupVault. +message DeleteBackupVaultRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. If set to true, any data source from this backup vault will also + // be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; + + // The current etag of the backup vault. + // If an etag is provided and does not match the current etag of the + // connection, deletion will be blocked. + string etag = 4; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true and the BackupVault is not found, the request will + // succeed but no action will be taken. + bool allow_missing = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing DataSources. +message ListDataSourcesRequest { + // Required. The project and location for which to retrieve data + // sources information, in the format + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + // locations map to Google Cloud regions, for example **us-central1**. + // To retrieve data sources for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/DataSource" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing DataSources. +message ListDataSourcesResponse { + // The list of DataSource instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return data sources in reachable locations + // and the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated DataSource data_sources = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a DataSource instance. +message GetDataSourceRequest { + // Required. Name of the data source resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/DataSource" + } + ]; +} + +// Request message for updating a data source instance. +message UpdateDataSourceRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // DataSource resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + DataSource data_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Enable upsert. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing Backups. +message ListBackupsRequest { + // Required. The project and location for which to retrieve backup + // information, in the format + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + // locations map to Google Cloud regions, for example **us-central1**. + // To retrieve data sources for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/Backup" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // resource. + BackupView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing Backups. +message ListBackupsResponse { + // The list of Backup instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return data sources in reachable locations + // and the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a Backup. +message GetBackupRequest { + // Required. Name of the data source resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // resource. + BackupView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for updating a Backup. +message UpdateBackupRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Backup resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Message for deleting a Backup. +message DeleteBackupRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for restoring from a Backup. +message RestoreBackupRequest { + // Required. The resource name of the Backup instance, in the format + // 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // The target environment for the restore operation. + oneof target_environment { + // Compute Engine target environment to be used during restore. + ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; + } + + // The property overrides for the instance being restored. + oneof instance_properties { + // Compute Engine instance properties to be overridden during restore. + ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; + } +} + +// Response message for restoring from a Backup. +message RestoreBackupResponse { + // Details of the target resource created/modified as part of restore. + TargetResource target_resource = 1; +} + +// Details of the target resource created/modified as part of restore. +message TargetResource { + // Minimum details to identify the restored resource. + oneof target_resource_info { + // Details of the native Google Cloud resource created as part of restore. + GcpResource gcp_resource = 1; + } +} + +// Minimum details to identify a Google Cloud resource +message GcpResource { + // Name of the Google Cloud resource. + string gcp_resourcename = 1; + + // Location of the resource: //"global"/"unspecified". + string location = 2; + + // Type of the resource. Use the Unified Resource Type, + // eg. compute.googleapis.com/Instance. + string type = 3; +} + +// Backup configuration state. Is the resource configured for backup? +enum BackupConfigState { + // The possible states of backup configuration. + // Status not set. + BACKUP_CONFIG_STATE_UNSPECIFIED = 0; + + // The data source is actively protected (i.e. there is a + // BackupPlanAssociation or Appliance SLA pointing to it) + ACTIVE = 1; + + // The data source is no longer protected (but may have backups under it) + PASSIVE = 2; +} + +// BackupView contains enum options for Partial and Full view. +enum BackupView { + // If the value is not set, the default 'FULL' view is used. + BACKUP_VIEW_UNSPECIFIED = 0; + + // Includes basic data about the Backup, but not the full contents. + BACKUP_VIEW_BASIC = 1; + + // Includes all data about the Backup. + // This is the default value (for both ListBackups and GetBackup). + BACKUP_VIEW_FULL = 2; +} + +// BackupVaultView contains enum options for Partial and Full view. +enum BackupVaultView { + // If the value is not set, the default 'FULL' view is used. + BACKUP_VAULT_VIEW_UNSPECIFIED = 0; + + // Includes basic data about the Backup Vault, but not the full contents. + BACKUP_VAULT_VIEW_BASIC = 1; + + // Includes all data about the Backup Vault. + // This is the default value (for both ListBackupVaults and GetBackupVault). + BACKUP_VAULT_VIEW_FULL = 2; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto new file mode 100644 index 00000000000..619b7a34290 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto @@ -0,0 +1,49 @@ +// Copyright 2024 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.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultBaProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// BackupApplianceBackupProperties represents BackupDR backup appliance's +// properties. +message BackupApplianceBackupProperties { + // Output only. The numeric generation ID of the backup (monotonically + // increasing). + optional int32 generation_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this backup object was finalized (if none, + // backup is not finalized). + optional google.protobuf.Timestamp finalize_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The earliest timestamp of data available in this Backup. + optional google.protobuf.Timestamp recovery_range_start_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The latest timestamp of data available in this Backup. + optional google.protobuf.Timestamp recovery_range_end_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto new file mode 100644 index 00000000000..cab0c0a7dc5 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto @@ -0,0 +1,949 @@ +// Copyright 2024 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.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultGceProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// ComputeInstanceBackupProperties represents Compute Engine instance backup +// properties. +message ComputeInstanceBackupProperties { + // An optional text description for the instances that are created from these + // properties. + optional string description = 1; + + // A list of tags to apply to the instances that are created from these + // properties. The tags identify valid sources or targets for network + // firewalls. The setTags method can modify this list of tags. Each tag within + // the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + optional Tags tags = 2; + + // The machine type to use for instances that are created from these + // properties. + optional string machine_type = 3; + + // Enables instances created based on these properties to send packets with + // source IP addresses other than their own and receive packets with + // destination IP addresses other than their own. If these instances will be + // used as an IP gateway or it will be set as the next-hop in a Route + // resource, specify `true`. If unsure, leave this set to `false`. See the + // https://cloud.google.com/vpc/docs/using-routes#canipforward + // documentation for more information. + optional bool can_ip_forward = 4; + + // An array of network access configurations for this interface. + repeated NetworkInterface network_interface = 5; + + // An array of disks that are associated with the instances that are created + // from these properties. + repeated AttachedDisk disk = 6; + + // The metadata key/value pairs to assign to instances that are created from + // these properties. These pairs can consist of custom metadata or predefined + // keys. See https://cloud.google.com/compute/docs/metadata/overview for more + // information. + optional Metadata metadata = 7; + + // A list of service accounts with specified scopes. Access tokens for these + // service accounts are available to the instances that are created from + // these properties. Use metadata queries to obtain the access tokens for + // these instances. + repeated ServiceAccount service_account = 8; + + // Specifies the scheduling options for the instances that are created from + // these properties. + optional Scheduling scheduling = 9; + + // A list of guest accelerator cards' type and count to use for instances + // created from these properties. + repeated AcceleratorConfig guest_accelerator = 10; + + // Minimum cpu/platform to be used by instances. The instance may be + // scheduled on the specified or newer cpu/platform. Applicable values are the + // friendly names of CPU platforms, such as + // `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + // For more information, read + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + optional string min_cpu_platform = 11; + + // KeyRevocationActionType of the instance. Supported options are "STOP" and + // "NONE". The default value is "NONE" if it is not specified. + optional KeyRevocationActionType key_revocation_action_type = 12; + + // The source instance used to create this backup. This can be a partial or + // full URL to the resource. For example, the following are valid values: + // -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + // -projects/project/zones/zone/instances/instance + optional string source_instance = 13; + + // Labels to apply to instances that are created from these properties. + map labels = 14; +} + +// ComputeInstanceRestoreProperties represents Compute Engine instance +// properties to be overridden during restore. +message ComputeInstanceRestoreProperties { + // The private IPv6 google access type for the VMs. + enum InstancePrivateIpv6GoogleAccess { + // Default value. This value is unused. + INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // Each network interface inherits PrivateIpv6GoogleAccess from its + // subnetwork. + INHERIT_FROM_SUBNETWORK = 1; + + // Outbound private IPv6 access from VMs in this subnet to Google services. + // If specified, the subnetwork who is attached to the instance's default + // network interface will be assigned an internal IPv6 prefix if it doesn't + // have before. + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; + + // Bidirectional private IPv6 access to/from Google services. If + // specified, the subnetwork who is attached to the instance's default + // network interface will be assigned an internal IPv6 prefix if it doesn't + // have before. + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; + } + + // Required. Name of the compute instance. + optional string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Controls for advanced machine-related behavior features. + optional AdvancedMachineFeatures advanced_machine_features = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allows this instance to send and receive packets with + // non-matching destination or source IPs. + optional bool can_ip_forward = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls Confidential compute options on the instance + optional ConfidentialInstanceConfig confidential_instance_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the resource should be protected against deletion. + optional bool deletion_protection = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional description of this resource. Provide this property + // when you create the resource. + optional string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + repeated AttachedDisk disks = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables display device for the instance. + optional DisplayDevice display_device = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of the type and count of accelerator cards attached to the + // instance. + repeated AcceleratorConfig guest_accelerators = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the hostname of the instance. The specified hostname + // must be RFC1035 compliant. If hostname is not specified, the default + // hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + // DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + // DNS. + optional string hostname = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypts suspended data for an instance with a + // customer-managed encryption key. + optional CustomerEncryptionKey instance_encryption_key = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. KeyRevocationActionType of the instance. + optional KeyRevocationActionType key_revocation_action_type = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels to apply to this instance. + map labels = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full or partial URL of the machine type resource to use for this + // instance. + optional string machine_type = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This includes custom metadata and predefined keys. + optional Metadata metadata = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum CPU platform to use for this instance. + optional string min_cpu_platform = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of network configurations for this instance. These + // specify how interfaces are configured to interact with other network + // services, such as connecting to the internet. Multiple interfaces are + // supported per instance. + repeated NetworkInterface network_interfaces = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configure network performance such as egress bandwidth tier. + optional NetworkPerformanceConfig network_performance_config = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Input only. Additional params passed with the request, but not persisted + // as part of resource payload. + optional InstanceParams params = 19 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. The private IPv6 google access type for the VM. + // If not specified, use INHERIT_FROM_SUBNETWORK as default. + optional InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the reservations that this instance can consume from. + optional AllocationAffinity allocation_affinity = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource policies applied to this instance. + repeated string resource_policies = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sets the scheduling options for this instance. + optional Scheduling scheduling = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of service accounts, with their specified scopes, + // authorized for this instance. Only one service account per VM instance is + // supported. + repeated ServiceAccount service_accounts = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tags to apply to this instance. Tags are used to identify valid + // sources or targets for network firewalls and are specified by the client + // during instance creation. + optional Tags tags = 26 [(google.api.field_behavior) = OPTIONAL]; +} + +// ComputeInstanceTargetEnvironment represents Compute Engine target +// environment to be used during restore. +message ComputeInstanceTargetEnvironment { + // Required. Target project for the Compute Engine instance. + string project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zone of the Compute Engine instance. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// ComputeInstanceDataSourceProperties represents the properties of a +// ComputeEngine resource that are stored in the DataSource. +message ComputeInstanceDataSourceProperties { + // Name of the compute instance backed up by the datasource. + string name = 1; + + // The description of the Compute Engine instance. + string description = 2; + + // The machine type of the instance. + string machine_type = 3; + + // The total number of disks attached to the Instance. + int64 total_disk_count = 4; + + // The sum of all the disk sizes. + int64 total_disk_size_gb = 5; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // Optional. Whether to enable nested virtualization or not (default is + // false). + optional bool enable_nested_virtualization = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of threads per physical core. To disable simultaneous + // multithreading (SMT) set this to 1. If unset, the maximum number + // of threads supported per core by the underlying processor is + // assumed. + optional int32 threads_per_core = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of physical cores to expose to an instance. Multiply + // by the number of threads per core to compute the total number of virtual + // CPUs to expose to the instance. If unset, the number of cores is + // inferred from the instance's nominal CPU count and the underlying + // platform's SMT width. + optional int32 visible_core_count = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to enable UEFI networking for instance creation. + optional bool enable_uefi_networking = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of Confidential Instance options. +message ConfidentialInstanceConfig { + // Optional. Defines whether the instance should have confidential compute + // enabled. + optional bool enable_confidential_compute = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of Display Device options +message DisplayDevice { + // Optional. Enables display for the Compute Engine VM + optional bool enable_display = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A specification of the type and number of accelerator cards attached to the +// instance. +message AcceleratorConfig { + // Optional. Full or partial URL of the accelerator type resource to attach to + // this instance. + optional string accelerator_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of the guest accelerator cards exposed to this + // instance. + optional int32 accelerator_count = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A customer-supplied encryption key. +message CustomerEncryptionKey { + // The key to use for encryption. + oneof key { + // Optional. Specifies a 256-bit customer-supplied + // encryption key. + string raw_key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. RSA-wrapped 2048-bit + // customer-supplied encryption key to either encrypt or decrypt this + // resource. + string rsa_encrypted_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the encryption key that is stored in Google Cloud + // KMS. + string kms_key_name = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The service account being used for the encryption request for the + // given KMS key. If absent, the Compute Engine default service account is + // used. + optional string kms_key_service_account = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A key/value pair to be used for storing metadata. +message Entry { + // Optional. Key for the metadata entry. + optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the instance. The + // only restriction placed on values is that their size must be less than + // or equal to 262144 bytes (256 KiB). + optional string value = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A metadata key/value entry. +message Metadata { + // Optional. Array of key/value pairs. The total size of all keys and values + // must be less than 512 KB. + repeated Entry items = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A network interface resource attached to an instance. +// s +message NetworkInterface { + // Stack type for this network interface. + enum StackType { + // Default should be STACK_TYPE_UNSPECIFIED. + STACK_TYPE_UNSPECIFIED = 0; + + // The network interface will be assigned IPv4 address. + IPV4_ONLY = 1; + + // The network interface can have both IPv4 and IPv6 addresses. + IPV4_IPV6 = 2; + } + + // IPv6 access type for this network interface. + enum Ipv6AccessType { + // IPv6 access type not set. Means this network interface hasn't been + // turned on IPv6 yet. + UNSPECIFIED_IPV6_ACCESS_TYPE = 0; + + // This network interface can have internal IPv6. + INTERNAL = 1; + + // This network interface can have external IPv6. + EXTERNAL = 2; + } + + // Nic type for this network interface. + enum NicType { + // Default should be NIC_TYPE_UNSPECIFIED. + NIC_TYPE_UNSPECIFIED = 0; + + // VIRTIO + VIRTIO_NET = 1; + + // GVNIC + GVNIC = 2; + } + + // Optional. URL of the VPC network resource for this instance. + optional string network = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URL of the Subnetwork resource for this instance. + optional string subnetwork = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An IPv4 internal IP address to assign to the instance for this + // network interface. If not specified by the user, an unused internal IP is + // assigned by the system. + optional string ip_address = 3 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. An IPv6 internal network address for this network interface. To + // use a static internal IP address, it must be unused and in the same region + // as the instance's zone. If not specified, Google Cloud will automatically + // assign an internal IPv6 address from the instance's subnetwork. + optional string ipv6_address = 4 [ + (google.api.field_info).format = IPV6, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The prefix length of the primary internal IPv6 range. + optional int32 internal_ipv6_prefix_length = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. [Output Only] The name of the network interface, which is + // generated by the server. + optional string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. An array of configurations for this interface. Currently, only + // one access config,ONE_TO_ONE_NAT is supported. If there are no + // accessConfigs specified, then this instance will have + // no external internet access. + repeated AccessConfig access_configs = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of IPv6 access configurations for this interface. + // Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + // is no ipv6AccessConfig specified, then this instance will + // have no external IPv6 Internet access. + repeated AccessConfig ipv6_access_configs = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of alias IP ranges for this network interface. + // You can only specify this field for network interfaces in VPC networks. + repeated AliasIpRange alias_ip_ranges = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // The stack type for this network interface. + optional StackType stack_type = 10; + + // Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + // IP can be accessed from the Internet. This field is always inherited from + // its subnetwork. + optional Ipv6AccessType ipv6_access_type = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The networking queue count that's specified by users for the + // network interface. Both Rx and Tx queues will be set to this number. It'll + // be empty if not specified by the users. + optional int32 queue_count = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of vNIC to be used on this interface. This may be gVNIC + // or VirtioNet. + optional NicType nic_type = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URL of the network attachment that this interface should + // connect to in the following format: + // projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + optional string network_attachment = 14 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Network performance configuration. +message NetworkPerformanceConfig { + // Network performance tier. + enum Tier { + // This value is unused. + TIER_UNSPECIFIED = 0; + + // Default network performance config. + DEFAULT = 1; + + // Tier 1 network performance config. + TIER_1 = 2; + } + + // Optional. The tier of the total egress bandwidth. + optional Tier total_egress_bandwidth_tier = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An access configuration attached to an instance's network interface. +// Only one access config per instance is supported. +message AccessConfig { + // The type of configuration. + enum AccessType { + // Default value. This value is unused. + ACCESS_TYPE_UNSPECIFIED = 0; + + // ONE_TO_ONE_NAT + ONE_TO_ONE_NAT = 1; + + // Direct IPv6 access. + DIRECT_IPV6 = 2; + } + + // Network tier property used by addresses, instances and forwarding rules. + enum NetworkTier { + // Default value. This value is unused. + NETWORK_TIER_UNSPECIFIED = 0; + + // High quality, Google-grade network tier, support for all networking + // products. + PREMIUM = 1; + + // Public internet quality, only limited support for other networking + // products. + STANDARD = 2; + } + + // Optional. In accessConfigs (IPv4), the + // default and only option is ONE_TO_ONE_NAT. In + // ipv6AccessConfigs, the default and only option is + // DIRECT_IPV6. + optional AccessType type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of this access configuration. + optional string name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The external IP address of this access configuration. + optional string external_ip = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The external IPv6 address of this access configuration. + optional string external_ipv6 = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The prefix length of the external IPv6 range. + optional int32 external_ipv6_prefix_length = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether a public DNS 'PTR' record should be created to + // map the external IP address of the instance to a DNS domain name. + optional bool set_public_ptr = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The DNS domain name for the public PTR record. + optional string public_ptr_domain_name = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This signifies the networking tier used for configuring this + // access + optional NetworkTier network_tier = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An alias IP range attached to an instance's network interface. +message AliasIpRange { + // Optional. The IP alias ranges to allocate for this interface. + optional string ip_cidr_range = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of a subnetwork secondary IP range from which to + // allocate an IP alias range. If not specified, the primary range of the + // subnetwork is used. + optional string subnetwork_range_name = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Additional instance params. +message InstanceParams { + // Optional. Resource manager tags to be bound to the instance. + map resource_manager_tags = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies the reservations that this instance can consume from. +message AllocationAffinity { + // Indicates whether to consume from a reservation or not. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Do not consume from any allocated capacity. + NO_RESERVATION = 1; + + // Consume any allocation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Optional. Specifies the type of reservation from which this instance can + // consume + optional Type consume_allocation_type = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label key of a reservation resource. + optional string key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of a reservation resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Sets the scheduling options for an Instance. +message Scheduling { + // Defines the maintenance behavior for this instance= + enum OnHostMaintenance { + // Default value. This value is unused. + ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + + // Tells Compute Engine to terminate and (optionally) restart the instance + // away from the maintenance activity. + TERMINATE = 1; + + // Default, Allows Compute Engine to automatically migrate instances + // out of the way of maintenance events. + MIGRATE = 1000; + } + + // Node Affinity: the configuration of desired nodes onto which this Instance + // could be scheduled. + message NodeAffinity { + // Defines the type of node selections. + enum Operator { + // Default value. This value is unused. + OPERATOR_UNSPECIFIED = 0; + + // Requires Compute Engine to seek for matched nodes. + IN = 1; + + // Requires Compute Engine to avoid certain nodes. + NOT_IN = 2; + } + + // Optional. Corresponds to the label key of Node resource. + optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the operation of node selection. + optional Operator operator = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of Node resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines the provisioning model for an instance. + enum ProvisioningModel { + // Default value. This value is not used. + PROVISIONING_MODEL_UNSPECIFIED = 0; + + // Standard provisioning with user controlled runtime, no discounts. + STANDARD = 1; + + // Heavily discounted, no guaranteed runtime. + SPOT = 2; + } + + // Defines the supported termination actions for an instance. + enum InstanceTerminationAction { + // Default value. This value is unused. + INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; + + // Delete the VM. + DELETE = 1; + + // Stop the VM without storing in-memory content. default action. + STOP = 2; + } + + // Optional. Defines the maintenance behavior for this instance. + optional OnHostMaintenance on_host_maintenance = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the instance should be automatically restarted + // if it is terminated by Compute Engine (not terminated by a user). + optional bool automatic_restart = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines whether the instance is preemptible. + optional bool preemptible = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of node affinity and anti-affinity configurations. + // Overrides reservationAffinity. + repeated NodeAffinity node_affinities = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The minimum number of virtual CPUs this instance will consume + // when running on a sole-tenant node. + optional int32 min_node_cpus = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the provisioning model of the instance. + optional ProvisioningModel provisioning_model = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the termination action for the instance. + optional InstanceTerminationAction instance_termination_action = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + // while recovery of the Local Ssd state is attempted. Its value should be in + // between 0 and 168 hours with hour granularity and the default value being 1 + // hour. + optional SchedulingDuration local_ssd_recovery_timeout = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A SchedulingDuration represents a fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". Range is approximately 10,000 years. +message SchedulingDuration { + // Optional. Span of time at a resolution of a second. + optional int64 seconds = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Span of time that's a fraction of a second at nanosecond + // resolution. + optional int32 nanos = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A service account. +message ServiceAccount { + // Optional. Email address of the service account. + optional string email = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of scopes to be made available for this service account. + repeated string scopes = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of instance tags. +message Tags { + // Optional. An array of tags. Each tag must be 1-63 characters long, and + // comply with RFC1035. + repeated string items = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// An instance-attached disk resource. +message AttachedDisk { + // Specifies the parameters to initialize this disk. + message InitializeParams { + // Optional. Specifies the disk name. If not specified, the default is to + // use the name of the instance. + optional string disk_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. URL of the zone where the disk should be created. + // Required for each regional disk associated with the instance. + repeated string replica_zones = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // List of the Disk Types. + enum DiskType { + // Default value, which is unused. + DISK_TYPE_UNSPECIFIED = 0; + + // A scratch disk type. + SCRATCH = 1; + + // A persistent disk type. + PERSISTENT = 2; + } + + // List of the Disk Modes. + enum DiskMode { + // Default value, which is unused. + DISK_MODE_UNSPECIFIED = 0; + + // Attaches this disk in read-write mode. Only one + // virtual machine at a time can be attached to a disk in read-write mode. + READ_WRITE = 1; + + // Attaches this disk in read-only mode. Multiple virtual machines can use + // a disk in read-only mode at a time. + READ_ONLY = 2; + + // The disk is locked for administrative reasons. Nobody else + // can use the disk. This mode is used (for example) when taking + // a snapshot of a disk to prevent mounting the disk while it is + // being snapshotted. + LOCKED = 3; + } + + // List of the Disk Interfaces. + enum DiskInterface { + // Default value, which is unused. + DISK_INTERFACE_UNSPECIFIED = 0; + + // SCSI Disk Interface. + SCSI = 1; + + // NVME Disk Interface. + NVME = 2; + + // NVDIMM Disk Interface. + NVDIMM = 3; + + // ISCSI Disk Interface. + ISCSI = 4; + } + + // List of the states of the Disk. + enum DiskSavedState { + // Default Disk state has not been preserved. + DISK_SAVED_STATE_UNSPECIFIED = 0; + + // Disk state has been preserved. + PRESERVED = 1; + } + + // Optional. Specifies the parameters to initialize this disk. + optional InitializeParams initialize_params = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This is used as an identifier for the disks. This is the unique + // name has to provided to modify disk parameters like disk_name and + // replica_zones (in case of RePDs) + optional string device_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the resource. + optional string kind = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies the type of the disk. + optional DiskType disk_type_deprecated = 6 [deprecated = true]; + + // Optional. The mode in which to attach this disk. + optional DiskMode mode = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a valid partial or full URL to an existing Persistent + // Disk resource. + optional string source = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A zero-based index to this disk, where 0 is reserved for the + // boot disk. + optional int64 index = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that this is a boot disk. The virtual machine will use + // the first partition of the disk for its root filesystem. + optional bool boot = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the disk will be auto-deleted when the instance + // is deleted (but not when the disk is detached from the instance). + optional bool auto_delete = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Any valid publicly visible licenses. + repeated string license = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the disk interface to use for attaching this disk. + optional DiskInterface disk_interface = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of features to enable on the guest operating system. + // Applicable only for bootable images. + repeated GuestOsFeature guest_os_feature = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypts or decrypts a disk using a customer-supplied + // encryption key. + optional CustomerEncryptionKey disk_encryption_key = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The size of the disk in GB. + optional int64 disk_size_gb = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. The state of the disk. + optional DiskSavedState saved_state = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Output only. The URI of the disk type resource. For example: + // projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + optional string disk_type = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Specifies the type of the disk. + optional DiskType type = 19 [(google.api.field_behavior) = OPTIONAL]; +} + +// Feature type of the Guest OS. +message GuestOsFeature { + // List of the Feature Types. + enum FeatureType { + // Default value, which is unused. + FEATURE_TYPE_UNSPECIFIED = 0; + + // VIRTIO_SCSI_MULTIQUEUE feature type. + VIRTIO_SCSI_MULTIQUEUE = 1; + + // WINDOWS feature type. + WINDOWS = 2; + + // MULTI_IP_SUBNET feature type. + MULTI_IP_SUBNET = 3; + + // UEFI_COMPATIBLE feature type. + UEFI_COMPATIBLE = 4; + + // SECURE_BOOT feature type. + SECURE_BOOT = 5; + + // GVNIC feature type. + GVNIC = 6; + + // SEV_CAPABLE feature type. + SEV_CAPABLE = 7; + + // BARE_METAL_LINUX_COMPATIBLE feature type. + BARE_METAL_LINUX_COMPATIBLE = 8; + + // SUSPEND_RESUME_COMPATIBLE feature type. + SUSPEND_RESUME_COMPATIBLE = 9; + + // SEV_LIVE_MIGRATABLE feature type. + SEV_LIVE_MIGRATABLE = 10; + + // SEV_SNP_CAPABLE feature type. + SEV_SNP_CAPABLE = 11; + + // TDX_CAPABLE feature type. + TDX_CAPABLE = 12; + + // IDPF feature type. + IDPF = 13; + + // SEV_LIVE_MIGRATABLE_V2 feature type. + SEV_LIVE_MIGRATABLE_V2 = 14; + } + + // The ID of a supported feature. + optional FeatureType type = 1; +} + +// Specifies whether the virtual machine instance will be shut down on key +// revocation. It is currently used in instance, instance properties and GMI +// protos +enum KeyRevocationActionType { + // Default value. This value is unused. + KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; + + // Indicates user chose no operation. + NONE = 1; + + // Indicates user chose to opt for VM shutdown on key revocation. + STOP = 2; +} diff --git a/packages/google-cloud-backupdr/protos/protos.d.ts b/packages/google-cloud-backupdr/protos/protos.d.ts index 5506c3035be..03e288c9665 100644 --- a/packages/google-cloud-backupdr/protos/protos.d.ts +++ b/packages/google-cloud-backupdr/protos/protos.d.ts @@ -101,1357 +101,11691 @@ export namespace google { * @returns Promise */ public deleteManagementServer(request: google.cloud.backupdr.v1.IDeleteManagementServerRequest): Promise; + + /** + * Calls CreateBackupVault. + * @param request CreateBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback): void; + + /** + * Calls CreateBackupVault. + * @param request CreateBackupVaultRequest message or plain object + * @returns Promise + */ + public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest): Promise; + + /** + * Calls ListBackupVaults. + * @param request ListBackupVaultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupVaultsResponse + */ + public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback): void; + + /** + * Calls ListBackupVaults. + * @param request ListBackupVaultsRequest message or plain object + * @returns Promise + */ + public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest): Promise; + + /** + * Calls FetchUsableBackupVaults. + * @param request FetchUsableBackupVaultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse + */ + public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback): void; + + /** + * Calls FetchUsableBackupVaults. + * @param request FetchUsableBackupVaultsRequest message or plain object + * @returns Promise + */ + public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): Promise; + + /** + * Calls GetBackupVault. + * @param request GetBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupVault + */ + public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback): void; + + /** + * Calls GetBackupVault. + * @param request GetBackupVaultRequest message or plain object + * @returns Promise + */ + public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest): Promise; + + /** + * Calls UpdateBackupVault. + * @param request UpdateBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback): void; + + /** + * Calls UpdateBackupVault. + * @param request UpdateBackupVaultRequest message or plain object + * @returns Promise + */ + public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): Promise; + + /** + * Calls DeleteBackupVault. + * @param request DeleteBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback): void; + + /** + * Calls DeleteBackupVault. + * @param request DeleteBackupVaultRequest message or plain object + * @returns Promise + */ + public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): Promise; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataSourcesResponse + */ + public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest, callback: google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback): void; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @returns Promise + */ + public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest): Promise; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSource + */ + public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback): void; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @returns Promise + */ + public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest): Promise; + + /** + * Calls UpdateDataSource. + * @param request UpdateDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback): void; + + /** + * Calls UpdateDataSource. + * @param request UpdateDataSourceRequest message or plain object + * @returns Promise + */ + public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest): 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.cloud.backupdr.v1.IListBackupsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.backupdr.v1.IListBackupsRequest): 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.cloud.backupdr.v1.IGetBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.backupdr.v1.IGetBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest): Promise; + + /** + * Calls RestoreBackup. + * @param request RestoreBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback): void; + + /** + * Calls RestoreBackup. + * @param request RestoreBackupRequest message or plain object + * @returns Promise + */ + public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest): Promise; + + /** + * Calls CreateBackupPlan. + * @param request CreateBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback): void; + + /** + * Calls CreateBackupPlan. + * @param request CreateBackupPlanRequest message or plain object + * @returns Promise + */ + public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest): Promise; + + /** + * Calls GetBackupPlan. + * @param request GetBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupPlan + */ + public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback): void; + + /** + * Calls GetBackupPlan. + * @param request GetBackupPlanRequest message or plain object + * @returns Promise + */ + public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest): Promise; + + /** + * Calls ListBackupPlans. + * @param request ListBackupPlansRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupPlansResponse + */ + public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback): void; + + /** + * Calls ListBackupPlans. + * @param request ListBackupPlansRequest message or plain object + * @returns Promise + */ + public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest): Promise; + + /** + * Calls DeleteBackupPlan. + * @param request DeleteBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback): void; + + /** + * Calls DeleteBackupPlan. + * @param request DeleteBackupPlanRequest message or plain object + * @returns Promise + */ + public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): Promise; + + /** + * Calls CreateBackupPlanAssociation. + * @param request CreateBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback): void; + + /** + * Calls CreateBackupPlanAssociation. + * @param request CreateBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): Promise; + + /** + * Calls GetBackupPlanAssociation. + * @param request GetBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupPlanAssociation + */ + public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback): void; + + /** + * Calls GetBackupPlanAssociation. + * @param request GetBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): Promise; + + /** + * Calls ListBackupPlanAssociations. + * @param request ListBackupPlanAssociationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse + */ + public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback): void; + + /** + * Calls ListBackupPlanAssociations. + * @param request ListBackupPlanAssociationsRequest message or plain object + * @returns Promise + */ + public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): Promise; + + /** + * Calls DeleteBackupPlanAssociation. + * @param request DeleteBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback): void; + + /** + * Calls DeleteBackupPlanAssociation. + * @param request DeleteBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): Promise; + + /** + * Calls TriggerBackup. + * @param request TriggerBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback): void; + + /** + * Calls TriggerBackup. + * @param request TriggerBackupRequest message or plain object + * @returns Promise + */ + public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest): Promise; + } + + namespace BackupDR { + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. + * @param error Error, if any + * @param [response] ListManagementServersResponse + */ + type ListManagementServersCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListManagementServersResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. + * @param error Error, if any + * @param [response] ManagementServer + */ + type GetManagementServerCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ManagementServer) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. + * @param error Error, if any + * @param [response] ListBackupVaultsResponse + */ + type ListBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupVaultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. + * @param error Error, if any + * @param [response] FetchUsableBackupVaultsResponse + */ + type FetchUsableBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. + * @param error Error, if any + * @param [response] BackupVault + */ + type GetBackupVaultCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupVault) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. + * @param error Error, if any + * @param [response] ListDataSourcesResponse + */ + type ListDataSourcesCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListDataSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. + * @param error Error, if any + * @param [response] DataSource + */ + type GetDataSourceCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.DataSource) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDataSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.Backup) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. + * @param error Error, if any + * @param [response] BackupPlan + */ + type GetBackupPlanCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlan) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. + * @param error Error, if any + * @param [response] ListBackupPlansResponse + */ + type ListBackupPlansCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlansResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. + * @param error Error, if any + * @param [response] BackupPlanAssociation + */ + type GetBackupPlanAssociationCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlanAssociation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. + * @param error Error, if any + * @param [response] ListBackupPlanAssociationsResponse + */ + type ListBackupPlanAssociationsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type TriggerBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig peeringMode */ + peeringMode?: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig peeringMode. */ + public peeringMode: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode); + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.INetworkConfig): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkConfig { + + /** PeeringMode enum. */ + enum PeeringMode { + PEERING_MODE_UNSPECIFIED = 0, + PRIVATE_SERVICE_ACCESS = 1 + } + } + + /** Properties of a ManagementURI. */ + interface IManagementURI { + + /** ManagementURI webUi */ + webUi?: (string|null); + + /** ManagementURI api */ + api?: (string|null); + } + + /** Represents a ManagementURI. */ + class ManagementURI implements IManagementURI { + + /** + * Constructs a new ManagementURI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IManagementURI); + + /** ManagementURI webUi. */ + public webUi: string; + + /** ManagementURI api. */ + public api: string; + + /** + * Creates a new ManagementURI instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagementURI instance + */ + public static create(properties?: google.cloud.backupdr.v1.IManagementURI): google.cloud.backupdr.v1.ManagementURI; + + /** + * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @param message ManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @param message ManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagementURI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementURI; + + /** + * Decodes a ManagementURI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementURI; + + /** + * Verifies a ManagementURI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagementURI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementURI; + + /** + * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. + * @param message ManagementURI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagementURI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagementURI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkforceIdentityBasedManagementURI. */ + interface IWorkforceIdentityBasedManagementURI { + + /** WorkforceIdentityBasedManagementURI firstPartyManagementUri */ + firstPartyManagementUri?: (string|null); + + /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri */ + thirdPartyManagementUri?: (string|null); + } + + /** Represents a WorkforceIdentityBasedManagementURI. */ + class WorkforceIdentityBasedManagementURI implements IWorkforceIdentityBasedManagementURI { + + /** + * Constructs a new WorkforceIdentityBasedManagementURI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI); + + /** WorkforceIdentityBasedManagementURI firstPartyManagementUri. */ + public firstPartyManagementUri: string; + + /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri. */ + public thirdPartyManagementUri: string; + + /** + * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkforceIdentityBasedManagementURI instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Verifies a WorkforceIdentityBasedManagementURI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkforceIdentityBasedManagementURI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. + * @param message WorkforceIdentityBasedManagementURI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkforceIdentityBasedManagementURI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkforceIdentityBasedManagementURI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkforceIdentityBasedOAuth2ClientID. */ + interface IWorkforceIdentityBasedOAuth2ClientID { + + /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId */ + firstPartyOauth2ClientId?: (string|null); + + /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId */ + thirdPartyOauth2ClientId?: (string|null); + } + + /** Represents a WorkforceIdentityBasedOAuth2ClientID. */ + class WorkforceIdentityBasedOAuth2ClientID implements IWorkforceIdentityBasedOAuth2ClientID { + + /** + * Constructs a new WorkforceIdentityBasedOAuth2ClientID. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID); + + /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. */ + public firstPartyOauth2ClientId: string; + + /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. */ + public thirdPartyOauth2ClientId: string; + + /** + * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkforceIdentityBasedOAuth2ClientID instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Verifies a WorkforceIdentityBasedOAuth2ClientID message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkforceIdentityBasedOAuth2ClientID + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. + * @param message WorkforceIdentityBasedOAuth2ClientID + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManagementServer. */ + interface IManagementServer { + + /** ManagementServer name */ + name?: (string|null); + + /** ManagementServer description */ + description?: (string|null); + + /** ManagementServer labels */ + labels?: ({ [k: string]: string }|null); + + /** ManagementServer createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer type */ + type?: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType|null); + + /** ManagementServer managementUri */ + managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); + + /** ManagementServer workforceIdentityBasedManagementUri */ + workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); + + /** ManagementServer state */ + state?: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState|null); + + /** ManagementServer networks */ + networks?: (google.cloud.backupdr.v1.INetworkConfig[]|null); + + /** ManagementServer etag */ + etag?: (string|null); + + /** ManagementServer oauth2ClientId */ + oauth2ClientId?: (string|null); + + /** ManagementServer workforceIdentityBasedOauth2ClientId */ + workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + + /** ManagementServer baProxyUri */ + baProxyUri?: (string[]|null); + + /** ManagementServer satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** ManagementServer satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a ManagementServer. */ + class ManagementServer implements IManagementServer { + + /** + * Constructs a new ManagementServer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IManagementServer); + + /** ManagementServer name. */ + public name: string; + + /** ManagementServer description. */ + public description: string; + + /** ManagementServer labels. */ + public labels: { [k: string]: string }; + + /** ManagementServer createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer type. */ + public type: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType); + + /** ManagementServer managementUri. */ + public managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); + + /** ManagementServer workforceIdentityBasedManagementUri. */ + public workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); + + /** ManagementServer state. */ + public state: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState); + + /** ManagementServer networks. */ + public networks: google.cloud.backupdr.v1.INetworkConfig[]; + + /** ManagementServer etag. */ + public etag: string; + + /** ManagementServer oauth2ClientId. */ + public oauth2ClientId: string; + + /** ManagementServer workforceIdentityBasedOauth2ClientId. */ + public workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + + /** ManagementServer baProxyUri. */ + public baProxyUri: string[]; + + /** ManagementServer satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** ManagementServer satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** + * Creates a new ManagementServer instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagementServer instance + */ + public static create(properties?: google.cloud.backupdr.v1.IManagementServer): google.cloud.backupdr.v1.ManagementServer; + + /** + * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @param message ManagementServer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @param message ManagementServer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagementServer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementServer; + + /** + * Decodes a ManagementServer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementServer; + + /** + * Verifies a ManagementServer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagementServer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementServer; + + /** + * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. + * @param message ManagementServer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ManagementServer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagementServer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagementServer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ManagementServer { + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + BACKUP_RESTORE = 1 + } + + /** InstanceState enum. */ + enum InstanceState { + INSTANCE_STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + UPDATING = 3, + DELETING = 4, + REPAIRING = 5, + MAINTENANCE = 6, + ERROR = 7 + } + } + + /** Properties of a ListManagementServersRequest. */ + interface IListManagementServersRequest { + + /** ListManagementServersRequest parent */ + parent?: (string|null); + + /** ListManagementServersRequest pageSize */ + pageSize?: (number|null); + + /** ListManagementServersRequest pageToken */ + pageToken?: (string|null); + + /** ListManagementServersRequest filter */ + filter?: (string|null); + + /** ListManagementServersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListManagementServersRequest. */ + class ListManagementServersRequest implements IListManagementServersRequest { + + /** + * Constructs a new ListManagementServersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListManagementServersRequest); + + /** ListManagementServersRequest parent. */ + public parent: string; + + /** ListManagementServersRequest pageSize. */ + public pageSize: number; + + /** ListManagementServersRequest pageToken. */ + public pageToken: string; + + /** ListManagementServersRequest filter. */ + public filter?: (string|null); + + /** ListManagementServersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListManagementServersRequest _filter. */ + public _filter?: "filter"; + + /** ListManagementServersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** + * Creates a new ListManagementServersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagementServersRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListManagementServersRequest): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @param message ListManagementServersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @param message ListManagementServersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagementServersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Decodes a ListManagementServersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Verifies a ListManagementServersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagementServersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Creates a plain object from a ListManagementServersRequest message. Also converts values to other types if specified. + * @param message ListManagementServersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListManagementServersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagementServersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagementServersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListManagementServersResponse. */ + interface IListManagementServersResponse { + + /** ListManagementServersResponse managementServers */ + managementServers?: (google.cloud.backupdr.v1.IManagementServer[]|null); + + /** ListManagementServersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListManagementServersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListManagementServersResponse. */ + class ListManagementServersResponse implements IListManagementServersResponse { + + /** + * Constructs a new ListManagementServersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListManagementServersResponse); + + /** ListManagementServersResponse managementServers. */ + public managementServers: google.cloud.backupdr.v1.IManagementServer[]; + + /** ListManagementServersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListManagementServersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListManagementServersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagementServersResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListManagementServersResponse): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @param message ListManagementServersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @param message ListManagementServersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagementServersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Decodes a ListManagementServersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Verifies a ListManagementServersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagementServersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Creates a plain object from a ListManagementServersResponse message. Also converts values to other types if specified. + * @param message ListManagementServersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListManagementServersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagementServersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagementServersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetManagementServerRequest. */ + interface IGetManagementServerRequest { + + /** GetManagementServerRequest name */ + name?: (string|null); + } + + /** Represents a GetManagementServerRequest. */ + class GetManagementServerRequest implements IGetManagementServerRequest { + + /** + * Constructs a new GetManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest); + + /** GetManagementServerRequest name. */ + public name: string; + + /** + * Creates a new GetManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @param message GetManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @param message GetManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Decodes a GetManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Verifies a GetManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. + * @param message GetManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateManagementServerRequest. */ + interface ICreateManagementServerRequest { + + /** CreateManagementServerRequest parent */ + parent?: (string|null); + + /** CreateManagementServerRequest managementServerId */ + managementServerId?: (string|null); + + /** CreateManagementServerRequest managementServer */ + managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + + /** CreateManagementServerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateManagementServerRequest. */ + class CreateManagementServerRequest implements ICreateManagementServerRequest { + + /** + * Constructs a new CreateManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest); + + /** CreateManagementServerRequest parent. */ + public parent: string; + + /** CreateManagementServerRequest managementServerId. */ + public managementServerId: string; + + /** CreateManagementServerRequest managementServer. */ + public managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + + /** CreateManagementServerRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @param message CreateManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @param message CreateManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Verifies a CreateManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. + * @param message CreateManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteManagementServerRequest. */ + interface IDeleteManagementServerRequest { + + /** DeleteManagementServerRequest name */ + name?: (string|null); + + /** DeleteManagementServerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteManagementServerRequest. */ + class DeleteManagementServerRequest implements IDeleteManagementServerRequest { + + /** + * Constructs a new DeleteManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest); + + /** DeleteManagementServerRequest name. */ + public name: string; + + /** DeleteManagementServerRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @param message DeleteManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @param message DeleteManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Decodes a DeleteManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Verifies a DeleteManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Creates a plain object from a DeleteManagementServerRequest message. Also converts values to other types if specified. + * @param message DeleteManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + + /** OperationMetadata additionalInfo */ + additionalInfo?: ({ [k: string]: string }|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata additionalInfo. */ + public additionalInfo: { [k: string]: string }; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.backupdr.v1.IOperationMetadata): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupPlan. */ + interface IBackupPlan { + + /** BackupPlan name */ + name?: (string|null); + + /** BackupPlan description */ + description?: (string|null); + + /** BackupPlan labels */ + labels?: ({ [k: string]: string }|null); + + /** BackupPlan createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan backupRules */ + backupRules?: (google.cloud.backupdr.v1.IBackupRule[]|null); + + /** BackupPlan state */ + state?: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State|null); + + /** BackupPlan resourceType */ + resourceType?: (string|null); + + /** BackupPlan etag */ + etag?: (string|null); + + /** BackupPlan backupVault */ + backupVault?: (string|null); + + /** BackupPlan backupVaultServiceAccount */ + backupVaultServiceAccount?: (string|null); + } + + /** Represents a BackupPlan. */ + class BackupPlan implements IBackupPlan { + + /** + * Constructs a new BackupPlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupPlan); + + /** BackupPlan name. */ + public name: string; + + /** BackupPlan description. */ + public description: string; + + /** BackupPlan labels. */ + public labels: { [k: string]: string }; + + /** BackupPlan createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan backupRules. */ + public backupRules: google.cloud.backupdr.v1.IBackupRule[]; + + /** BackupPlan state. */ + public state: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State); + + /** BackupPlan resourceType. */ + public resourceType: string; + + /** BackupPlan etag. */ + public etag: string; + + /** BackupPlan backupVault. */ + public backupVault: string; + + /** BackupPlan backupVaultServiceAccount. */ + public backupVaultServiceAccount: string; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlan instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupPlan): google.cloud.backupdr.v1.BackupPlan; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @param message BackupPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @param message BackupPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupPlan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlan; + + /** + * Decodes a BackupPlan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlan; + + /** + * Verifies a BackupPlan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupPlan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlan; + + /** + * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. + * @param message BackupPlan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupPlan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupPlan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupPlan { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4 + } + } + + /** Properties of a BackupRule. */ + interface IBackupRule { + + /** BackupRule ruleId */ + ruleId?: (string|null); + + /** BackupRule backupRetentionDays */ + backupRetentionDays?: (number|null); + + /** BackupRule standardSchedule */ + standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); + } + + /** Represents a BackupRule. */ + class BackupRule implements IBackupRule { + + /** + * Constructs a new BackupRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupRule); + + /** BackupRule ruleId. */ + public ruleId: string; + + /** BackupRule backupRetentionDays. */ + public backupRetentionDays: number; + + /** BackupRule standardSchedule. */ + public standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); + + /** BackupRule backupScheduleOneof. */ + public backupScheduleOneof?: "standardSchedule"; + + /** + * Creates a new BackupRule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupRule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupRule): google.cloud.backupdr.v1.BackupRule; + + /** + * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @param message BackupRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @param message BackupRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupRule; + + /** + * Decodes a BackupRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupRule; + + /** + * Verifies a BackupRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupRule; + + /** + * Creates a plain object from a BackupRule message. Also converts values to other types if specified. + * @param message BackupRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardSchedule. */ + interface IStandardSchedule { + + /** StandardSchedule recurrenceType */ + recurrenceType?: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null); + + /** StandardSchedule hourlyFrequency */ + hourlyFrequency?: (number|null); + + /** StandardSchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + + /** StandardSchedule daysOfMonth */ + daysOfMonth?: (number[]|null); + + /** StandardSchedule weekDayOfMonth */ + weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); + + /** StandardSchedule months */ + months?: (google.type.Month[]|null); + + /** StandardSchedule backupWindow */ + backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); + + /** StandardSchedule timeZone */ + timeZone?: (string|null); + } + + /** Represents a StandardSchedule. */ + class StandardSchedule implements IStandardSchedule { + + /** + * Constructs a new StandardSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IStandardSchedule); + + /** StandardSchedule recurrenceType. */ + public recurrenceType: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType); + + /** StandardSchedule hourlyFrequency. */ + public hourlyFrequency: number; + + /** StandardSchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; + + /** StandardSchedule daysOfMonth. */ + public daysOfMonth: number[]; + + /** StandardSchedule weekDayOfMonth. */ + public weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); + + /** StandardSchedule months. */ + public months: google.type.Month[]; + + /** StandardSchedule backupWindow. */ + public backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); + + /** StandardSchedule timeZone. */ + public timeZone: string; + + /** + * Creates a new StandardSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSchedule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IStandardSchedule): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @param message StandardSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @param message StandardSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Verifies a StandardSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. + * @param message StandardSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.StandardSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StandardSchedule { + + /** RecurrenceType enum. */ + enum RecurrenceType { + RECURRENCE_TYPE_UNSPECIFIED = 0, + HOURLY = 1, + DAILY = 2, + WEEKLY = 3, + MONTHLY = 4, + YEARLY = 5 + } + } + + /** Properties of a BackupWindow. */ + interface IBackupWindow { + + /** BackupWindow startHourOfDay */ + startHourOfDay?: (number|null); + + /** BackupWindow endHourOfDay */ + endHourOfDay?: (number|null); + } + + /** Represents a BackupWindow. */ + class BackupWindow implements IBackupWindow { + + /** + * Constructs a new BackupWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupWindow); + + /** BackupWindow startHourOfDay. */ + public startHourOfDay: number; + + /** BackupWindow endHourOfDay. */ + public endHourOfDay: number; + + /** + * Creates a new BackupWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupWindow instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupWindow): google.cloud.backupdr.v1.BackupWindow; + + /** + * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @param message BackupWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @param message BackupWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupWindow; + + /** + * Decodes a BackupWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupWindow; + + /** + * Verifies a BackupWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupWindow; + + /** + * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. + * @param message BackupWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WeekDayOfMonth. */ + interface IWeekDayOfMonth { + + /** WeekDayOfMonth weekOfMonth */ + weekOfMonth?: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null); + + /** WeekDayOfMonth dayOfWeek */ + dayOfWeek?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + } + + /** Represents a WeekDayOfMonth. */ + class WeekDayOfMonth implements IWeekDayOfMonth { + + /** + * Constructs a new WeekDayOfMonth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth); + + /** WeekDayOfMonth weekOfMonth. */ + public weekOfMonth: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth); + + /** WeekDayOfMonth dayOfWeek. */ + public dayOfWeek: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @param [properties] Properties to set + * @returns WeekDayOfMonth instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Verifies a WeekDayOfMonth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeekDayOfMonth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @param message WeekDayOfMonth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WeekDayOfMonth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeekDayOfMonth + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WeekDayOfMonth { + + /** WeekOfMonth enum. */ + enum WeekOfMonth { + WEEK_OF_MONTH_UNSPECIFIED = 0, + FIRST = 1, + SECOND = 2, + THIRD = 3, + FOURTH = 4, + LAST = 5 + } + } + + /** Properties of a CreateBackupPlanRequest. */ + interface ICreateBackupPlanRequest { + + /** CreateBackupPlanRequest parent */ + parent?: (string|null); + + /** CreateBackupPlanRequest backupPlanId */ + backupPlanId?: (string|null); + + /** CreateBackupPlanRequest backupPlan */ + backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateBackupPlanRequest. */ + class CreateBackupPlanRequest implements ICreateBackupPlanRequest { + + /** + * Constructs a new CreateBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest); + + /** CreateBackupPlanRequest parent. */ + public parent: string; + + /** CreateBackupPlanRequest backupPlanId. */ + public backupPlanId: string; + + /** CreateBackupPlanRequest backupPlan. */ + public backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @param message CreateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @param message CreateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Verifies a CreateBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. + * @param message CreateBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlansRequest. */ + interface IListBackupPlansRequest { + + /** ListBackupPlansRequest parent */ + parent?: (string|null); + + /** ListBackupPlansRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupPlansRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupPlansRequest filter */ + filter?: (string|null); + + /** ListBackupPlansRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListBackupPlansRequest. */ + class ListBackupPlansRequest implements IListBackupPlansRequest { + + /** + * Constructs a new ListBackupPlansRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest); + + /** ListBackupPlansRequest parent. */ + public parent: string; + + /** ListBackupPlansRequest pageSize. */ + public pageSize: number; + + /** ListBackupPlansRequest pageToken. */ + public pageToken: string; + + /** ListBackupPlansRequest filter. */ + public filter: string; + + /** ListBackupPlansRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListBackupPlansRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlansRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @param message ListBackupPlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @param message ListBackupPlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Verifies a ListBackupPlansRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlansRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Creates a plain object from a ListBackupPlansRequest message. Also converts values to other types if specified. + * @param message ListBackupPlansRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlansRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlansRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlansResponse. */ + interface IListBackupPlansResponse { + + /** ListBackupPlansResponse backupPlans */ + backupPlans?: (google.cloud.backupdr.v1.IBackupPlan[]|null); + + /** ListBackupPlansResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupPlansResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupPlansResponse. */ + class ListBackupPlansResponse implements IListBackupPlansResponse { + + /** + * Constructs a new ListBackupPlansResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse); + + /** ListBackupPlansResponse backupPlans. */ + public backupPlans: google.cloud.backupdr.v1.IBackupPlan[]; + + /** ListBackupPlansResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupPlansResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupPlansResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlansResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @param message ListBackupPlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @param message ListBackupPlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Verifies a ListBackupPlansResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlansResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Creates a plain object from a ListBackupPlansResponse message. Also converts values to other types if specified. + * @param message ListBackupPlansResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlansResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlansResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupPlanRequest. */ + interface IGetBackupPlanRequest { + + /** GetBackupPlanRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupPlanRequest. */ + class GetBackupPlanRequest implements IGetBackupPlanRequest { + + /** + * Constructs a new GetBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest); + + /** GetBackupPlanRequest name. */ + public name: string; + + /** + * Creates a new GetBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @param message GetBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @param message GetBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Verifies a GetBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. + * @param message GetBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupPlanRequest. */ + interface IDeleteBackupPlanRequest { + + /** DeleteBackupPlanRequest name */ + name?: (string|null); + + /** DeleteBackupPlanRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupPlanRequest. */ + class DeleteBackupPlanRequest implements IDeleteBackupPlanRequest { + + /** + * Constructs a new DeleteBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest); + + /** DeleteBackupPlanRequest name. */ + public name: string; + + /** DeleteBackupPlanRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @param message DeleteBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @param message DeleteBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Verifies a DeleteBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Creates a plain object from a DeleteBackupPlanRequest message. Also converts values to other types if specified. + * @param message DeleteBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupPlanAssociation. */ + interface IBackupPlanAssociation { + + /** BackupPlanAssociation name */ + name?: (string|null); + + /** BackupPlanAssociation resourceType */ + resourceType?: (string|null); + + /** BackupPlanAssociation resource */ + resource?: (string|null); + + /** BackupPlanAssociation backupPlan */ + backupPlan?: (string|null); + + /** BackupPlanAssociation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation state */ + state?: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State|null); + + /** BackupPlanAssociation rulesConfigInfo */ + rulesConfigInfo?: (google.cloud.backupdr.v1.IRuleConfigInfo[]|null); + + /** BackupPlanAssociation dataSource */ + dataSource?: (string|null); + } + + /** Represents a BackupPlanAssociation. */ + class BackupPlanAssociation implements IBackupPlanAssociation { + + /** + * Constructs a new BackupPlanAssociation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation); + + /** BackupPlanAssociation name. */ + public name: string; + + /** BackupPlanAssociation resourceType. */ + public resourceType: string; + + /** BackupPlanAssociation resource. */ + public resource: string; + + /** BackupPlanAssociation backupPlan. */ + public backupPlan: string; + + /** BackupPlanAssociation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation state. */ + public state: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State); + + /** BackupPlanAssociation rulesConfigInfo. */ + public rulesConfigInfo: google.cloud.backupdr.v1.IRuleConfigInfo[]; + + /** BackupPlanAssociation dataSource. */ + public dataSource: string; + + /** + * Creates a new BackupPlanAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlanAssociation instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @param message BackupPlanAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @param message BackupPlanAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Verifies a BackupPlanAssociation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupPlanAssociation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. + * @param message BackupPlanAssociation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupPlanAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupPlanAssociation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupPlanAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupPlanAssociation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4 + } + } + + /** Properties of a RuleConfigInfo. */ + interface IRuleConfigInfo { + + /** RuleConfigInfo ruleId */ + ruleId?: (string|null); + + /** RuleConfigInfo lastBackupState */ + lastBackupState?: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null); + + /** RuleConfigInfo lastBackupError */ + lastBackupError?: (google.rpc.IStatus|null); + + /** RuleConfigInfo lastSuccessfulBackupConsistencyTime */ + lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RuleConfigInfo. */ + class RuleConfigInfo implements IRuleConfigInfo { + + /** + * Constructs a new RuleConfigInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRuleConfigInfo); + + /** RuleConfigInfo ruleId. */ + public ruleId: string; + + /** RuleConfigInfo lastBackupState. */ + public lastBackupState: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState); + + /** RuleConfigInfo lastBackupError. */ + public lastBackupError?: (google.rpc.IStatus|null); + + /** RuleConfigInfo lastSuccessfulBackupConsistencyTime. */ + public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RuleConfigInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RuleConfigInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRuleConfigInfo): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @param message RuleConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @param message RuleConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Verifies a RuleConfigInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuleConfigInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. + * @param message RuleConfigInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RuleConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuleConfigInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuleConfigInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuleConfigInfo { + + /** LastBackupState enum. */ + enum LastBackupState { + LAST_BACKUP_STATE_UNSPECIFIED = 0, + FIRST_BACKUP_PENDING = 1, + PERMISSION_DENIED = 2, + SUCCEEDED = 3, + FAILED = 4 + } + } + + /** Properties of a CreateBackupPlanAssociationRequest. */ + interface ICreateBackupPlanAssociationRequest { + + /** CreateBackupPlanAssociationRequest parent */ + parent?: (string|null); + + /** CreateBackupPlanAssociationRequest backupPlanAssociationId */ + backupPlanAssociationId?: (string|null); + + /** CreateBackupPlanAssociationRequest backupPlanAssociation */ + backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** CreateBackupPlanAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateBackupPlanAssociationRequest. */ + class CreateBackupPlanAssociationRequest implements ICreateBackupPlanAssociationRequest { + + /** + * Constructs a new CreateBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest); + + /** CreateBackupPlanAssociationRequest parent. */ + public parent: string; + + /** CreateBackupPlanAssociationRequest backupPlanAssociationId. */ + public backupPlanAssociationId: string; + + /** CreateBackupPlanAssociationRequest backupPlanAssociation. */ + public backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** CreateBackupPlanAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @param message CreateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @param message CreateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Verifies a CreateBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message CreateBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanAssociationsRequest. */ + interface IListBackupPlanAssociationsRequest { + + /** ListBackupPlanAssociationsRequest parent */ + parent?: (string|null); + + /** ListBackupPlanAssociationsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupPlanAssociationsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupPlanAssociationsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListBackupPlanAssociationsRequest. */ + class ListBackupPlanAssociationsRequest implements IListBackupPlanAssociationsRequest { + + /** + * Constructs a new ListBackupPlanAssociationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest); + + /** ListBackupPlanAssociationsRequest parent. */ + public parent: string; + + /** ListBackupPlanAssociationsRequest pageSize. */ + public pageSize: number; + + /** ListBackupPlanAssociationsRequest pageToken. */ + public pageToken: string; + + /** ListBackupPlanAssociationsRequest filter. */ + public filter: string; + + /** + * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanAssociationsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @param message ListBackupPlanAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @param message ListBackupPlanAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Verifies a ListBackupPlanAssociationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanAssociationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Creates a plain object from a ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. + * @param message ListBackupPlanAssociationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanAssociationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanAssociationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanAssociationsResponse. */ + interface IListBackupPlanAssociationsResponse { + + /** ListBackupPlanAssociationsResponse backupPlanAssociations */ + backupPlanAssociations?: (google.cloud.backupdr.v1.IBackupPlanAssociation[]|null); + + /** ListBackupPlanAssociationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupPlanAssociationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupPlanAssociationsResponse. */ + class ListBackupPlanAssociationsResponse implements IListBackupPlanAssociationsResponse { + + /** + * Constructs a new ListBackupPlanAssociationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse); + + /** ListBackupPlanAssociationsResponse backupPlanAssociations. */ + public backupPlanAssociations: google.cloud.backupdr.v1.IBackupPlanAssociation[]; + + /** ListBackupPlanAssociationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupPlanAssociationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanAssociationsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @param message ListBackupPlanAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @param message ListBackupPlanAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Verifies a ListBackupPlanAssociationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanAssociationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Creates a plain object from a ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. + * @param message ListBackupPlanAssociationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanAssociationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanAssociationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupPlanAssociationRequest. */ + interface IGetBackupPlanAssociationRequest { + + /** GetBackupPlanAssociationRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupPlanAssociationRequest. */ + class GetBackupPlanAssociationRequest implements IGetBackupPlanAssociationRequest { + + /** + * Constructs a new GetBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest); + + /** GetBackupPlanAssociationRequest name. */ + public name: string; + + /** + * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @param message GetBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @param message GetBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Verifies a GetBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message GetBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupPlanAssociationRequest. */ + interface IDeleteBackupPlanAssociationRequest { + + /** DeleteBackupPlanAssociationRequest name */ + name?: (string|null); + + /** DeleteBackupPlanAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupPlanAssociationRequest. */ + class DeleteBackupPlanAssociationRequest implements IDeleteBackupPlanAssociationRequest { + + /** + * Constructs a new DeleteBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest); + + /** DeleteBackupPlanAssociationRequest name. */ + public name: string; + + /** DeleteBackupPlanAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @param message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @param message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Verifies a DeleteBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Creates a plain object from a DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message DeleteBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggerBackupRequest. */ + interface ITriggerBackupRequest { + + /** TriggerBackupRequest name */ + name?: (string|null); + + /** TriggerBackupRequest ruleId */ + ruleId?: (string|null); + + /** TriggerBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a TriggerBackupRequest. */ + class TriggerBackupRequest implements ITriggerBackupRequest { + + /** + * Constructs a new TriggerBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest); + + /** TriggerBackupRequest name. */ + public name: string; + + /** TriggerBackupRequest ruleId. */ + public ruleId: string; + + /** TriggerBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new TriggerBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @param message TriggerBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @param message TriggerBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Verifies a TriggerBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. + * @param message TriggerBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.TriggerBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupVault. */ + interface IBackupVault { + + /** BackupVault name */ + name?: (string|null); + + /** BackupVault description */ + description?: (string|null); + + /** BackupVault labels */ + labels?: ({ [k: string]: string }|null); + + /** BackupVault createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupMinimumEnforcedRetentionDuration */ + backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); + + /** BackupVault deletable */ + deletable?: (boolean|null); + + /** BackupVault etag */ + etag?: (string|null); + + /** BackupVault state */ + state?: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State|null); + + /** BackupVault effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupCount */ + backupCount?: (number|Long|string|null); + + /** BackupVault serviceAccount */ + serviceAccount?: (string|null); + + /** BackupVault totalStoredBytes */ + totalStoredBytes?: (number|Long|string|null); + + /** BackupVault uid */ + uid?: (string|null); + + /** BackupVault annotations */ + annotations?: ({ [k: string]: string }|null); + + /** BackupVault accessRestriction */ + accessRestriction?: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction|null); + } + + /** Represents a BackupVault. */ + class BackupVault implements IBackupVault { + + /** + * Constructs a new BackupVault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupVault); + + /** BackupVault name. */ + public name: string; + + /** BackupVault description. */ + public description?: (string|null); + + /** BackupVault labels. */ + public labels: { [k: string]: string }; + + /** BackupVault createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupMinimumEnforcedRetentionDuration. */ + public backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); + + /** BackupVault deletable. */ + public deletable?: (boolean|null); + + /** BackupVault etag. */ + public etag?: (string|null); + + /** BackupVault state. */ + public state: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State); + + /** BackupVault effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupCount. */ + public backupCount: (number|Long|string); + + /** BackupVault serviceAccount. */ + public serviceAccount: string; + + /** BackupVault totalStoredBytes. */ + public totalStoredBytes: (number|Long|string); + + /** BackupVault uid. */ + public uid: string; + + /** BackupVault annotations. */ + public annotations: { [k: string]: string }; + + /** BackupVault accessRestriction. */ + public accessRestriction: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction); + + /** BackupVault _description. */ + public _description?: "description"; + + /** BackupVault _createTime. */ + public _createTime?: "createTime"; + + /** BackupVault _updateTime. */ + public _updateTime?: "updateTime"; + + /** BackupVault _backupMinimumEnforcedRetentionDuration. */ + public _backupMinimumEnforcedRetentionDuration?: "backupMinimumEnforcedRetentionDuration"; + + /** BackupVault _deletable. */ + public _deletable?: "deletable"; + + /** BackupVault _etag. */ + public _etag?: "etag"; + + /** BackupVault _effectiveTime. */ + public _effectiveTime?: "effectiveTime"; + + /** + * Creates a new BackupVault instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupVault instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupVault): google.cloud.backupdr.v1.BackupVault; + + /** + * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @param message BackupVault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @param message BackupVault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupVault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupVault; + + /** + * Decodes a BackupVault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupVault; + + /** + * Verifies a BackupVault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupVault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupVault; + + /** + * Creates a plain object from a BackupVault message. Also converts values to other types if specified. + * @param message BackupVault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupVault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupVault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupVault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupVault { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4 + } + + /** AccessRestriction enum. */ + enum AccessRestriction { + ACCESS_RESTRICTION_UNSPECIFIED = 0, + WITHIN_PROJECT = 1, + WITHIN_ORGANIZATION = 2, + UNRESTRICTED = 3 + } + } + + /** Properties of a DataSource. */ + interface IDataSource { + + /** DataSource name */ + name?: (string|null); + + /** DataSource state */ + state?: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State|null); + + /** DataSource labels */ + labels?: ({ [k: string]: string }|null); + + /** DataSource createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DataSource updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DataSource backupCount */ + backupCount?: (number|Long|string|null); + + /** DataSource etag */ + etag?: (string|null); + + /** DataSource totalStoredBytes */ + totalStoredBytes?: (number|Long|string|null); + + /** DataSource configState */ + configState?: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState|null); + + /** DataSource backupConfigInfo */ + backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); + + /** DataSource dataSourceGcpResource */ + dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); + + /** DataSource dataSourceBackupApplianceApplication */ + dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); + } + + /** Represents a DataSource. */ + class DataSource implements IDataSource { + + /** + * Constructs a new DataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSource); + + /** DataSource name. */ + public name: string; + + /** DataSource state. */ + public state: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State); + + /** DataSource labels. */ + public labels: { [k: string]: string }; + + /** DataSource createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DataSource updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DataSource backupCount. */ + public backupCount?: (number|Long|string|null); + + /** DataSource etag. */ + public etag?: (string|null); + + /** DataSource totalStoredBytes. */ + public totalStoredBytes?: (number|Long|string|null); + + /** DataSource configState. */ + public configState: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState); + + /** DataSource backupConfigInfo. */ + public backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); + + /** DataSource dataSourceGcpResource. */ + public dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); + + /** DataSource dataSourceBackupApplianceApplication. */ + public dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); + + /** DataSource _createTime. */ + public _createTime?: "createTime"; + + /** DataSource _updateTime. */ + public _updateTime?: "updateTime"; + + /** DataSource _backupCount. */ + public _backupCount?: "backupCount"; + + /** DataSource _etag. */ + public _etag?: "etag"; + + /** DataSource _totalStoredBytes. */ + public _totalStoredBytes?: "totalStoredBytes"; + + /** DataSource sourceResource. */ + public sourceResource?: ("dataSourceGcpResource"|"dataSourceBackupApplianceApplication"); + + /** + * Creates a new DataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSource): google.cloud.backupdr.v1.DataSource; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSource; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSource; + + /** + * Verifies a DataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSource; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @param message DataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSource { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4 + } + } + + /** Properties of a BackupConfigInfo. */ + interface IBackupConfigInfo { + + /** BackupConfigInfo lastBackupState */ + lastBackupState?: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null); + + /** BackupConfigInfo lastSuccessfulBackupConsistencyTime */ + lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigInfo lastBackupError */ + lastBackupError?: (google.rpc.IStatus|null); + + /** BackupConfigInfo gcpBackupConfig */ + gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); + + /** BackupConfigInfo backupApplianceBackupConfig */ + backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); + } + + /** Represents a BackupConfigInfo. */ + class BackupConfigInfo implements IBackupConfigInfo { + + /** + * Constructs a new BackupConfigInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupConfigInfo); + + /** BackupConfigInfo lastBackupState. */ + public lastBackupState: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState); + + /** BackupConfigInfo lastSuccessfulBackupConsistencyTime. */ + public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigInfo lastBackupError. */ + public lastBackupError?: (google.rpc.IStatus|null); + + /** BackupConfigInfo gcpBackupConfig. */ + public gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); + + /** BackupConfigInfo backupApplianceBackupConfig. */ + public backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); + + /** BackupConfigInfo backupConfig. */ + public backupConfig?: ("gcpBackupConfig"|"backupApplianceBackupConfig"); + + /** + * Creates a new BackupConfigInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupConfigInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupConfigInfo): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @param message BackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @param message BackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Verifies a BackupConfigInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupConfigInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. + * @param message BackupConfigInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupConfigInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupConfigInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupConfigInfo { + + /** LastBackupState enum. */ + enum LastBackupState { + LAST_BACKUP_STATE_UNSPECIFIED = 0, + FIRST_BACKUP_PENDING = 1, + SUCCEEDED = 2, + FAILED = 3, + PERMISSION_DENIED = 4 + } + } + + /** Properties of a GcpBackupConfig. */ + interface IGcpBackupConfig { + + /** GcpBackupConfig backupPlan */ + backupPlan?: (string|null); + + /** GcpBackupConfig backupPlanDescription */ + backupPlanDescription?: (string|null); + + /** GcpBackupConfig backupPlanAssociation */ + backupPlanAssociation?: (string|null); + + /** GcpBackupConfig backupPlanRules */ + backupPlanRules?: (string[]|null); + } + + /** Represents a GcpBackupConfig. */ + class GcpBackupConfig implements IGcpBackupConfig { + + /** + * Constructs a new GcpBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGcpBackupConfig); + + /** GcpBackupConfig backupPlan. */ + public backupPlan: string; + + /** GcpBackupConfig backupPlanDescription. */ + public backupPlanDescription: string; + + /** GcpBackupConfig backupPlanAssociation. */ + public backupPlanAssociation: string; + + /** GcpBackupConfig backupPlanRules. */ + public backupPlanRules: string[]; + + /** + * Creates a new GcpBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGcpBackupConfig): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @param message GcpBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @param message GcpBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Verifies a GcpBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. + * @param message GcpBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GcpBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupApplianceBackupConfig. */ + interface IBackupApplianceBackupConfig { + + /** BackupApplianceBackupConfig backupApplianceName */ + backupApplianceName?: (string|null); + + /** BackupApplianceBackupConfig backupApplianceId */ + backupApplianceId?: (number|Long|string|null); + + /** BackupApplianceBackupConfig slaId */ + slaId?: (number|Long|string|null); + + /** BackupApplianceBackupConfig applicationName */ + applicationName?: (string|null); + + /** BackupApplianceBackupConfig hostName */ + hostName?: (string|null); + + /** BackupApplianceBackupConfig sltName */ + sltName?: (string|null); + + /** BackupApplianceBackupConfig slpName */ + slpName?: (string|null); + } + + /** Represents a BackupApplianceBackupConfig. */ + class BackupApplianceBackupConfig implements IBackupApplianceBackupConfig { + + /** + * Constructs a new BackupApplianceBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig); + + /** BackupApplianceBackupConfig backupApplianceName. */ + public backupApplianceName: string; + + /** BackupApplianceBackupConfig backupApplianceId. */ + public backupApplianceId: (number|Long|string); + + /** BackupApplianceBackupConfig slaId. */ + public slaId: (number|Long|string); + + /** BackupApplianceBackupConfig applicationName. */ + public applicationName: string; + + /** BackupApplianceBackupConfig hostName. */ + public hostName: string; + + /** BackupApplianceBackupConfig sltName. */ + public sltName: string; + + /** BackupApplianceBackupConfig slpName. */ + public slpName: string; + + /** + * Creates a new BackupApplianceBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @param message BackupApplianceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @param message BackupApplianceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Verifies a BackupApplianceBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. + * @param message BackupApplianceBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceGcpResource. */ + interface IDataSourceGcpResource { + + /** DataSourceGcpResource gcpResourcename */ + gcpResourcename?: (string|null); + + /** DataSourceGcpResource location */ + location?: (string|null); + + /** DataSourceGcpResource type */ + type?: (string|null); + + /** DataSourceGcpResource computeInstanceDatasourceProperties */ + computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); + } + + /** Represents a DataSourceGcpResource. */ + class DataSourceGcpResource implements IDataSourceGcpResource { + + /** + * Constructs a new DataSourceGcpResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource); + + /** DataSourceGcpResource gcpResourcename. */ + public gcpResourcename: string; + + /** DataSourceGcpResource location. */ + public location: string; + + /** DataSourceGcpResource type. */ + public type: string; + + /** DataSourceGcpResource computeInstanceDatasourceProperties. */ + public computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); + + /** DataSourceGcpResource gcpResourceProperties. */ + public gcpResourceProperties?: "computeInstanceDatasourceProperties"; + + /** + * Creates a new DataSourceGcpResource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceGcpResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @param message DataSourceGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @param message DataSourceGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Verifies a DataSourceGcpResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceGcpResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. + * @param message DataSourceGcpResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceGcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceGcpResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceGcpResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceBackupApplianceApplication. */ + interface IDataSourceBackupApplianceApplication { + + /** DataSourceBackupApplianceApplication applicationName */ + applicationName?: (string|null); + + /** DataSourceBackupApplianceApplication backupAppliance */ + backupAppliance?: (string|null); + + /** DataSourceBackupApplianceApplication applianceId */ + applianceId?: (number|Long|string|null); + + /** DataSourceBackupApplianceApplication type */ + type?: (string|null); + + /** DataSourceBackupApplianceApplication applicationId */ + applicationId?: (number|Long|string|null); + + /** DataSourceBackupApplianceApplication hostname */ + hostname?: (string|null); + + /** DataSourceBackupApplianceApplication hostId */ + hostId?: (number|Long|string|null); + } + + /** Represents a DataSourceBackupApplianceApplication. */ + class DataSourceBackupApplianceApplication implements IDataSourceBackupApplianceApplication { + + /** + * Constructs a new DataSourceBackupApplianceApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication); + + /** DataSourceBackupApplianceApplication applicationName. */ + public applicationName: string; + + /** DataSourceBackupApplianceApplication backupAppliance. */ + public backupAppliance: string; + + /** DataSourceBackupApplianceApplication applianceId. */ + public applianceId: (number|Long|string); + + /** DataSourceBackupApplianceApplication type. */ + public type: string; + + /** DataSourceBackupApplianceApplication applicationId. */ + public applicationId: (number|Long|string); + + /** DataSourceBackupApplianceApplication hostname. */ + public hostname: string; + + /** DataSourceBackupApplianceApplication hostId. */ + public hostId: (number|Long|string); + + /** + * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceBackupApplianceApplication instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @param message DataSourceBackupApplianceApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @param message DataSourceBackupApplianceApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Verifies a DataSourceBackupApplianceApplication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceBackupApplianceApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. + * @param message DataSourceBackupApplianceApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceBackupApplianceApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceBackupApplianceApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceBackupApplianceApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceLockInfo. */ + interface IServiceLockInfo { + + /** ServiceLockInfo operation */ + operation?: (string|null); + } + + /** Represents a ServiceLockInfo. */ + class ServiceLockInfo implements IServiceLockInfo { + + /** + * Constructs a new ServiceLockInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IServiceLockInfo); + + /** ServiceLockInfo operation. */ + public operation: string; + + /** + * Creates a new ServiceLockInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceLockInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IServiceLockInfo): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @param message ServiceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @param message ServiceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Verifies a ServiceLockInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceLockInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. + * @param message ServiceLockInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ServiceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceLockInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceLockInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupApplianceLockInfo. */ + interface IBackupApplianceLockInfo { + + /** BackupApplianceLockInfo backupApplianceId */ + backupApplianceId?: (number|Long|string|null); + + /** BackupApplianceLockInfo backupApplianceName */ + backupApplianceName?: (string|null); + + /** BackupApplianceLockInfo lockReason */ + lockReason?: (string|null); + + /** BackupApplianceLockInfo jobName */ + jobName?: (string|null); + + /** BackupApplianceLockInfo backupImage */ + backupImage?: (string|null); + + /** BackupApplianceLockInfo slaId */ + slaId?: (number|Long|string|null); + } + + /** Represents a BackupApplianceLockInfo. */ + class BackupApplianceLockInfo implements IBackupApplianceLockInfo { + + /** + * Constructs a new BackupApplianceLockInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo); + + /** BackupApplianceLockInfo backupApplianceId. */ + public backupApplianceId: (number|Long|string); + + /** BackupApplianceLockInfo backupApplianceName. */ + public backupApplianceName: string; + + /** BackupApplianceLockInfo lockReason. */ + public lockReason: string; + + /** BackupApplianceLockInfo jobName. */ + public jobName?: (string|null); + + /** BackupApplianceLockInfo backupImage. */ + public backupImage?: (string|null); + + /** BackupApplianceLockInfo slaId. */ + public slaId?: (number|Long|string|null); + + /** BackupApplianceLockInfo lockSource. */ + public lockSource?: ("jobName"|"backupImage"|"slaId"); + + /** + * Creates a new BackupApplianceLockInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceLockInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @param message BackupApplianceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @param message BackupApplianceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Verifies a BackupApplianceLockInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceLockInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. + * @param message BackupApplianceLockInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceLockInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceLockInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupLock. */ + interface IBackupLock { + + /** BackupLock lockUntilTime */ + lockUntilTime?: (google.protobuf.ITimestamp|null); + + /** BackupLock backupApplianceLockInfo */ + backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); + + /** BackupLock serviceLockInfo */ + serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); + } + + /** Represents a BackupLock. */ + class BackupLock implements IBackupLock { + + /** + * Constructs a new BackupLock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupLock); + + /** BackupLock lockUntilTime. */ + public lockUntilTime?: (google.protobuf.ITimestamp|null); + + /** BackupLock backupApplianceLockInfo. */ + public backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); + + /** BackupLock serviceLockInfo. */ + public serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); + + /** BackupLock ClientLockInfo. */ + public ClientLockInfo?: ("backupApplianceLockInfo"|"serviceLockInfo"); + + /** + * Creates a new BackupLock instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupLock instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupLock): google.cloud.backupdr.v1.BackupLock; + + /** + * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @param message BackupLock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @param message BackupLock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupLock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupLock; + + /** + * Decodes a BackupLock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupLock; + + /** + * Verifies a BackupLock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupLock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupLock; + + /** + * Creates a plain object from a BackupLock message. Also converts values to other types if specified. + * @param message BackupLock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupLock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupLock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupLock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup description */ + description?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup enforcedRetentionEndTime */ + enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup consistencyTime */ + consistencyTime?: (google.protobuf.ITimestamp|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup state */ + state?: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State|null); + + /** Backup serviceLocks */ + serviceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); + + /** Backup backupApplianceLocks */ + backupApplianceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); + + /** Backup computeInstanceBackupProperties */ + computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); + + /** Backup backupApplianceBackupProperties */ + backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); + + /** Backup backupType */ + backupType?: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType|null); + + /** Backup gcpBackupPlanInfo */ + gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); + + /** Backup resourceSizeBytes */ + resourceSizeBytes?: (number|Long|string|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup description. */ + public description?: (string|null); + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup enforcedRetentionEndTime. */ + public enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup consistencyTime. */ + public consistencyTime?: (google.protobuf.ITimestamp|null); + + /** Backup etag. */ + public etag?: (string|null); + + /** Backup state. */ + public state: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State); + + /** Backup serviceLocks. */ + public serviceLocks: google.cloud.backupdr.v1.IBackupLock[]; + + /** Backup backupApplianceLocks. */ + public backupApplianceLocks: google.cloud.backupdr.v1.IBackupLock[]; + + /** Backup computeInstanceBackupProperties. */ + public computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); + + /** Backup backupApplianceBackupProperties. */ + public backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); + + /** Backup backupType. */ + public backupType: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType); + + /** Backup gcpBackupPlanInfo. */ + public gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); + + /** Backup resourceSizeBytes. */ + public resourceSizeBytes: (number|Long|string); + + /** Backup _description. */ + public _description?: "description"; + + /** Backup _createTime. */ + public _createTime?: "createTime"; + + /** Backup _updateTime. */ + public _updateTime?: "updateTime"; + + /** Backup _enforcedRetentionEndTime. */ + public _enforcedRetentionEndTime?: "enforcedRetentionEndTime"; + + /** Backup _expireTime. */ + public _expireTime?: "expireTime"; + + /** Backup _consistencyTime. */ + public _consistencyTime?: "consistencyTime"; + + /** Backup _etag. */ + public _etag?: "etag"; + + /** Backup backupProperties. */ + public backupProperties?: ("computeInstanceBackupProperties"|"backupApplianceBackupProperties"); + + /** Backup planInfo. */ + public planInfo?: "gcpBackupPlanInfo"; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackup): google.cloud.backupdr.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * 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.cloud.backupdr.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.cloud.backupdr.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 { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4 + } + + /** BackupType enum. */ + enum BackupType { + BACKUP_TYPE_UNSPECIFIED = 0, + SCHEDULED = 1, + ON_DEMAND = 2 + } + + /** Properties of a GCPBackupPlanInfo. */ + interface IGCPBackupPlanInfo { + + /** GCPBackupPlanInfo backupPlan */ + backupPlan?: (string|null); + + /** GCPBackupPlanInfo backupPlanRuleId */ + backupPlanRuleId?: (string|null); + } + + /** Represents a GCPBackupPlanInfo. */ + class GCPBackupPlanInfo implements IGCPBackupPlanInfo { + + /** + * Constructs a new GCPBackupPlanInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo); + + /** GCPBackupPlanInfo backupPlan. */ + public backupPlan: string; + + /** GCPBackupPlanInfo backupPlanRuleId. */ + public backupPlanRuleId: string; + + /** + * Creates a new GCPBackupPlanInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GCPBackupPlanInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @param message GCPBackupPlanInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @param message GCPBackupPlanInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Verifies a GCPBackupPlanInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCPBackupPlanInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. + * @param message GCPBackupPlanInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCPBackupPlanInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCPBackupPlanInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateBackupVaultRequest. */ + interface ICreateBackupVaultRequest { + + /** CreateBackupVaultRequest parent */ + parent?: (string|null); + + /** CreateBackupVaultRequest backupVaultId */ + backupVaultId?: (string|null); + + /** CreateBackupVaultRequest backupVault */ + backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** CreateBackupVaultRequest requestId */ + requestId?: (string|null); + + /** CreateBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateBackupVaultRequest. */ + class CreateBackupVaultRequest implements ICreateBackupVaultRequest { + + /** + * Constructs a new CreateBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest); + + /** CreateBackupVaultRequest parent. */ + public parent: string; + + /** CreateBackupVaultRequest backupVaultId. */ + public backupVaultId: string; + + /** CreateBackupVaultRequest backupVault. */ + public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** CreateBackupVaultRequest requestId. */ + public requestId: string; + + /** CreateBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @param message CreateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @param message CreateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Verifies a CreateBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. + * @param message CreateBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupVaultsRequest. */ + interface IListBackupVaultsRequest { + + /** ListBackupVaultsRequest parent */ + parent?: (string|null); + + /** ListBackupVaultsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupVaultsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupVaultsRequest filter */ + filter?: (string|null); + + /** ListBackupVaultsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupVaultsRequest view */ + view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); + } + + /** Represents a ListBackupVaultsRequest. */ + class ListBackupVaultsRequest implements IListBackupVaultsRequest { + + /** + * Constructs a new ListBackupVaultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest); + + /** ListBackupVaultsRequest parent. */ + public parent: string; + + /** ListBackupVaultsRequest pageSize. */ + public pageSize: number; + + /** ListBackupVaultsRequest pageToken. */ + public pageToken: string; + + /** ListBackupVaultsRequest filter. */ + public filter: string; + + /** ListBackupVaultsRequest orderBy. */ + public orderBy: string; + + /** ListBackupVaultsRequest view. */ + public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); + + /** + * Creates a new ListBackupVaultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupVaultsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @param message ListBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @param message ListBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Verifies a ListBackupVaultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupVaultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. + * @param message ListBackupVaultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupVaultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupVaultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupVaultsResponse. */ + interface IListBackupVaultsResponse { + + /** ListBackupVaultsResponse backupVaults */ + backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); + + /** ListBackupVaultsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupVaultsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupVaultsResponse. */ + class ListBackupVaultsResponse implements IListBackupVaultsResponse { + + /** + * Constructs a new ListBackupVaultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse); + + /** ListBackupVaultsResponse backupVaults. */ + public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; + + /** ListBackupVaultsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupVaultsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupVaultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupVaultsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @param message ListBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @param message ListBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Verifies a ListBackupVaultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupVaultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Creates a plain object from a ListBackupVaultsResponse message. Also converts values to other types if specified. + * @param message ListBackupVaultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupVaultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupVaultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchUsableBackupVaultsRequest. */ + interface IFetchUsableBackupVaultsRequest { + + /** FetchUsableBackupVaultsRequest parent */ + parent?: (string|null); + + /** FetchUsableBackupVaultsRequest pageSize */ + pageSize?: (number|null); + + /** FetchUsableBackupVaultsRequest pageToken */ + pageToken?: (string|null); + + /** FetchUsableBackupVaultsRequest filter */ + filter?: (string|null); + + /** FetchUsableBackupVaultsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a FetchUsableBackupVaultsRequest. */ + class FetchUsableBackupVaultsRequest implements IFetchUsableBackupVaultsRequest { + + /** + * Constructs a new FetchUsableBackupVaultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest); + + /** FetchUsableBackupVaultsRequest parent. */ + public parent: string; + + /** FetchUsableBackupVaultsRequest pageSize. */ + public pageSize: number; + + /** FetchUsableBackupVaultsRequest pageToken. */ + public pageToken: string; + + /** FetchUsableBackupVaultsRequest filter. */ + public filter: string; + + /** FetchUsableBackupVaultsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchUsableBackupVaultsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @param message FetchUsableBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @param message FetchUsableBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Verifies a FetchUsableBackupVaultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchUsableBackupVaultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Creates a plain object from a FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. + * @param message FetchUsableBackupVaultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchUsableBackupVaultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchUsableBackupVaultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchUsableBackupVaultsResponse. */ + interface IFetchUsableBackupVaultsResponse { + + /** FetchUsableBackupVaultsResponse backupVaults */ + backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); + + /** FetchUsableBackupVaultsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** FetchUsableBackupVaultsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a FetchUsableBackupVaultsResponse. */ + class FetchUsableBackupVaultsResponse implements IFetchUsableBackupVaultsResponse { + + /** + * Constructs a new FetchUsableBackupVaultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse); + + /** FetchUsableBackupVaultsResponse backupVaults. */ + public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; + + /** FetchUsableBackupVaultsResponse nextPageToken. */ + public nextPageToken: string; + + /** FetchUsableBackupVaultsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchUsableBackupVaultsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @param message FetchUsableBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @param message FetchUsableBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Verifies a FetchUsableBackupVaultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchUsableBackupVaultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Creates a plain object from a FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. + * @param message FetchUsableBackupVaultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchUsableBackupVaultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchUsableBackupVaultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupVaultRequest. */ + interface IGetBackupVaultRequest { + + /** GetBackupVaultRequest name */ + name?: (string|null); + + /** GetBackupVaultRequest view */ + view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); + } + + /** Represents a GetBackupVaultRequest. */ + class GetBackupVaultRequest implements IGetBackupVaultRequest { + + /** + * Constructs a new GetBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest); + + /** GetBackupVaultRequest name. */ + public name: string; + + /** GetBackupVaultRequest view. */ + public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); + + /** + * Creates a new GetBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @param message GetBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @param message GetBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Verifies a GetBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. + * @param message GetBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupVaultRequest. */ + interface IUpdateBackupVaultRequest { + + /** UpdateBackupVaultRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupVaultRequest backupVault */ + backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** UpdateBackupVaultRequest requestId */ + requestId?: (string|null); + + /** UpdateBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateBackupVaultRequest force */ + force?: (boolean|null); + } + + /** Represents an UpdateBackupVaultRequest. */ + class UpdateBackupVaultRequest implements IUpdateBackupVaultRequest { + + /** + * Constructs a new UpdateBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest); + + /** UpdateBackupVaultRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupVaultRequest backupVault. */ + public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** UpdateBackupVaultRequest requestId. */ + public requestId: string; + + /** UpdateBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateBackupVaultRequest force. */ + public force: boolean; + + /** + * Creates a new UpdateBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @param message UpdateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @param message UpdateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Verifies an UpdateBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. + * @param message UpdateBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupVaultRequest. */ + interface IDeleteBackupVaultRequest { + + /** DeleteBackupVaultRequest name */ + name?: (string|null); + + /** DeleteBackupVaultRequest requestId */ + requestId?: (string|null); + + /** DeleteBackupVaultRequest force */ + force?: (boolean|null); + + /** DeleteBackupVaultRequest etag */ + etag?: (string|null); + + /** DeleteBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteBackupVaultRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents a DeleteBackupVaultRequest. */ + class DeleteBackupVaultRequest implements IDeleteBackupVaultRequest { + + /** + * Constructs a new DeleteBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest); + + /** DeleteBackupVaultRequest name. */ + public name: string; + + /** DeleteBackupVaultRequest requestId. */ + public requestId: string; + + /** DeleteBackupVaultRequest force. */ + public force: boolean; + + /** DeleteBackupVaultRequest etag. */ + public etag: string; + + /** DeleteBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteBackupVaultRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new DeleteBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @param message DeleteBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @param message DeleteBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Verifies a DeleteBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. + * @param message DeleteBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesRequest. */ + interface IListDataSourcesRequest { + + /** ListDataSourcesRequest parent */ + parent?: (string|null); + + /** ListDataSourcesRequest pageSize */ + pageSize?: (number|null); + + /** ListDataSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListDataSourcesRequest filter */ + filter?: (string|null); + + /** ListDataSourcesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDataSourcesRequest. */ + class ListDataSourcesRequest implements IListDataSourcesRequest { + + /** + * Constructs a new ListDataSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest); + + /** ListDataSourcesRequest parent. */ + public parent: string; + + /** ListDataSourcesRequest pageSize. */ + public pageSize: number; + + /** ListDataSourcesRequest pageToken. */ + public pageToken: string; + + /** ListDataSourcesRequest filter. */ + public filter: string; + + /** ListDataSourcesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Verifies a ListDataSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @param message ListDataSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesResponse. */ + interface IListDataSourcesResponse { + + /** ListDataSourcesResponse dataSources */ + dataSources?: (google.cloud.backupdr.v1.IDataSource[]|null); + + /** ListDataSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDataSourcesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDataSourcesResponse. */ + class ListDataSourcesResponse implements IListDataSourcesResponse { + + /** + * Constructs a new ListDataSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse); + + /** ListDataSourcesResponse dataSources. */ + public dataSources: google.cloud.backupdr.v1.IDataSource[]; + + /** ListDataSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDataSourcesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Verifies a ListDataSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @param message ListDataSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataSourceRequest. */ + interface IGetDataSourceRequest { + + /** GetDataSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetDataSourceRequest. */ + class GetDataSourceRequest implements IGetDataSourceRequest { + + /** + * Constructs a new GetDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest); + + /** GetDataSourceRequest name. */ + public name: string; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataSourceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Verifies a GetDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @param message GetDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDataSourceRequest. */ + interface IUpdateDataSourceRequest { + + /** UpdateDataSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataSourceRequest dataSource */ + dataSource?: (google.cloud.backupdr.v1.IDataSource|null); + + /** UpdateDataSourceRequest requestId */ + requestId?: (string|null); + + /** UpdateDataSourceRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateDataSourceRequest. */ + class UpdateDataSourceRequest implements IUpdateDataSourceRequest { + + /** + * Constructs a new UpdateDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest); + + /** UpdateDataSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataSourceRequest dataSource. */ + public dataSource?: (google.cloud.backupdr.v1.IDataSource|null); + + /** UpdateDataSourceRequest requestId. */ + public requestId: string; + + /** UpdateDataSourceRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataSourceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @param message UpdateDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @param message UpdateDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Verifies an UpdateDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. + * @param message UpdateDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataSourceRequest + * @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); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest view */ + view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest view. */ + public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupsRequest): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * 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.cloud.backupdr.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.cloud.backupdr.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.cloud.backupdr.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|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.cloud.backupdr.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.backupdr.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupsResponse): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * 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.cloud.backupdr.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.cloud.backupdr.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 GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + + /** GetBackupRequest view */ + view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** GetBackupRequest view. */ + public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupRequest): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * 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.cloud.backupdr.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.cloud.backupdr.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 an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.backupdr.v1.IBackup|null); + + /** UpdateBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.backupdr.v1.IBackup|null); + + /** UpdateBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @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); + + /** DeleteBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * 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.cloud.backupdr.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.cloud.backupdr.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 RestoreBackupRequest. */ + interface IRestoreBackupRequest { + + /** RestoreBackupRequest name */ + name?: (string|null); + + /** RestoreBackupRequest requestId */ + requestId?: (string|null); + + /** RestoreBackupRequest computeInstanceTargetEnvironment */ + computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); + + /** RestoreBackupRequest computeInstanceRestoreProperties */ + computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); + } + + /** Represents a RestoreBackupRequest. */ + class RestoreBackupRequest implements IRestoreBackupRequest { + + /** + * Constructs a new RestoreBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest); + + /** RestoreBackupRequest name. */ + public name: string; + + /** RestoreBackupRequest requestId. */ + public requestId: string; + + /** RestoreBackupRequest computeInstanceTargetEnvironment. */ + public computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); + + /** RestoreBackupRequest computeInstanceRestoreProperties. */ + public computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); + + /** RestoreBackupRequest targetEnvironment. */ + public targetEnvironment?: "computeInstanceTargetEnvironment"; + + /** RestoreBackupRequest instanceProperties. */ + public instanceProperties?: "computeInstanceRestoreProperties"; + + /** + * Creates a new RestoreBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @param message RestoreBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @param message RestoreBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Verifies a RestoreBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. + * @param message RestoreBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RestoreBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreBackupResponse. */ + interface IRestoreBackupResponse { + + /** RestoreBackupResponse targetResource */ + targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); + } + + /** Represents a RestoreBackupResponse. */ + class RestoreBackupResponse implements IRestoreBackupResponse { + + /** + * Constructs a new RestoreBackupResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse); + + /** RestoreBackupResponse targetResource. */ + public targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); + + /** + * Creates a new RestoreBackupResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreBackupResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @param message RestoreBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @param message RestoreBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Verifies a RestoreBackupResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreBackupResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. + * @param message RestoreBackupResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RestoreBackupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreBackupResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreBackupResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetResource. */ + interface ITargetResource { + + /** TargetResource gcpResource */ + gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); + } + + /** Represents a TargetResource. */ + class TargetResource implements ITargetResource { + + /** + * Constructs a new TargetResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ITargetResource); + + /** TargetResource gcpResource. */ + public gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); + + /** TargetResource targetResourceInfo. */ + public targetResourceInfo?: "gcpResource"; + + /** + * Creates a new TargetResource instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.ITargetResource): google.cloud.backupdr.v1.TargetResource; + + /** + * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @param message TargetResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @param message TargetResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TargetResource; + + /** + * Decodes a TargetResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TargetResource; + + /** + * Verifies a TargetResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TargetResource; + + /** + * Creates a plain object from a TargetResource message. Also converts values to other types if specified. + * @param message TargetResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.TargetResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcpResource. */ + interface IGcpResource { + + /** GcpResource gcpResourcename */ + gcpResourcename?: (string|null); + + /** GcpResource location */ + location?: (string|null); + + /** GcpResource type */ + type?: (string|null); + } + + /** Represents a GcpResource. */ + class GcpResource implements IGcpResource { + + /** + * Constructs a new GcpResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGcpResource); + + /** GcpResource gcpResourcename. */ + public gcpResourcename: string; + + /** GcpResource location. */ + public location: string; + + /** GcpResource type. */ + public type: string; + + /** + * Creates a new GcpResource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGcpResource): google.cloud.backupdr.v1.GcpResource; + + /** + * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @param message GcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @param message GcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpResource; + + /** + * Decodes a GcpResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpResource; + + /** + * Verifies a GcpResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpResource; + + /** + * Creates a plain object from a GcpResource message. Also converts values to other types if specified. + * @param message GcpResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** BackupConfigState enum. */ + enum BackupConfigState { + BACKUP_CONFIG_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PASSIVE = 2 + } + + /** BackupView enum. */ + enum BackupView { + BACKUP_VIEW_UNSPECIFIED = 0, + BACKUP_VIEW_BASIC = 1, + BACKUP_VIEW_FULL = 2 + } + + /** BackupVaultView enum. */ + enum BackupVaultView { + BACKUP_VAULT_VIEW_UNSPECIFIED = 0, + BACKUP_VAULT_VIEW_BASIC = 1, + BACKUP_VAULT_VIEW_FULL = 2 + } + + /** Properties of a BackupApplianceBackupProperties. */ + interface IBackupApplianceBackupProperties { + + /** BackupApplianceBackupProperties generationId */ + generationId?: (number|null); + + /** BackupApplianceBackupProperties finalizeTime */ + finalizeTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeStartTime */ + recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeEndTime */ + recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupApplianceBackupProperties. */ + class BackupApplianceBackupProperties implements IBackupApplianceBackupProperties { + + /** + * Constructs a new BackupApplianceBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties); + + /** BackupApplianceBackupProperties generationId. */ + public generationId?: (number|null); + + /** BackupApplianceBackupProperties finalizeTime. */ + public finalizeTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeStartTime. */ + public recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeEndTime. */ + public recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties _generationId. */ + public _generationId?: "generationId"; + + /** BackupApplianceBackupProperties _finalizeTime. */ + public _finalizeTime?: "finalizeTime"; + + /** BackupApplianceBackupProperties _recoveryRangeStartTime. */ + public _recoveryRangeStartTime?: "recoveryRangeStartTime"; + + /** BackupApplianceBackupProperties _recoveryRangeEndTime. */ + public _recoveryRangeEndTime?: "recoveryRangeEndTime"; + + /** + * Creates a new BackupApplianceBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @param message BackupApplianceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @param message BackupApplianceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Verifies a BackupApplianceBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. + * @param message BackupApplianceBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceBackupProperties. */ + interface IComputeInstanceBackupProperties { + + /** ComputeInstanceBackupProperties description */ + description?: (string|null); + + /** ComputeInstanceBackupProperties tags */ + tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceBackupProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceBackupProperties canIpForward */ + canIpForward?: (boolean|null); + + /** ComputeInstanceBackupProperties networkInterface */ + networkInterface?: (google.cloud.backupdr.v1.INetworkInterface[]|null); + + /** ComputeInstanceBackupProperties disk */ + disk?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); + + /** ComputeInstanceBackupProperties metadata */ + metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceBackupProperties serviceAccount */ + serviceAccount?: (google.cloud.backupdr.v1.IServiceAccount[]|null); + + /** ComputeInstanceBackupProperties scheduling */ + scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceBackupProperties guestAccelerator */ + guestAccelerator?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); + + /** ComputeInstanceBackupProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** ComputeInstanceBackupProperties keyRevocationActionType */ + keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceBackupProperties sourceInstance */ + sourceInstance?: (string|null); + + /** ComputeInstanceBackupProperties labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a ComputeInstanceBackupProperties. */ + class ComputeInstanceBackupProperties implements IComputeInstanceBackupProperties { + + /** + * Constructs a new ComputeInstanceBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties); + + /** ComputeInstanceBackupProperties description. */ + public description?: (string|null); + + /** ComputeInstanceBackupProperties tags. */ + public tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceBackupProperties machineType. */ + public machineType?: (string|null); + + /** ComputeInstanceBackupProperties canIpForward. */ + public canIpForward?: (boolean|null); + + /** ComputeInstanceBackupProperties networkInterface. */ + public networkInterface: google.cloud.backupdr.v1.INetworkInterface[]; + + /** ComputeInstanceBackupProperties disk. */ + public disk: google.cloud.backupdr.v1.IAttachedDisk[]; + + /** ComputeInstanceBackupProperties metadata. */ + public metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceBackupProperties serviceAccount. */ + public serviceAccount: google.cloud.backupdr.v1.IServiceAccount[]; + + /** ComputeInstanceBackupProperties scheduling. */ + public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceBackupProperties guestAccelerator. */ + public guestAccelerator: google.cloud.backupdr.v1.IAcceleratorConfig[]; + + /** ComputeInstanceBackupProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** ComputeInstanceBackupProperties keyRevocationActionType. */ + public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceBackupProperties sourceInstance. */ + public sourceInstance?: (string|null); + + /** ComputeInstanceBackupProperties labels. */ + public labels: { [k: string]: string }; + + /** ComputeInstanceBackupProperties _description. */ + public _description?: "description"; + + /** ComputeInstanceBackupProperties _tags. */ + public _tags?: "tags"; + + /** ComputeInstanceBackupProperties _machineType. */ + public _machineType?: "machineType"; + + /** ComputeInstanceBackupProperties _canIpForward. */ + public _canIpForward?: "canIpForward"; + + /** ComputeInstanceBackupProperties _metadata. */ + public _metadata?: "metadata"; + + /** ComputeInstanceBackupProperties _scheduling. */ + public _scheduling?: "scheduling"; + + /** ComputeInstanceBackupProperties _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** ComputeInstanceBackupProperties _keyRevocationActionType. */ + public _keyRevocationActionType?: "keyRevocationActionType"; + + /** ComputeInstanceBackupProperties _sourceInstance. */ + public _sourceInstance?: "sourceInstance"; + + /** + * Creates a new ComputeInstanceBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @param message ComputeInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @param message ComputeInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Verifies a ComputeInstanceBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Creates a plain object from a ComputeInstanceBackupProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceRestoreProperties. */ + interface IComputeInstanceRestoreProperties { + + /** ComputeInstanceRestoreProperties name */ + name?: (string|null); + + /** ComputeInstanceRestoreProperties advancedMachineFeatures */ + advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); + + /** ComputeInstanceRestoreProperties canIpForward */ + canIpForward?: (boolean|null); + + /** ComputeInstanceRestoreProperties confidentialInstanceConfig */ + confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); + + /** ComputeInstanceRestoreProperties deletionProtection */ + deletionProtection?: (boolean|null); + + /** ComputeInstanceRestoreProperties description */ + description?: (string|null); + + /** ComputeInstanceRestoreProperties disks */ + disks?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); + + /** ComputeInstanceRestoreProperties displayDevice */ + displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); + + /** ComputeInstanceRestoreProperties guestAccelerators */ + guestAccelerators?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); + + /** ComputeInstanceRestoreProperties hostname */ + hostname?: (string|null); + + /** ComputeInstanceRestoreProperties instanceEncryptionKey */ + instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** ComputeInstanceRestoreProperties keyRevocationActionType */ + keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceRestoreProperties labels */ + labels?: ({ [k: string]: string }|null); + + /** ComputeInstanceRestoreProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceRestoreProperties metadata */ + metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceRestoreProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** ComputeInstanceRestoreProperties networkInterfaces */ + networkInterfaces?: (google.cloud.backupdr.v1.INetworkInterface[]|null); + + /** ComputeInstanceRestoreProperties networkPerformanceConfig */ + networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); + + /** ComputeInstanceRestoreProperties params */ + params?: (google.cloud.backupdr.v1.IInstanceParams|null); + + /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess */ + privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); + + /** ComputeInstanceRestoreProperties allocationAffinity */ + allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); + + /** ComputeInstanceRestoreProperties resourcePolicies */ + resourcePolicies?: (string[]|null); + + /** ComputeInstanceRestoreProperties scheduling */ + scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceRestoreProperties serviceAccounts */ + serviceAccounts?: (google.cloud.backupdr.v1.IServiceAccount[]|null); + + /** ComputeInstanceRestoreProperties tags */ + tags?: (google.cloud.backupdr.v1.ITags|null); + } + + /** Represents a ComputeInstanceRestoreProperties. */ + class ComputeInstanceRestoreProperties implements IComputeInstanceRestoreProperties { + + /** + * Constructs a new ComputeInstanceRestoreProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties); + + /** ComputeInstanceRestoreProperties name. */ + public name?: (string|null); + + /** ComputeInstanceRestoreProperties advancedMachineFeatures. */ + public advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); + + /** ComputeInstanceRestoreProperties canIpForward. */ + public canIpForward?: (boolean|null); + + /** ComputeInstanceRestoreProperties confidentialInstanceConfig. */ + public confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); + + /** ComputeInstanceRestoreProperties deletionProtection. */ + public deletionProtection?: (boolean|null); + + /** ComputeInstanceRestoreProperties description. */ + public description?: (string|null); + + /** ComputeInstanceRestoreProperties disks. */ + public disks: google.cloud.backupdr.v1.IAttachedDisk[]; + + /** ComputeInstanceRestoreProperties displayDevice. */ + public displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); + + /** ComputeInstanceRestoreProperties guestAccelerators. */ + public guestAccelerators: google.cloud.backupdr.v1.IAcceleratorConfig[]; + + /** ComputeInstanceRestoreProperties hostname. */ + public hostname?: (string|null); + + /** ComputeInstanceRestoreProperties instanceEncryptionKey. */ + public instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** ComputeInstanceRestoreProperties keyRevocationActionType. */ + public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceRestoreProperties labels. */ + public labels: { [k: string]: string }; + + /** ComputeInstanceRestoreProperties machineType. */ + public machineType?: (string|null); + + /** ComputeInstanceRestoreProperties metadata. */ + public metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceRestoreProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** ComputeInstanceRestoreProperties networkInterfaces. */ + public networkInterfaces: google.cloud.backupdr.v1.INetworkInterface[]; + + /** ComputeInstanceRestoreProperties networkPerformanceConfig. */ + public networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); + + /** ComputeInstanceRestoreProperties params. */ + public params?: (google.cloud.backupdr.v1.IInstanceParams|null); + + /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess. */ + public privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); + + /** ComputeInstanceRestoreProperties allocationAffinity. */ + public allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); + + /** ComputeInstanceRestoreProperties resourcePolicies. */ + public resourcePolicies: string[]; + + /** ComputeInstanceRestoreProperties scheduling. */ + public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceRestoreProperties serviceAccounts. */ + public serviceAccounts: google.cloud.backupdr.v1.IServiceAccount[]; + + /** ComputeInstanceRestoreProperties tags. */ + public tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceRestoreProperties _name. */ + public _name?: "name"; + + /** ComputeInstanceRestoreProperties _advancedMachineFeatures. */ + public _advancedMachineFeatures?: "advancedMachineFeatures"; + + /** ComputeInstanceRestoreProperties _canIpForward. */ + public _canIpForward?: "canIpForward"; + + /** ComputeInstanceRestoreProperties _confidentialInstanceConfig. */ + public _confidentialInstanceConfig?: "confidentialInstanceConfig"; + + /** ComputeInstanceRestoreProperties _deletionProtection. */ + public _deletionProtection?: "deletionProtection"; + + /** ComputeInstanceRestoreProperties _description. */ + public _description?: "description"; + + /** ComputeInstanceRestoreProperties _displayDevice. */ + public _displayDevice?: "displayDevice"; + + /** ComputeInstanceRestoreProperties _hostname. */ + public _hostname?: "hostname"; + + /** ComputeInstanceRestoreProperties _instanceEncryptionKey. */ + public _instanceEncryptionKey?: "instanceEncryptionKey"; + + /** ComputeInstanceRestoreProperties _keyRevocationActionType. */ + public _keyRevocationActionType?: "keyRevocationActionType"; + + /** ComputeInstanceRestoreProperties _machineType. */ + public _machineType?: "machineType"; + + /** ComputeInstanceRestoreProperties _metadata. */ + public _metadata?: "metadata"; + + /** ComputeInstanceRestoreProperties _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** ComputeInstanceRestoreProperties _networkPerformanceConfig. */ + public _networkPerformanceConfig?: "networkPerformanceConfig"; + + /** ComputeInstanceRestoreProperties _params. */ + public _params?: "params"; + + /** ComputeInstanceRestoreProperties _privateIpv6GoogleAccess. */ + public _privateIpv6GoogleAccess?: "privateIpv6GoogleAccess"; + + /** ComputeInstanceRestoreProperties _allocationAffinity. */ + public _allocationAffinity?: "allocationAffinity"; + + /** ComputeInstanceRestoreProperties _scheduling. */ + public _scheduling?: "scheduling"; + + /** ComputeInstanceRestoreProperties _tags. */ + public _tags?: "tags"; + + /** + * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceRestoreProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @param message ComputeInstanceRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @param message ComputeInstanceRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Verifies a ComputeInstanceRestoreProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceRestoreProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceRestoreProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceRestoreProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceRestoreProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceRestoreProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ComputeInstanceRestoreProperties { + + /** InstancePrivateIpv6GoogleAccess enum. */ + enum InstancePrivateIpv6GoogleAccess { + INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0, + INHERIT_FROM_SUBNETWORK = 1, + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2, + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3 + } + } + + /** Properties of a ComputeInstanceTargetEnvironment. */ + interface IComputeInstanceTargetEnvironment { + + /** ComputeInstanceTargetEnvironment project */ + project?: (string|null); + + /** ComputeInstanceTargetEnvironment zone */ + zone?: (string|null); + } + + /** Represents a ComputeInstanceTargetEnvironment. */ + class ComputeInstanceTargetEnvironment implements IComputeInstanceTargetEnvironment { + + /** + * Constructs a new ComputeInstanceTargetEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment); + + /** ComputeInstanceTargetEnvironment project. */ + public project: string; + + /** ComputeInstanceTargetEnvironment zone. */ + public zone: string; + + /** + * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceTargetEnvironment instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @param message ComputeInstanceTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @param message ComputeInstanceTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Verifies a ComputeInstanceTargetEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceTargetEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. + * @param message ComputeInstanceTargetEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceTargetEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceTargetEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceDataSourceProperties. */ + interface IComputeInstanceDataSourceProperties { + + /** ComputeInstanceDataSourceProperties name */ + name?: (string|null); + + /** ComputeInstanceDataSourceProperties description */ + description?: (string|null); + + /** ComputeInstanceDataSourceProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceDataSourceProperties totalDiskCount */ + totalDiskCount?: (number|Long|string|null); + + /** ComputeInstanceDataSourceProperties totalDiskSizeGb */ + totalDiskSizeGb?: (number|Long|string|null); + } + + /** Represents a ComputeInstanceDataSourceProperties. */ + class ComputeInstanceDataSourceProperties implements IComputeInstanceDataSourceProperties { + + /** + * Constructs a new ComputeInstanceDataSourceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties); + + /** ComputeInstanceDataSourceProperties name. */ + public name: string; + + /** ComputeInstanceDataSourceProperties description. */ + public description: string; + + /** ComputeInstanceDataSourceProperties machineType. */ + public machineType: string; + + /** ComputeInstanceDataSourceProperties totalDiskCount. */ + public totalDiskCount: (number|Long|string); + + /** ComputeInstanceDataSourceProperties totalDiskSizeGb. */ + public totalDiskSizeGb: (number|Long|string); + + /** + * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceDataSourceProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @param message ComputeInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @param message ComputeInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Verifies a ComputeInstanceDataSourceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceDataSourceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceDataSourceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceDataSourceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceDataSourceProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdvancedMachineFeatures. */ + interface IAdvancedMachineFeatures { + + /** AdvancedMachineFeatures enableNestedVirtualization */ + enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore */ + threadsPerCore?: (number|null); + + /** AdvancedMachineFeatures visibleCoreCount */ + visibleCoreCount?: (number|null); + + /** AdvancedMachineFeatures enableUefiNetworking */ + enableUefiNetworking?: (boolean|null); + } + + /** Represents an AdvancedMachineFeatures. */ + class AdvancedMachineFeatures implements IAdvancedMachineFeatures { + + /** + * Constructs a new AdvancedMachineFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures); + + /** AdvancedMachineFeatures enableNestedVirtualization. */ + public enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore. */ + public threadsPerCore?: (number|null); + + /** AdvancedMachineFeatures visibleCoreCount. */ + public visibleCoreCount?: (number|null); + + /** AdvancedMachineFeatures enableUefiNetworking. */ + public enableUefiNetworking?: (boolean|null); + + /** AdvancedMachineFeatures _enableNestedVirtualization. */ + public _enableNestedVirtualization?: "enableNestedVirtualization"; + + /** AdvancedMachineFeatures _threadsPerCore. */ + public _threadsPerCore?: "threadsPerCore"; + + /** AdvancedMachineFeatures _visibleCoreCount. */ + public _visibleCoreCount?: "visibleCoreCount"; + + /** AdvancedMachineFeatures _enableUefiNetworking. */ + public _enableUefiNetworking?: "enableUefiNetworking"; + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedMachineFeatures instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Verifies an AdvancedMachineFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedMachineFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @param message AdvancedMachineFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AdvancedMachineFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedMachineFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfidentialInstanceConfig. */ + interface IConfidentialInstanceConfig { + + /** ConfidentialInstanceConfig enableConfidentialCompute */ + enableConfidentialCompute?: (boolean|null); + } + + /** Represents a ConfidentialInstanceConfig. */ + class ConfidentialInstanceConfig implements IConfidentialInstanceConfig { + + /** + * Constructs a new ConfidentialInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IConfidentialInstanceConfig); + + /** ConfidentialInstanceConfig enableConfidentialCompute. */ + public enableConfidentialCompute?: (boolean|null); + + /** ConfidentialInstanceConfig _enableConfidentialCompute. */ + public _enableConfidentialCompute?: "enableConfidentialCompute"; + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidentialInstanceConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IConfidentialInstanceConfig): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidentialInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @param message ConfidentialInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ConfidentialInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidentialInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisplayDevice. */ + interface IDisplayDevice { + + /** DisplayDevice enableDisplay */ + enableDisplay?: (boolean|null); + } + + /** Represents a DisplayDevice. */ + class DisplayDevice implements IDisplayDevice { + + /** + * Constructs a new DisplayDevice. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDisplayDevice); + + /** DisplayDevice enableDisplay. */ + public enableDisplay?: (boolean|null); + + /** DisplayDevice _enableDisplay. */ + public _enableDisplay?: "enableDisplay"; + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @param [properties] Properties to set + * @returns DisplayDevice instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDisplayDevice): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Verifies a DisplayDevice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisplayDevice + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @param message DisplayDevice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DisplayDevice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisplayDevice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisplayDevice + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcceleratorConfig. */ + interface IAcceleratorConfig { + + /** AcceleratorConfig acceleratorType */ + acceleratorType?: (string|null); + + /** AcceleratorConfig acceleratorCount */ + acceleratorCount?: (number|null); + } + + /** Represents an AcceleratorConfig. */ + class AcceleratorConfig implements IAcceleratorConfig { + + /** + * Constructs a new AcceleratorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAcceleratorConfig); + + /** AcceleratorConfig acceleratorType. */ + public acceleratorType?: (string|null); + + /** AcceleratorConfig acceleratorCount. */ + public acceleratorCount?: (number|null); + + /** AcceleratorConfig _acceleratorType. */ + public _acceleratorType?: "acceleratorType"; + + /** AcceleratorConfig _acceleratorCount. */ + public _acceleratorCount?: "acceleratorCount"; + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAcceleratorConfig): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Verifies an AcceleratorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @param message AcceleratorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AcceleratorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcceleratorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerEncryptionKey. */ + interface ICustomerEncryptionKey { + + /** CustomerEncryptionKey rawKey */ + rawKey?: (string|null); + + /** CustomerEncryptionKey rsaEncryptedKey */ + rsaEncryptedKey?: (string|null); + + /** CustomerEncryptionKey kmsKeyName */ + kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount */ + kmsKeyServiceAccount?: (string|null); + } + + /** Represents a CustomerEncryptionKey. */ + class CustomerEncryptionKey implements ICustomerEncryptionKey { + + /** + * Constructs a new CustomerEncryptionKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey); + + /** CustomerEncryptionKey rawKey. */ + public rawKey?: (string|null); + + /** CustomerEncryptionKey rsaEncryptedKey. */ + public rsaEncryptedKey?: (string|null); + + /** CustomerEncryptionKey kmsKeyName. */ + public kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount. */ + public kmsKeyServiceAccount?: (string|null); + + /** CustomerEncryptionKey key. */ + public key?: ("rawKey"|"rsaEncryptedKey"|"kmsKeyName"); + + /** CustomerEncryptionKey _kmsKeyServiceAccount. */ + public _kmsKeyServiceAccount?: "kmsKeyServiceAccount"; + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEncryptionKey instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Verifies a CustomerEncryptionKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEncryptionKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @param message CustomerEncryptionKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CustomerEncryptionKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry key */ + key?: (string|null); + + /** Entry value */ + value?: (string|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IEntry); + + /** Entry key. */ + public key?: (string|null); + + /** Entry value. */ + public value?: (string|null); + + /** Entry _key. */ + public _key?: "key"; + + /** Entry _value. */ + public _value?: "value"; + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.backupdr.v1.IEntry): google.cloud.backupdr.v1.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata items */ + items?: (google.cloud.backupdr.v1.IEntry[]|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IMetadata); + + /** Metadata items. */ + public items: google.cloud.backupdr.v1.IEntry[]; + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.backupdr.v1.IMetadata): google.cloud.backupdr.v1.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface ipAddress */ + ipAddress?: (string|null); + + /** NetworkInterface ipv6Address */ + ipv6Address?: (string|null); + + /** NetworkInterface internalIpv6PrefixLength */ + internalIpv6PrefixLength?: (number|null); + + /** NetworkInterface name */ + name?: (string|null); + + /** NetworkInterface accessConfigs */ + accessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); + + /** NetworkInterface ipv6AccessConfigs */ + ipv6AccessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); + + /** NetworkInterface aliasIpRanges */ + aliasIpRanges?: (google.cloud.backupdr.v1.IAliasIpRange[]|null); + + /** NetworkInterface stackType */ + stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); + + /** NetworkInterface ipv6AccessType */ + ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); + + /** NetworkInterface queueCount */ + queueCount?: (number|null); + + /** NetworkInterface nicType */ + nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); + + /** NetworkInterface networkAttachment */ + networkAttachment?: (string|null); } - namespace BackupDR { + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.INetworkInterface); + + /** NetworkInterface network. */ + public network?: (string|null); + + /** NetworkInterface subnetwork. */ + public subnetwork?: (string|null); + + /** NetworkInterface ipAddress. */ + public ipAddress?: (string|null); + + /** NetworkInterface ipv6Address. */ + public ipv6Address?: (string|null); + + /** NetworkInterface internalIpv6PrefixLength. */ + public internalIpv6PrefixLength?: (number|null); + + /** NetworkInterface name. */ + public name?: (string|null); + + /** NetworkInterface accessConfigs. */ + public accessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; + + /** NetworkInterface ipv6AccessConfigs. */ + public ipv6AccessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; + + /** NetworkInterface aliasIpRanges. */ + public aliasIpRanges: google.cloud.backupdr.v1.IAliasIpRange[]; + + /** NetworkInterface stackType. */ + public stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); + + /** NetworkInterface ipv6AccessType. */ + public ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); + + /** NetworkInterface queueCount. */ + public queueCount?: (number|null); + + /** NetworkInterface nicType. */ + public nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); + + /** NetworkInterface networkAttachment. */ + public networkAttachment?: (string|null); + + /** NetworkInterface _network. */ + public _network?: "network"; + + /** NetworkInterface _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** NetworkInterface _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** NetworkInterface _ipv6Address. */ + public _ipv6Address?: "ipv6Address"; + + /** NetworkInterface _internalIpv6PrefixLength. */ + public _internalIpv6PrefixLength?: "internalIpv6PrefixLength"; + + /** NetworkInterface _name. */ + public _name?: "name"; + + /** NetworkInterface _stackType. */ + public _stackType?: "stackType"; + + /** NetworkInterface _ipv6AccessType. */ + public _ipv6AccessType?: "ipv6AccessType"; + + /** NetworkInterface _queueCount. */ + public _queueCount?: "queueCount"; + + /** NetworkInterface _nicType. */ + public _nicType?: "nicType"; + + /** NetworkInterface _networkAttachment. */ + public _networkAttachment?: "networkAttachment"; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. - * @param error Error, if any - * @param [response] ListManagementServersResponse + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance */ - type ListManagementServersCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListManagementServersResponse) => void; + public static create(properties?: google.cloud.backupdr.v1.INetworkInterface): google.cloud.backupdr.v1.NetworkInterface; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. - * @param error Error, if any - * @param [response] ManagementServer + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetManagementServerCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ManagementServer) => void; + public static encode(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type CreateManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. - * @param error Error, if any - * @param [response] Operation + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a NetworkConfig. */ - interface INetworkConfig { + namespace NetworkInterface { - /** NetworkConfig network */ - network?: (string|null); + /** StackType enum. */ + enum StackType { + STACK_TYPE_UNSPECIFIED = 0, + IPV4_ONLY = 1, + IPV4_IPV6 = 2 + } - /** NetworkConfig peeringMode */ - peeringMode?: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null); + /** Ipv6AccessType enum. */ + enum Ipv6AccessType { + UNSPECIFIED_IPV6_ACCESS_TYPE = 0, + INTERNAL = 1, + EXTERNAL = 2 + } + + /** NicType enum. */ + enum NicType { + NIC_TYPE_UNSPECIFIED = 0, + VIRTIO_NET = 1, + GVNIC = 2 + } } - /** Represents a NetworkConfig. */ - class NetworkConfig implements INetworkConfig { + /** Properties of a NetworkPerformanceConfig. */ + interface INetworkPerformanceConfig { + + /** NetworkPerformanceConfig totalEgressBandwidthTier */ + totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); + } + + /** Represents a NetworkPerformanceConfig. */ + class NetworkPerformanceConfig implements INetworkPerformanceConfig { /** - * Constructs a new NetworkConfig. + * Constructs a new NetworkPerformanceConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.INetworkConfig); + constructor(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig); - /** NetworkConfig network. */ - public network: string; + /** NetworkPerformanceConfig totalEgressBandwidthTier. */ + public totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); - /** NetworkConfig peeringMode. */ - public peeringMode: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode); + /** NetworkPerformanceConfig _totalEgressBandwidthTier. */ + public _totalEgressBandwidthTier?: "totalEgressBandwidthTier"; /** - * Creates a new NetworkConfig instance using the specified properties. + * Creates a new NetworkPerformanceConfig instance using the specified properties. * @param [properties] Properties to set - * @returns NetworkConfig instance + * @returns NetworkPerformanceConfig instance */ - public static create(properties?: google.cloud.backupdr.v1.INetworkConfig): google.cloud.backupdr.v1.NetworkConfig; + public static create(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode + * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @param message NetworkPerformanceConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode + * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @param message NetworkPerformanceConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NetworkConfig message from the specified reader or buffer. + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NetworkConfig + * @returns NetworkPerformanceConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NetworkConfig + * @returns NetworkPerformanceConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Verifies a NetworkConfig message. + * Verifies a NetworkPerformanceConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NetworkConfig + * @returns NetworkPerformanceConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @param message NetworkConfig + * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. + * @param message NetworkPerformanceConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.NetworkPerformanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NetworkConfig to JSON. + * Converts this NetworkPerformanceConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for NetworkConfig + * Gets the default type url for NetworkPerformanceConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace NetworkConfig { + namespace NetworkPerformanceConfig { - /** PeeringMode enum. */ - enum PeeringMode { - PEERING_MODE_UNSPECIFIED = 0, - PRIVATE_SERVICE_ACCESS = 1 + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + DEFAULT = 1, + TIER_1 = 2 } } - /** Properties of a ManagementURI. */ - interface IManagementURI { + /** Properties of an AccessConfig. */ + interface IAccessConfig { - /** ManagementURI webUi */ - webUi?: (string|null); + /** AccessConfig type */ + type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); - /** ManagementURI api */ - api?: (string|null); + /** AccessConfig name */ + name?: (string|null); + + /** AccessConfig externalIp */ + externalIp?: (string|null); + + /** AccessConfig externalIpv6 */ + externalIpv6?: (string|null); + + /** AccessConfig externalIpv6PrefixLength */ + externalIpv6PrefixLength?: (number|null); + + /** AccessConfig setPublicPtr */ + setPublicPtr?: (boolean|null); + + /** AccessConfig publicPtrDomainName */ + publicPtrDomainName?: (string|null); + + /** AccessConfig networkTier */ + networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); } - /** Represents a ManagementURI. */ - class ManagementURI implements IManagementURI { + /** Represents an AccessConfig. */ + class AccessConfig implements IAccessConfig { /** - * Constructs a new ManagementURI. + * Constructs a new AccessConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IManagementURI); + constructor(properties?: google.cloud.backupdr.v1.IAccessConfig); - /** ManagementURI webUi. */ - public webUi: string; + /** AccessConfig type. */ + public type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); - /** ManagementURI api. */ - public api: string; + /** AccessConfig name. */ + public name?: (string|null); + + /** AccessConfig externalIp. */ + public externalIp?: (string|null); + + /** AccessConfig externalIpv6. */ + public externalIpv6?: (string|null); + + /** AccessConfig externalIpv6PrefixLength. */ + public externalIpv6PrefixLength?: (number|null); + + /** AccessConfig setPublicPtr. */ + public setPublicPtr?: (boolean|null); + + /** AccessConfig publicPtrDomainName. */ + public publicPtrDomainName?: (string|null); + + /** AccessConfig networkTier. */ + public networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); + + /** AccessConfig _type. */ + public _type?: "type"; + + /** AccessConfig _name. */ + public _name?: "name"; + + /** AccessConfig _externalIp. */ + public _externalIp?: "externalIp"; + + /** AccessConfig _externalIpv6. */ + public _externalIpv6?: "externalIpv6"; + + /** AccessConfig _externalIpv6PrefixLength. */ + public _externalIpv6PrefixLength?: "externalIpv6PrefixLength"; + + /** AccessConfig _setPublicPtr. */ + public _setPublicPtr?: "setPublicPtr"; + + /** AccessConfig _publicPtrDomainName. */ + public _publicPtrDomainName?: "publicPtrDomainName"; + + /** AccessConfig _networkTier. */ + public _networkTier?: "networkTier"; /** - * Creates a new ManagementURI instance using the specified properties. + * Creates a new AccessConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ManagementURI instance + * @returns AccessConfig instance */ - public static create(properties?: google.cloud.backupdr.v1.IManagementURI): google.cloud.backupdr.v1.ManagementURI; + public static create(properties?: google.cloud.backupdr.v1.IAccessConfig): google.cloud.backupdr.v1.AccessConfig; /** - * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @param message ManagementURI message or plain object to encode + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @param message ManagementURI message or plain object to encode + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ManagementURI message from the specified reader or buffer. + * Decodes an AccessConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ManagementURI + * @returns AccessConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementURI; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AccessConfig; /** - * Decodes a ManagementURI message from the specified reader or buffer, length delimited. + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ManagementURI + * @returns AccessConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementURI; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AccessConfig; /** - * Verifies a ManagementURI message. + * Verifies an AccessConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ManagementURI + * @returns AccessConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementURI; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AccessConfig; /** - * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. - * @param message ManagementURI + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @param message AccessConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AccessConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ManagementURI to JSON. + * Converts this AccessConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ManagementURI + * Gets the default type url for AccessConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WorkforceIdentityBasedManagementURI. */ - interface IWorkforceIdentityBasedManagementURI { + namespace AccessConfig { - /** WorkforceIdentityBasedManagementURI firstPartyManagementUri */ - firstPartyManagementUri?: (string|null); + /** AccessType enum. */ + enum AccessType { + ACCESS_TYPE_UNSPECIFIED = 0, + ONE_TO_ONE_NAT = 1, + DIRECT_IPV6 = 2 + } - /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri */ - thirdPartyManagementUri?: (string|null); + /** NetworkTier enum. */ + enum NetworkTier { + NETWORK_TIER_UNSPECIFIED = 0, + PREMIUM = 1, + STANDARD = 2 + } } - /** Represents a WorkforceIdentityBasedManagementURI. */ - class WorkforceIdentityBasedManagementURI implements IWorkforceIdentityBasedManagementURI { + /** Properties of an AliasIpRange. */ + interface IAliasIpRange { + + /** AliasIpRange ipCidrRange */ + ipCidrRange?: (string|null); + + /** AliasIpRange subnetworkRangeName */ + subnetworkRangeName?: (string|null); + } + + /** Represents an AliasIpRange. */ + class AliasIpRange implements IAliasIpRange { /** - * Constructs a new WorkforceIdentityBasedManagementURI. + * Constructs a new AliasIpRange. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI); + constructor(properties?: google.cloud.backupdr.v1.IAliasIpRange); - /** WorkforceIdentityBasedManagementURI firstPartyManagementUri. */ - public firstPartyManagementUri: string; + /** AliasIpRange ipCidrRange. */ + public ipCidrRange?: (string|null); - /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri. */ - public thirdPartyManagementUri: string; + /** AliasIpRange subnetworkRangeName. */ + public subnetworkRangeName?: (string|null); + + /** AliasIpRange _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** AliasIpRange _subnetworkRangeName. */ + public _subnetworkRangeName?: "subnetworkRangeName"; /** - * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. + * Creates a new AliasIpRange instance using the specified properties. * @param [properties] Properties to set - * @returns WorkforceIdentityBasedManagementURI instance + * @returns AliasIpRange instance */ - public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static create(properties?: google.cloud.backupdr.v1.IAliasIpRange): google.cloud.backupdr.v1.AliasIpRange; /** - * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. + * Decodes an AliasIpRange message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WorkforceIdentityBasedManagementURI + * @returns AliasIpRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AliasIpRange; /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WorkforceIdentityBasedManagementURI + * @returns AliasIpRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AliasIpRange; /** - * Verifies a WorkforceIdentityBasedManagementURI message. + * Verifies an AliasIpRange message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WorkforceIdentityBasedManagementURI + * @returns AliasIpRange */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AliasIpRange; /** - * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. - * @param message WorkforceIdentityBasedManagementURI + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @param message AliasIpRange * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AliasIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WorkforceIdentityBasedManagementURI to JSON. + * Converts this AliasIpRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WorkforceIdentityBasedManagementURI + * Gets the default type url for AliasIpRange * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WorkforceIdentityBasedOAuth2ClientID. */ - interface IWorkforceIdentityBasedOAuth2ClientID { - - /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId */ - firstPartyOauth2ClientId?: (string|null); + /** Properties of an InstanceParams. */ + interface IInstanceParams { - /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId */ - thirdPartyOauth2ClientId?: (string|null); + /** InstanceParams resourceManagerTags */ + resourceManagerTags?: ({ [k: string]: string }|null); } - /** Represents a WorkforceIdentityBasedOAuth2ClientID. */ - class WorkforceIdentityBasedOAuth2ClientID implements IWorkforceIdentityBasedOAuth2ClientID { + /** Represents an InstanceParams. */ + class InstanceParams implements IInstanceParams { /** - * Constructs a new WorkforceIdentityBasedOAuth2ClientID. + * Constructs a new InstanceParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID); - - /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. */ - public firstPartyOauth2ClientId: string; + constructor(properties?: google.cloud.backupdr.v1.IInstanceParams); - /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. */ - public thirdPartyOauth2ClientId: string; + /** InstanceParams resourceManagerTags. */ + public resourceManagerTags: { [k: string]: string }; /** - * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. + * Creates a new InstanceParams instance using the specified properties. * @param [properties] Properties to set - * @returns WorkforceIdentityBasedOAuth2ClientID instance + * @returns InstanceParams instance */ - public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static create(properties?: google.cloud.backupdr.v1.IInstanceParams): google.cloud.backupdr.v1.InstanceParams; /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @param message InstanceParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @param message InstanceParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. + * Decodes an InstanceParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WorkforceIdentityBasedOAuth2ClientID + * @returns InstanceParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InstanceParams; /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. + * Decodes an InstanceParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WorkforceIdentityBasedOAuth2ClientID + * @returns InstanceParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InstanceParams; /** - * Verifies a WorkforceIdentityBasedOAuth2ClientID message. + * Verifies an InstanceParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. + * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WorkforceIdentityBasedOAuth2ClientID + * @returns InstanceParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InstanceParams; - /** - * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. - * @param message WorkforceIdentityBasedOAuth2ClientID + /** + * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. + * @param message InstanceParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.InstanceParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. + * Converts this InstanceParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID + * Gets the default type url for InstanceParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ManagementServer. */ - interface IManagementServer { - - /** ManagementServer name */ - name?: (string|null); - - /** ManagementServer description */ - description?: (string|null); - - /** ManagementServer labels */ - labels?: ({ [k: string]: string }|null); - - /** ManagementServer createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer type */ - type?: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType|null); - - /** ManagementServer managementUri */ - managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); - - /** ManagementServer workforceIdentityBasedManagementUri */ - workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); - - /** ManagementServer state */ - state?: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState|null); - - /** ManagementServer networks */ - networks?: (google.cloud.backupdr.v1.INetworkConfig[]|null); - - /** ManagementServer etag */ - etag?: (string|null); - - /** ManagementServer oauth2ClientId */ - oauth2ClientId?: (string|null); - - /** ManagementServer workforceIdentityBasedOauth2ClientId */ - workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + /** Properties of an AllocationAffinity. */ + interface IAllocationAffinity { - /** ManagementServer baProxyUri */ - baProxyUri?: (string[]|null); + /** AllocationAffinity consumeAllocationType */ + consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); - /** ManagementServer satisfiesPzs */ - satisfiesPzs?: (google.protobuf.IBoolValue|null); + /** AllocationAffinity key */ + key?: (string|null); - /** ManagementServer satisfiesPzi */ - satisfiesPzi?: (boolean|null); + /** AllocationAffinity values */ + values?: (string[]|null); } - /** Represents a ManagementServer. */ - class ManagementServer implements IManagementServer { + /** Represents an AllocationAffinity. */ + class AllocationAffinity implements IAllocationAffinity { /** - * Constructs a new ManagementServer. + * Constructs a new AllocationAffinity. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IManagementServer); - - /** ManagementServer name. */ - public name: string; - - /** ManagementServer description. */ - public description: string; - - /** ManagementServer labels. */ - public labels: { [k: string]: string }; + constructor(properties?: google.cloud.backupdr.v1.IAllocationAffinity); - /** ManagementServer createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer type. */ - public type: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType); - - /** ManagementServer managementUri. */ - public managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); - - /** ManagementServer workforceIdentityBasedManagementUri. */ - public workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); - - /** ManagementServer state. */ - public state: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState); - - /** ManagementServer networks. */ - public networks: google.cloud.backupdr.v1.INetworkConfig[]; - - /** ManagementServer etag. */ - public etag: string; - - /** ManagementServer oauth2ClientId. */ - public oauth2ClientId: string; + /** AllocationAffinity consumeAllocationType. */ + public consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); - /** ManagementServer workforceIdentityBasedOauth2ClientId. */ - public workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + /** AllocationAffinity key. */ + public key?: (string|null); - /** ManagementServer baProxyUri. */ - public baProxyUri: string[]; + /** AllocationAffinity values. */ + public values: string[]; - /** ManagementServer satisfiesPzs. */ - public satisfiesPzs?: (google.protobuf.IBoolValue|null); + /** AllocationAffinity _consumeAllocationType. */ + public _consumeAllocationType?: "consumeAllocationType"; - /** ManagementServer satisfiesPzi. */ - public satisfiesPzi: boolean; + /** AllocationAffinity _key. */ + public _key?: "key"; /** - * Creates a new ManagementServer instance using the specified properties. + * Creates a new AllocationAffinity instance using the specified properties. * @param [properties] Properties to set - * @returns ManagementServer instance + * @returns AllocationAffinity instance */ - public static create(properties?: google.cloud.backupdr.v1.IManagementServer): google.cloud.backupdr.v1.ManagementServer; + public static create(properties?: google.cloud.backupdr.v1.IAllocationAffinity): google.cloud.backupdr.v1.AllocationAffinity; /** - * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @param message ManagementServer message or plain object to encode + * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @param message AllocationAffinity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @param message ManagementServer message or plain object to encode + * Encodes the specified AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @param message AllocationAffinity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ManagementServer message from the specified reader or buffer. + * Decodes an AllocationAffinity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ManagementServer + * @returns AllocationAffinity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementServer; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AllocationAffinity; /** - * Decodes a ManagementServer message from the specified reader or buffer, length delimited. + * Decodes an AllocationAffinity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ManagementServer + * @returns AllocationAffinity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementServer; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AllocationAffinity; /** - * Verifies a ManagementServer message. + * Verifies an AllocationAffinity message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. + * Creates an AllocationAffinity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ManagementServer + * @returns AllocationAffinity */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementServer; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AllocationAffinity; /** - * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. - * @param message ManagementServer + * Creates a plain object from an AllocationAffinity message. Also converts values to other types if specified. + * @param message AllocationAffinity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ManagementServer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AllocationAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ManagementServer to JSON. + * Converts this AllocationAffinity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ManagementServer + * Gets the default type url for AllocationAffinity * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ManagementServer { - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - BACKUP_RESTORE = 1 - } + namespace AllocationAffinity { - /** InstanceState enum. */ - enum InstanceState { - INSTANCE_STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - UPDATING = 3, - DELETING = 4, - REPAIRING = 5, - MAINTENANCE = 6, - ERROR = 7 + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + NO_RESERVATION = 1, + ANY_RESERVATION = 2, + SPECIFIC_RESERVATION = 3 } } - /** Properties of a ListManagementServersRequest. */ - interface IListManagementServersRequest { + /** Properties of a Scheduling. */ + interface IScheduling { - /** ListManagementServersRequest parent */ - parent?: (string|null); + /** Scheduling onHostMaintenance */ + onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); - /** ListManagementServersRequest pageSize */ - pageSize?: (number|null); + /** Scheduling automaticRestart */ + automaticRestart?: (boolean|null); - /** ListManagementServersRequest pageToken */ - pageToken?: (string|null); + /** Scheduling preemptible */ + preemptible?: (boolean|null); - /** ListManagementServersRequest filter */ - filter?: (string|null); + /** Scheduling nodeAffinities */ + nodeAffinities?: (google.cloud.backupdr.v1.Scheduling.INodeAffinity[]|null); - /** ListManagementServersRequest orderBy */ - orderBy?: (string|null); + /** Scheduling minNodeCpus */ + minNodeCpus?: (number|null); + + /** Scheduling provisioningModel */ + provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); + + /** Scheduling instanceTerminationAction */ + instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); + + /** Scheduling localSsdRecoveryTimeout */ + localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); } - /** Represents a ListManagementServersRequest. */ - class ListManagementServersRequest implements IListManagementServersRequest { + /** Represents a Scheduling. */ + class Scheduling implements IScheduling { /** - * Constructs a new ListManagementServersRequest. + * Constructs a new Scheduling. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IListManagementServersRequest); + constructor(properties?: google.cloud.backupdr.v1.IScheduling); - /** ListManagementServersRequest parent. */ - public parent: string; + /** Scheduling onHostMaintenance. */ + public onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); - /** ListManagementServersRequest pageSize. */ - public pageSize: number; + /** Scheduling automaticRestart. */ + public automaticRestart?: (boolean|null); - /** ListManagementServersRequest pageToken. */ - public pageToken: string; + /** Scheduling preemptible. */ + public preemptible?: (boolean|null); - /** ListManagementServersRequest filter. */ - public filter?: (string|null); + /** Scheduling nodeAffinities. */ + public nodeAffinities: google.cloud.backupdr.v1.Scheduling.INodeAffinity[]; - /** ListManagementServersRequest orderBy. */ - public orderBy?: (string|null); + /** Scheduling minNodeCpus. */ + public minNodeCpus?: (number|null); - /** ListManagementServersRequest _filter. */ - public _filter?: "filter"; + /** Scheduling provisioningModel. */ + public provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); - /** ListManagementServersRequest _orderBy. */ - public _orderBy?: "orderBy"; + /** Scheduling instanceTerminationAction. */ + public instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); + + /** Scheduling localSsdRecoveryTimeout. */ + public localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); + + /** Scheduling _onHostMaintenance. */ + public _onHostMaintenance?: "onHostMaintenance"; + + /** Scheduling _automaticRestart. */ + public _automaticRestart?: "automaticRestart"; + + /** Scheduling _preemptible. */ + public _preemptible?: "preemptible"; + + /** Scheduling _minNodeCpus. */ + public _minNodeCpus?: "minNodeCpus"; + + /** Scheduling _provisioningModel. */ + public _provisioningModel?: "provisioningModel"; + + /** Scheduling _instanceTerminationAction. */ + public _instanceTerminationAction?: "instanceTerminationAction"; + + /** Scheduling _localSsdRecoveryTimeout. */ + public _localSsdRecoveryTimeout?: "localSsdRecoveryTimeout"; /** - * Creates a new ListManagementServersRequest instance using the specified properties. + * Creates a new Scheduling instance using the specified properties. * @param [properties] Properties to set - * @returns ListManagementServersRequest instance + * @returns Scheduling instance */ - public static create(properties?: google.cloud.backupdr.v1.IListManagementServersRequest): google.cloud.backupdr.v1.ListManagementServersRequest; + public static create(properties?: google.cloud.backupdr.v1.IScheduling): google.cloud.backupdr.v1.Scheduling; /** - * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @param message ListManagementServersRequest message or plain object to encode + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @param message ListManagementServersRequest message or plain object to encode + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListManagementServersRequest message from the specified reader or buffer. + * Decodes a Scheduling message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListManagementServersRequest + * @returns Scheduling * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling; /** - * Decodes a ListManagementServersRequest message from the specified reader or buffer, length delimited. + * Decodes a Scheduling message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListManagementServersRequest + * @returns Scheduling * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling; /** - * Verifies a ListManagementServersRequest message. + * Verifies a Scheduling message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListManagementServersRequest + * @returns Scheduling */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling; /** - * Creates a plain object from a ListManagementServersRequest message. Also converts values to other types if specified. - * @param message ListManagementServersRequest + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @param message Scheduling * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ListManagementServersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.Scheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListManagementServersRequest to JSON. + * Converts this Scheduling to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListManagementServersRequest + * Gets the default type url for Scheduling * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListManagementServersResponse. */ - interface IListManagementServersResponse { + namespace Scheduling { - /** ListManagementServersResponse managementServers */ - managementServers?: (google.cloud.backupdr.v1.IManagementServer[]|null); + /** OnHostMaintenance enum. */ + enum OnHostMaintenance { + ON_HOST_MAINTENANCE_UNSPECIFIED = 0, + TERMINATE = 1, + MIGRATE = 1000 + } - /** ListManagementServersResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a NodeAffinity. */ + interface INodeAffinity { - /** ListManagementServersResponse unreachable */ - unreachable?: (string[]|null); + /** NodeAffinity key */ + key?: (string|null); + + /** NodeAffinity operator */ + operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); + + /** NodeAffinity values */ + values?: (string[]|null); + } + + /** Represents a NodeAffinity. */ + class NodeAffinity implements INodeAffinity { + + /** + * Constructs a new NodeAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity); + + /** NodeAffinity key. */ + public key?: (string|null); + + /** NodeAffinity operator. */ + public operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); + + /** NodeAffinity values. */ + public values: string[]; + + /** NodeAffinity _key. */ + public _key?: "key"; + + /** NodeAffinity _operator. */ + public _operator?: "operator"; + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAffinity instance + */ + public static create(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Verifies a NodeAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @param message NodeAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Scheduling.NodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodeAffinity { + + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + IN = 1, + NOT_IN = 2 + } + } + + /** ProvisioningModel enum. */ + enum ProvisioningModel { + PROVISIONING_MODEL_UNSPECIFIED = 0, + STANDARD = 1, + SPOT = 2 + } + + /** InstanceTerminationAction enum. */ + enum InstanceTerminationAction { + INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0, + DELETE = 1, + STOP = 2 + } } - /** Represents a ListManagementServersResponse. */ - class ListManagementServersResponse implements IListManagementServersResponse { + /** Properties of a SchedulingDuration. */ + interface ISchedulingDuration { + + /** SchedulingDuration seconds */ + seconds?: (number|Long|string|null); + + /** SchedulingDuration nanos */ + nanos?: (number|null); + } + + /** Represents a SchedulingDuration. */ + class SchedulingDuration implements ISchedulingDuration { /** - * Constructs a new ListManagementServersResponse. + * Constructs a new SchedulingDuration. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IListManagementServersResponse); + constructor(properties?: google.cloud.backupdr.v1.ISchedulingDuration); - /** ListManagementServersResponse managementServers. */ - public managementServers: google.cloud.backupdr.v1.IManagementServer[]; + /** SchedulingDuration seconds. */ + public seconds?: (number|Long|string|null); - /** ListManagementServersResponse nextPageToken. */ - public nextPageToken: string; + /** SchedulingDuration nanos. */ + public nanos?: (number|null); - /** ListManagementServersResponse unreachable. */ - public unreachable: string[]; + /** SchedulingDuration _seconds. */ + public _seconds?: "seconds"; + + /** SchedulingDuration _nanos. */ + public _nanos?: "nanos"; /** - * Creates a new ListManagementServersResponse instance using the specified properties. + * Creates a new SchedulingDuration instance using the specified properties. * @param [properties] Properties to set - * @returns ListManagementServersResponse instance + * @returns SchedulingDuration instance */ - public static create(properties?: google.cloud.backupdr.v1.IListManagementServersResponse): google.cloud.backupdr.v1.ListManagementServersResponse; + public static create(properties?: google.cloud.backupdr.v1.ISchedulingDuration): google.cloud.backupdr.v1.SchedulingDuration; /** - * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @param message ListManagementServersResponse message or plain object to encode + * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @param message SchedulingDuration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @param message ListManagementServersResponse message or plain object to encode + * Encodes the specified SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @param message SchedulingDuration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListManagementServersResponse message from the specified reader or buffer. + * Decodes a SchedulingDuration message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListManagementServersResponse + * @returns SchedulingDuration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.SchedulingDuration; /** - * Decodes a ListManagementServersResponse message from the specified reader or buffer, length delimited. + * Decodes a SchedulingDuration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListManagementServersResponse + * @returns SchedulingDuration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.SchedulingDuration; /** - * Verifies a ListManagementServersResponse message. + * Verifies a SchedulingDuration message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListManagementServersResponse + * @returns SchedulingDuration */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.SchedulingDuration; /** - * Creates a plain object from a ListManagementServersResponse message. Also converts values to other types if specified. - * @param message ListManagementServersResponse + * Creates a plain object from a SchedulingDuration message. Also converts values to other types if specified. + * @param message SchedulingDuration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ListManagementServersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.SchedulingDuration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListManagementServersResponse to JSON. + * Converts this SchedulingDuration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListManagementServersResponse + * Gets the default type url for SchedulingDuration * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetManagementServerRequest. */ - interface IGetManagementServerRequest { + /** Properties of a ServiceAccount. */ + interface IServiceAccount { - /** GetManagementServerRequest name */ - name?: (string|null); + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); } - /** Represents a GetManagementServerRequest. */ - class GetManagementServerRequest implements IGetManagementServerRequest { + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { /** - * Constructs a new GetManagementServerRequest. + * Constructs a new ServiceAccount. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest); + constructor(properties?: google.cloud.backupdr.v1.IServiceAccount); - /** GetManagementServerRequest name. */ - public name: string; + /** ServiceAccount email. */ + public email?: (string|null); + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** ServiceAccount _email. */ + public _email?: "email"; /** - * Creates a new GetManagementServerRequest instance using the specified properties. + * Creates a new ServiceAccount instance using the specified properties. * @param [properties] Properties to set - * @returns GetManagementServerRequest instance + * @returns ServiceAccount instance */ - public static create(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest): google.cloud.backupdr.v1.GetManagementServerRequest; + public static create(properties?: google.cloud.backupdr.v1.IServiceAccount): google.cloud.backupdr.v1.ServiceAccount; /** - * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @param message GetManagementServerRequest message or plain object to encode + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @param message GetManagementServerRequest message or plain object to encode + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetManagementServerRequest message from the specified reader or buffer. + * Decodes a ServiceAccount message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetManagementServerRequest + * @returns ServiceAccount * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetManagementServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceAccount; /** - * Decodes a GetManagementServerRequest message from the specified reader or buffer, length delimited. + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetManagementServerRequest + * @returns ServiceAccount * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetManagementServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceAccount; /** - * Verifies a GetManagementServerRequest message. + * Verifies a ServiceAccount message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetManagementServerRequest + * @returns ServiceAccount */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetManagementServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceAccount; /** - * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. - * @param message GetManagementServerRequest + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.GetManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetManagementServerRequest to JSON. + * Converts this ServiceAccount to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetManagementServerRequest + * Gets the default type url for ServiceAccount * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateManagementServerRequest. */ - interface ICreateManagementServerRequest { - - /** CreateManagementServerRequest parent */ - parent?: (string|null); - - /** CreateManagementServerRequest managementServerId */ - managementServerId?: (string|null); - - /** CreateManagementServerRequest managementServer */ - managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + /** Properties of a Tags. */ + interface ITags { - /** CreateManagementServerRequest requestId */ - requestId?: (string|null); + /** Tags items */ + items?: (string[]|null); } - /** Represents a CreateManagementServerRequest. */ - class CreateManagementServerRequest implements ICreateManagementServerRequest { + /** Represents a Tags. */ + class Tags implements ITags { /** - * Constructs a new CreateManagementServerRequest. + * Constructs a new Tags. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest); - - /** CreateManagementServerRequest parent. */ - public parent: string; - - /** CreateManagementServerRequest managementServerId. */ - public managementServerId: string; + constructor(properties?: google.cloud.backupdr.v1.ITags); - /** CreateManagementServerRequest managementServer. */ - public managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); - - /** CreateManagementServerRequest requestId. */ - public requestId: string; + /** Tags items. */ + public items: string[]; /** - * Creates a new CreateManagementServerRequest instance using the specified properties. + * Creates a new Tags instance using the specified properties. * @param [properties] Properties to set - * @returns CreateManagementServerRequest instance + * @returns Tags instance */ - public static create(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static create(properties?: google.cloud.backupdr.v1.ITags): google.cloud.backupdr.v1.Tags; /** - * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @param message CreateManagementServerRequest message or plain object to encode + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @param message CreateManagementServerRequest message or plain object to encode + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer. + * Decodes a Tags message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateManagementServerRequest + * @returns Tags * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Tags; /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. + * Decodes a Tags message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateManagementServerRequest + * @returns Tags * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Tags; /** - * Verifies a CreateManagementServerRequest message. + * Verifies a Tags message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Tags message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateManagementServerRequest + * @returns Tags */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Tags; /** - * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. - * @param message CreateManagementServerRequest + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @param message Tags * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.CreateManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.Tags, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateManagementServerRequest to JSON. + * Converts this Tags to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateManagementServerRequest + * Gets the default type url for Tags * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteManagementServerRequest. */ - interface IDeleteManagementServerRequest { + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { - /** DeleteManagementServerRequest name */ - name?: (string|null); + /** AttachedDisk initializeParams */ + initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); - /** DeleteManagementServerRequest requestId */ - requestId?: (string|null); + /** AttachedDisk deviceName */ + deviceName?: (string|null); + + /** AttachedDisk kind */ + kind?: (string|null); + + /** AttachedDisk diskTypeDeprecated */ + diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk mode */ + mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); + + /** AttachedDisk source */ + source?: (string|null); + + /** AttachedDisk index */ + index?: (number|Long|string|null); + + /** AttachedDisk boot */ + boot?: (boolean|null); + + /** AttachedDisk autoDelete */ + autoDelete?: (boolean|null); + + /** AttachedDisk license */ + license?: (string[]|null); + + /** AttachedDisk diskInterface */ + diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); + + /** AttachedDisk guestOsFeature */ + guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); + + /** AttachedDisk diskEncryptionKey */ + diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk savedState */ + savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); + + /** AttachedDisk diskType */ + diskType?: (string|null); + + /** AttachedDisk type */ + type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); } - /** Represents a DeleteManagementServerRequest. */ - class DeleteManagementServerRequest implements IDeleteManagementServerRequest { + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { /** - * Constructs a new DeleteManagementServerRequest. + * Constructs a new AttachedDisk. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest); + constructor(properties?: google.cloud.backupdr.v1.IAttachedDisk); - /** DeleteManagementServerRequest name. */ - public name: string; + /** AttachedDisk initializeParams. */ + public initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); - /** DeleteManagementServerRequest requestId. */ - public requestId: string; + /** AttachedDisk deviceName. */ + public deviceName?: (string|null); + + /** AttachedDisk kind. */ + public kind?: (string|null); + + /** AttachedDisk diskTypeDeprecated. */ + public diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk mode. */ + public mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); + + /** AttachedDisk source. */ + public source?: (string|null); + + /** AttachedDisk index. */ + public index?: (number|Long|string|null); + + /** AttachedDisk boot. */ + public boot?: (boolean|null); + + /** AttachedDisk autoDelete. */ + public autoDelete?: (boolean|null); + + /** AttachedDisk license. */ + public license: string[]; + + /** AttachedDisk diskInterface. */ + public diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); + + /** AttachedDisk guestOsFeature. */ + public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; + + /** AttachedDisk diskEncryptionKey. */ + public diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk savedState. */ + public savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); + + /** AttachedDisk diskType. */ + public diskType?: (string|null); + + /** AttachedDisk type. */ + public type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk _initializeParams. */ + public _initializeParams?: "initializeParams"; + + /** AttachedDisk _deviceName. */ + public _deviceName?: "deviceName"; + + /** AttachedDisk _kind. */ + public _kind?: "kind"; + + /** AttachedDisk _diskTypeDeprecated. */ + public _diskTypeDeprecated?: "diskTypeDeprecated"; + + /** AttachedDisk _mode. */ + public _mode?: "mode"; + + /** AttachedDisk _source. */ + public _source?: "source"; + + /** AttachedDisk _index. */ + public _index?: "index"; + + /** AttachedDisk _boot. */ + public _boot?: "boot"; + + /** AttachedDisk _autoDelete. */ + public _autoDelete?: "autoDelete"; + + /** AttachedDisk _diskInterface. */ + public _diskInterface?: "diskInterface"; + + /** AttachedDisk _diskEncryptionKey. */ + public _diskEncryptionKey?: "diskEncryptionKey"; + + /** AttachedDisk _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** AttachedDisk _savedState. */ + public _savedState?: "savedState"; + + /** AttachedDisk _diskType. */ + public _diskType?: "diskType"; + + /** AttachedDisk _type. */ + public _type?: "type"; /** - * Creates a new DeleteManagementServerRequest instance using the specified properties. + * Creates a new AttachedDisk instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteManagementServerRequest instance + * @returns AttachedDisk instance */ - public static create(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static create(properties?: google.cloud.backupdr.v1.IAttachedDisk): google.cloud.backupdr.v1.AttachedDisk; /** - * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @param message DeleteManagementServerRequest message or plain object to encode + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @param message DeleteManagementServerRequest message or plain object to encode + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. + * Decodes an AttachedDisk message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteManagementServerRequest + * @returns AttachedDisk * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk; /** - * Decodes a DeleteManagementServerRequest message from the specified reader or buffer, length delimited. + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteManagementServerRequest + * @returns AttachedDisk * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk; /** - * Verifies a DeleteManagementServerRequest message. + * Verifies an AttachedDisk message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteManagementServerRequest + * @returns AttachedDisk */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk; /** - * Creates a plain object from a DeleteManagementServerRequest message. Also converts values to other types if specified. - * @param message DeleteManagementServerRequest + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.DeleteManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteManagementServerRequest to JSON. + * Converts this AttachedDisk to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteManagementServerRequest + * Gets the default type url for AttachedDisk * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { + namespace AttachedDisk { - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Properties of an InitializeParams. */ + interface IInitializeParams { - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** InitializeParams diskName */ + diskName?: (string|null); - /** OperationMetadata target */ - target?: (string|null); + /** InitializeParams replicaZones */ + replicaZones?: (string[]|null); + } - /** OperationMetadata verb */ - verb?: (string|null); + /** Represents an InitializeParams. */ + class InitializeParams implements IInitializeParams { + + /** + * Constructs a new InitializeParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams); + + /** InitializeParams diskName. */ + public diskName?: (string|null); + + /** InitializeParams replicaZones. */ + public replicaZones: string[]; + + /** InitializeParams _diskName. */ + public _diskName?: "diskName"; + + /** + * Creates a new InitializeParams instance using the specified properties. + * @param [properties] Properties to set + * @returns InitializeParams instance + */ + public static create(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @param message InitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @param message InitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitializeParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Decodes an InitializeParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Verifies an InitializeParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitializeParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. + * @param message InitializeParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AttachedDisk.InitializeParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitializeParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InitializeParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); + /** DiskType enum. */ + enum DiskType { + DISK_TYPE_UNSPECIFIED = 0, + SCRATCH = 1, + PERSISTENT = 2 + } - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); + /** DiskMode enum. */ + enum DiskMode { + DISK_MODE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2, + LOCKED = 3 + } - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); + /** DiskInterface enum. */ + enum DiskInterface { + DISK_INTERFACE_UNSPECIFIED = 0, + SCSI = 1, + NVME = 2, + NVDIMM = 3, + ISCSI = 4 + } - /** OperationMetadata additionalInfo */ - additionalInfo?: ({ [k: string]: string }|null); + /** DiskSavedState enum. */ + enum DiskSavedState { + DISK_SAVED_STATE_UNSPECIFIED = 0, + PRESERVED = 1 + } } - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** Properties of a GuestOsFeature. */ + interface IGuestOsFeature { + + /** GuestOsFeature type */ + type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); + } + + /** Represents a GuestOsFeature. */ + class GuestOsFeature implements IGuestOsFeature { /** - * Constructs a new OperationMetadata. + * Constructs a new GuestOsFeature. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; + constructor(properties?: google.cloud.backupdr.v1.IGuestOsFeature); - /** OperationMetadata apiVersion. */ - public apiVersion: string; + /** GuestOsFeature type. */ + public type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); - /** OperationMetadata additionalInfo. */ - public additionalInfo: { [k: string]: string }; + /** GuestOsFeature _type. */ + public _type?: "type"; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new GuestOsFeature instance using the specified properties. * @param [properties] Properties to set - * @returns OperationMetadata instance + * @returns GuestOsFeature instance */ - public static create(properties?: google.cloud.backupdr.v1.IOperationMetadata): google.cloud.backupdr.v1.OperationMetadata; + public static create(properties?: google.cloud.backupdr.v1.IGuestOsFeature): google.cloud.backupdr.v1.GuestOsFeature; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a GuestOsFeature message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OperationMetadata + * @returns GuestOsFeature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GuestOsFeature; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns GuestOsFeature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GuestOsFeature; /** - * Verifies an OperationMetadata message. + * Verifies a GuestOsFeature message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns GuestOsFeature */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GuestOsFeature; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @param message GuestOsFeature * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.GuestOsFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this GuestOsFeature to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for GuestOsFeature * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + namespace GuestOsFeature { + + /** FeatureType enum. */ + enum FeatureType { + FEATURE_TYPE_UNSPECIFIED = 0, + VIRTIO_SCSI_MULTIQUEUE = 1, + WINDOWS = 2, + MULTI_IP_SUBNET = 3, + UEFI_COMPATIBLE = 4, + SECURE_BOOT = 5, + GVNIC = 6, + SEV_CAPABLE = 7, + BARE_METAL_LINUX_COMPATIBLE = 8, + SUSPEND_RESUME_COMPATIBLE = 9, + SEV_LIVE_MIGRATABLE = 10, + SEV_SNP_CAPABLE = 11, + TDX_CAPABLE = 12, + IDPF = 13, + SEV_LIVE_MIGRATABLE_V2 = 14 + } + } + + /** KeyRevocationActionType enum. */ + enum KeyRevocationActionType { + KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0, + NONE = 1, + STOP = 2 + } } } } @@ -3319,6 +13653,115 @@ export namespace google { IDENTIFIER = 8 } + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { @@ -5742,6 +16185,9 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + /** FieldOptions .google.api.resourceReference */ ".google.api.resourceReference"?: (google.api.IResourceReference|null); } @@ -7783,6 +18229,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * 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.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 an Any. */ interface IAny { @@ -7886,194 +18435,188 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Empty. */ - interface IEmpty { + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); } - /** Represents an Empty. */ - class Empty implements IEmpty { + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { /** - * Constructs a new Empty. + * Constructs a new FieldMask. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEmpty); + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; /** - * Creates a new Empty instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @param [properties] Properties to set - * @returns Empty instance + * @returns FieldMask instance */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Empty + * @returns FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Empty + * @returns FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies an Empty message. + * Verifies a FieldMask message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Empty + * Gets the default type url for FieldMask * @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 { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new Timestamp. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns Timestamp instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Timestamp + * @returns Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @returns Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies a Timestamp message. + * Verifies an Empty message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty * @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.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this Empty to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Empty * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -8954,6 +19497,152 @@ export namespace google { } } + /** Namespace type. */ + namespace type { + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Month enum. */ + enum Month { + MONTH_UNSPECIFIED = 0, + JANUARY = 1, + FEBRUARY = 2, + MARCH = 3, + APRIL = 4, + MAY = 5, + JUNE = 6, + JULY = 7, + AUGUST = 8, + SEPTEMBER = 9, + OCTOBER = 10, + NOVEMBER = 11, + DECEMBER = 12 + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace longrunning. */ namespace longrunning { @@ -9925,117 +20614,4 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } } diff --git a/packages/google-cloud-backupdr/protos/protos.js b/packages/google-cloud-backupdr/protos/protos.js index cd28ca533aa..34c1fd94966 100644 --- a/packages/google-cloud-backupdr/protos/protos.js +++ b/packages/google-cloud-backupdr/protos/protos.js @@ -230,6 +230,765 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupVault. + * @function createBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupVault = function createBackupVault(request, callback) { + return this.rpcCall(createBackupVault, $root.google.cloud.backupdr.v1.CreateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupVault" }); + + /** + * Calls CreateBackupVault. + * @function createBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupVaultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} [response] ListBackupVaultsResponse + */ + + /** + * Calls ListBackupVaults. + * @function listBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback} callback Node-style callback called with the error, if any, and ListBackupVaultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupVaults = function listBackupVaults(request, callback) { + return this.rpcCall(listBackupVaults, $root.google.cloud.backupdr.v1.ListBackupVaultsRequest, $root.google.cloud.backupdr.v1.ListBackupVaultsResponse, request, callback); + }, "name", { value: "ListBackupVaults" }); + + /** + * Calls ListBackupVaults. + * @function listBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef FetchUsableBackupVaultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} [response] FetchUsableBackupVaultsResponse + */ + + /** + * Calls FetchUsableBackupVaults. + * @function fetchUsableBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback} callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.fetchUsableBackupVaults = function fetchUsableBackupVaults(request, callback) { + return this.rpcCall(fetchUsableBackupVaults, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, request, callback); + }, "name", { value: "FetchUsableBackupVaults" }); + + /** + * Calls FetchUsableBackupVaults. + * @function fetchUsableBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupVault} [response] BackupVault + */ + + /** + * Calls GetBackupVault. + * @function getBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback} callback Node-style callback called with the error, if any, and BackupVault + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupVault = function getBackupVault(request, callback) { + return this.rpcCall(getBackupVault, $root.google.cloud.backupdr.v1.GetBackupVaultRequest, $root.google.cloud.backupdr.v1.BackupVault, request, callback); + }, "name", { value: "GetBackupVault" }); + + /** + * Calls GetBackupVault. + * @function getBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackupVault. + * @function updateBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackupVault = function updateBackupVault(request, callback) { + return this.rpcCall(updateBackupVault, $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackupVault" }); + + /** + * Calls UpdateBackupVault. + * @function updateBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupVault. + * @function deleteBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupVault = function deleteBackupVault(request, callback) { + return this.rpcCall(deleteBackupVault, $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupVault" }); + + /** + * Calls DeleteBackupVault. + * @function deleteBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListDataSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} [response] ListDataSourcesResponse + */ + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback} callback Node-style callback called with the error, if any, and ListDataSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listDataSources = function listDataSources(request, callback) { + return this.rpcCall(listDataSources, $root.google.cloud.backupdr.v1.ListDataSourcesRequest, $root.google.cloud.backupdr.v1.ListDataSourcesResponse, request, callback); + }, "name", { value: "ListDataSources" }); + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.DataSource} [response] DataSource + */ + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback} callback Node-style callback called with the error, if any, and DataSource + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getDataSource = function getDataSource(request, callback) { + return this.rpcCall(getDataSource, $root.google.cloud.backupdr.v1.GetDataSourceRequest, $root.google.cloud.backupdr.v1.DataSource, request, callback); + }, "name", { value: "GetDataSource" }); + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDataSource. + * @function updateDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateDataSource = function updateDataSource(request, callback) { + return this.rpcCall(updateDataSource, $root.google.cloud.backupdr.v1.UpdateDataSourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDataSource" }); + + /** + * Calls UpdateDataSource. + * @function updateDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.backupdr.v1.ListBackupsRequest, $root.google.cloud.backupdr.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.backupdr.v1.GetBackupRequest, $root.google.cloud.backupdr.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.backupdr.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.backupdr.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef RestoreBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreBackup. + * @function restoreBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.restoreBackup = function restoreBackup(request, callback) { + return this.rpcCall(restoreBackup, $root.google.cloud.backupdr.v1.RestoreBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreBackup" }); + + /** + * Calls RestoreBackup. + * @function restoreBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupPlan = function createBackupPlan(request, callback) { + return this.rpcCall(createBackupPlan, $root.google.cloud.backupdr.v1.CreateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupPlan" }); + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupPlan} [response] BackupPlan + */ + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback} callback Node-style callback called with the error, if any, and BackupPlan + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupPlan = function getBackupPlan(request, callback) { + return this.rpcCall(getBackupPlan, $root.google.cloud.backupdr.v1.GetBackupPlanRequest, $root.google.cloud.backupdr.v1.BackupPlan, request, callback); + }, "name", { value: "GetBackupPlan" }); + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupPlansCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} [response] ListBackupPlansResponse + */ + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback} callback Node-style callback called with the error, if any, and ListBackupPlansResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupPlans = function listBackupPlans(request, callback) { + return this.rpcCall(listBackupPlans, $root.google.cloud.backupdr.v1.ListBackupPlansRequest, $root.google.cloud.backupdr.v1.ListBackupPlansResponse, request, callback); + }, "name", { value: "ListBackupPlans" }); + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupPlan = function deleteBackupPlan(request, callback) { + return this.rpcCall(deleteBackupPlan, $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupPlan" }); + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupPlanAssociation. + * @function createBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupPlanAssociation = function createBackupPlanAssociation(request, callback) { + return this.rpcCall(createBackupPlanAssociation, $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupPlanAssociation" }); + + /** + * Calls CreateBackupPlanAssociation. + * @function createBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} [response] BackupPlanAssociation + */ + + /** + * Calls GetBackupPlanAssociation. + * @function getBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and BackupPlanAssociation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupPlanAssociation = function getBackupPlanAssociation(request, callback) { + return this.rpcCall(getBackupPlanAssociation, $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, $root.google.cloud.backupdr.v1.BackupPlanAssociation, request, callback); + }, "name", { value: "GetBackupPlanAssociation" }); + + /** + * Calls GetBackupPlanAssociation. + * @function getBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupPlanAssociationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} [response] ListBackupPlanAssociationsResponse + */ + + /** + * Calls ListBackupPlanAssociations. + * @function listBackupPlanAssociations + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback} callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupPlanAssociations = function listBackupPlanAssociations(request, callback) { + return this.rpcCall(listBackupPlanAssociations, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, request, callback); + }, "name", { value: "ListBackupPlanAssociations" }); + + /** + * Calls ListBackupPlanAssociations. + * @function listBackupPlanAssociations + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupPlanAssociation. + * @function deleteBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupPlanAssociation = function deleteBackupPlanAssociation(request, callback) { + return this.rpcCall(deleteBackupPlanAssociation, $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupPlanAssociation" }); + + /** + * Calls DeleteBackupPlanAssociation. + * @function deleteBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef TriggerBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TriggerBackup. + * @function triggerBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.triggerBackup = function triggerBackup(request, callback) { + return this.rpcCall(triggerBackup, $root.google.cloud.backupdr.v1.TriggerBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TriggerBackup" }); + + /** + * Calls TriggerBackup. + * @function triggerBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return BackupDR; })(); @@ -3673,6 +4432,27708 @@ return OperationMetadata; })(); + v1.BackupPlan = (function() { + + /** + * Properties of a BackupPlan. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupPlan + * @property {string|null} [name] BackupPlan name + * @property {string|null} [description] BackupPlan description + * @property {Object.|null} [labels] BackupPlan labels + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlan createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlan updateTime + * @property {Array.|null} [backupRules] BackupPlan backupRules + * @property {google.cloud.backupdr.v1.BackupPlan.State|null} [state] BackupPlan state + * @property {string|null} [resourceType] BackupPlan resourceType + * @property {string|null} [etag] BackupPlan etag + * @property {string|null} [backupVault] BackupPlan backupVault + * @property {string|null} [backupVaultServiceAccount] BackupPlan backupVaultServiceAccount + */ + + /** + * Constructs a new BackupPlan. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupPlan. + * @implements IBackupPlan + * @constructor + * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set + */ + function BackupPlan(properties) { + this.labels = {}; + this.backupRules = []; + 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]]; + } + + /** + * BackupPlan name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.name = ""; + + /** + * BackupPlan description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.description = ""; + + /** + * BackupPlan labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.labels = $util.emptyObject; + + /** + * BackupPlan createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.createTime = null; + + /** + * BackupPlan updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.updateTime = null; + + /** + * BackupPlan backupRules. + * @member {Array.} backupRules + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupRules = $util.emptyArray; + + /** + * BackupPlan state. + * @member {google.cloud.backupdr.v1.BackupPlan.State} state + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.state = 0; + + /** + * BackupPlan resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.resourceType = ""; + + /** + * BackupPlan etag. + * @member {string} etag + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.etag = ""; + + /** + * BackupPlan backupVault. + * @member {string} backupVault + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupVault = ""; + + /** + * BackupPlan backupVaultServiceAccount. + * @member {string} backupVaultServiceAccount + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupVaultServiceAccount = ""; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan instance + */ + BackupPlan.create = function create(properties) { + return new BackupPlan(properties); + }; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.backupRules != null && message.backupRules.length) + for (var i = 0; i < message.backupRules.length; ++i) + $root.google.cloud.backupdr.v1.BackupRule.encode(message.backupRules[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceType); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.backupVault); + if (message.backupVaultServiceAccount != null && Object.hasOwnProperty.call(message, "backupVaultServiceAccount")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.backupVaultServiceAccount); + return writer; + }; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupPlan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlan(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.backupRules && message.backupRules.length)) + message.backupRules = []; + message.backupRules.push($root.google.cloud.backupdr.v1.BackupRule.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.resourceType = reader.string(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.backupVault = reader.string(); + break; + } + case 11: { + message.backupVaultServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupPlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupPlan message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupPlan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.backupRules != null && message.hasOwnProperty("backupRules")) { + if (!Array.isArray(message.backupRules)) + return "backupRules: array expected"; + for (var i = 0; i < message.backupRules.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupRule.verify(message.backupRules[i]); + if (error) + return "backupRules." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + if (!$util.isString(message.backupVault)) + return "backupVault: string expected"; + if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) + if (!$util.isString(message.backupVaultServiceAccount)) + return "backupVaultServiceAccount: string expected"; + return null; + }; + + /** + * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + */ + BackupPlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupPlan) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupPlan(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupRules) { + if (!Array.isArray(object.backupRules)) + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: array expected"); + message.backupRules = []; + for (var i = 0; i < object.backupRules.length; ++i) { + if (typeof object.backupRules[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: object expected"); + message.backupRules[i] = $root.google.cloud.backupdr.v1.BackupRule.fromObject(object.backupRules[i]); + } + } + 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 "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + } + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.etag != null) + message.etag = String(object.etag); + if (object.backupVault != null) + message.backupVault = String(object.backupVault); + if (object.backupVaultServiceAccount != null) + message.backupVaultServiceAccount = String(object.backupVaultServiceAccount); + return message; + }; + + /** + * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.BackupPlan} message BackupPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupRules = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.resourceType = ""; + object.etag = ""; + object.backupVault = ""; + object.backupVaultServiceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.backupRules && message.backupRules.length) { + object.backupRules = []; + for (var j = 0; j < message.backupRules.length; ++j) + object.backupRules[j] = $root.google.cloud.backupdr.v1.BackupRule.toObject(message.backupRules[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] : message.state; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = message.backupVault; + if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) + object.backupVaultServiceAccount = message.backupVaultServiceAccount; + return object; + }; + + /** + * Converts this BackupPlan to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + * @returns {Object.} JSON object + */ + BackupPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupPlan + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlan"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupPlan.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + */ + BackupPlan.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + return values; + })(); + + return BackupPlan; + })(); + + v1.BackupRule = (function() { + + /** + * Properties of a BackupRule. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupRule + * @property {string|null} [ruleId] BackupRule ruleId + * @property {number|null} [backupRetentionDays] BackupRule backupRetentionDays + * @property {google.cloud.backupdr.v1.IStandardSchedule|null} [standardSchedule] BackupRule standardSchedule + */ + + /** + * Constructs a new BackupRule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupRule. + * @implements IBackupRule + * @constructor + * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set + */ + function BackupRule(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]]; + } + + /** + * BackupRule ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.ruleId = ""; + + /** + * BackupRule backupRetentionDays. + * @member {number} backupRetentionDays + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.backupRetentionDays = 0; + + /** + * BackupRule standardSchedule. + * @member {google.cloud.backupdr.v1.IStandardSchedule|null|undefined} standardSchedule + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.standardSchedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupRule backupScheduleOneof. + * @member {"standardSchedule"|undefined} backupScheduleOneof + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + Object.defineProperty(BackupRule.prototype, "backupScheduleOneof", { + get: $util.oneOfGetter($oneOfFields = ["standardSchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupRule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule instance + */ + BackupRule.create = function create(properties) { + return new BackupRule(properties); + }; + + /** + * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.backupRetentionDays != null && Object.hasOwnProperty.call(message, "backupRetentionDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.backupRetentionDays); + if (message.standardSchedule != null && Object.hasOwnProperty.call(message, "standardSchedule")) + $root.google.cloud.backupdr.v1.StandardSchedule.encode(message.standardSchedule, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 4: { + message.backupRetentionDays = reader.int32(); + break; + } + case 5: { + message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupRule message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) + if (!$util.isInteger(message.backupRetentionDays)) + return "backupRetentionDays: integer expected"; + if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { + properties.backupScheduleOneof = 1; + { + var error = $root.google.cloud.backupdr.v1.StandardSchedule.verify(message.standardSchedule); + if (error) + return "standardSchedule." + error; + } + } + return null; + }; + + /** + * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + */ + BackupRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupRule) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupRule(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.backupRetentionDays != null) + message.backupRetentionDays = object.backupRetentionDays | 0; + if (object.standardSchedule != null) { + if (typeof object.standardSchedule !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupRule.standardSchedule: object expected"); + message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.fromObject(object.standardSchedule); + } + return message; + }; + + /** + * Creates a plain object from a BackupRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.BackupRule} message BackupRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.backupRetentionDays = 0; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) + object.backupRetentionDays = message.backupRetentionDays; + if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { + object.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.toObject(message.standardSchedule, options); + if (options.oneofs) + object.backupScheduleOneof = "standardSchedule"; + } + return object; + }; + + /** + * Converts this BackupRule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + * @returns {Object.} JSON object + */ + BackupRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupRule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupRule"; + }; + + return BackupRule; + })(); + + v1.StandardSchedule = (function() { + + /** + * Properties of a StandardSchedule. + * @memberof google.cloud.backupdr.v1 + * @interface IStandardSchedule + * @property {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null} [recurrenceType] StandardSchedule recurrenceType + * @property {number|null} [hourlyFrequency] StandardSchedule hourlyFrequency + * @property {Array.|null} [daysOfWeek] StandardSchedule daysOfWeek + * @property {Array.|null} [daysOfMonth] StandardSchedule daysOfMonth + * @property {google.cloud.backupdr.v1.IWeekDayOfMonth|null} [weekDayOfMonth] StandardSchedule weekDayOfMonth + * @property {Array.|null} [months] StandardSchedule months + * @property {google.cloud.backupdr.v1.IBackupWindow|null} [backupWindow] StandardSchedule backupWindow + * @property {string|null} [timeZone] StandardSchedule timeZone + */ + + /** + * Constructs a new StandardSchedule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a StandardSchedule. + * @implements IStandardSchedule + * @constructor + * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set + */ + function StandardSchedule(properties) { + this.daysOfWeek = []; + this.daysOfMonth = []; + this.months = []; + 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]]; + } + + /** + * StandardSchedule recurrenceType. + * @member {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType} recurrenceType + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.recurrenceType = 0; + + /** + * StandardSchedule hourlyFrequency. + * @member {number} hourlyFrequency + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.hourlyFrequency = 0; + + /** + * StandardSchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.daysOfWeek = $util.emptyArray; + + /** + * StandardSchedule daysOfMonth. + * @member {Array.} daysOfMonth + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.daysOfMonth = $util.emptyArray; + + /** + * StandardSchedule weekDayOfMonth. + * @member {google.cloud.backupdr.v1.IWeekDayOfMonth|null|undefined} weekDayOfMonth + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.weekDayOfMonth = null; + + /** + * StandardSchedule months. + * @member {Array.} months + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.months = $util.emptyArray; + + /** + * StandardSchedule backupWindow. + * @member {google.cloud.backupdr.v1.IBackupWindow|null|undefined} backupWindow + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.backupWindow = null; + + /** + * StandardSchedule timeZone. + * @member {string} timeZone + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.timeZone = ""; + + /** + * Creates a new StandardSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule instance + */ + StandardSchedule.create = function create(properties) { + return new StandardSchedule(properties); + }; + + /** + * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recurrenceType != null && Object.hasOwnProperty.call(message, "recurrenceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.recurrenceType); + if (message.hourlyFrequency != null && Object.hasOwnProperty.call(message, "hourlyFrequency")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.hourlyFrequency); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + if (message.daysOfMonth != null && message.daysOfMonth.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.daysOfMonth.length; ++i) + writer.int32(message.daysOfMonth[i]); + writer.ldelim(); + } + if (message.weekDayOfMonth != null && Object.hasOwnProperty.call(message, "weekDayOfMonth")) + $root.google.cloud.backupdr.v1.WeekDayOfMonth.encode(message.weekDayOfMonth, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.months != null && message.months.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.months.length; ++i) + writer.int32(message.months[i]); + writer.ldelim(); + } + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.cloud.backupdr.v1.BackupWindow.encode(message.backupWindow, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.StandardSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recurrenceType = reader.int32(); + break; + } + case 2: { + message.hourlyFrequency = reader.int32(); + break; + } + case 3: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + case 4: { + if (!(message.daysOfMonth && message.daysOfMonth.length)) + message.daysOfMonth = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfMonth.push(reader.int32()); + } else + message.daysOfMonth.push(reader.int32()); + break; + } + case 5: { + message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.months && message.months.length)) + message.months = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.months.push(reader.int32()); + } else + message.months.push(reader.int32()); + break; + } + case 7: { + message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSchedule message. + * @function verify + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) + switch (message.recurrenceType) { + default: + return "recurrenceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) + if (!$util.isInteger(message.hourlyFrequency)) + return "hourlyFrequency: integer expected"; + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.daysOfMonth != null && message.hasOwnProperty("daysOfMonth")) { + if (!Array.isArray(message.daysOfMonth)) + return "daysOfMonth: array expected"; + for (var i = 0; i < message.daysOfMonth.length; ++i) + if (!$util.isInteger(message.daysOfMonth[i])) + return "daysOfMonth: integer[] expected"; + } + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) { + var error = $root.google.cloud.backupdr.v1.WeekDayOfMonth.verify(message.weekDayOfMonth); + if (error) + return "weekDayOfMonth." + error; + } + if (message.months != null && message.hasOwnProperty("months")) { + if (!Array.isArray(message.months)) + return "months: array expected"; + for (var i = 0; i < message.months.length; ++i) + switch (message.months[i]) { + default: + return "months: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.cloud.backupdr.v1.BackupWindow.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + */ + StandardSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.StandardSchedule) + return object; + var message = new $root.google.cloud.backupdr.v1.StandardSchedule(); + switch (object.recurrenceType) { + default: + if (typeof object.recurrenceType === "number") { + message.recurrenceType = object.recurrenceType; + break; + } + break; + case "RECURRENCE_TYPE_UNSPECIFIED": + case 0: + message.recurrenceType = 0; + break; + case "HOURLY": + case 1: + message.recurrenceType = 1; + break; + case "DAILY": + case 2: + message.recurrenceType = 2; + break; + case "WEEKLY": + case 3: + message.recurrenceType = 3; + break; + case "MONTHLY": + case 4: + message.recurrenceType = 4; + break; + case "YEARLY": + case 5: + message.recurrenceType = 5; + break; + } + if (object.hourlyFrequency != null) + message.hourlyFrequency = object.hourlyFrequency | 0; + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + if (object.daysOfMonth) { + if (!Array.isArray(object.daysOfMonth)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfMonth: array expected"); + message.daysOfMonth = []; + for (var i = 0; i < object.daysOfMonth.length; ++i) + message.daysOfMonth[i] = object.daysOfMonth[i] | 0; + } + if (object.weekDayOfMonth != null) { + if (typeof object.weekDayOfMonth !== "object") + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.weekDayOfMonth: object expected"); + message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.fromObject(object.weekDayOfMonth); + } + if (object.months) { + if (!Array.isArray(object.months)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.months: array expected"); + message.months = []; + for (var i = 0; i < object.months.length; ++i) + switch (object.months[i]) { + default: + if (typeof object.months[i] === "number") { + message.months[i] = object.months[i]; + break; + } + case "MONTH_UNSPECIFIED": + case 0: + message.months[i] = 0; + break; + case "JANUARY": + case 1: + message.months[i] = 1; + break; + case "FEBRUARY": + case 2: + message.months[i] = 2; + break; + case "MARCH": + case 3: + message.months[i] = 3; + break; + case "APRIL": + case 4: + message.months[i] = 4; + break; + case "MAY": + case 5: + message.months[i] = 5; + break; + case "JUNE": + case 6: + message.months[i] = 6; + break; + case "JULY": + case 7: + message.months[i] = 7; + break; + case "AUGUST": + case 8: + message.months[i] = 8; + break; + case "SEPTEMBER": + case 9: + message.months[i] = 9; + break; + case "OCTOBER": + case 10: + message.months[i] = 10; + break; + case "NOVEMBER": + case 11: + message.months[i] = 11; + break; + case "DECEMBER": + case 12: + message.months[i] = 12; + break; + } + } + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.backupWindow: object expected"); + message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.fromObject(object.backupWindow); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.StandardSchedule} message StandardSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.daysOfWeek = []; + object.daysOfMonth = []; + object.months = []; + } + if (options.defaults) { + object.recurrenceType = options.enums === String ? "RECURRENCE_TYPE_UNSPECIFIED" : 0; + object.hourlyFrequency = 0; + object.weekDayOfMonth = null; + object.backupWindow = null; + object.timeZone = ""; + } + if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) + object.recurrenceType = options.enums === String ? $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] === undefined ? message.recurrenceType : $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] : message.recurrenceType; + if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) + object.hourlyFrequency = message.hourlyFrequency; + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + if (message.daysOfMonth && message.daysOfMonth.length) { + object.daysOfMonth = []; + for (var j = 0; j < message.daysOfMonth.length; ++j) + object.daysOfMonth[j] = message.daysOfMonth[j]; + } + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) + object.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.toObject(message.weekDayOfMonth, options); + if (message.months && message.months.length) { + object.months = []; + for (var j = 0; j < message.months.length; ++j) + object.months[j] = options.enums === String ? $root.google.type.Month[message.months[j]] === undefined ? message.months[j] : $root.google.type.Month[message.months[j]] : message.months[j]; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.toObject(message.backupWindow, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this StandardSchedule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + * @returns {Object.} JSON object + */ + StandardSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSchedule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.StandardSchedule"; + }; + + /** + * RecurrenceType enum. + * @name google.cloud.backupdr.v1.StandardSchedule.RecurrenceType + * @enum {number} + * @property {number} RECURRENCE_TYPE_UNSPECIFIED=0 RECURRENCE_TYPE_UNSPECIFIED value + * @property {number} HOURLY=1 HOURLY value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} MONTHLY=4 MONTHLY value + * @property {number} YEARLY=5 YEARLY value + */ + StandardSchedule.RecurrenceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECURRENCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOURLY"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "MONTHLY"] = 4; + values[valuesById[5] = "YEARLY"] = 5; + return values; + })(); + + return StandardSchedule; + })(); + + v1.BackupWindow = (function() { + + /** + * Properties of a BackupWindow. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupWindow + * @property {number|null} [startHourOfDay] BackupWindow startHourOfDay + * @property {number|null} [endHourOfDay] BackupWindow endHourOfDay + */ + + /** + * Constructs a new BackupWindow. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupWindow. + * @implements IBackupWindow + * @constructor + * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set + */ + function BackupWindow(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]]; + } + + /** + * BackupWindow startHourOfDay. + * @member {number} startHourOfDay + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + */ + BackupWindow.prototype.startHourOfDay = 0; + + /** + * BackupWindow endHourOfDay. + * @member {number} endHourOfDay + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + */ + BackupWindow.prototype.endHourOfDay = 0; + + /** + * Creates a new BackupWindow instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow instance + */ + BackupWindow.create = function create(properties) { + return new BackupWindow(properties); + }; + + /** + * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startHourOfDay != null && Object.hasOwnProperty.call(message, "startHourOfDay")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startHourOfDay); + if (message.endHourOfDay != null && Object.hasOwnProperty.call(message, "endHourOfDay")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endHourOfDay); + return writer; + }; + + /** + * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startHourOfDay = reader.int32(); + break; + } + case 2: { + message.endHourOfDay = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupWindow message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) + if (!$util.isInteger(message.startHourOfDay)) + return "startHourOfDay: integer expected"; + if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) + if (!$util.isInteger(message.endHourOfDay)) + return "endHourOfDay: integer expected"; + return null; + }; + + /** + * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + */ + BackupWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupWindow) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupWindow(); + if (object.startHourOfDay != null) + message.startHourOfDay = object.startHourOfDay | 0; + if (object.endHourOfDay != null) + message.endHourOfDay = object.endHourOfDay | 0; + return message; + }; + + /** + * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.BackupWindow} message BackupWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startHourOfDay = 0; + object.endHourOfDay = 0; + } + if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) + object.startHourOfDay = message.startHourOfDay; + if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) + object.endHourOfDay = message.endHourOfDay; + return object; + }; + + /** + * Converts this BackupWindow to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + * @returns {Object.} JSON object + */ + BackupWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupWindow + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupWindow"; + }; + + return BackupWindow; + })(); + + v1.WeekDayOfMonth = (function() { + + /** + * Properties of a WeekDayOfMonth. + * @memberof google.cloud.backupdr.v1 + * @interface IWeekDayOfMonth + * @property {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null} [weekOfMonth] WeekDayOfMonth weekOfMonth + * @property {google.type.DayOfWeek|null} [dayOfWeek] WeekDayOfMonth dayOfWeek + */ + + /** + * Constructs a new WeekDayOfMonth. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a WeekDayOfMonth. + * @implements IWeekDayOfMonth + * @constructor + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set + */ + function WeekDayOfMonth(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]]; + } + + /** + * WeekDayOfMonth weekOfMonth. + * @member {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth} weekOfMonth + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.weekOfMonth = 0; + + /** + * WeekDayOfMonth dayOfWeek. + * @member {google.type.DayOfWeek} dayOfWeek + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.dayOfWeek = 0; + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth instance + */ + WeekDayOfMonth.create = function create(properties) { + return new WeekDayOfMonth(properties); + }; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weekOfMonth != null && Object.hasOwnProperty.call(message, "weekOfMonth")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.weekOfMonth); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dayOfWeek); + return writer; + }; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.weekOfMonth = reader.int32(); + break; + } + case 2: { + message.dayOfWeek = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeekDayOfMonth message. + * @function verify + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeekDayOfMonth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) + switch (message.weekOfMonth) { + default: + return "weekOfMonth: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + */ + WeekDayOfMonth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.WeekDayOfMonth) + return object; + var message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); + switch (object.weekOfMonth) { + default: + if (typeof object.weekOfMonth === "number") { + message.weekOfMonth = object.weekOfMonth; + break; + } + break; + case "WEEK_OF_MONTH_UNSPECIFIED": + case 0: + message.weekOfMonth = 0; + break; + case "FIRST": + case 1: + message.weekOfMonth = 1; + break; + case "SECOND": + case 2: + message.weekOfMonth = 2; + break; + case "THIRD": + case 3: + message.weekOfMonth = 3; + break; + case "FOURTH": + case 4: + message.weekOfMonth = 4; + break; + case "LAST": + case 5: + message.weekOfMonth = 5; + break; + } + switch (object.dayOfWeek) { + default: + if (typeof object.dayOfWeek === "number") { + message.dayOfWeek = object.dayOfWeek; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.dayOfWeek = 0; + break; + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.WeekDayOfMonth} message WeekDayOfMonth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeekDayOfMonth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.weekOfMonth = options.enums === String ? "WEEK_OF_MONTH_UNSPECIFIED" : 0; + object.dayOfWeek = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + } + if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) + object.weekOfMonth = options.enums === String ? $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] === undefined ? message.weekOfMonth : $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] : message.weekOfMonth; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeek] === undefined ? message.dayOfWeek : $root.google.type.DayOfWeek[message.dayOfWeek] : message.dayOfWeek; + return object; + }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + * @returns {Object.} JSON object + */ + WeekDayOfMonth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeekDayOfMonth + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeekDayOfMonth.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.WeekDayOfMonth"; + }; + + /** + * WeekOfMonth enum. + * @name google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth + * @enum {number} + * @property {number} WEEK_OF_MONTH_UNSPECIFIED=0 WEEK_OF_MONTH_UNSPECIFIED value + * @property {number} FIRST=1 FIRST value + * @property {number} SECOND=2 SECOND value + * @property {number} THIRD=3 THIRD value + * @property {number} FOURTH=4 FOURTH value + * @property {number} LAST=5 LAST value + */ + WeekDayOfMonth.WeekOfMonth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEEK_OF_MONTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST"] = 1; + values[valuesById[2] = "SECOND"] = 2; + values[valuesById[3] = "THIRD"] = 3; + values[valuesById[4] = "FOURTH"] = 4; + values[valuesById[5] = "LAST"] = 5; + return values; + })(); + + return WeekDayOfMonth; + })(); + + v1.CreateBackupPlanRequest = (function() { + + /** + * Properties of a CreateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupPlanRequest + * @property {string|null} [parent] CreateBackupPlanRequest parent + * @property {string|null} [backupPlanId] CreateBackupPlanRequest backupPlanId + * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlan] CreateBackupPlanRequest backupPlan + * @property {string|null} [requestId] CreateBackupPlanRequest requestId + */ + + /** + * Constructs a new CreateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupPlanRequest. + * @implements ICreateBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set + */ + function CreateBackupPlanRequest(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]]; + } + + /** + * CreateBackupPlanRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.parent = ""; + + /** + * CreateBackupPlanRequest backupPlanId. + * @member {string} backupPlanId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlanId = ""; + + /** + * CreateBackupPlanRequest backupPlan. + * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlan + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlan = null; + + /** + * CreateBackupPlanRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.requestId = ""; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest instance + */ + CreateBackupPlanRequest.create = function create(properties) { + return new CreateBackupPlanRequest(properties); + }; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupPlanId != null && Object.hasOwnProperty.call(message, "backupPlanId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanId); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupPlanId = reader.string(); + break; + } + case 3: { + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupPlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + if (!$util.isString(message.backupPlanId)) + return "backupPlanId: string expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlan); + if (error) + return "backupPlan." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + */ + CreateBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupPlanId != null) + message.backupPlanId = String(object.backupPlanId); + if (object.backupPlan != null) { + if (typeof object.backupPlan !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanRequest.backupPlan: object expected"); + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlan); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupPlanRequest} message CreateBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupPlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupPlanId = ""; + object.backupPlan = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + object.backupPlanId = message.backupPlanId; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlan, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanRequest"; + }; + + return CreateBackupPlanRequest; + })(); + + v1.ListBackupPlansRequest = (function() { + + /** + * Properties of a ListBackupPlansRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlansRequest + * @property {string|null} [parent] ListBackupPlansRequest parent + * @property {number|null} [pageSize] ListBackupPlansRequest pageSize + * @property {string|null} [pageToken] ListBackupPlansRequest pageToken + * @property {string|null} [filter] ListBackupPlansRequest filter + * @property {string|null} [orderBy] ListBackupPlansRequest orderBy + */ + + /** + * Constructs a new ListBackupPlansRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlansRequest. + * @implements IListBackupPlansRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set + */ + function ListBackupPlansRequest(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]]; + } + + /** + * ListBackupPlansRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.parent = ""; + + /** + * ListBackupPlansRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageSize = 0; + + /** + * ListBackupPlansRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageToken = ""; + + /** + * ListBackupPlansRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.filter = ""; + + /** + * ListBackupPlansRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupPlansRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest instance + */ + ListBackupPlansRequest.create = function create(properties) { + return new ListBackupPlansRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlansRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlansRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + */ + ListBackupPlansRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListBackupPlansRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlansRequest} message ListBackupPlansRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlansRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListBackupPlansRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlansRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlansRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlansRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansRequest"; + }; + + return ListBackupPlansRequest; + })(); + + v1.ListBackupPlansResponse = (function() { + + /** + * Properties of a ListBackupPlansResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlansResponse + * @property {Array.|null} [backupPlans] ListBackupPlansResponse backupPlans + * @property {string|null} [nextPageToken] ListBackupPlansResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupPlansResponse unreachable + */ + + /** + * Constructs a new ListBackupPlansResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlansResponse. + * @implements IListBackupPlansResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set + */ + function ListBackupPlansResponse(properties) { + this.backupPlans = []; + 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]]; + } + + /** + * ListBackupPlansResponse backupPlans. + * @member {Array.} backupPlans + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.backupPlans = $util.emptyArray; + + /** + * ListBackupPlansResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlansResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlansResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse instance + */ + ListBackupPlansResponse.create = function create(properties) { + return new ListBackupPlansResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlans != null && message.backupPlans.length) + for (var i = 0; i < message.backupPlans.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlans[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlans && message.backupPlans.length)) + message.backupPlans = []; + message.backupPlans.push($root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlansResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlansResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlans != null && message.hasOwnProperty("backupPlans")) { + if (!Array.isArray(message.backupPlans)) + return "backupPlans: array expected"; + for (var i = 0; i < message.backupPlans.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlans[i]); + if (error) + return "backupPlans." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + */ + ListBackupPlansResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); + if (object.backupPlans) { + if (!Array.isArray(object.backupPlans)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: array expected"); + message.backupPlans = []; + for (var i = 0; i < object.backupPlans.length; ++i) { + if (typeof object.backupPlans[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: object expected"); + message.backupPlans[i] = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlans[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.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 ListBackupPlansResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} message ListBackupPlansResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlansResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupPlans = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlans && message.backupPlans.length) { + object.backupPlans = []; + for (var j = 0; j < message.backupPlans.length; ++j) + object.backupPlans[j] = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlans[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + 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 ListBackupPlansResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlansResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlansResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlansResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansResponse"; + }; + + return ListBackupPlansResponse; + })(); + + v1.GetBackupPlanRequest = (function() { + + /** + * Properties of a GetBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupPlanRequest + * @property {string|null} [name] GetBackupPlanRequest name + */ + + /** + * Constructs a new GetBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupPlanRequest. + * @implements IGetBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set + */ + function GetBackupPlanRequest(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]]; + } + + /** + * GetBackupPlanRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @instance + */ + GetBackupPlanRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest instance + */ + GetBackupPlanRequest.create = function create(properties) { + return new GetBackupPlanRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupPlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + */ + GetBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupPlanRequest} message GetBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupPlanRequest.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 GetBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanRequest"; + }; + + return GetBackupPlanRequest; + })(); + + v1.DeleteBackupPlanRequest = (function() { + + /** + * Properties of a DeleteBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupPlanRequest + * @property {string|null} [name] DeleteBackupPlanRequest name + * @property {string|null} [requestId] DeleteBackupPlanRequest requestId + */ + + /** + * Constructs a new DeleteBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupPlanRequest. + * @implements IDeleteBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set + */ + function DeleteBackupPlanRequest(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]]; + } + + /** + * DeleteBackupPlanRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.name = ""; + + /** + * DeleteBackupPlanRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest instance + */ + DeleteBackupPlanRequest.create = function create(properties) { + return new DeleteBackupPlanRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupPlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + */ + DeleteBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupPlanRequest} message DeleteBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupPlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanRequest"; + }; + + return DeleteBackupPlanRequest; + })(); + + v1.BackupPlanAssociation = (function() { + + /** + * Properties of a BackupPlanAssociation. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupPlanAssociation + * @property {string|null} [name] BackupPlanAssociation name + * @property {string|null} [resourceType] BackupPlanAssociation resourceType + * @property {string|null} [resource] BackupPlanAssociation resource + * @property {string|null} [backupPlan] BackupPlanAssociation backupPlan + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlanAssociation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlanAssociation updateTime + * @property {google.cloud.backupdr.v1.BackupPlanAssociation.State|null} [state] BackupPlanAssociation state + * @property {Array.|null} [rulesConfigInfo] BackupPlanAssociation rulesConfigInfo + * @property {string|null} [dataSource] BackupPlanAssociation dataSource + */ + + /** + * Constructs a new BackupPlanAssociation. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupPlanAssociation. + * @implements IBackupPlanAssociation + * @constructor + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set + */ + function BackupPlanAssociation(properties) { + this.rulesConfigInfo = []; + 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]]; + } + + /** + * BackupPlanAssociation name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.name = ""; + + /** + * BackupPlanAssociation resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.resourceType = ""; + + /** + * BackupPlanAssociation resource. + * @member {string} resource + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.resource = ""; + + /** + * BackupPlanAssociation backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.backupPlan = ""; + + /** + * BackupPlanAssociation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.createTime = null; + + /** + * BackupPlanAssociation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.updateTime = null; + + /** + * BackupPlanAssociation state. + * @member {google.cloud.backupdr.v1.BackupPlanAssociation.State} state + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.state = 0; + + /** + * BackupPlanAssociation rulesConfigInfo. + * @member {Array.} rulesConfigInfo + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.rulesConfigInfo = $util.emptyArray; + + /** + * BackupPlanAssociation dataSource. + * @member {string} dataSource + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.dataSource = ""; + + /** + * Creates a new BackupPlanAssociation instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation instance + */ + BackupPlanAssociation.create = function create(properties) { + return new BackupPlanAssociation(properties); + }; + + /** + * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanAssociation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlan); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.rulesConfigInfo != null && message.rulesConfigInfo.length) + for (var i = 0; i < message.rulesConfigInfo.length; ++i) + $root.google.cloud.backupdr.v1.RuleConfigInfo.encode(message.rulesConfigInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.dataSource); + return writer; + }; + + /** + * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanAssociation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanAssociation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.backupPlan = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + if (!(message.rulesConfigInfo && message.rulesConfigInfo.length)) + message.rulesConfigInfo = []; + message.rulesConfigInfo.push($root.google.cloud.backupdr.v1.RuleConfigInfo.decode(reader, reader.uint32())); + break; + } + case 9: { + message.dataSource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanAssociation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupPlanAssociation message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupPlanAssociation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.rulesConfigInfo != null && message.hasOwnProperty("rulesConfigInfo")) { + if (!Array.isArray(message.rulesConfigInfo)) + return "rulesConfigInfo: array expected"; + for (var i = 0; i < message.rulesConfigInfo.length; ++i) { + var error = $root.google.cloud.backupdr.v1.RuleConfigInfo.verify(message.rulesConfigInfo[i]); + if (error) + return "rulesConfigInfo." + error; + } + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + if (!$util.isString(message.dataSource)) + return "dataSource: string expected"; + return null; + }; + + /** + * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + */ + BackupPlanAssociation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupPlanAssociation) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); + if (object.name != null) + message.name = String(object.name); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resource != null) + message.resource = String(object.resource); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + 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 "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + } + if (object.rulesConfigInfo) { + if (!Array.isArray(object.rulesConfigInfo)) + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: array expected"); + message.rulesConfigInfo = []; + for (var i = 0; i < object.rulesConfigInfo.length; ++i) { + if (typeof object.rulesConfigInfo[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: object expected"); + message.rulesConfigInfo[i] = $root.google.cloud.backupdr.v1.RuleConfigInfo.fromObject(object.rulesConfigInfo[i]); + } + } + if (object.dataSource != null) + message.dataSource = String(object.dataSource); + return message; + }; + + /** + * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} message BackupPlanAssociation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupPlanAssociation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rulesConfigInfo = []; + if (options.defaults) { + object.name = ""; + object.resourceType = ""; + object.resource = ""; + object.backupPlan = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.dataSource = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] : message.state; + if (message.rulesConfigInfo && message.rulesConfigInfo.length) { + object.rulesConfigInfo = []; + for (var j = 0; j < message.rulesConfigInfo.length; ++j) + object.rulesConfigInfo[j] = $root.google.cloud.backupdr.v1.RuleConfigInfo.toObject(message.rulesConfigInfo[j], options); + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = message.dataSource; + return object; + }; + + /** + * Converts this BackupPlanAssociation to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + * @returns {Object.} JSON object + */ + BackupPlanAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupPlanAssociation + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupPlanAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlanAssociation"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupPlanAssociation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + */ + BackupPlanAssociation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + return values; + })(); + + return BackupPlanAssociation; + })(); + + v1.RuleConfigInfo = (function() { + + /** + * Properties of a RuleConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IRuleConfigInfo + * @property {string|null} [ruleId] RuleConfigInfo ruleId + * @property {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null} [lastBackupState] RuleConfigInfo lastBackupState + * @property {google.rpc.IStatus|null} [lastBackupError] RuleConfigInfo lastBackupError + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] RuleConfigInfo lastSuccessfulBackupConsistencyTime + */ + + /** + * Constructs a new RuleConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RuleConfigInfo. + * @implements IRuleConfigInfo + * @constructor + * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set + */ + function RuleConfigInfo(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]]; + } + + /** + * RuleConfigInfo ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.ruleId = ""; + + /** + * RuleConfigInfo lastBackupState. + * @member {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState} lastBackupState + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastBackupState = 0; + + /** + * RuleConfigInfo lastBackupError. + * @member {google.rpc.IStatus|null|undefined} lastBackupError + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastBackupError = null; + + /** + * RuleConfigInfo lastSuccessfulBackupConsistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; + + /** + * Creates a new RuleConfigInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo instance + */ + RuleConfigInfo.create = function create(properties) { + return new RuleConfigInfo(properties); + }; + + /** + * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleConfigInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.lastBackupState); + if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) + $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleConfigInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 3: { + message.lastBackupState = reader.int32(); + break; + } + case 4: { + message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleConfigInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleConfigInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleConfigInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + switch (message.lastBackupState) { + default: + return "lastBackupState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { + var error = $root.google.rpc.Status.verify(message.lastBackupError); + if (error) + return "lastBackupError." + error; + } + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); + if (error) + return "lastSuccessfulBackupConsistencyTime." + error; + } + return null; + }; + + /** + * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + */ + RuleConfigInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RuleConfigInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + switch (object.lastBackupState) { + default: + if (typeof object.lastBackupState === "number") { + message.lastBackupState = object.lastBackupState; + break; + } + break; + case "LAST_BACKUP_STATE_UNSPECIFIED": + case 0: + message.lastBackupState = 0; + break; + case "FIRST_BACKUP_PENDING": + case 1: + message.lastBackupState = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.lastBackupState = 2; + break; + case "SUCCEEDED": + case 3: + message.lastBackupState = 3; + break; + case "FAILED": + case 4: + message.lastBackupState = 4; + break; + } + if (object.lastBackupError != null) { + if (typeof object.lastBackupError !== "object") + throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastBackupError: object expected"); + message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); + } + if (object.lastSuccessfulBackupConsistencyTime != null) { + if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); + } + return message; + }; + + /** + * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.RuleConfigInfo} message RuleConfigInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleConfigInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; + object.lastBackupError = null; + object.lastSuccessfulBackupConsistencyTime = null; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) + object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) + object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); + return object; + }; + + /** + * Converts this RuleConfigInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + * @returns {Object.} JSON object + */ + RuleConfigInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleConfigInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RuleConfigInfo"; + }; + + /** + * LastBackupState enum. + * @name google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState + * @enum {number} + * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value + * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + */ + RuleConfigInfo.LastBackupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return RuleConfigInfo; + })(); + + v1.CreateBackupPlanAssociationRequest = (function() { + + /** + * Properties of a CreateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupPlanAssociationRequest + * @property {string|null} [parent] CreateBackupPlanAssociationRequest parent + * @property {string|null} [backupPlanAssociationId] CreateBackupPlanAssociationRequest backupPlanAssociationId + * @property {google.cloud.backupdr.v1.IBackupPlanAssociation|null} [backupPlanAssociation] CreateBackupPlanAssociationRequest backupPlanAssociation + * @property {string|null} [requestId] CreateBackupPlanAssociationRequest requestId + */ + + /** + * Constructs a new CreateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupPlanAssociationRequest. + * @implements ICreateBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set + */ + function CreateBackupPlanAssociationRequest(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]]; + } + + /** + * CreateBackupPlanAssociationRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.parent = ""; + + /** + * CreateBackupPlanAssociationRequest backupPlanAssociationId. + * @member {string} backupPlanAssociationId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.backupPlanAssociationId = ""; + + /** + * CreateBackupPlanAssociationRequest backupPlanAssociation. + * @member {google.cloud.backupdr.v1.IBackupPlanAssociation|null|undefined} backupPlanAssociation + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.backupPlanAssociation = null; + + /** + * CreateBackupPlanAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest instance + */ + CreateBackupPlanAssociationRequest.create = function create(properties) { + return new CreateBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupPlanAssociationId != null && Object.hasOwnProperty.call(message, "backupPlanAssociationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanAssociationId); + if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanAssociationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupPlanAssociationId = reader.string(); + break; + } + case 3: { + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupPlanAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) + if (!$util.isString(message.backupPlanAssociationId)) + return "backupPlanAssociationId: string expected"; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociation); + if (error) + return "backupPlanAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + */ + CreateBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupPlanAssociationId != null) + message.backupPlanAssociationId = String(object.backupPlanAssociationId); + if (object.backupPlanAssociation != null) { + if (typeof object.backupPlanAssociation !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.backupPlanAssociation: object expected"); + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupPlanAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupPlanAssociationId = ""; + object.backupPlanAssociation = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) + object.backupPlanAssociationId = message.backupPlanAssociationId; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + object.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest"; + }; + + return CreateBackupPlanAssociationRequest; + })(); + + v1.ListBackupPlanAssociationsRequest = (function() { + + /** + * Properties of a ListBackupPlanAssociationsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanAssociationsRequest + * @property {string|null} [parent] ListBackupPlanAssociationsRequest parent + * @property {number|null} [pageSize] ListBackupPlanAssociationsRequest pageSize + * @property {string|null} [pageToken] ListBackupPlanAssociationsRequest pageToken + * @property {string|null} [filter] ListBackupPlanAssociationsRequest filter + */ + + /** + * Constructs a new ListBackupPlanAssociationsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanAssociationsRequest. + * @implements IListBackupPlanAssociationsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set + */ + function ListBackupPlanAssociationsRequest(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]]; + } + + /** + * ListBackupPlanAssociationsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.parent = ""; + + /** + * ListBackupPlanAssociationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.pageSize = 0; + + /** + * ListBackupPlanAssociationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.pageToken = ""; + + /** + * ListBackupPlanAssociationsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.filter = ""; + + /** + * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest instance + */ + ListBackupPlanAssociationsRequest.create = function create(properties) { + return new ListBackupPlanAssociationsRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanAssociationsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanAssociationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + */ + ListBackupPlanAssociationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanAssociationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListBackupPlanAssociationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanAssociationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanAssociationsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanAssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest"; + }; + + return ListBackupPlanAssociationsRequest; + })(); + + v1.ListBackupPlanAssociationsResponse = (function() { + + /** + * Properties of a ListBackupPlanAssociationsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanAssociationsResponse + * @property {Array.|null} [backupPlanAssociations] ListBackupPlanAssociationsResponse backupPlanAssociations + * @property {string|null} [nextPageToken] ListBackupPlanAssociationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupPlanAssociationsResponse unreachable + */ + + /** + * Constructs a new ListBackupPlanAssociationsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanAssociationsResponse. + * @implements IListBackupPlanAssociationsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set + */ + function ListBackupPlanAssociationsResponse(properties) { + this.backupPlanAssociations = []; + 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]]; + } + + /** + * ListBackupPlanAssociationsResponse backupPlanAssociations. + * @member {Array.} backupPlanAssociations + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.backupPlanAssociations = $util.emptyArray; + + /** + * ListBackupPlanAssociationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlanAssociationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse instance + */ + ListBackupPlanAssociationsResponse.create = function create(properties) { + return new ListBackupPlanAssociationsResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlanAssociations != null && message.backupPlanAssociations.length) + for (var i = 0; i < message.backupPlanAssociations.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlanAssociations && message.backupPlanAssociations.length)) + message.backupPlanAssociations = []; + message.backupPlanAssociations.push($root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanAssociationsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanAssociationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlanAssociations != null && message.hasOwnProperty("backupPlanAssociations")) { + if (!Array.isArray(message.backupPlanAssociations)) + return "backupPlanAssociations: array expected"; + for (var i = 0; i < message.backupPlanAssociations.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociations[i]); + if (error) + return "backupPlanAssociations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + */ + ListBackupPlanAssociationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); + if (object.backupPlanAssociations) { + if (!Array.isArray(object.backupPlanAssociations)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: array expected"); + message.backupPlanAssociations = []; + for (var i = 0; i < object.backupPlanAssociations.length; ++i) { + if (typeof object.backupPlanAssociations[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: object expected"); + message.backupPlanAssociations[i] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.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 ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanAssociationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupPlanAssociations = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlanAssociations && message.backupPlanAssociations.length) { + object.backupPlanAssociations = []; + for (var j = 0; j < message.backupPlanAssociations.length; ++j) + object.backupPlanAssociations[j] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + 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 ListBackupPlanAssociationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanAssociationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanAssociationsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanAssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse"; + }; + + return ListBackupPlanAssociationsResponse; + })(); + + v1.GetBackupPlanAssociationRequest = (function() { + + /** + * Properties of a GetBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupPlanAssociationRequest + * @property {string|null} [name] GetBackupPlanAssociationRequest name + */ + + /** + * Constructs a new GetBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupPlanAssociationRequest. + * @implements IGetBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set + */ + function GetBackupPlanAssociationRequest(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]]; + } + + /** + * GetBackupPlanAssociationRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @instance + */ + GetBackupPlanAssociationRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest instance + */ + GetBackupPlanAssociationRequest.create = function create(properties) { + return new GetBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanAssociationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupPlanAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + */ + GetBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupPlanAssociationRequest.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 GetBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanAssociationRequest"; + }; + + return GetBackupPlanAssociationRequest; + })(); + + v1.DeleteBackupPlanAssociationRequest = (function() { + + /** + * Properties of a DeleteBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupPlanAssociationRequest + * @property {string|null} [name] DeleteBackupPlanAssociationRequest name + * @property {string|null} [requestId] DeleteBackupPlanAssociationRequest requestId + */ + + /** + * Constructs a new DeleteBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupPlanAssociationRequest. + * @implements IDeleteBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set + */ + function DeleteBackupPlanAssociationRequest(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]]; + } + + /** + * DeleteBackupPlanAssociationRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + */ + DeleteBackupPlanAssociationRequest.prototype.name = ""; + + /** + * DeleteBackupPlanAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + */ + DeleteBackupPlanAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest instance + */ + DeleteBackupPlanAssociationRequest.create = function create(properties) { + return new DeleteBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanAssociationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupPlanAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + */ + DeleteBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupPlanAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest"; + }; + + return DeleteBackupPlanAssociationRequest; + })(); + + v1.TriggerBackupRequest = (function() { + + /** + * Properties of a TriggerBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ITriggerBackupRequest + * @property {string|null} [name] TriggerBackupRequest name + * @property {string|null} [ruleId] TriggerBackupRequest ruleId + * @property {string|null} [requestId] TriggerBackupRequest requestId + */ + + /** + * Constructs a new TriggerBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a TriggerBackupRequest. + * @implements ITriggerBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set + */ + function TriggerBackupRequest(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]]; + } + + /** + * TriggerBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.name = ""; + + /** + * TriggerBackupRequest ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.ruleId = ""; + + /** + * TriggerBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.requestId = ""; + + /** + * Creates a new TriggerBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest instance + */ + TriggerBackupRequest.create = function create(properties) { + return new TriggerBackupRequest(properties); + }; + + /** + * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ruleId = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + */ + TriggerBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.TriggerBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.TriggerBackupRequest} message TriggerBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ruleId = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this TriggerBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + * @returns {Object.} JSON object + */ + TriggerBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.TriggerBackupRequest"; + }; + + return TriggerBackupRequest; + })(); + + v1.BackupVault = (function() { + + /** + * Properties of a BackupVault. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupVault + * @property {string|null} [name] BackupVault name + * @property {string|null} [description] BackupVault description + * @property {Object.|null} [labels] BackupVault labels + * @property {google.protobuf.ITimestamp|null} [createTime] BackupVault createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupVault updateTime + * @property {google.protobuf.IDuration|null} [backupMinimumEnforcedRetentionDuration] BackupVault backupMinimumEnforcedRetentionDuration + * @property {boolean|null} [deletable] BackupVault deletable + * @property {string|null} [etag] BackupVault etag + * @property {google.cloud.backupdr.v1.BackupVault.State|null} [state] BackupVault state + * @property {google.protobuf.ITimestamp|null} [effectiveTime] BackupVault effectiveTime + * @property {number|Long|null} [backupCount] BackupVault backupCount + * @property {string|null} [serviceAccount] BackupVault serviceAccount + * @property {number|Long|null} [totalStoredBytes] BackupVault totalStoredBytes + * @property {string|null} [uid] BackupVault uid + * @property {Object.|null} [annotations] BackupVault annotations + * @property {google.cloud.backupdr.v1.BackupVault.AccessRestriction|null} [accessRestriction] BackupVault accessRestriction + */ + + /** + * Constructs a new BackupVault. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupVault. + * @implements IBackupVault + * @constructor + * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set + */ + function BackupVault(properties) { + this.labels = {}; + this.annotations = {}; + 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]]; + } + + /** + * BackupVault name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.name = ""; + + /** + * BackupVault description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.description = null; + + /** + * BackupVault labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.labels = $util.emptyObject; + + /** + * BackupVault createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.createTime = null; + + /** + * BackupVault updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.updateTime = null; + + /** + * BackupVault backupMinimumEnforcedRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} backupMinimumEnforcedRetentionDuration + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.backupMinimumEnforcedRetentionDuration = null; + + /** + * BackupVault deletable. + * @member {boolean|null|undefined} deletable + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.deletable = null; + + /** + * BackupVault etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.etag = null; + + /** + * BackupVault state. + * @member {google.cloud.backupdr.v1.BackupVault.State} state + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.state = 0; + + /** + * BackupVault effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.effectiveTime = null; + + /** + * BackupVault backupCount. + * @member {number|Long} backupCount + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.backupCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupVault serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.serviceAccount = ""; + + /** + * BackupVault totalStoredBytes. + * @member {number|Long} totalStoredBytes + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.totalStoredBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupVault uid. + * @member {string} uid + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.uid = ""; + + /** + * BackupVault annotations. + * @member {Object.} annotations + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.annotations = $util.emptyObject; + + /** + * BackupVault accessRestriction. + * @member {google.cloud.backupdr.v1.BackupVault.AccessRestriction} accessRestriction + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.accessRestriction = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupVault _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _createTime. + * @member {"createTime"|undefined} _createTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _updateTime. + * @member {"updateTime"|undefined} _updateTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _backupMinimumEnforcedRetentionDuration. + * @member {"backupMinimumEnforcedRetentionDuration"|undefined} _backupMinimumEnforcedRetentionDuration + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_backupMinimumEnforcedRetentionDuration", { + get: $util.oneOfGetter($oneOfFields = ["backupMinimumEnforcedRetentionDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _deletable. + * @member {"deletable"|undefined} _deletable + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_deletable", { + get: $util.oneOfGetter($oneOfFields = ["deletable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _effectiveTime. + * @member {"effectiveTime"|undefined} _effectiveTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_effectiveTime", { + get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupVault instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault instance + */ + BackupVault.create = function create(properties) { + return new BackupVault(properties); + }; + + /** + * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupVault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deletable != null && Object.hasOwnProperty.call(message, "deletable")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.deletable); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.backupCount); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.serviceAccount); + if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.totalStoredBytes); + if (message.backupMinimumEnforcedRetentionDuration != null && Object.hasOwnProperty.call(message, "backupMinimumEnforcedRetentionDuration")) + $root.google.protobuf.Duration.encode(message.backupMinimumEnforcedRetentionDuration, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.uid); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.accessRestriction != null && Object.hasOwnProperty.call(message, "accessRestriction")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.accessRestriction); + return writer; + }; + + /** + * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupVault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupVault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupVault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupVault(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deletable = reader.bool(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 12: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.backupCount = reader.int64(); + break; + } + case 18: { + message.serviceAccount = reader.string(); + break; + } + case 19: { + message.totalStoredBytes = reader.int64(); + break; + } + case 21: { + message.uid = reader.string(); + break; + } + case 22: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 24: { + message.accessRestriction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupVault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupVault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupVault message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupVault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { + properties._backupMinimumEnforcedRetentionDuration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.backupMinimumEnforcedRetentionDuration); + if (error) + return "backupMinimumEnforcedRetentionDuration." + error; + } + } + if (message.deletable != null && message.hasOwnProperty("deletable")) { + properties._deletable = 1; + if (typeof message.deletable !== "boolean") + return "deletable: boolean expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + properties._effectiveTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) + if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) + return "backupCount: integer|Long expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) + if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) + return "totalStoredBytes: integer|Long expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) + switch (message.accessRestriction) { + default: + return "accessRestriction: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + */ + BackupVault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupVault) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupVault(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupMinimumEnforcedRetentionDuration != null) { + if (typeof object.backupMinimumEnforcedRetentionDuration !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.backupMinimumEnforcedRetentionDuration: object expected"); + message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.fromObject(object.backupMinimumEnforcedRetentionDuration); + } + if (object.deletable != null) + message.deletable = Boolean(object.deletable); + if (object.etag != null) + message.etag = String(object.etag); + 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 "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + if (object.backupCount != null) + if ($util.Long) + (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; + else if (typeof object.backupCount === "string") + message.backupCount = parseInt(object.backupCount, 10); + else if (typeof object.backupCount === "number") + message.backupCount = object.backupCount; + else if (typeof object.backupCount === "object") + message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.totalStoredBytes != null) + if ($util.Long) + (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; + else if (typeof object.totalStoredBytes === "string") + message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); + else if (typeof object.totalStoredBytes === "number") + message.totalStoredBytes = object.totalStoredBytes; + else if (typeof object.totalStoredBytes === "object") + message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); + if (object.uid != null) + message.uid = String(object.uid); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + switch (object.accessRestriction) { + default: + if (typeof object.accessRestriction === "number") { + message.accessRestriction = object.accessRestriction; + break; + } + break; + case "ACCESS_RESTRICTION_UNSPECIFIED": + case 0: + message.accessRestriction = 0; + break; + case "WITHIN_PROJECT": + case 1: + message.accessRestriction = 1; + break; + case "WITHIN_ORGANIZATION": + case 2: + message.accessRestriction = 2; + break; + case "UNRESTRICTED": + case 3: + message.accessRestriction = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a BackupVault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.BackupVault} message BackupVault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupVault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupCount = options.longs === String ? "0" : 0; + object.serviceAccount = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalStoredBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalStoredBytes = options.longs === String ? "0" : 0; + object.uid = ""; + object.accessRestriction = options.enums === String ? "ACCESS_RESTRICTION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + if (message.deletable != null && message.hasOwnProperty("deletable")) { + object.deletable = message.deletable; + if (options.oneofs) + object._deletable = "deletable"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupVault.State[message.state] : message.state; + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (options.oneofs) + object._effectiveTime = "effectiveTime"; + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) + if (typeof message.backupCount === "number") + object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; + else + object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) + if (typeof message.totalStoredBytes === "number") + object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; + else + object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; + if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { + object.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.toObject(message.backupMinimumEnforcedRetentionDuration, options); + if (options.oneofs) + object._backupMinimumEnforcedRetentionDuration = "backupMinimumEnforcedRetentionDuration"; + } + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) + object.accessRestriction = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] === undefined ? message.accessRestriction : $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] : message.accessRestriction; + return object; + }; + + /** + * Converts this BackupVault to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + * @returns {Object.} JSON object + */ + BackupVault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupVault + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupVault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupVault"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupVault.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + BackupVault.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + /** + * AccessRestriction enum. + * @name google.cloud.backupdr.v1.BackupVault.AccessRestriction + * @enum {number} + * @property {number} ACCESS_RESTRICTION_UNSPECIFIED=0 ACCESS_RESTRICTION_UNSPECIFIED value + * @property {number} WITHIN_PROJECT=1 WITHIN_PROJECT value + * @property {number} WITHIN_ORGANIZATION=2 WITHIN_ORGANIZATION value + * @property {number} UNRESTRICTED=3 UNRESTRICTED value + */ + BackupVault.AccessRestriction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_RESTRICTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "WITHIN_PROJECT"] = 1; + values[valuesById[2] = "WITHIN_ORGANIZATION"] = 2; + values[valuesById[3] = "UNRESTRICTED"] = 3; + return values; + })(); + + return BackupVault; + })(); + + v1.DataSource = (function() { + + /** + * Properties of a DataSource. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSource + * @property {string|null} [name] DataSource name + * @property {google.cloud.backupdr.v1.DataSource.State|null} [state] DataSource state + * @property {Object.|null} [labels] DataSource labels + * @property {google.protobuf.ITimestamp|null} [createTime] DataSource createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DataSource updateTime + * @property {number|Long|null} [backupCount] DataSource backupCount + * @property {string|null} [etag] DataSource etag + * @property {number|Long|null} [totalStoredBytes] DataSource totalStoredBytes + * @property {google.cloud.backupdr.v1.BackupConfigState|null} [configState] DataSource configState + * @property {google.cloud.backupdr.v1.IBackupConfigInfo|null} [backupConfigInfo] DataSource backupConfigInfo + * @property {google.cloud.backupdr.v1.IDataSourceGcpResource|null} [dataSourceGcpResource] DataSource dataSourceGcpResource + * @property {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null} [dataSourceBackupApplianceApplication] DataSource dataSourceBackupApplianceApplication + */ + + /** + * Constructs a new DataSource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSource. + * @implements IDataSource + * @constructor + * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set + */ + function DataSource(properties) { + this.labels = {}; + 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]]; + } + + /** + * DataSource name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.name = ""; + + /** + * DataSource state. + * @member {google.cloud.backupdr.v1.DataSource.State} state + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.state = 0; + + /** + * DataSource labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.labels = $util.emptyObject; + + /** + * DataSource createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.createTime = null; + + /** + * DataSource updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.updateTime = null; + + /** + * DataSource backupCount. + * @member {number|Long|null|undefined} backupCount + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.backupCount = null; + + /** + * DataSource etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.etag = null; + + /** + * DataSource totalStoredBytes. + * @member {number|Long|null|undefined} totalStoredBytes + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.totalStoredBytes = null; + + /** + * DataSource configState. + * @member {google.cloud.backupdr.v1.BackupConfigState} configState + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.configState = 0; + + /** + * DataSource backupConfigInfo. + * @member {google.cloud.backupdr.v1.IBackupConfigInfo|null|undefined} backupConfigInfo + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.backupConfigInfo = null; + + /** + * DataSource dataSourceGcpResource. + * @member {google.cloud.backupdr.v1.IDataSourceGcpResource|null|undefined} dataSourceGcpResource + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceGcpResource = null; + + /** + * DataSource dataSourceBackupApplianceApplication. + * @member {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null|undefined} dataSourceBackupApplianceApplication + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceBackupApplianceApplication = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataSource _createTime. + * @member {"createTime"|undefined} _createTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _updateTime. + * @member {"updateTime"|undefined} _updateTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _backupCount. + * @member {"backupCount"|undefined} _backupCount + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_backupCount", { + get: $util.oneOfGetter($oneOfFields = ["backupCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _totalStoredBytes. + * @member {"totalStoredBytes"|undefined} _totalStoredBytes + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_totalStoredBytes", { + get: $util.oneOfGetter($oneOfFields = ["totalStoredBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource sourceResource. + * @member {"dataSourceGcpResource"|"dataSourceBackupApplianceApplication"|undefined} sourceResource + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "sourceResource", { + get: $util.oneOfGetter($oneOfFields = ["dataSourceGcpResource", "dataSourceBackupApplianceApplication"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSource} DataSource instance + */ + DataSource.create = function create(properties) { + return new DataSource(properties); + }; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.backupCount); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.state); + if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.totalStoredBytes); + if (message.configState != null && Object.hasOwnProperty.call(message, "configState")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.configState); + if (message.backupConfigInfo != null && Object.hasOwnProperty.call(message, "backupConfigInfo")) + $root.google.cloud.backupdr.v1.BackupConfigInfo.encode(message.backupConfigInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dataSourceGcpResource != null && Object.hasOwnProperty.call(message, "dataSourceGcpResource")) + $root.google.cloud.backupdr.v1.DataSourceGcpResource.encode(message.dataSourceGcpResource, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.dataSourceBackupApplianceApplication != null && Object.hasOwnProperty.call(message, "dataSourceBackupApplianceApplication")) + $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.encode(message.dataSourceBackupApplianceApplication, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSource(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 21: { + message.state = reader.int32(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.backupCount = reader.int64(); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 23: { + message.totalStoredBytes = reader.int64(); + break; + } + case 24: { + message.configState = reader.int32(); + break; + } + case 25: { + message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.decode(reader, reader.uint32()); + break; + } + case 27: { + message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSource message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) { + properties._backupCount = 1; + if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) + return "backupCount: integer|Long expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + properties._totalStoredBytes = 1; + if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) + return "totalStoredBytes: integer|Long expected"; + } + if (message.configState != null && message.hasOwnProperty("configState")) + switch (message.configState) { + default: + return "configState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) { + var error = $root.google.cloud.backupdr.v1.BackupConfigInfo.verify(message.backupConfigInfo); + if (error) + return "backupConfigInfo." + error; + } + if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { + properties.sourceResource = 1; + { + var error = $root.google.cloud.backupdr.v1.DataSourceGcpResource.verify(message.dataSourceGcpResource); + if (error) + return "dataSourceGcpResource." + error; + } + } + if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { + if (properties.sourceResource === 1) + return "sourceResource: multiple values"; + properties.sourceResource = 1; + { + var error = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify(message.dataSourceBackupApplianceApplication); + if (error) + return "dataSourceBackupApplianceApplication." + error; + } + } + return null; + }; + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + */ + DataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSource) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSource(); + if (object.name != null) + message.name = String(object.name); + 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 "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupCount != null) + if ($util.Long) + (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; + else if (typeof object.backupCount === "string") + message.backupCount = parseInt(object.backupCount, 10); + else if (typeof object.backupCount === "number") + message.backupCount = object.backupCount; + else if (typeof object.backupCount === "object") + message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.totalStoredBytes != null) + if ($util.Long) + (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; + else if (typeof object.totalStoredBytes === "string") + message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); + else if (typeof object.totalStoredBytes === "number") + message.totalStoredBytes = object.totalStoredBytes; + else if (typeof object.totalStoredBytes === "object") + message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); + switch (object.configState) { + default: + if (typeof object.configState === "number") { + message.configState = object.configState; + break; + } + break; + case "BACKUP_CONFIG_STATE_UNSPECIFIED": + case 0: + message.configState = 0; + break; + case "ACTIVE": + case 1: + message.configState = 1; + break; + case "PASSIVE": + case 2: + message.configState = 2; + break; + } + if (object.backupConfigInfo != null) { + if (typeof object.backupConfigInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.backupConfigInfo: object expected"); + message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.fromObject(object.backupConfigInfo); + } + if (object.dataSourceGcpResource != null) { + if (typeof object.dataSourceGcpResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceGcpResource: object expected"); + message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.fromObject(object.dataSourceGcpResource); + } + if (object.dataSourceBackupApplianceApplication != null) { + if (typeof object.dataSourceBackupApplianceApplication !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceBackupApplianceApplication: object expected"); + message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.fromObject(object.dataSourceBackupApplianceApplication); + } + return message; + }; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.DataSource} message DataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.configState = options.enums === String ? "BACKUP_CONFIG_STATE_UNSPECIFIED" : 0; + object.backupConfigInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) { + if (typeof message.backupCount === "number") + object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; + else + object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; + if (options.oneofs) + object._backupCount = "backupCount"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.DataSource.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.DataSource.State[message.state] : message.state; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + if (typeof message.totalStoredBytes === "number") + object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; + else + object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; + if (options.oneofs) + object._totalStoredBytes = "totalStoredBytes"; + } + if (message.configState != null && message.hasOwnProperty("configState")) + object.configState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] === undefined ? message.configState : $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] : message.configState; + if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) + object.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.toObject(message.backupConfigInfo, options); + if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { + object.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.toObject(message.dataSourceGcpResource, options); + if (options.oneofs) + object.sourceResource = "dataSourceGcpResource"; + } + if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { + object.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.toObject(message.dataSourceBackupApplianceApplication, options); + if (options.oneofs) + object.sourceResource = "dataSourceBackupApplianceApplication"; + } + return object; + }; + + /** + * Converts this DataSource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + * @returns {Object.} JSON object + */ + DataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSource"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.DataSource.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + DataSource.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + return DataSource; + })(); + + v1.BackupConfigInfo = (function() { + + /** + * Properties of a BackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupConfigInfo + * @property {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null} [lastBackupState] BackupConfigInfo lastBackupState + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] BackupConfigInfo lastSuccessfulBackupConsistencyTime + * @property {google.rpc.IStatus|null} [lastBackupError] BackupConfigInfo lastBackupError + * @property {google.cloud.backupdr.v1.IGcpBackupConfig|null} [gcpBackupConfig] BackupConfigInfo gcpBackupConfig + * @property {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null} [backupApplianceBackupConfig] BackupConfigInfo backupApplianceBackupConfig + */ + + /** + * Constructs a new BackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupConfigInfo. + * @implements IBackupConfigInfo + * @constructor + * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set + */ + function BackupConfigInfo(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]]; + } + + /** + * BackupConfigInfo lastBackupState. + * @member {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState} lastBackupState + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastBackupState = 0; + + /** + * BackupConfigInfo lastSuccessfulBackupConsistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; + + /** + * BackupConfigInfo lastBackupError. + * @member {google.rpc.IStatus|null|undefined} lastBackupError + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastBackupError = null; + + /** + * BackupConfigInfo gcpBackupConfig. + * @member {google.cloud.backupdr.v1.IGcpBackupConfig|null|undefined} gcpBackupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.gcpBackupConfig = null; + + /** + * BackupConfigInfo backupApplianceBackupConfig. + * @member {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null|undefined} backupApplianceBackupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.backupApplianceBackupConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupConfigInfo backupConfig. + * @member {"gcpBackupConfig"|"backupApplianceBackupConfig"|undefined} backupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + Object.defineProperty(BackupConfigInfo.prototype, "backupConfig", { + get: $util.oneOfGetter($oneOfFields = ["gcpBackupConfig", "backupApplianceBackupConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupConfigInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo instance + */ + BackupConfigInfo.create = function create(properties) { + return new BackupConfigInfo(properties); + }; + + /** + * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lastBackupState); + if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) + $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcpBackupConfig != null && Object.hasOwnProperty.call(message, "gcpBackupConfig")) + $root.google.cloud.backupdr.v1.GcpBackupConfig.encode(message.gcpBackupConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.backupApplianceBackupConfig != null && Object.hasOwnProperty.call(message, "backupApplianceBackupConfig")) + $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.encode(message.backupApplianceBackupConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lastBackupState = reader.int32(); + break; + } + case 2: { + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupConfigInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupConfigInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + switch (message.lastBackupState) { + default: + return "lastBackupState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); + if (error) + return "lastSuccessfulBackupConsistencyTime." + error; + } + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { + var error = $root.google.rpc.Status.verify(message.lastBackupError); + if (error) + return "lastBackupError." + error; + } + if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { + properties.backupConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.GcpBackupConfig.verify(message.gcpBackupConfig); + if (error) + return "gcpBackupConfig." + error; + } + } + if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { + if (properties.backupConfig === 1) + return "backupConfig: multiple values"; + properties.backupConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify(message.backupApplianceBackupConfig); + if (error) + return "backupApplianceBackupConfig." + error; + } + } + return null; + }; + + /** + * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + */ + BackupConfigInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupConfigInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); + switch (object.lastBackupState) { + default: + if (typeof object.lastBackupState === "number") { + message.lastBackupState = object.lastBackupState; + break; + } + break; + case "LAST_BACKUP_STATE_UNSPECIFIED": + case 0: + message.lastBackupState = 0; + break; + case "FIRST_BACKUP_PENDING": + case 1: + message.lastBackupState = 1; + break; + case "SUCCEEDED": + case 2: + message.lastBackupState = 2; + break; + case "FAILED": + case 3: + message.lastBackupState = 3; + break; + case "PERMISSION_DENIED": + case 4: + message.lastBackupState = 4; + break; + } + if (object.lastSuccessfulBackupConsistencyTime != null) { + if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); + } + if (object.lastBackupError != null) { + if (typeof object.lastBackupError !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastBackupError: object expected"); + message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); + } + if (object.gcpBackupConfig != null) { + if (typeof object.gcpBackupConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.gcpBackupConfig: object expected"); + message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.fromObject(object.gcpBackupConfig); + } + if (object.backupApplianceBackupConfig != null) { + if (typeof object.backupApplianceBackupConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.backupApplianceBackupConfig: object expected"); + message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.fromObject(object.backupApplianceBackupConfig); + } + return message; + }; + + /** + * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.BackupConfigInfo} message BackupConfigInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupConfigInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; + object.lastSuccessfulBackupConsistencyTime = null; + object.lastBackupError = null; + } + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) + object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) + object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); + if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { + object.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.toObject(message.gcpBackupConfig, options); + if (options.oneofs) + object.backupConfig = "gcpBackupConfig"; + } + if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { + object.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.toObject(message.backupApplianceBackupConfig, options); + if (options.oneofs) + object.backupConfig = "backupApplianceBackupConfig"; + } + return object; + }; + + /** + * Converts this BackupConfigInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + * @returns {Object.} JSON object + */ + BackupConfigInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupConfigInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupConfigInfo"; + }; + + /** + * LastBackupState enum. + * @name google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState + * @enum {number} + * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value + * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} PERMISSION_DENIED=4 PERMISSION_DENIED value + */ + BackupConfigInfo.LastBackupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "PERMISSION_DENIED"] = 4; + return values; + })(); + + return BackupConfigInfo; + })(); + + v1.GcpBackupConfig = (function() { + + /** + * Properties of a GcpBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IGcpBackupConfig + * @property {string|null} [backupPlan] GcpBackupConfig backupPlan + * @property {string|null} [backupPlanDescription] GcpBackupConfig backupPlanDescription + * @property {string|null} [backupPlanAssociation] GcpBackupConfig backupPlanAssociation + * @property {Array.|null} [backupPlanRules] GcpBackupConfig backupPlanRules + */ + + /** + * Constructs a new GcpBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GcpBackupConfig. + * @implements IGcpBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set + */ + function GcpBackupConfig(properties) { + this.backupPlanRules = []; + 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]]; + } + + /** + * GcpBackupConfig backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlan = ""; + + /** + * GcpBackupConfig backupPlanDescription. + * @member {string} backupPlanDescription + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanDescription = ""; + + /** + * GcpBackupConfig backupPlanAssociation. + * @member {string} backupPlanAssociation + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanAssociation = ""; + + /** + * GcpBackupConfig backupPlanRules. + * @member {Array.} backupPlanRules + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanRules = $util.emptyArray; + + /** + * Creates a new GcpBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig instance + */ + GcpBackupConfig.create = function create(properties) { + return new GcpBackupConfig(properties); + }; + + /** + * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); + if (message.backupPlanDescription != null && Object.hasOwnProperty.call(message, "backupPlanDescription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanDescription); + if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupPlanAssociation); + if (message.backupPlanRules != null && message.backupPlanRules.length) + for (var i = 0; i < message.backupPlanRules.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlanRules[i]); + return writer; + }; + + /** + * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpBackupConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupPlan = reader.string(); + break; + } + case 2: { + message.backupPlanDescription = reader.string(); + break; + } + case 3: { + message.backupPlanAssociation = reader.string(); + break; + } + case 4: { + if (!(message.backupPlanRules && message.backupPlanRules.length)) + message.backupPlanRules = []; + message.backupPlanRules.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) + if (!$util.isString(message.backupPlanDescription)) + return "backupPlanDescription: string expected"; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + if (!$util.isString(message.backupPlanAssociation)) + return "backupPlanAssociation: string expected"; + if (message.backupPlanRules != null && message.hasOwnProperty("backupPlanRules")) { + if (!Array.isArray(message.backupPlanRules)) + return "backupPlanRules: array expected"; + for (var i = 0; i < message.backupPlanRules.length; ++i) + if (!$util.isString(message.backupPlanRules[i])) + return "backupPlanRules: string[] expected"; + } + return null; + }; + + /** + * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + */ + GcpBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GcpBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.backupPlanDescription != null) + message.backupPlanDescription = String(object.backupPlanDescription); + if (object.backupPlanAssociation != null) + message.backupPlanAssociation = String(object.backupPlanAssociation); + if (object.backupPlanRules) { + if (!Array.isArray(object.backupPlanRules)) + throw TypeError(".google.cloud.backupdr.v1.GcpBackupConfig.backupPlanRules: array expected"); + message.backupPlanRules = []; + for (var i = 0; i < object.backupPlanRules.length; ++i) + message.backupPlanRules[i] = String(object.backupPlanRules[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.GcpBackupConfig} message GcpBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupPlanRules = []; + if (options.defaults) { + object.backupPlan = ""; + object.backupPlanDescription = ""; + object.backupPlanAssociation = ""; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) + object.backupPlanDescription = message.backupPlanDescription; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + object.backupPlanAssociation = message.backupPlanAssociation; + if (message.backupPlanRules && message.backupPlanRules.length) { + object.backupPlanRules = []; + for (var j = 0; j < message.backupPlanRules.length; ++j) + object.backupPlanRules[j] = message.backupPlanRules[j]; + } + return object; + }; + + /** + * Converts this GcpBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + * @returns {Object.} JSON object + */ + GcpBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpBackupConfig"; + }; + + return GcpBackupConfig; + })(); + + v1.BackupApplianceBackupConfig = (function() { + + /** + * Properties of a BackupApplianceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceBackupConfig + * @property {string|null} [backupApplianceName] BackupApplianceBackupConfig backupApplianceName + * @property {number|Long|null} [backupApplianceId] BackupApplianceBackupConfig backupApplianceId + * @property {number|Long|null} [slaId] BackupApplianceBackupConfig slaId + * @property {string|null} [applicationName] BackupApplianceBackupConfig applicationName + * @property {string|null} [hostName] BackupApplianceBackupConfig hostName + * @property {string|null} [sltName] BackupApplianceBackupConfig sltName + * @property {string|null} [slpName] BackupApplianceBackupConfig slpName + */ + + /** + * Constructs a new BackupApplianceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceBackupConfig. + * @implements IBackupApplianceBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set + */ + function BackupApplianceBackupConfig(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]]; + } + + /** + * BackupApplianceBackupConfig backupApplianceName. + * @member {string} backupApplianceName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.backupApplianceName = ""; + + /** + * BackupApplianceBackupConfig backupApplianceId. + * @member {number|Long} backupApplianceId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceBackupConfig slaId. + * @member {number|Long} slaId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.slaId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceBackupConfig applicationName. + * @member {string} applicationName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.applicationName = ""; + + /** + * BackupApplianceBackupConfig hostName. + * @member {string} hostName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.hostName = ""; + + /** + * BackupApplianceBackupConfig sltName. + * @member {string} sltName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.sltName = ""; + + /** + * BackupApplianceBackupConfig slpName. + * @member {string} slpName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.slpName = ""; + + /** + * Creates a new BackupApplianceBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig instance + */ + BackupApplianceBackupConfig.create = function create(properties) { + return new BackupApplianceBackupConfig(properties); + }; + + /** + * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupApplianceName); + if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.backupApplianceId); + if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.slaId); + if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.applicationName); + if (message.hostName != null && Object.hasOwnProperty.call(message, "hostName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostName); + if (message.sltName != null && Object.hasOwnProperty.call(message, "sltName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sltName); + if (message.slpName != null && Object.hasOwnProperty.call(message, "slpName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.slpName); + return writer; + }; + + /** + * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupApplianceName = reader.string(); + break; + } + case 2: { + message.backupApplianceId = reader.int64(); + break; + } + case 3: { + message.slaId = reader.int64(); + break; + } + case 4: { + message.applicationName = reader.string(); + break; + } + case 5: { + message.hostName = reader.string(); + break; + } + case 6: { + message.sltName = reader.string(); + break; + } + case 7: { + message.slpName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + if (!$util.isString(message.backupApplianceName)) + return "backupApplianceName: string expected"; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) + return "backupApplianceId: integer|Long expected"; + if (message.slaId != null && message.hasOwnProperty("slaId")) + if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) + return "slaId: integer|Long expected"; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + if (!$util.isString(message.applicationName)) + return "applicationName: string expected"; + if (message.hostName != null && message.hasOwnProperty("hostName")) + if (!$util.isString(message.hostName)) + return "hostName: string expected"; + if (message.sltName != null && message.hasOwnProperty("sltName")) + if (!$util.isString(message.sltName)) + return "sltName: string expected"; + if (message.slpName != null && message.hasOwnProperty("slpName")) + if (!$util.isString(message.slpName)) + return "slpName: string expected"; + return null; + }; + + /** + * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + */ + BackupApplianceBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); + if (object.backupApplianceName != null) + message.backupApplianceName = String(object.backupApplianceName); + if (object.backupApplianceId != null) + if ($util.Long) + (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; + else if (typeof object.backupApplianceId === "string") + message.backupApplianceId = parseInt(object.backupApplianceId, 10); + else if (typeof object.backupApplianceId === "number") + message.backupApplianceId = object.backupApplianceId; + else if (typeof object.backupApplianceId === "object") + message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); + if (object.slaId != null) + if ($util.Long) + (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; + else if (typeof object.slaId === "string") + message.slaId = parseInt(object.slaId, 10); + else if (typeof object.slaId === "number") + message.slaId = object.slaId; + else if (typeof object.slaId === "object") + message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); + if (object.applicationName != null) + message.applicationName = String(object.applicationName); + if (object.hostName != null) + message.hostName = String(object.hostName); + if (object.sltName != null) + message.sltName = String(object.sltName); + if (object.slpName != null) + message.slpName = String(object.slpName); + return message; + }; + + /** + * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceBackupConfig} message BackupApplianceBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupApplianceName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupApplianceId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slaId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slaId = options.longs === String ? "0" : 0; + object.applicationName = ""; + object.hostName = ""; + object.sltName = ""; + object.slpName = ""; + } + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + object.backupApplianceName = message.backupApplianceName; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (typeof message.backupApplianceId === "number") + object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; + else + object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; + if (message.slaId != null && message.hasOwnProperty("slaId")) + if (typeof message.slaId === "number") + object.slaId = options.longs === String ? String(message.slaId) : message.slaId; + else + object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + object.applicationName = message.applicationName; + if (message.hostName != null && message.hasOwnProperty("hostName")) + object.hostName = message.hostName; + if (message.sltName != null && message.hasOwnProperty("sltName")) + object.sltName = message.sltName; + if (message.slpName != null && message.hasOwnProperty("slpName")) + object.slpName = message.slpName; + return object; + }; + + /** + * Converts this BackupApplianceBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupConfig"; + }; + + return BackupApplianceBackupConfig; + })(); + + v1.DataSourceGcpResource = (function() { + + /** + * Properties of a DataSourceGcpResource. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceGcpResource + * @property {string|null} [gcpResourcename] DataSourceGcpResource gcpResourcename + * @property {string|null} [location] DataSourceGcpResource location + * @property {string|null} [type] DataSourceGcpResource type + * @property {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null} [computeInstanceDatasourceProperties] DataSourceGcpResource computeInstanceDatasourceProperties + */ + + /** + * Constructs a new DataSourceGcpResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceGcpResource. + * @implements IDataSourceGcpResource + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set + */ + function DataSourceGcpResource(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]]; + } + + /** + * DataSourceGcpResource gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.gcpResourcename = ""; + + /** + * DataSourceGcpResource location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.location = ""; + + /** + * DataSourceGcpResource type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.type = ""; + + /** + * DataSourceGcpResource computeInstanceDatasourceProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null|undefined} computeInstanceDatasourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.computeInstanceDatasourceProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataSourceGcpResource gcpResourceProperties. + * @member {"computeInstanceDatasourceProperties"|undefined} gcpResourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + Object.defineProperty(DataSourceGcpResource.prototype, "gcpResourceProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceDatasourceProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSourceGcpResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource instance + */ + DataSourceGcpResource.create = function create(properties) { + return new DataSourceGcpResource(properties); + }; + + /** + * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.computeInstanceDatasourceProperties != null && Object.hasOwnProperty.call(message, "computeInstanceDatasourceProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.encode(message.computeInstanceDatasourceProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 4: { + message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceGcpResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceGcpResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { + properties.gcpResourceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify(message.computeInstanceDatasourceProperties); + if (error) + return "computeInstanceDatasourceProperties." + error; + } + } + return null; + }; + + /** + * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + */ + DataSourceGcpResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceGcpResource) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + if (object.computeInstanceDatasourceProperties != null) { + if (typeof object.computeInstanceDatasourceProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.computeInstanceDatasourceProperties: object expected"); + message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.fromObject(object.computeInstanceDatasourceProperties); + } + return message; + }; + + /** + * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.DataSourceGcpResource} message DataSourceGcpResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceGcpResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.location = ""; + object.type = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { + object.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.toObject(message.computeInstanceDatasourceProperties, options); + if (options.oneofs) + object.gcpResourceProperties = "computeInstanceDatasourceProperties"; + } + return object; + }; + + /** + * Converts this DataSourceGcpResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + * @returns {Object.} JSON object + */ + DataSourceGcpResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceGcpResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceGcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceGcpResource"; + }; + + return DataSourceGcpResource; + })(); + + v1.DataSourceBackupApplianceApplication = (function() { + + /** + * Properties of a DataSourceBackupApplianceApplication. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceBackupApplianceApplication + * @property {string|null} [applicationName] DataSourceBackupApplianceApplication applicationName + * @property {string|null} [backupAppliance] DataSourceBackupApplianceApplication backupAppliance + * @property {number|Long|null} [applianceId] DataSourceBackupApplianceApplication applianceId + * @property {string|null} [type] DataSourceBackupApplianceApplication type + * @property {number|Long|null} [applicationId] DataSourceBackupApplianceApplication applicationId + * @property {string|null} [hostname] DataSourceBackupApplianceApplication hostname + * @property {number|Long|null} [hostId] DataSourceBackupApplianceApplication hostId + */ + + /** + * Constructs a new DataSourceBackupApplianceApplication. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceBackupApplianceApplication. + * @implements IDataSourceBackupApplianceApplication + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set + */ + function DataSourceBackupApplianceApplication(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]]; + } + + /** + * DataSourceBackupApplianceApplication applicationName. + * @member {string} applicationName + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applicationName = ""; + + /** + * DataSourceBackupApplianceApplication backupAppliance. + * @member {string} backupAppliance + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.backupAppliance = ""; + + /** + * DataSourceBackupApplianceApplication applianceId. + * @member {number|Long} applianceId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataSourceBackupApplianceApplication type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.type = ""; + + /** + * DataSourceBackupApplianceApplication applicationId. + * @member {number|Long} applicationId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applicationId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataSourceBackupApplianceApplication hostname. + * @member {string} hostname + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.hostname = ""; + + /** + * DataSourceBackupApplianceApplication hostId. + * @member {number|Long} hostId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.hostId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication instance + */ + DataSourceBackupApplianceApplication.create = function create(properties) { + return new DataSourceBackupApplianceApplication(properties); + }; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupApplianceApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.applicationName); + if (message.backupAppliance != null && Object.hasOwnProperty.call(message, "backupAppliance")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupAppliance); + if (message.applianceId != null && Object.hasOwnProperty.call(message, "applianceId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.applianceId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hostname); + if (message.hostId != null && Object.hasOwnProperty.call(message, "hostId")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.hostId); + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.applicationId); + return writer; + }; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupApplianceApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupApplianceApplication.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.applicationName = reader.string(); + break; + } + case 2: { + message.backupAppliance = reader.string(); + break; + } + case 3: { + message.applianceId = reader.int64(); + break; + } + case 4: { + message.type = reader.string(); + break; + } + case 8: { + message.applicationId = reader.int64(); + break; + } + case 6: { + message.hostname = reader.string(); + break; + } + case 7: { + message.hostId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupApplianceApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceBackupApplianceApplication message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceBackupApplianceApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + if (!$util.isString(message.applicationName)) + return "applicationName: string expected"; + if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) + if (!$util.isString(message.backupAppliance)) + return "backupAppliance: string expected"; + if (message.applianceId != null && message.hasOwnProperty("applianceId")) + if (!$util.isInteger(message.applianceId) && !(message.applianceId && $util.isInteger(message.applianceId.low) && $util.isInteger(message.applianceId.high))) + return "applianceId: integer|Long expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (!$util.isInteger(message.applicationId) && !(message.applicationId && $util.isInteger(message.applicationId.low) && $util.isInteger(message.applicationId.high))) + return "applicationId: integer|Long expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.hostId != null && message.hasOwnProperty("hostId")) + if (!$util.isInteger(message.hostId) && !(message.hostId && $util.isInteger(message.hostId.low) && $util.isInteger(message.hostId.high))) + return "hostId: integer|Long expected"; + return null; + }; + + /** + * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + */ + DataSourceBackupApplianceApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); + if (object.applicationName != null) + message.applicationName = String(object.applicationName); + if (object.backupAppliance != null) + message.backupAppliance = String(object.backupAppliance); + if (object.applianceId != null) + if ($util.Long) + (message.applianceId = $util.Long.fromValue(object.applianceId)).unsigned = false; + else if (typeof object.applianceId === "string") + message.applianceId = parseInt(object.applianceId, 10); + else if (typeof object.applianceId === "number") + message.applianceId = object.applianceId; + else if (typeof object.applianceId === "object") + message.applianceId = new $util.LongBits(object.applianceId.low >>> 0, object.applianceId.high >>> 0).toNumber(); + if (object.type != null) + message.type = String(object.type); + if (object.applicationId != null) + if ($util.Long) + (message.applicationId = $util.Long.fromValue(object.applicationId)).unsigned = false; + else if (typeof object.applicationId === "string") + message.applicationId = parseInt(object.applicationId, 10); + else if (typeof object.applicationId === "number") + message.applicationId = object.applicationId; + else if (typeof object.applicationId === "object") + message.applicationId = new $util.LongBits(object.applicationId.low >>> 0, object.applicationId.high >>> 0).toNumber(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.hostId != null) + if ($util.Long) + (message.hostId = $util.Long.fromValue(object.hostId)).unsigned = false; + else if (typeof object.hostId === "string") + message.hostId = parseInt(object.hostId, 10); + else if (typeof object.hostId === "number") + message.hostId = object.hostId; + else if (typeof object.hostId === "object") + message.hostId = new $util.LongBits(object.hostId.low >>> 0, object.hostId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceBackupApplianceApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.applicationName = ""; + object.backupAppliance = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applianceId = options.longs === String ? "0" : 0; + object.type = ""; + object.hostname = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.hostId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.hostId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applicationId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applicationId = options.longs === String ? "0" : 0; + } + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + object.applicationName = message.applicationName; + if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) + object.backupAppliance = message.backupAppliance; + if (message.applianceId != null && message.hasOwnProperty("applianceId")) + if (typeof message.applianceId === "number") + object.applianceId = options.longs === String ? String(message.applianceId) : message.applianceId; + else + object.applianceId = options.longs === String ? $util.Long.prototype.toString.call(message.applianceId) : options.longs === Number ? new $util.LongBits(message.applianceId.low >>> 0, message.applianceId.high >>> 0).toNumber() : message.applianceId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.hostId != null && message.hasOwnProperty("hostId")) + if (typeof message.hostId === "number") + object.hostId = options.longs === String ? String(message.hostId) : message.hostId; + else + object.hostId = options.longs === String ? $util.Long.prototype.toString.call(message.hostId) : options.longs === Number ? new $util.LongBits(message.hostId.low >>> 0, message.hostId.high >>> 0).toNumber() : message.hostId; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (typeof message.applicationId === "number") + object.applicationId = options.longs === String ? String(message.applicationId) : message.applicationId; + else + object.applicationId = options.longs === String ? $util.Long.prototype.toString.call(message.applicationId) : options.longs === Number ? new $util.LongBits(message.applicationId.low >>> 0, message.applicationId.high >>> 0).toNumber() : message.applicationId; + return object; + }; + + /** + * Converts this DataSourceBackupApplianceApplication to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + * @returns {Object.} JSON object + */ + DataSourceBackupApplianceApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceBackupApplianceApplication + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceBackupApplianceApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceBackupApplianceApplication"; + }; + + return DataSourceBackupApplianceApplication; + })(); + + v1.ServiceLockInfo = (function() { + + /** + * Properties of a ServiceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IServiceLockInfo + * @property {string|null} [operation] ServiceLockInfo operation + */ + + /** + * Constructs a new ServiceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ServiceLockInfo. + * @implements IServiceLockInfo + * @constructor + * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set + */ + function ServiceLockInfo(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]]; + } + + /** + * ServiceLockInfo operation. + * @member {string} operation + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @instance + */ + ServiceLockInfo.prototype.operation = ""; + + /** + * Creates a new ServiceLockInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo instance + */ + ServiceLockInfo.create = function create(properties) { + return new ServiceLockInfo(properties); + }; + + /** + * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLockInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + return writer; + }; + + /** + * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLockInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLockInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceLockInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceLockInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + return null; + }; + + /** + * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + */ + ServiceLockInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ServiceLockInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); + if (object.operation != null) + message.operation = String(object.operation); + return message; + }; + + /** + * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.ServiceLockInfo} message ServiceLockInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceLockInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + return object; + }; + + /** + * Converts this ServiceLockInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @instance + * @returns {Object.} JSON object + */ + ServiceLockInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceLockInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceLockInfo"; + }; + + return ServiceLockInfo; + })(); + + v1.BackupApplianceLockInfo = (function() { + + /** + * Properties of a BackupApplianceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceLockInfo + * @property {number|Long|null} [backupApplianceId] BackupApplianceLockInfo backupApplianceId + * @property {string|null} [backupApplianceName] BackupApplianceLockInfo backupApplianceName + * @property {string|null} [lockReason] BackupApplianceLockInfo lockReason + * @property {string|null} [jobName] BackupApplianceLockInfo jobName + * @property {string|null} [backupImage] BackupApplianceLockInfo backupImage + * @property {number|Long|null} [slaId] BackupApplianceLockInfo slaId + */ + + /** + * Constructs a new BackupApplianceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceLockInfo. + * @implements IBackupApplianceLockInfo + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set + */ + function BackupApplianceLockInfo(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]]; + } + + /** + * BackupApplianceLockInfo backupApplianceId. + * @member {number|Long} backupApplianceId + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceLockInfo backupApplianceName. + * @member {string} backupApplianceName + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupApplianceName = ""; + + /** + * BackupApplianceLockInfo lockReason. + * @member {string} lockReason + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.lockReason = ""; + + /** + * BackupApplianceLockInfo jobName. + * @member {string|null|undefined} jobName + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.jobName = null; + + /** + * BackupApplianceLockInfo backupImage. + * @member {string|null|undefined} backupImage + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupImage = null; + + /** + * BackupApplianceLockInfo slaId. + * @member {number|Long|null|undefined} slaId + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.slaId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupApplianceLockInfo lockSource. + * @member {"jobName"|"backupImage"|"slaId"|undefined} lockSource + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + Object.defineProperty(BackupApplianceLockInfo.prototype, "lockSource", { + get: $util.oneOfGetter($oneOfFields = ["jobName", "backupImage", "slaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupApplianceLockInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo instance + */ + BackupApplianceLockInfo.create = function create(properties) { + return new BackupApplianceLockInfo(properties); + }; + + /** + * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceLockInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.backupApplianceId); + if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupApplianceName); + if (message.lockReason != null && Object.hasOwnProperty.call(message, "lockReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.lockReason); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.jobName); + if (message.backupImage != null && Object.hasOwnProperty.call(message, "backupImage")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.backupImage); + if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.slaId); + return writer; + }; + + /** + * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceLockInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupApplianceId = reader.int64(); + break; + } + case 2: { + message.backupApplianceName = reader.string(); + break; + } + case 5: { + message.lockReason = reader.string(); + break; + } + case 6: { + message.jobName = reader.string(); + break; + } + case 7: { + message.backupImage = reader.string(); + break; + } + case 8: { + message.slaId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceLockInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceLockInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceLockInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) + return "backupApplianceId: integer|Long expected"; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + if (!$util.isString(message.backupApplianceName)) + return "backupApplianceName: string expected"; + if (message.lockReason != null && message.hasOwnProperty("lockReason")) + if (!$util.isString(message.lockReason)) + return "lockReason: string expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) { + properties.lockSource = 1; + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + } + if (message.backupImage != null && message.hasOwnProperty("backupImage")) { + if (properties.lockSource === 1) + return "lockSource: multiple values"; + properties.lockSource = 1; + if (!$util.isString(message.backupImage)) + return "backupImage: string expected"; + } + if (message.slaId != null && message.hasOwnProperty("slaId")) { + if (properties.lockSource === 1) + return "lockSource: multiple values"; + properties.lockSource = 1; + if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) + return "slaId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + */ + BackupApplianceLockInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceLockInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); + if (object.backupApplianceId != null) + if ($util.Long) + (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; + else if (typeof object.backupApplianceId === "string") + message.backupApplianceId = parseInt(object.backupApplianceId, 10); + else if (typeof object.backupApplianceId === "number") + message.backupApplianceId = object.backupApplianceId; + else if (typeof object.backupApplianceId === "object") + message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); + if (object.backupApplianceName != null) + message.backupApplianceName = String(object.backupApplianceName); + if (object.lockReason != null) + message.lockReason = String(object.lockReason); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.backupImage != null) + message.backupImage = String(object.backupImage); + if (object.slaId != null) + if ($util.Long) + (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; + else if (typeof object.slaId === "string") + message.slaId = parseInt(object.slaId, 10); + else if (typeof object.slaId === "number") + message.slaId = object.slaId; + else if (typeof object.slaId === "object") + message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceLockInfo} message BackupApplianceLockInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceLockInfo.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.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupApplianceId = options.longs === String ? "0" : 0; + object.backupApplianceName = ""; + object.lockReason = ""; + } + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (typeof message.backupApplianceId === "number") + object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; + else + object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + object.backupApplianceName = message.backupApplianceName; + if (message.lockReason != null && message.hasOwnProperty("lockReason")) + object.lockReason = message.lockReason; + if (message.jobName != null && message.hasOwnProperty("jobName")) { + object.jobName = message.jobName; + if (options.oneofs) + object.lockSource = "jobName"; + } + if (message.backupImage != null && message.hasOwnProperty("backupImage")) { + object.backupImage = message.backupImage; + if (options.oneofs) + object.lockSource = "backupImage"; + } + if (message.slaId != null && message.hasOwnProperty("slaId")) { + if (typeof message.slaId === "number") + object.slaId = options.longs === String ? String(message.slaId) : message.slaId; + else + object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; + if (options.oneofs) + object.lockSource = "slaId"; + } + return object; + }; + + /** + * Converts this BackupApplianceLockInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceLockInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceLockInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceLockInfo"; + }; + + return BackupApplianceLockInfo; + })(); + + v1.BackupLock = (function() { + + /** + * Properties of a BackupLock. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupLock + * @property {google.protobuf.ITimestamp|null} [lockUntilTime] BackupLock lockUntilTime + * @property {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null} [backupApplianceLockInfo] BackupLock backupApplianceLockInfo + * @property {google.cloud.backupdr.v1.IServiceLockInfo|null} [serviceLockInfo] BackupLock serviceLockInfo + */ + + /** + * Constructs a new BackupLock. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupLock. + * @implements IBackupLock + * @constructor + * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set + */ + function BackupLock(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]]; + } + + /** + * BackupLock lockUntilTime. + * @member {google.protobuf.ITimestamp|null|undefined} lockUntilTime + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.lockUntilTime = null; + + /** + * BackupLock backupApplianceLockInfo. + * @member {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null|undefined} backupApplianceLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.backupApplianceLockInfo = null; + + /** + * BackupLock serviceLockInfo. + * @member {google.cloud.backupdr.v1.IServiceLockInfo|null|undefined} serviceLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.serviceLockInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupLock ClientLockInfo. + * @member {"backupApplianceLockInfo"|"serviceLockInfo"|undefined} ClientLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + Object.defineProperty(BackupLock.prototype, "ClientLockInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupApplianceLockInfo", "serviceLockInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupLock instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock instance + */ + BackupLock.create = function create(properties) { + return new BackupLock(properties); + }; + + /** + * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lockUntilTime != null && Object.hasOwnProperty.call(message, "lockUntilTime")) + $root.google.protobuf.Timestamp.encode(message.lockUntilTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backupApplianceLockInfo != null && Object.hasOwnProperty.call(message, "backupApplianceLockInfo")) + $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.encode(message.backupApplianceLockInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceLockInfo != null && Object.hasOwnProperty.call(message, "serviceLockInfo")) + $root.google.cloud.backupdr.v1.ServiceLockInfo.encode(message.serviceLockInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupLock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupLock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lockUntilTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupLock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupLock message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupLock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lockUntilTime); + if (error) + return "lockUntilTime." + error; + } + if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { + properties.ClientLockInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.verify(message.backupApplianceLockInfo); + if (error) + return "backupApplianceLockInfo." + error; + } + } + if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { + if (properties.ClientLockInfo === 1) + return "ClientLockInfo: multiple values"; + properties.ClientLockInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.ServiceLockInfo.verify(message.serviceLockInfo); + if (error) + return "serviceLockInfo." + error; + } + } + return null; + }; + + /** + * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + */ + BackupLock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupLock) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupLock(); + if (object.lockUntilTime != null) { + if (typeof object.lockUntilTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.lockUntilTime: object expected"); + message.lockUntilTime = $root.google.protobuf.Timestamp.fromObject(object.lockUntilTime); + } + if (object.backupApplianceLockInfo != null) { + if (typeof object.backupApplianceLockInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.backupApplianceLockInfo: object expected"); + message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.fromObject(object.backupApplianceLockInfo); + } + if (object.serviceLockInfo != null) { + if (typeof object.serviceLockInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.serviceLockInfo: object expected"); + message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.fromObject(object.serviceLockInfo); + } + return message; + }; + + /** + * Creates a plain object from a BackupLock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.BackupLock} message BackupLock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupLock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.lockUntilTime = null; + if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) + object.lockUntilTime = $root.google.protobuf.Timestamp.toObject(message.lockUntilTime, options); + if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { + object.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.toObject(message.backupApplianceLockInfo, options); + if (options.oneofs) + object.ClientLockInfo = "backupApplianceLockInfo"; + } + if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { + object.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.toObject(message.serviceLockInfo, options); + if (options.oneofs) + object.ClientLockInfo = "serviceLockInfo"; + } + return object; + }; + + /** + * Converts this BackupLock to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + * @returns {Object.} JSON object + */ + BackupLock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupLock + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupLock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupLock"; + }; + + return BackupLock; + })(); + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.backupdr.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [description] Backup description + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {Object.|null} [labels] Backup labels + * @property {google.protobuf.ITimestamp|null} [enforcedRetentionEndTime] Backup enforcedRetentionEndTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {google.protobuf.ITimestamp|null} [consistencyTime] Backup consistencyTime + * @property {string|null} [etag] Backup etag + * @property {google.cloud.backupdr.v1.Backup.State|null} [state] Backup state + * @property {Array.|null} [serviceLocks] Backup serviceLocks + * @property {Array.|null} [backupApplianceLocks] Backup backupApplianceLocks + * @property {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null} [computeInstanceBackupProperties] Backup computeInstanceBackupProperties + * @property {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null} [backupApplianceBackupProperties] Backup backupApplianceBackupProperties + * @property {google.cloud.backupdr.v1.Backup.BackupType|null} [backupType] Backup backupType + * @property {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null} [gcpBackupPlanInfo] Backup gcpBackupPlanInfo + * @property {number|Long|null} [resourceSizeBytes] Backup resourceSizeBytes + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + this.serviceLocks = []; + this.backupApplianceLocks = []; + 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.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.description = null; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup enforcedRetentionEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} enforcedRetentionEndTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.enforcedRetentionEndTime = null; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup consistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} consistencyTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.consistencyTime = null; + + /** + * Backup etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.etag = null; + + /** + * Backup state. + * @member {google.cloud.backupdr.v1.Backup.State} state + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup serviceLocks. + * @member {Array.} serviceLocks + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.serviceLocks = $util.emptyArray; + + /** + * Backup backupApplianceLocks. + * @member {Array.} backupApplianceLocks + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupApplianceLocks = $util.emptyArray; + + /** + * Backup computeInstanceBackupProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null|undefined} computeInstanceBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.computeInstanceBackupProperties = null; + + /** + * Backup backupApplianceBackupProperties. + * @member {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null|undefined} backupApplianceBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupApplianceBackupProperties = null; + + /** + * Backup backupType. + * @member {google.cloud.backupdr.v1.Backup.BackupType} backupType + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupType = 0; + + /** + * Backup gcpBackupPlanInfo. + * @member {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null|undefined} gcpBackupPlanInfo + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.gcpBackupPlanInfo = null; + + /** + * Backup resourceSizeBytes. + * @member {number|Long} resourceSizeBytes + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.resourceSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Backup _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _createTime. + * @member {"createTime"|undefined} _createTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _updateTime. + * @member {"updateTime"|undefined} _updateTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _enforcedRetentionEndTime. + * @member {"enforcedRetentionEndTime"|undefined} _enforcedRetentionEndTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_enforcedRetentionEndTime", { + get: $util.oneOfGetter($oneOfFields = ["enforcedRetentionEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _expireTime. + * @member {"expireTime"|undefined} _expireTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_expireTime", { + get: $util.oneOfGetter($oneOfFields = ["expireTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _consistencyTime. + * @member {"consistencyTime"|undefined} _consistencyTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_consistencyTime", { + get: $util.oneOfGetter($oneOfFields = ["consistencyTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup backupProperties. + * @member {"computeInstanceBackupProperties"|"backupApplianceBackupProperties"|undefined} backupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "backupProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceBackupProperties", "backupApplianceBackupProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup planInfo. + * @member {"gcpBackupPlanInfo"|undefined} planInfo + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "planInfo", { + get: $util.oneOfGetter($oneOfFields = ["gcpBackupPlanInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.enforcedRetentionEndTime != null && Object.hasOwnProperty.call(message, "enforcedRetentionEndTime")) + $root.google.protobuf.Timestamp.encode(message.enforcedRetentionEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.consistencyTime != null && Object.hasOwnProperty.call(message, "consistencyTime")) + $root.google.protobuf.Timestamp.encode(message.consistencyTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.serviceLocks != null && message.serviceLocks.length) + for (var i = 0; i < message.serviceLocks.length; ++i) + $root.google.cloud.backupdr.v1.BackupLock.encode(message.serviceLocks[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.backupApplianceLocks != null && message.backupApplianceLocks.length) + for (var i = 0; i < message.backupApplianceLocks.length; ++i) + $root.google.cloud.backupdr.v1.BackupLock.encode(message.backupApplianceLocks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.computeInstanceBackupProperties != null && Object.hasOwnProperty.call(message, "computeInstanceBackupProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.encode(message.computeInstanceBackupProperties, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.backupType); + if (message.backupApplianceBackupProperties != null && Object.hasOwnProperty.call(message, "backupApplianceBackupProperties")) + $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.encode(message.backupApplianceBackupProperties, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.gcpBackupPlanInfo != null && Object.hasOwnProperty.call(message, "gcpBackupPlanInfo")) + $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.encode(message.gcpBackupPlanInfo, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.resourceSizeBytes != null && Object.hasOwnProperty.call(message, "resourceSizeBytes")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.resourceSizeBytes); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.consistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 17: { + if (!(message.serviceLocks && message.serviceLocks.length)) + message.serviceLocks = []; + message.serviceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); + break; + } + case 18: { + if (!(message.backupApplianceLocks && message.backupApplianceLocks.length)) + message.backupApplianceLocks = []; + message.backupApplianceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); + break; + } + case 19: { + message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.decode(reader, reader.uint32()); + break; + } + case 21: { + message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.decode(reader, reader.uint32()); + break; + } + case 20: { + message.backupType = reader.int32(); + break; + } + case 22: { + message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.decode(reader, reader.uint32()); + break; + } + case 23: { + message.resourceSizeBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { + properties._enforcedRetentionEndTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.enforcedRetentionEndTime); + if (error) + return "enforcedRetentionEndTime." + error; + } + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties._expireTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { + properties._consistencyTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.consistencyTime); + if (error) + return "consistencyTime." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.serviceLocks != null && message.hasOwnProperty("serviceLocks")) { + if (!Array.isArray(message.serviceLocks)) + return "serviceLocks: array expected"; + for (var i = 0; i < message.serviceLocks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.serviceLocks[i]); + if (error) + return "serviceLocks." + error; + } + } + if (message.backupApplianceLocks != null && message.hasOwnProperty("backupApplianceLocks")) { + if (!Array.isArray(message.backupApplianceLocks)) + return "backupApplianceLocks: array expected"; + for (var i = 0; i < message.backupApplianceLocks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.backupApplianceLocks[i]); + if (error) + return "backupApplianceLocks." + error; + } + } + if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify(message.computeInstanceBackupProperties); + if (error) + return "computeInstanceBackupProperties." + error; + } + } + if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { + if (properties.backupProperties === 1) + return "backupProperties: multiple values"; + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify(message.backupApplianceBackupProperties); + if (error) + return "backupApplianceBackupProperties." + error; + } + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + switch (message.backupType) { + default: + return "backupType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { + properties.planInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify(message.gcpBackupPlanInfo); + if (error) + return "gcpBackupPlanInfo." + error; + } + } + if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) + if (!$util.isInteger(message.resourceSizeBytes) && !(message.resourceSizeBytes && $util.isInteger(message.resourceSizeBytes.low) && $util.isInteger(message.resourceSizeBytes.high))) + return "resourceSizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Backup) + return object; + var message = new $root.google.cloud.backupdr.v1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.enforcedRetentionEndTime != null) { + if (typeof object.enforcedRetentionEndTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.enforcedRetentionEndTime: object expected"); + message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.fromObject(object.enforcedRetentionEndTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.consistencyTime != null) { + if (typeof object.consistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.consistencyTime: object expected"); + message.consistencyTime = $root.google.protobuf.Timestamp.fromObject(object.consistencyTime); + } + if (object.etag != null) + message.etag = String(object.etag); + 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 "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.serviceLocks) { + if (!Array.isArray(object.serviceLocks)) + throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: array expected"); + message.serviceLocks = []; + for (var i = 0; i < object.serviceLocks.length; ++i) { + if (typeof object.serviceLocks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: object expected"); + message.serviceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.serviceLocks[i]); + } + } + if (object.backupApplianceLocks) { + if (!Array.isArray(object.backupApplianceLocks)) + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: array expected"); + message.backupApplianceLocks = []; + for (var i = 0; i < object.backupApplianceLocks.length; ++i) { + if (typeof object.backupApplianceLocks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: object expected"); + message.backupApplianceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.backupApplianceLocks[i]); + } + } + if (object.computeInstanceBackupProperties != null) { + if (typeof object.computeInstanceBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.computeInstanceBackupProperties: object expected"); + message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.fromObject(object.computeInstanceBackupProperties); + } + if (object.backupApplianceBackupProperties != null) { + if (typeof object.backupApplianceBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceBackupProperties: object expected"); + message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.fromObject(object.backupApplianceBackupProperties); + } + switch (object.backupType) { + default: + if (typeof object.backupType === "number") { + message.backupType = object.backupType; + break; + } + break; + case "BACKUP_TYPE_UNSPECIFIED": + case 0: + message.backupType = 0; + break; + case "SCHEDULED": + case 1: + message.backupType = 1; + break; + case "ON_DEMAND": + case 2: + message.backupType = 2; + break; + } + if (object.gcpBackupPlanInfo != null) { + if (typeof object.gcpBackupPlanInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.gcpBackupPlanInfo: object expected"); + message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.fromObject(object.gcpBackupPlanInfo); + } + if (object.resourceSizeBytes != null) + if ($util.Long) + (message.resourceSizeBytes = $util.Long.fromValue(object.resourceSizeBytes)).unsigned = false; + else if (typeof object.resourceSizeBytes === "string") + message.resourceSizeBytes = parseInt(object.resourceSizeBytes, 10); + else if (typeof object.resourceSizeBytes === "number") + message.resourceSizeBytes = object.resourceSizeBytes; + else if (typeof object.resourceSizeBytes === "object") + message.resourceSizeBytes = new $util.LongBits(object.resourceSizeBytes.low >>> 0, object.resourceSizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.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.arrays || options.defaults) { + object.serviceLocks = []; + object.backupApplianceLocks = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.backupType = options.enums === String ? "BACKUP_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resourceSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resourceSizeBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { + object.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.toObject(message.enforcedRetentionEndTime, options); + if (options.oneofs) + object._enforcedRetentionEndTime = "enforcedRetentionEndTime"; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object._expireTime = "expireTime"; + } + if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { + object.consistencyTime = $root.google.protobuf.Timestamp.toObject(message.consistencyTime, options); + if (options.oneofs) + object._consistencyTime = "consistencyTime"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.Backup.State[message.state] : message.state; + if (message.serviceLocks && message.serviceLocks.length) { + object.serviceLocks = []; + for (var j = 0; j < message.serviceLocks.length; ++j) + object.serviceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.serviceLocks[j], options); + } + if (message.backupApplianceLocks && message.backupApplianceLocks.length) { + object.backupApplianceLocks = []; + for (var j = 0; j < message.backupApplianceLocks.length; ++j) + object.backupApplianceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.backupApplianceLocks[j], options); + } + if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { + object.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.toObject(message.computeInstanceBackupProperties, options); + if (options.oneofs) + object.backupProperties = "computeInstanceBackupProperties"; + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + object.backupType = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] === undefined ? message.backupType : $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] : message.backupType; + if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { + object.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.toObject(message.backupApplianceBackupProperties, options); + if (options.oneofs) + object.backupProperties = "backupApplianceBackupProperties"; + } + if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { + object.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.toObject(message.gcpBackupPlanInfo, options); + if (options.oneofs) + object.planInfo = "gcpBackupPlanInfo"; + } + if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) + if (typeof message.resourceSizeBytes === "number") + object.resourceSizeBytes = options.longs === String ? String(message.resourceSizeBytes) : message.resourceSizeBytes; + else + object.resourceSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.resourceSizeBytes) : options.longs === Number ? new $util.LongBits(message.resourceSizeBytes.low >>> 0, message.resourceSizeBytes.high >>> 0).toNumber() : message.resourceSizeBytes; + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.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.cloud.backupdr.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.cloud.backupdr.v1.Backup"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + /** + * BackupType enum. + * @name google.cloud.backupdr.v1.Backup.BackupType + * @enum {number} + * @property {number} BACKUP_TYPE_UNSPECIFIED=0 BACKUP_TYPE_UNSPECIFIED value + * @property {number} SCHEDULED=1 SCHEDULED value + * @property {number} ON_DEMAND=2 ON_DEMAND value + */ + Backup.BackupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEDULED"] = 1; + values[valuesById[2] = "ON_DEMAND"] = 2; + return values; + })(); + + Backup.GCPBackupPlanInfo = (function() { + + /** + * Properties of a GCPBackupPlanInfo. + * @memberof google.cloud.backupdr.v1.Backup + * @interface IGCPBackupPlanInfo + * @property {string|null} [backupPlan] GCPBackupPlanInfo backupPlan + * @property {string|null} [backupPlanRuleId] GCPBackupPlanInfo backupPlanRuleId + */ + + /** + * Constructs a new GCPBackupPlanInfo. + * @memberof google.cloud.backupdr.v1.Backup + * @classdesc Represents a GCPBackupPlanInfo. + * @implements IGCPBackupPlanInfo + * @constructor + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set + */ + function GCPBackupPlanInfo(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]]; + } + + /** + * GCPBackupPlanInfo backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlan = ""; + + /** + * GCPBackupPlanInfo backupPlanRuleId. + * @member {string} backupPlanRuleId + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlanRuleId = ""; + + /** + * Creates a new GCPBackupPlanInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo instance + */ + GCPBackupPlanInfo.create = function create(properties) { + return new GCPBackupPlanInfo(properties); + }; + + /** + * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCPBackupPlanInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); + if (message.backupPlanRuleId != null && Object.hasOwnProperty.call(message, "backupPlanRuleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanRuleId); + return writer; + }; + + /** + * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCPBackupPlanInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCPBackupPlanInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupPlan = reader.string(); + break; + } + case 2: { + message.backupPlanRuleId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCPBackupPlanInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCPBackupPlanInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCPBackupPlanInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) + if (!$util.isString(message.backupPlanRuleId)) + return "backupPlanRuleId: string expected"; + return null; + }; + + /** + * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + */ + GCPBackupPlanInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.backupPlanRuleId != null) + message.backupPlanRuleId = String(object.backupPlanRuleId); + return message; + }; + + /** + * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} message GCPBackupPlanInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCPBackupPlanInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupPlan = ""; + object.backupPlanRuleId = ""; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) + object.backupPlanRuleId = message.backupPlanRuleId; + return object; + }; + + /** + * Converts this GCPBackupPlanInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + * @returns {Object.} JSON object + */ + GCPBackupPlanInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCPBackupPlanInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCPBackupPlanInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo"; + }; + + return GCPBackupPlanInfo; + })(); + + return Backup; + })(); + + v1.CreateBackupVaultRequest = (function() { + + /** + * Properties of a CreateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupVaultRequest + * @property {string|null} [parent] CreateBackupVaultRequest parent + * @property {string|null} [backupVaultId] CreateBackupVaultRequest backupVaultId + * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] CreateBackupVaultRequest backupVault + * @property {string|null} [requestId] CreateBackupVaultRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupVaultRequest validateOnly + */ + + /** + * Constructs a new CreateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupVaultRequest. + * @implements ICreateBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set + */ + function CreateBackupVaultRequest(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]]; + } + + /** + * CreateBackupVaultRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.parent = ""; + + /** + * CreateBackupVaultRequest backupVaultId. + * @member {string} backupVaultId + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.backupVaultId = ""; + + /** + * CreateBackupVaultRequest backupVault. + * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.backupVault = null; + + /** + * CreateBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.requestId = ""; + + /** + * CreateBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest instance + */ + CreateBackupVaultRequest.create = function create(properties) { + return new CreateBackupVaultRequest(properties); + }; + + /** + * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.backupVaultId != null && Object.hasOwnProperty.call(message, "backupVaultId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupVaultId); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupVaultId = reader.string(); + break; + } + case 3: { + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.backupVaultId != null && message.hasOwnProperty("backupVaultId")) + if (!$util.isString(message.backupVaultId)) + return "backupVaultId: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); + if (error) + return "backupVault." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + */ + CreateBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupVaultId != null) + message.backupVaultId = String(object.backupVaultId); + if (object.backupVault != null) { + if (typeof object.backupVault !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupVaultRequest.backupVault: object expected"); + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupVaultRequest} message CreateBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupVaultId = ""; + object.backupVault = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupVaultId != null && message.hasOwnProperty("backupVaultId")) + object.backupVaultId = message.backupVaultId; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupVaultRequest"; + }; + + return CreateBackupVaultRequest; + })(); + + v1.ListBackupVaultsRequest = (function() { + + /** + * Properties of a ListBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupVaultsRequest + * @property {string|null} [parent] ListBackupVaultsRequest parent + * @property {number|null} [pageSize] ListBackupVaultsRequest pageSize + * @property {string|null} [pageToken] ListBackupVaultsRequest pageToken + * @property {string|null} [filter] ListBackupVaultsRequest filter + * @property {string|null} [orderBy] ListBackupVaultsRequest orderBy + * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] ListBackupVaultsRequest view + */ + + /** + * Constructs a new ListBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupVaultsRequest. + * @implements IListBackupVaultsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set + */ + function ListBackupVaultsRequest(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]]; + } + + /** + * ListBackupVaultsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.parent = ""; + + /** + * ListBackupVaultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.pageSize = 0; + + /** + * ListBackupVaultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.pageToken = ""; + + /** + * ListBackupVaultsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.filter = ""; + + /** + * ListBackupVaultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.orderBy = ""; + + /** + * ListBackupVaultsRequest view. + * @member {google.cloud.backupdr.v1.BackupVaultView} view + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.view = 0; + + /** + * Creates a new ListBackupVaultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest instance + */ + ListBackupVaultsRequest.create = function create(properties) { + return new ListBackupVaultsRequest(properties); + }; + + /** + * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupVaultsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupVaultsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + */ + ListBackupVaultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VAULT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VAULT_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VAULT_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupVaultsRequest} message ListBackupVaultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupVaultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "BACKUP_VAULT_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListBackupVaultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupVaultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupVaultsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsRequest"; + }; + + return ListBackupVaultsRequest; + })(); + + v1.ListBackupVaultsResponse = (function() { + + /** + * Properties of a ListBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupVaultsResponse + * @property {Array.|null} [backupVaults] ListBackupVaultsResponse backupVaults + * @property {string|null} [nextPageToken] ListBackupVaultsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupVaultsResponse unreachable + */ + + /** + * Constructs a new ListBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupVaultsResponse. + * @implements IListBackupVaultsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set + */ + function ListBackupVaultsResponse(properties) { + this.backupVaults = []; + 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]]; + } + + /** + * ListBackupVaultsResponse backupVaults. + * @member {Array.} backupVaults + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; + + /** + * ListBackupVaultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupVaultsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupVaultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse instance + */ + ListBackupVaultsResponse.create = function create(properties) { + return new ListBackupVaultsResponse(properties); + }; + + /** + * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaults != null && message.backupVaults.length) + for (var i = 0; i < message.backupVaults.length; ++i) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupVaults && message.backupVaults.length)) + message.backupVaults = []; + message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupVaultsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupVaultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { + if (!Array.isArray(message.backupVaults)) + return "backupVaults: array expected"; + for (var i = 0; i < message.backupVaults.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); + if (error) + return "backupVaults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + */ + ListBackupVaultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); + if (object.backupVaults) { + if (!Array.isArray(object.backupVaults)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: array expected"); + message.backupVaults = []; + for (var i = 0; i < object.backupVaults.length; ++i) { + if (typeof object.backupVaults[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: object expected"); + message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.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 ListBackupVaultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} message ListBackupVaultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupVaultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupVaults = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupVaults && message.backupVaults.length) { + object.backupVaults = []; + for (var j = 0; j < message.backupVaults.length; ++j) + object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + 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 ListBackupVaultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupVaultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupVaultsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsResponse"; + }; + + return ListBackupVaultsResponse; + })(); + + v1.FetchUsableBackupVaultsRequest = (function() { + + /** + * Properties of a FetchUsableBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchUsableBackupVaultsRequest + * @property {string|null} [parent] FetchUsableBackupVaultsRequest parent + * @property {number|null} [pageSize] FetchUsableBackupVaultsRequest pageSize + * @property {string|null} [pageToken] FetchUsableBackupVaultsRequest pageToken + * @property {string|null} [filter] FetchUsableBackupVaultsRequest filter + * @property {string|null} [orderBy] FetchUsableBackupVaultsRequest orderBy + */ + + /** + * Constructs a new FetchUsableBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchUsableBackupVaultsRequest. + * @implements IFetchUsableBackupVaultsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set + */ + function FetchUsableBackupVaultsRequest(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]]; + } + + /** + * FetchUsableBackupVaultsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.parent = ""; + + /** + * FetchUsableBackupVaultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.pageSize = 0; + + /** + * FetchUsableBackupVaultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.pageToken = ""; + + /** + * FetchUsableBackupVaultsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.filter = ""; + + /** + * FetchUsableBackupVaultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.orderBy = ""; + + /** + * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest instance + */ + FetchUsableBackupVaultsRequest.create = function create(properties) { + return new FetchUsableBackupVaultsRequest(properties); + }; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchUsableBackupVaultsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchUsableBackupVaultsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + */ + FetchUsableBackupVaultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchUsableBackupVaultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this FetchUsableBackupVaultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + * @returns {Object.} JSON object + */ + FetchUsableBackupVaultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchUsableBackupVaultsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchUsableBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest"; + }; + + return FetchUsableBackupVaultsRequest; + })(); + + v1.FetchUsableBackupVaultsResponse = (function() { + + /** + * Properties of a FetchUsableBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchUsableBackupVaultsResponse + * @property {Array.|null} [backupVaults] FetchUsableBackupVaultsResponse backupVaults + * @property {string|null} [nextPageToken] FetchUsableBackupVaultsResponse nextPageToken + * @property {Array.|null} [unreachable] FetchUsableBackupVaultsResponse unreachable + */ + + /** + * Constructs a new FetchUsableBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchUsableBackupVaultsResponse. + * @implements IFetchUsableBackupVaultsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set + */ + function FetchUsableBackupVaultsResponse(properties) { + this.backupVaults = []; + 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]]; + } + + /** + * FetchUsableBackupVaultsResponse backupVaults. + * @member {Array.} backupVaults + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; + + /** + * FetchUsableBackupVaultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.nextPageToken = ""; + + /** + * FetchUsableBackupVaultsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse instance + */ + FetchUsableBackupVaultsResponse.create = function create(properties) { + return new FetchUsableBackupVaultsResponse(properties); + }; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaults != null && message.backupVaults.length) + for (var i = 0; i < message.backupVaults.length; ++i) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupVaults && message.backupVaults.length)) + message.backupVaults = []; + message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchUsableBackupVaultsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchUsableBackupVaultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { + if (!Array.isArray(message.backupVaults)) + return "backupVaults: array expected"; + for (var i = 0; i < message.backupVaults.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); + if (error) + return "backupVaults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + */ + FetchUsableBackupVaultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); + if (object.backupVaults) { + if (!Array.isArray(object.backupVaults)) + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: array expected"); + message.backupVaults = []; + for (var i = 0; i < object.backupVaults.length; ++i) { + if (typeof object.backupVaults[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: object expected"); + message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.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 FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchUsableBackupVaultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupVaults = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupVaults && message.backupVaults.length) { + object.backupVaults = []; + for (var j = 0; j < message.backupVaults.length; ++j) + object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + 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 FetchUsableBackupVaultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + * @returns {Object.} JSON object + */ + FetchUsableBackupVaultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchUsableBackupVaultsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchUsableBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse"; + }; + + return FetchUsableBackupVaultsResponse; + })(); + + v1.GetBackupVaultRequest = (function() { + + /** + * Properties of a GetBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupVaultRequest + * @property {string|null} [name] GetBackupVaultRequest name + * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] GetBackupVaultRequest view + */ + + /** + * Constructs a new GetBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupVaultRequest. + * @implements IGetBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set + */ + function GetBackupVaultRequest(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]]; + } + + /** + * GetBackupVaultRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + */ + GetBackupVaultRequest.prototype.name = ""; + + /** + * GetBackupVaultRequest view. + * @member {google.cloud.backupdr.v1.BackupVaultView} view + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + */ + GetBackupVaultRequest.prototype.view = 0; + + /** + * Creates a new GetBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest instance + */ + GetBackupVaultRequest.create = function create(properties) { + return new GetBackupVaultRequest(properties); + }; + + /** + * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + */ + GetBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VAULT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VAULT_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VAULT_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupVaultRequest} message GetBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BACKUP_VAULT_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupVaultRequest"; + }; + + return GetBackupVaultRequest; + })(); + + v1.UpdateBackupVaultRequest = (function() { + + /** + * Properties of an UpdateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupVaultRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupVaultRequest updateMask + * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] UpdateBackupVaultRequest backupVault + * @property {string|null} [requestId] UpdateBackupVaultRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupVaultRequest validateOnly + * @property {boolean|null} [force] UpdateBackupVaultRequest force + */ + + /** + * Constructs a new UpdateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupVaultRequest. + * @implements IUpdateBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set + */ + function UpdateBackupVaultRequest(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]]; + } + + /** + * UpdateBackupVaultRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.updateMask = null; + + /** + * UpdateBackupVaultRequest backupVault. + * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.backupVault = null; + + /** + * UpdateBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.requestId = ""; + + /** + * UpdateBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.validateOnly = false; + + /** + * UpdateBackupVaultRequest force. + * @member {boolean} force + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.force = false; + + /** + * Creates a new UpdateBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest instance + */ + UpdateBackupVaultRequest.create = function create(properties) { + return new UpdateBackupVaultRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; + + /** + * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backupVault != null && message.hasOwnProperty("backupVault")) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); + if (error) + return "backupVault." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + */ + UpdateBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backupVault != null) { + if (typeof object.backupVault !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.backupVault: object expected"); + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupVaultRequest} message UpdateBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backupVault = null; + object.requestId = ""; + object.validateOnly = false; + object.force = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this UpdateBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupVaultRequest"; + }; + + return UpdateBackupVaultRequest; + })(); + + v1.DeleteBackupVaultRequest = (function() { + + /** + * Properties of a DeleteBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupVaultRequest + * @property {string|null} [name] DeleteBackupVaultRequest name + * @property {string|null} [requestId] DeleteBackupVaultRequest requestId + * @property {boolean|null} [force] DeleteBackupVaultRequest force + * @property {string|null} [etag] DeleteBackupVaultRequest etag + * @property {boolean|null} [validateOnly] DeleteBackupVaultRequest validateOnly + * @property {boolean|null} [allowMissing] DeleteBackupVaultRequest allowMissing + */ + + /** + * Constructs a new DeleteBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupVaultRequest. + * @implements IDeleteBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set + */ + function DeleteBackupVaultRequest(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]]; + } + + /** + * DeleteBackupVaultRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.name = ""; + + /** + * DeleteBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.requestId = ""; + + /** + * DeleteBackupVaultRequest force. + * @member {boolean} force + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.force = false; + + /** + * DeleteBackupVaultRequest etag. + * @member {string} etag + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.etag = ""; + + /** + * DeleteBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.validateOnly = false; + + /** + * DeleteBackupVaultRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.allowMissing = false; + + /** + * Creates a new DeleteBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest instance + */ + DeleteBackupVaultRequest.create = function create(properties) { + return new DeleteBackupVaultRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + case 6: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + */ + DeleteBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupVaultRequest} message DeleteBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + object.etag = ""; + object.validateOnly = false; + object.allowMissing = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this DeleteBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupVaultRequest"; + }; + + return DeleteBackupVaultRequest; + })(); + + v1.ListDataSourcesRequest = (function() { + + /** + * Properties of a ListDataSourcesRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourcesRequest + * @property {string|null} [parent] ListDataSourcesRequest parent + * @property {number|null} [pageSize] ListDataSourcesRequest pageSize + * @property {string|null} [pageToken] ListDataSourcesRequest pageToken + * @property {string|null} [filter] ListDataSourcesRequest filter + * @property {string|null} [orderBy] ListDataSourcesRequest orderBy + */ + + /** + * Constructs a new ListDataSourcesRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourcesRequest. + * @implements IListDataSourcesRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set + */ + function ListDataSourcesRequest(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]]; + } + + /** + * ListDataSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.parent = ""; + + /** + * ListDataSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageSize = 0; + + /** + * ListDataSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageToken = ""; + + /** + * ListDataSourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.filter = ""; + + /** + * ListDataSourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest instance + */ + ListDataSourcesRequest.create = function create(properties) { + return new ListDataSourcesRequest(properties); + }; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + */ + ListDataSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.ListDataSourcesRequest} message ListDataSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesRequest"; + }; + + return ListDataSourcesRequest; + })(); + + v1.ListDataSourcesResponse = (function() { + + /** + * Properties of a ListDataSourcesResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourcesResponse + * @property {Array.|null} [dataSources] ListDataSourcesResponse dataSources + * @property {string|null} [nextPageToken] ListDataSourcesResponse nextPageToken + * @property {Array.|null} [unreachable] ListDataSourcesResponse unreachable + */ + + /** + * Constructs a new ListDataSourcesResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourcesResponse. + * @implements IListDataSourcesResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set + */ + function ListDataSourcesResponse(properties) { + this.dataSources = []; + 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]]; + } + + /** + * ListDataSourcesResponse dataSources. + * @member {Array.} dataSources + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.dataSources = $util.emptyArray; + + /** + * ListDataSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.nextPageToken = ""; + + /** + * ListDataSourcesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse instance + */ + ListDataSourcesResponse.create = function create(properties) { + return new ListDataSourcesResponse(properties); + }; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSources != null && message.dataSources.length) + for (var i = 0; i < message.dataSources.length; ++i) + $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataSources && message.dataSources.length)) + message.dataSources = []; + message.dataSources.push($root.google.cloud.backupdr.v1.DataSource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSources != null && message.hasOwnProperty("dataSources")) { + if (!Array.isArray(message.dataSources)) + return "dataSources: array expected"; + for (var i = 0; i < message.dataSources.length; ++i) { + var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSources[i]); + if (error) + return "dataSources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + */ + ListDataSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); + if (object.dataSources) { + if (!Array.isArray(object.dataSources)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: array expected"); + message.dataSources = []; + for (var i = 0; i < object.dataSources.length; ++i) { + if (typeof object.dataSources[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: object expected"); + message.dataSources[i] = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.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 ListDataSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} message ListDataSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataSources = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSources && message.dataSources.length) { + object.dataSources = []; + for (var j = 0; j < message.dataSources.length; ++j) + object.dataSources[j] = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + 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 ListDataSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesResponse"; + }; + + return ListDataSourcesResponse; + })(); + + v1.GetDataSourceRequest = (function() { + + /** + * Properties of a GetDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetDataSourceRequest + * @property {string|null} [name] GetDataSourceRequest name + */ + + /** + * Constructs a new GetDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetDataSourceRequest. + * @implements IGetDataSourceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set + */ + function GetDataSourceRequest(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]]; + } + + /** + * GetDataSourceRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @instance + */ + GetDataSourceRequest.prototype.name = ""; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest instance + */ + GetDataSourceRequest.create = function create(properties) { + return new GetDataSourceRequest(properties); + }; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataSourceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + */ + GetDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetDataSourceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.GetDataSourceRequest} message GetDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataSourceRequest.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 GetDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetDataSourceRequest"; + }; + + return GetDataSourceRequest; + })(); + + v1.UpdateDataSourceRequest = (function() { + + /** + * Properties of an UpdateDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateDataSourceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataSourceRequest updateMask + * @property {google.cloud.backupdr.v1.IDataSource|null} [dataSource] UpdateDataSourceRequest dataSource + * @property {string|null} [requestId] UpdateDataSourceRequest requestId + * @property {boolean|null} [allowMissing] UpdateDataSourceRequest allowMissing + */ + + /** + * Constructs a new UpdateDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateDataSourceRequest. + * @implements IUpdateDataSourceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set + */ + function UpdateDataSourceRequest(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]]; + } + + /** + * UpdateDataSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.updateMask = null; + + /** + * UpdateDataSourceRequest dataSource. + * @member {google.cloud.backupdr.v1.IDataSource|null|undefined} dataSource + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.dataSource = null; + + /** + * UpdateDataSourceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.requestId = ""; + + /** + * UpdateDataSourceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest instance + */ + UpdateDataSourceRequest.create = function create(properties) { + return new UpdateDataSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dataSource = $root.google.cloud.backupdr.v1.DataSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataSourceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) { + var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSource); + if (error) + return "dataSource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + */ + UpdateDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateDataSourceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.dataSource != null) { + if (typeof object.dataSource !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.dataSource: object expected"); + message.dataSource = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateDataSourceRequest} message UpdateDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.dataSource = null; + object.requestId = ""; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateDataSourceRequest"; + }; + + return UpdateDataSourceRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {google.cloud.backupdr.v1.BackupView|null} [view] ListBackupsRequest view + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.backupdr.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.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest view. + * @member {google.cloud.backupdr.v1.BackupView} view + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.view = 0; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.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 = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.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.cloud.backupdr.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.cloud.backupdr.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.backupdr.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.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.backupdr.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.backupdr.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.cloud.backupdr.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.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.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.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 (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.backupdr.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + 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.cloud.backupdr.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.cloud.backupdr.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.cloud.backupdr.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + * @property {google.cloud.backupdr.v1.BackupView|null} [view] GetBackupRequest view + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.backupdr.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.cloud.backupdr.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * GetBackupRequest view. + * @member {google.cloud.backupdr.v1.BackupView} view + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.view = 0; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.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 = ""; + object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.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.cloud.backupdr.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.cloud.backupdr.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.backupdr.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(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]]; + } + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.backupdr.v1.IBackup|null|undefined} backup + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.backupdr.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backup = $root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backup = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.backupdr.v1.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.backupdr.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.cloud.backupdr.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.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 = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.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.cloud.backupdr.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.cloud.backupdr.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.RestoreBackupRequest = (function() { + + /** + * Properties of a RestoreBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IRestoreBackupRequest + * @property {string|null} [name] RestoreBackupRequest name + * @property {string|null} [requestId] RestoreBackupRequest requestId + * @property {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null} [computeInstanceTargetEnvironment] RestoreBackupRequest computeInstanceTargetEnvironment + * @property {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null} [computeInstanceRestoreProperties] RestoreBackupRequest computeInstanceRestoreProperties + */ + + /** + * Constructs a new RestoreBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RestoreBackupRequest. + * @implements IRestoreBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set + */ + function RestoreBackupRequest(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]]; + } + + /** + * RestoreBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.name = ""; + + /** + * RestoreBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.requestId = ""; + + /** + * RestoreBackupRequest computeInstanceTargetEnvironment. + * @member {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null|undefined} computeInstanceTargetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.computeInstanceTargetEnvironment = null; + + /** + * RestoreBackupRequest computeInstanceRestoreProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null|undefined} computeInstanceRestoreProperties + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.computeInstanceRestoreProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreBackupRequest targetEnvironment. + * @member {"computeInstanceTargetEnvironment"|undefined} targetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + Object.defineProperty(RestoreBackupRequest.prototype, "targetEnvironment", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceTargetEnvironment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RestoreBackupRequest instanceProperties. + * @member {"computeInstanceRestoreProperties"|undefined} instanceProperties + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + Object.defineProperty(RestoreBackupRequest.prototype, "instanceProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceRestoreProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest instance + */ + RestoreBackupRequest.create = function create(properties) { + return new RestoreBackupRequest(properties); + }; + + /** + * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.computeInstanceTargetEnvironment != null && Object.hasOwnProperty.call(message, "computeInstanceTargetEnvironment")) + $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.encode(message.computeInstanceTargetEnvironment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.computeInstanceRestoreProperties != null && Object.hasOwnProperty.call(message, "computeInstanceRestoreProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.encode(message.computeInstanceRestoreProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { + properties.targetEnvironment = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify(message.computeInstanceTargetEnvironment); + if (error) + return "computeInstanceTargetEnvironment." + error; + } + } + if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { + properties.instanceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify(message.computeInstanceRestoreProperties); + if (error) + return "computeInstanceRestoreProperties." + error; + } + } + return null; + }; + + /** + * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + */ + RestoreBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.computeInstanceTargetEnvironment != null) { + if (typeof object.computeInstanceTargetEnvironment !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceTargetEnvironment: object expected"); + message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.fromObject(object.computeInstanceTargetEnvironment); + } + if (object.computeInstanceRestoreProperties != null) { + if (typeof object.computeInstanceRestoreProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceRestoreProperties: object expected"); + message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.fromObject(object.computeInstanceRestoreProperties); + } + return message; + }; + + /** + * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.RestoreBackupRequest} message RestoreBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { + object.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.toObject(message.computeInstanceTargetEnvironment, options); + if (options.oneofs) + object.targetEnvironment = "computeInstanceTargetEnvironment"; + } + if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { + object.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.toObject(message.computeInstanceRestoreProperties, options); + if (options.oneofs) + object.instanceProperties = "computeInstanceRestoreProperties"; + } + return object; + }; + + /** + * Converts this RestoreBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupRequest"; + }; + + return RestoreBackupRequest; + })(); + + v1.RestoreBackupResponse = (function() { + + /** + * Properties of a RestoreBackupResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IRestoreBackupResponse + * @property {google.cloud.backupdr.v1.ITargetResource|null} [targetResource] RestoreBackupResponse targetResource + */ + + /** + * Constructs a new RestoreBackupResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RestoreBackupResponse. + * @implements IRestoreBackupResponse + * @constructor + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set + */ + function RestoreBackupResponse(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]]; + } + + /** + * RestoreBackupResponse targetResource. + * @member {google.cloud.backupdr.v1.ITargetResource|null|undefined} targetResource + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @instance + */ + RestoreBackupResponse.prototype.targetResource = null; + + /** + * Creates a new RestoreBackupResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse instance + */ + RestoreBackupResponse.create = function create(properties) { + return new RestoreBackupResponse(properties); + }; + + /** + * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + $root.google.cloud.backupdr.v1.TargetResource.encode(message.targetResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreBackupResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreBackupResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) { + var error = $root.google.cloud.backupdr.v1.TargetResource.verify(message.targetResource); + if (error) + return "targetResource." + error; + } + return null; + }; + + /** + * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + */ + RestoreBackupResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); + if (object.targetResource != null) { + if (typeof object.targetResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupResponse.targetResource: object expected"); + message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.fromObject(object.targetResource); + } + return message; + }; + + /** + * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.RestoreBackupResponse} message RestoreBackupResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreBackupResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.targetResource = null; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) + object.targetResource = $root.google.cloud.backupdr.v1.TargetResource.toObject(message.targetResource, options); + return object; + }; + + /** + * Converts this RestoreBackupResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreBackupResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreBackupResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupResponse"; + }; + + return RestoreBackupResponse; + })(); + + v1.TargetResource = (function() { + + /** + * Properties of a TargetResource. + * @memberof google.cloud.backupdr.v1 + * @interface ITargetResource + * @property {google.cloud.backupdr.v1.IGcpResource|null} [gcpResource] TargetResource gcpResource + */ + + /** + * Constructs a new TargetResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a TargetResource. + * @implements ITargetResource + * @constructor + * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set + */ + function TargetResource(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]]; + } + + /** + * TargetResource gcpResource. + * @member {google.cloud.backupdr.v1.IGcpResource|null|undefined} gcpResource + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + */ + TargetResource.prototype.gcpResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetResource targetResourceInfo. + * @member {"gcpResource"|undefined} targetResourceInfo + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + */ + Object.defineProperty(TargetResource.prototype, "targetResourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["gcpResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource instance + */ + TargetResource.create = function create(properties) { + return new TargetResource(properties); + }; + + /** + * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResource != null && Object.hasOwnProperty.call(message, "gcpResource")) + $root.google.cloud.backupdr.v1.GcpResource.encode(message.gcpResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TargetResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + properties.targetResourceInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.GcpResource.verify(message.gcpResource); + if (error) + return "gcpResource." + error; + } + } + return null; + }; + + /** + * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + */ + TargetResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.TargetResource) + return object; + var message = new $root.google.cloud.backupdr.v1.TargetResource(); + if (object.gcpResource != null) { + if (typeof object.gcpResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.TargetResource.gcpResource: object expected"); + message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.fromObject(object.gcpResource); + } + return message; + }; + + /** + * Creates a plain object from a TargetResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.TargetResource} message TargetResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + object.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.toObject(message.gcpResource, options); + if (options.oneofs) + object.targetResourceInfo = "gcpResource"; + } + return object; + }; + + /** + * Converts this TargetResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + * @returns {Object.} JSON object + */ + TargetResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.TargetResource"; + }; + + return TargetResource; + })(); + + v1.GcpResource = (function() { + + /** + * Properties of a GcpResource. + * @memberof google.cloud.backupdr.v1 + * @interface IGcpResource + * @property {string|null} [gcpResourcename] GcpResource gcpResourcename + * @property {string|null} [location] GcpResource location + * @property {string|null} [type] GcpResource type + */ + + /** + * Constructs a new GcpResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GcpResource. + * @implements IGcpResource + * @constructor + * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set + */ + function GcpResource(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]]; + } + + /** + * GcpResource gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.gcpResourcename = ""; + + /** + * GcpResource location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.location = ""; + + /** + * GcpResource type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.type = ""; + + /** + * Creates a new GcpResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource instance + */ + GcpResource.create = function create(properties) { + return new GcpResource(properties); + }; + + /** + * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + return writer; + }; + + /** + * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcpResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcpResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + */ + GcpResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GcpResource) + return object; + var message = new $root.google.cloud.backupdr.v1.GcpResource(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a GcpResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.GcpResource} message GcpResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.location = ""; + object.type = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this GcpResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + * @returns {Object.} JSON object + */ + GcpResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpResource"; + }; + + return GcpResource; + })(); + + /** + * BackupConfigState enum. + * @name google.cloud.backupdr.v1.BackupConfigState + * @enum {number} + * @property {number} BACKUP_CONFIG_STATE_UNSPECIFIED=0 BACKUP_CONFIG_STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PASSIVE=2 PASSIVE value + */ + v1.BackupConfigState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_CONFIG_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PASSIVE"] = 2; + return values; + })(); + + /** + * BackupView enum. + * @name google.cloud.backupdr.v1.BackupView + * @enum {number} + * @property {number} BACKUP_VIEW_UNSPECIFIED=0 BACKUP_VIEW_UNSPECIFIED value + * @property {number} BACKUP_VIEW_BASIC=1 BACKUP_VIEW_BASIC value + * @property {number} BACKUP_VIEW_FULL=2 BACKUP_VIEW_FULL value + */ + v1.BackupView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP_VIEW_BASIC"] = 1; + values[valuesById[2] = "BACKUP_VIEW_FULL"] = 2; + return values; + })(); + + /** + * BackupVaultView enum. + * @name google.cloud.backupdr.v1.BackupVaultView + * @enum {number} + * @property {number} BACKUP_VAULT_VIEW_UNSPECIFIED=0 BACKUP_VAULT_VIEW_UNSPECIFIED value + * @property {number} BACKUP_VAULT_VIEW_BASIC=1 BACKUP_VAULT_VIEW_BASIC value + * @property {number} BACKUP_VAULT_VIEW_FULL=2 BACKUP_VAULT_VIEW_FULL value + */ + v1.BackupVaultView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_VAULT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP_VAULT_VIEW_BASIC"] = 1; + values[valuesById[2] = "BACKUP_VAULT_VIEW_FULL"] = 2; + return values; + })(); + + v1.BackupApplianceBackupProperties = (function() { + + /** + * Properties of a BackupApplianceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceBackupProperties + * @property {number|null} [generationId] BackupApplianceBackupProperties generationId + * @property {google.protobuf.ITimestamp|null} [finalizeTime] BackupApplianceBackupProperties finalizeTime + * @property {google.protobuf.ITimestamp|null} [recoveryRangeStartTime] BackupApplianceBackupProperties recoveryRangeStartTime + * @property {google.protobuf.ITimestamp|null} [recoveryRangeEndTime] BackupApplianceBackupProperties recoveryRangeEndTime + */ + + /** + * Constructs a new BackupApplianceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceBackupProperties. + * @implements IBackupApplianceBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set + */ + function BackupApplianceBackupProperties(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]]; + } + + /** + * BackupApplianceBackupProperties generationId. + * @member {number|null|undefined} generationId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.generationId = null; + + /** + * BackupApplianceBackupProperties finalizeTime. + * @member {google.protobuf.ITimestamp|null|undefined} finalizeTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.finalizeTime = null; + + /** + * BackupApplianceBackupProperties recoveryRangeStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeStartTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.recoveryRangeStartTime = null; + + /** + * BackupApplianceBackupProperties recoveryRangeEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeEndTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.recoveryRangeEndTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupApplianceBackupProperties _generationId. + * @member {"generationId"|undefined} _generationId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_generationId", { + get: $util.oneOfGetter($oneOfFields = ["generationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupApplianceBackupProperties _finalizeTime. + * @member {"finalizeTime"|undefined} _finalizeTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_finalizeTime", { + get: $util.oneOfGetter($oneOfFields = ["finalizeTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupApplianceBackupProperties _recoveryRangeStartTime. + * @member {"recoveryRangeStartTime"|undefined} _recoveryRangeStartTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeStartTime", { + get: $util.oneOfGetter($oneOfFields = ["recoveryRangeStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupApplianceBackupProperties _recoveryRangeEndTime. + * @member {"recoveryRangeEndTime"|undefined} _recoveryRangeEndTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeEndTime", { + get: $util.oneOfGetter($oneOfFields = ["recoveryRangeEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupApplianceBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties instance + */ + BackupApplianceBackupProperties.create = function create(properties) { + return new BackupApplianceBackupProperties(properties); + }; + + /** + * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generationId != null && Object.hasOwnProperty.call(message, "generationId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.generationId); + if (message.finalizeTime != null && Object.hasOwnProperty.call(message, "finalizeTime")) + $root.google.protobuf.Timestamp.encode(message.finalizeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.recoveryRangeStartTime != null && Object.hasOwnProperty.call(message, "recoveryRangeStartTime")) + $root.google.protobuf.Timestamp.encode(message.recoveryRangeStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryRangeEndTime != null && Object.hasOwnProperty.call(message, "recoveryRangeEndTime")) + $root.google.protobuf.Timestamp.encode(message.recoveryRangeEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.generationId = reader.int32(); + break; + } + case 2: { + message.finalizeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.generationId != null && message.hasOwnProperty("generationId")) { + properties._generationId = 1; + if (!$util.isInteger(message.generationId)) + return "generationId: integer expected"; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { + properties._finalizeTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.finalizeTime); + if (error) + return "finalizeTime." + error; + } + } + if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { + properties._recoveryRangeStartTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeStartTime); + if (error) + return "recoveryRangeStartTime." + error; + } + } + if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { + properties._recoveryRangeEndTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeEndTime); + if (error) + return "recoveryRangeEndTime." + error; + } + } + return null; + }; + + /** + * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + */ + BackupApplianceBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); + if (object.generationId != null) + message.generationId = object.generationId | 0; + if (object.finalizeTime != null) { + if (typeof object.finalizeTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.finalizeTime: object expected"); + message.finalizeTime = $root.google.protobuf.Timestamp.fromObject(object.finalizeTime); + } + if (object.recoveryRangeStartTime != null) { + if (typeof object.recoveryRangeStartTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeStartTime: object expected"); + message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeStartTime); + } + if (object.recoveryRangeEndTime != null) { + if (typeof object.recoveryRangeEndTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeEndTime: object expected"); + message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeEndTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceBackupProperties} message BackupApplianceBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.generationId != null && message.hasOwnProperty("generationId")) { + object.generationId = message.generationId; + if (options.oneofs) + object._generationId = "generationId"; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { + object.finalizeTime = $root.google.protobuf.Timestamp.toObject(message.finalizeTime, options); + if (options.oneofs) + object._finalizeTime = "finalizeTime"; + } + if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { + object.recoveryRangeStartTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeStartTime, options); + if (options.oneofs) + object._recoveryRangeStartTime = "recoveryRangeStartTime"; + } + if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { + object.recoveryRangeEndTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeEndTime, options); + if (options.oneofs) + object._recoveryRangeEndTime = "recoveryRangeEndTime"; + } + return object; + }; + + /** + * Converts this BackupApplianceBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupProperties"; + }; + + return BackupApplianceBackupProperties; + })(); + + v1.ComputeInstanceBackupProperties = (function() { + + /** + * Properties of a ComputeInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceBackupProperties + * @property {string|null} [description] ComputeInstanceBackupProperties description + * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceBackupProperties tags + * @property {string|null} [machineType] ComputeInstanceBackupProperties machineType + * @property {boolean|null} [canIpForward] ComputeInstanceBackupProperties canIpForward + * @property {Array.|null} [networkInterface] ComputeInstanceBackupProperties networkInterface + * @property {Array.|null} [disk] ComputeInstanceBackupProperties disk + * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceBackupProperties metadata + * @property {Array.|null} [serviceAccount] ComputeInstanceBackupProperties serviceAccount + * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceBackupProperties scheduling + * @property {Array.|null} [guestAccelerator] ComputeInstanceBackupProperties guestAccelerator + * @property {string|null} [minCpuPlatform] ComputeInstanceBackupProperties minCpuPlatform + * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceBackupProperties keyRevocationActionType + * @property {string|null} [sourceInstance] ComputeInstanceBackupProperties sourceInstance + * @property {Object.|null} [labels] ComputeInstanceBackupProperties labels + */ + + /** + * Constructs a new ComputeInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceBackupProperties. + * @implements IComputeInstanceBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set + */ + function ComputeInstanceBackupProperties(properties) { + this.networkInterface = []; + this.disk = []; + this.serviceAccount = []; + this.guestAccelerator = []; + this.labels = {}; + 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]]; + } + + /** + * ComputeInstanceBackupProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.description = null; + + /** + * ComputeInstanceBackupProperties tags. + * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.tags = null; + + /** + * ComputeInstanceBackupProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.machineType = null; + + /** + * ComputeInstanceBackupProperties canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.canIpForward = null; + + /** + * ComputeInstanceBackupProperties networkInterface. + * @member {Array.} networkInterface + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.networkInterface = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties disk. + * @member {Array.} disk + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.disk = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties metadata. + * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.metadata = null; + + /** + * ComputeInstanceBackupProperties serviceAccount. + * @member {Array.} serviceAccount + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.serviceAccount = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties scheduling. + * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.scheduling = null; + + /** + * ComputeInstanceBackupProperties guestAccelerator. + * @member {Array.} guestAccelerator + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.guestAccelerator = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.minCpuPlatform = null; + + /** + * ComputeInstanceBackupProperties keyRevocationActionType. + * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.keyRevocationActionType = null; + + /** + * ComputeInstanceBackupProperties sourceInstance. + * @member {string|null|undefined} sourceInstance + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.sourceInstance = null; + + /** + * ComputeInstanceBackupProperties labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ComputeInstanceBackupProperties _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _tags. + * @member {"tags"|undefined} _tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _canIpForward. + * @member {"canIpForward"|undefined} _canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _scheduling. + * @member {"scheduling"|undefined} _scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _keyRevocationActionType. + * @member {"keyRevocationActionType"|undefined} _keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_keyRevocationActionType", { + get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _sourceInstance. + * @member {"sourceInstance"|undefined} _sourceInstance + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_sourceInstance", { + get: $util.oneOfGetter($oneOfFields = ["sourceInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComputeInstanceBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties instance + */ + ComputeInstanceBackupProperties.create = function create(properties) { + return new ComputeInstanceBackupProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.canIpForward); + if (message.networkInterface != null && message.networkInterface.length) + for (var i = 0; i < message.networkInterface.length; ++i) + $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterface[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.disk != null && message.disk.length) + for (var i = 0; i < message.disk.length; ++i) + $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disk[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceAccount != null && message.serviceAccount.length) + for (var i = 0; i < message.serviceAccount.length; ++i) + $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccount[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.guestAccelerator != null && message.guestAccelerator.length) + for (var i = 0; i < message.guestAccelerator.length; ++i) + $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerator[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.minCpuPlatform); + if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.sourceInstance); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceBackupProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); + break; + } + case 3: { + message.machineType = reader.string(); + break; + } + case 4: { + message.canIpForward = reader.bool(); + break; + } + case 5: { + if (!(message.networkInterface && message.networkInterface.length)) + message.networkInterface = []; + message.networkInterface.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.disk && message.disk.length)) + message.disk = []; + message.disk.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 7: { + message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.serviceAccount && message.serviceAccount.length)) + message.serviceAccount = []; + message.serviceAccount.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + } + case 9: { + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.guestAccelerator && message.guestAccelerator.length)) + message.guestAccelerator = []; + message.guestAccelerator.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + message.minCpuPlatform = reader.string(); + break; + } + case 12: { + message.keyRevocationActionType = reader.int32(); + break; + } + case 13: { + message.sourceInstance = reader.string(); + break; + } + case 14: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) { + if (!Array.isArray(message.networkInterface)) + return "networkInterface: array expected"; + for (var i = 0; i < message.networkInterface.length; ++i) { + var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterface[i]); + if (error) + return "networkInterface." + error; + } + } + if (message.disk != null && message.hasOwnProperty("disk")) { + if (!Array.isArray(message.disk)) + return "disk: array expected"; + for (var i = 0; i < message.disk.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disk[i]); + if (error) + return "disk." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + if (!Array.isArray(message.serviceAccount)) + return "serviceAccount: array expected"; + for (var i = 0; i < message.serviceAccount.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccount[i]); + if (error) + return "serviceAccount." + error; + } + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.guestAccelerator != null && message.hasOwnProperty("guestAccelerator")) { + if (!Array.isArray(message.guestAccelerator)) + return "guestAccelerator: array expected"; + for (var i = 0; i < message.guestAccelerator.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerator[i]); + if (error) + return "guestAccelerator." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + properties._keyRevocationActionType = 1; + switch (message.keyRevocationActionType) { + default: + return "keyRevocationActionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + properties._sourceInstance = 1; + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: string expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + */ + ComputeInstanceBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(); + if (object.description != null) + message.description = String(object.description); + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.tags: object expected"); + message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.networkInterface) { + if (!Array.isArray(object.networkInterface)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: array expected"); + message.networkInterface = []; + for (var i = 0; i < object.networkInterface.length; ++i) { + if (typeof object.networkInterface[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: object expected"); + message.networkInterface[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterface[i]); + } + } + if (object.disk) { + if (!Array.isArray(object.disk)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: array expected"); + message.disk = []; + for (var i = 0; i < object.disk.length; ++i) { + if (typeof object.disk[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: object expected"); + message.disk[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disk[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.metadata: object expected"); + message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); + } + if (object.serviceAccount) { + if (!Array.isArray(object.serviceAccount)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: array expected"); + message.serviceAccount = []; + for (var i = 0; i < object.serviceAccount.length; ++i) { + if (typeof object.serviceAccount[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: object expected"); + message.serviceAccount[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccount[i]); + } + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.scheduling: object expected"); + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); + } + if (object.guestAccelerator) { + if (!Array.isArray(object.guestAccelerator)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: array expected"); + message.guestAccelerator = []; + for (var i = 0; i < object.guestAccelerator.length; ++i) { + if (typeof object.guestAccelerator[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: object expected"); + message.guestAccelerator[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerator[i]); + } + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + switch (object.keyRevocationActionType) { + default: + if (typeof object.keyRevocationActionType === "number") { + message.keyRevocationActionType = object.keyRevocationActionType; + break; + } + break; + case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": + case 0: + message.keyRevocationActionType = 0; + break; + case "NONE": + case 1: + message.keyRevocationActionType = 1; + break; + case "STOP": + case 2: + message.keyRevocationActionType = 2; + break; + } + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} message ComputeInstanceBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkInterface = []; + object.disk = []; + object.serviceAccount = []; + object.guestAccelerator = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.networkInterface && message.networkInterface.length) { + object.networkInterface = []; + for (var j = 0; j < message.networkInterface.length; ++j) + object.networkInterface[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterface[j], options); + } + if (message.disk && message.disk.length) { + object.disk = []; + for (var j = 0; j < message.disk.length; ++j) + object.disk[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disk[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.serviceAccount && message.serviceAccount.length) { + object.serviceAccount = []; + for (var j = 0; j < message.serviceAccount.length; ++j) + object.serviceAccount[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccount[j], options); + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.guestAccelerator && message.guestAccelerator.length) { + object.guestAccelerator = []; + for (var j = 0; j < message.guestAccelerator.length; ++j) + object.guestAccelerator[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerator[j], options); + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; + if (options.oneofs) + object._keyRevocationActionType = "keyRevocationActionType"; + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + object.sourceInstance = message.sourceInstance; + if (options.oneofs) + object._sourceInstance = "sourceInstance"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this ComputeInstanceBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceBackupProperties"; + }; + + return ComputeInstanceBackupProperties; + })(); + + v1.ComputeInstanceRestoreProperties = (function() { + + /** + * Properties of a ComputeInstanceRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceRestoreProperties + * @property {string|null} [name] ComputeInstanceRestoreProperties name + * @property {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null} [advancedMachineFeatures] ComputeInstanceRestoreProperties advancedMachineFeatures + * @property {boolean|null} [canIpForward] ComputeInstanceRestoreProperties canIpForward + * @property {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] ComputeInstanceRestoreProperties confidentialInstanceConfig + * @property {boolean|null} [deletionProtection] ComputeInstanceRestoreProperties deletionProtection + * @property {string|null} [description] ComputeInstanceRestoreProperties description + * @property {Array.|null} [disks] ComputeInstanceRestoreProperties disks + * @property {google.cloud.backupdr.v1.IDisplayDevice|null} [displayDevice] ComputeInstanceRestoreProperties displayDevice + * @property {Array.|null} [guestAccelerators] ComputeInstanceRestoreProperties guestAccelerators + * @property {string|null} [hostname] ComputeInstanceRestoreProperties hostname + * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [instanceEncryptionKey] ComputeInstanceRestoreProperties instanceEncryptionKey + * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceRestoreProperties keyRevocationActionType + * @property {Object.|null} [labels] ComputeInstanceRestoreProperties labels + * @property {string|null} [machineType] ComputeInstanceRestoreProperties machineType + * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceRestoreProperties metadata + * @property {string|null} [minCpuPlatform] ComputeInstanceRestoreProperties minCpuPlatform + * @property {Array.|null} [networkInterfaces] ComputeInstanceRestoreProperties networkInterfaces + * @property {google.cloud.backupdr.v1.INetworkPerformanceConfig|null} [networkPerformanceConfig] ComputeInstanceRestoreProperties networkPerformanceConfig + * @property {google.cloud.backupdr.v1.IInstanceParams|null} [params] ComputeInstanceRestoreProperties params + * @property {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] ComputeInstanceRestoreProperties privateIpv6GoogleAccess + * @property {google.cloud.backupdr.v1.IAllocationAffinity|null} [allocationAffinity] ComputeInstanceRestoreProperties allocationAffinity + * @property {Array.|null} [resourcePolicies] ComputeInstanceRestoreProperties resourcePolicies + * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceRestoreProperties scheduling + * @property {Array.|null} [serviceAccounts] ComputeInstanceRestoreProperties serviceAccounts + * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceRestoreProperties tags + */ + + /** + * Constructs a new ComputeInstanceRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceRestoreProperties. + * @implements IComputeInstanceRestoreProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set + */ + function ComputeInstanceRestoreProperties(properties) { + this.disks = []; + this.guestAccelerators = []; + this.labels = {}; + this.networkInterfaces = []; + this.resourcePolicies = []; + this.serviceAccounts = []; + 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]]; + } + + /** + * ComputeInstanceRestoreProperties name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.name = null; + + /** + * ComputeInstanceRestoreProperties advancedMachineFeatures. + * @member {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null|undefined} advancedMachineFeatures + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.advancedMachineFeatures = null; + + /** + * ComputeInstanceRestoreProperties canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.canIpForward = null; + + /** + * ComputeInstanceRestoreProperties confidentialInstanceConfig. + * @member {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.confidentialInstanceConfig = null; + + /** + * ComputeInstanceRestoreProperties deletionProtection. + * @member {boolean|null|undefined} deletionProtection + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.deletionProtection = null; + + /** + * ComputeInstanceRestoreProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.description = null; + + /** + * ComputeInstanceRestoreProperties disks. + * @member {Array.} disks + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.disks = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties displayDevice. + * @member {google.cloud.backupdr.v1.IDisplayDevice|null|undefined} displayDevice + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.displayDevice = null; + + /** + * ComputeInstanceRestoreProperties guestAccelerators. + * @member {Array.} guestAccelerators + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.guestAccelerators = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties hostname. + * @member {string|null|undefined} hostname + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.hostname = null; + + /** + * ComputeInstanceRestoreProperties instanceEncryptionKey. + * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} instanceEncryptionKey + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.instanceEncryptionKey = null; + + /** + * ComputeInstanceRestoreProperties keyRevocationActionType. + * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.keyRevocationActionType = null; + + /** + * ComputeInstanceRestoreProperties labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.labels = $util.emptyObject; + + /** + * ComputeInstanceRestoreProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.machineType = null; + + /** + * ComputeInstanceRestoreProperties metadata. + * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.metadata = null; + + /** + * ComputeInstanceRestoreProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.minCpuPlatform = null; + + /** + * ComputeInstanceRestoreProperties networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.networkInterfaces = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties networkPerformanceConfig. + * @member {google.cloud.backupdr.v1.INetworkPerformanceConfig|null|undefined} networkPerformanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.networkPerformanceConfig = null; + + /** + * ComputeInstanceRestoreProperties params. + * @member {google.cloud.backupdr.v1.IInstanceParams|null|undefined} params + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.params = null; + + /** + * ComputeInstanceRestoreProperties privateIpv6GoogleAccess. + * @member {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null|undefined} privateIpv6GoogleAccess + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.privateIpv6GoogleAccess = null; + + /** + * ComputeInstanceRestoreProperties allocationAffinity. + * @member {google.cloud.backupdr.v1.IAllocationAffinity|null|undefined} allocationAffinity + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.allocationAffinity = null; + + /** + * ComputeInstanceRestoreProperties resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.resourcePolicies = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties scheduling. + * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.scheduling = null; + + /** + * ComputeInstanceRestoreProperties serviceAccounts. + * @member {Array.} serviceAccounts + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.serviceAccounts = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties tags. + * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.tags = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ComputeInstanceRestoreProperties _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _advancedMachineFeatures. + * @member {"advancedMachineFeatures"|undefined} _advancedMachineFeatures + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_advancedMachineFeatures", { + get: $util.oneOfGetter($oneOfFields = ["advancedMachineFeatures"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _canIpForward. + * @member {"canIpForward"|undefined} _canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _confidentialInstanceConfig. + * @member {"confidentialInstanceConfig"|undefined} _confidentialInstanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_confidentialInstanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["confidentialInstanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _deletionProtection. + * @member {"deletionProtection"|undefined} _deletionProtection + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_deletionProtection", { + get: $util.oneOfGetter($oneOfFields = ["deletionProtection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _displayDevice. + * @member {"displayDevice"|undefined} _displayDevice + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_displayDevice", { + get: $util.oneOfGetter($oneOfFields = ["displayDevice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _hostname. + * @member {"hostname"|undefined} _hostname + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_hostname", { + get: $util.oneOfGetter($oneOfFields = ["hostname"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _instanceEncryptionKey. + * @member {"instanceEncryptionKey"|undefined} _instanceEncryptionKey + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_instanceEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["instanceEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _keyRevocationActionType. + * @member {"keyRevocationActionType"|undefined} _keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_keyRevocationActionType", { + get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _networkPerformanceConfig. + * @member {"networkPerformanceConfig"|undefined} _networkPerformanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_networkPerformanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["networkPerformanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _params. + * @member {"params"|undefined} _params + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_params", { + get: $util.oneOfGetter($oneOfFields = ["params"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _privateIpv6GoogleAccess. + * @member {"privateIpv6GoogleAccess"|undefined} _privateIpv6GoogleAccess + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_privateIpv6GoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpv6GoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _allocationAffinity. + * @member {"allocationAffinity"|undefined} _allocationAffinity + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_allocationAffinity", { + get: $util.oneOfGetter($oneOfFields = ["allocationAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _scheduling. + * @member {"scheduling"|undefined} _scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _tags. + * @member {"tags"|undefined} _tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties instance + */ + ComputeInstanceRestoreProperties.create = function create(properties) { + return new ComputeInstanceRestoreProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceRestoreProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) + $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canIpForward); + if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) + $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deletionProtection); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayDevice != null && Object.hasOwnProperty.call(message, "displayDevice")) + $root.google.cloud.backupdr.v1.DisplayDevice.encode(message.displayDevice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.guestAccelerators != null && message.guestAccelerators.length) + for (var i = 0; i < message.guestAccelerators.length; ++i) + $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.hostname); + if (message.instanceEncryptionKey != null && Object.hasOwnProperty.call(message, "instanceEncryptionKey")) + $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.instanceEncryptionKey, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.machineType); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.minCpuPlatform); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.networkPerformanceConfig != null && Object.hasOwnProperty.call(message, "networkPerformanceConfig")) + $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.encode(message.networkPerformanceConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.cloud.backupdr.v1.InstanceParams.encode(message.params, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.privateIpv6GoogleAccess); + if (message.allocationAffinity != null && Object.hasOwnProperty.call(message, "allocationAffinity")) + $root.google.cloud.backupdr.v1.AllocationAffinity.encode(message.allocationAffinity, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.resourcePolicies[i]); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.serviceAccounts != null && message.serviceAccounts.length) + for (var i = 0; i < message.serviceAccounts.length; ++i) + $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccounts[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceRestoreProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceRestoreProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.decode(reader, reader.uint32()); + break; + } + case 3: { + message.canIpForward = reader.bool(); + break; + } + case 4: { + message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deletionProtection = reader.bool(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 8: { + message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.guestAccelerators && message.guestAccelerators.length)) + message.guestAccelerators = []; + message.guestAccelerators.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 10: { + message.hostname = reader.string(); + break; + } + case 11: { + message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 12: { + message.keyRevocationActionType = reader.int32(); + break; + } + case 13: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 14: { + message.machineType = reader.string(); + break; + } + case 15: { + message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); + break; + } + case 16: { + message.minCpuPlatform = reader.string(); + break; + } + case 17: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 18: { + message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.params = $root.google.cloud.backupdr.v1.InstanceParams.decode(reader, reader.uint32()); + break; + } + case 20: { + message.privateIpv6GoogleAccess = reader.int32(); + break; + } + case 21: { + message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.decode(reader, reader.uint32()); + break; + } + case 22: { + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + } + case 23: { + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); + break; + } + case 24: { + if (!(message.serviceAccounts && message.serviceAccounts.length)) + message.serviceAccounts = []; + message.serviceAccounts.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + } + case 26: { + message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceRestoreProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceRestoreProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceRestoreProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + properties._advancedMachineFeatures = 1; + { + var error = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.verify(message.advancedMachineFeatures); + if (error) + return "advancedMachineFeatures." + error; + } + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + properties._confidentialInstanceConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); + if (error) + return "confidentialInstanceConfig." + error; + } + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + properties._deletionProtection = 1; + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + properties._displayDevice = 1; + { + var error = $root.google.cloud.backupdr.v1.DisplayDevice.verify(message.displayDevice); + if (error) + return "displayDevice." + error; + } + } + if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { + if (!Array.isArray(message.guestAccelerators)) + return "guestAccelerators: array expected"; + for (var i = 0; i < message.guestAccelerators.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); + if (error) + return "guestAccelerators." + error; + } + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + properties._hostname = 1; + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + } + if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { + properties._instanceEncryptionKey = 1; + { + var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.instanceEncryptionKey); + if (error) + return "instanceEncryptionKey." + error; + } + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + properties._keyRevocationActionType = 1; + switch (message.keyRevocationActionType) { + default: + return "keyRevocationActionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { + properties._networkPerformanceConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.verify(message.networkPerformanceConfig); + if (error) + return "networkPerformanceConfig." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + properties._params = 1; + { + var error = $root.google.cloud.backupdr.v1.InstanceParams.verify(message.params); + if (error) + return "params." + error; + } + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + properties._privateIpv6GoogleAccess = 1; + switch (message.privateIpv6GoogleAccess) { + default: + return "privateIpv6GoogleAccess: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { + properties._allocationAffinity = 1; + { + var error = $root.google.cloud.backupdr.v1.AllocationAffinity.verify(message.allocationAffinity); + if (error) + return "allocationAffinity." + error; + } + } + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.serviceAccounts != null && message.hasOwnProperty("serviceAccounts")) { + if (!Array.isArray(message.serviceAccounts)) + return "serviceAccounts: array expected"; + for (var i = 0; i < message.serviceAccounts.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccounts[i]); + if (error) + return "serviceAccounts." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + return null; + }; + + /** + * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + */ + ComputeInstanceRestoreProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.advancedMachineFeatures != null) { + if (typeof object.advancedMachineFeatures !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.advancedMachineFeatures: object expected"); + message.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures); + } + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.confidentialInstanceConfig != null) { + if (typeof object.confidentialInstanceConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.confidentialInstanceConfig: object expected"); + message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); + } + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + if (object.description != null) + message.description = String(object.description); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: object expected"); + message.disks[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.displayDevice != null) { + if (typeof object.displayDevice !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.displayDevice: object expected"); + message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.fromObject(object.displayDevice); + } + if (object.guestAccelerators) { + if (!Array.isArray(object.guestAccelerators)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: array expected"); + message.guestAccelerators = []; + for (var i = 0; i < object.guestAccelerators.length; ++i) { + if (typeof object.guestAccelerators[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: object expected"); + message.guestAccelerators[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); + } + } + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.instanceEncryptionKey != null) { + if (typeof object.instanceEncryptionKey !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.instanceEncryptionKey: object expected"); + message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.instanceEncryptionKey); + } + switch (object.keyRevocationActionType) { + default: + if (typeof object.keyRevocationActionType === "number") { + message.keyRevocationActionType = object.keyRevocationActionType; + break; + } + break; + case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": + case 0: + message.keyRevocationActionType = 0; + break; + case "NONE": + case 1: + message.keyRevocationActionType = 1; + break; + case "STOP": + case 2: + message.keyRevocationActionType = 2; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.metadata: object expected"); + message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + if (object.networkPerformanceConfig != null) { + if (typeof object.networkPerformanceConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkPerformanceConfig: object expected"); + message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.fromObject(object.networkPerformanceConfig); + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.params: object expected"); + message.params = $root.google.cloud.backupdr.v1.InstanceParams.fromObject(object.params); + } + switch (object.privateIpv6GoogleAccess) { + default: + if (typeof object.privateIpv6GoogleAccess === "number") { + message.privateIpv6GoogleAccess = object.privateIpv6GoogleAccess; + break; + } + break; + case "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": + case 0: + message.privateIpv6GoogleAccess = 0; + break; + case "INHERIT_FROM_SUBNETWORK": + case 1: + message.privateIpv6GoogleAccess = 1; + break; + case "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": + case 2: + message.privateIpv6GoogleAccess = 2; + break; + case "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": + case 3: + message.privateIpv6GoogleAccess = 3; + break; + } + if (object.allocationAffinity != null) { + if (typeof object.allocationAffinity !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.allocationAffinity: object expected"); + message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.fromObject(object.allocationAffinity); + } + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.scheduling: object expected"); + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); + } + if (object.serviceAccounts) { + if (!Array.isArray(object.serviceAccounts)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: array expected"); + message.serviceAccounts = []; + for (var i = 0; i < object.serviceAccounts.length; ++i) { + if (typeof object.serviceAccounts[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: object expected"); + message.serviceAccounts[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccounts[i]); + } + } + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.tags: object expected"); + message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); + } + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceRestoreProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.disks = []; + object.guestAccelerators = []; + object.networkInterfaces = []; + object.resourcePolicies = []; + object.serviceAccounts = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + object.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); + if (options.oneofs) + object._advancedMachineFeatures = "advancedMachineFeatures"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + object.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); + if (options.oneofs) + object._confidentialInstanceConfig = "confidentialInstanceConfig"; + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + object.deletionProtection = message.deletionProtection; + if (options.oneofs) + object._deletionProtection = "deletionProtection"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disks[j], options); + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + object.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.toObject(message.displayDevice, options); + if (options.oneofs) + object._displayDevice = "displayDevice"; + } + if (message.guestAccelerators && message.guestAccelerators.length) { + object.guestAccelerators = []; + for (var j = 0; j < message.guestAccelerators.length; ++j) + object.guestAccelerators[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + object.hostname = message.hostname; + if (options.oneofs) + object._hostname = "hostname"; + } + if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { + object.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.instanceEncryptionKey, options); + if (options.oneofs) + object._instanceEncryptionKey = "instanceEncryptionKey"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; + if (options.oneofs) + object._keyRevocationActionType = "keyRevocationActionType"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { + object.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.toObject(message.networkPerformanceConfig, options); + if (options.oneofs) + object._networkPerformanceConfig = "networkPerformanceConfig"; + } + if (message.params != null && message.hasOwnProperty("params")) { + object.params = $root.google.cloud.backupdr.v1.InstanceParams.toObject(message.params, options); + if (options.oneofs) + object._params = "params"; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] === undefined ? message.privateIpv6GoogleAccess : $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; + if (options.oneofs) + object._privateIpv6GoogleAccess = "privateIpv6GoogleAccess"; + } + if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { + object.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.toObject(message.allocationAffinity, options); + if (options.oneofs) + object._allocationAffinity = "allocationAffinity"; + } + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.serviceAccounts && message.serviceAccounts.length) { + object.serviceAccounts = []; + for (var j = 0; j < message.serviceAccounts.length; ++j) + object.serviceAccounts[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccounts[j], options); + } + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + return object; + }; + + /** + * Converts this ComputeInstanceRestoreProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceRestoreProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceRestoreProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceRestoreProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceRestoreProperties"; + }; + + /** + * InstancePrivateIpv6GoogleAccess enum. + * @name google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess + * @enum {number} + * @property {number} INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED=0 INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED value + * @property {number} INHERIT_FROM_SUBNETWORK=1 INHERIT_FROM_SUBNETWORK value + * @property {number} ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE=2 ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE value + * @property {number} ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE=3 ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE value + */ + ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "INHERIT_FROM_SUBNETWORK"] = 1; + values[valuesById[2] = "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"] = 2; + values[valuesById[3] = "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"] = 3; + return values; + })(); + + return ComputeInstanceRestoreProperties; + })(); + + v1.ComputeInstanceTargetEnvironment = (function() { + + /** + * Properties of a ComputeInstanceTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceTargetEnvironment + * @property {string|null} [project] ComputeInstanceTargetEnvironment project + * @property {string|null} [zone] ComputeInstanceTargetEnvironment zone + */ + + /** + * Constructs a new ComputeInstanceTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceTargetEnvironment. + * @implements IComputeInstanceTargetEnvironment + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set + */ + function ComputeInstanceTargetEnvironment(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]]; + } + + /** + * ComputeInstanceTargetEnvironment project. + * @member {string} project + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + */ + ComputeInstanceTargetEnvironment.prototype.project = ""; + + /** + * ComputeInstanceTargetEnvironment zone. + * @member {string} zone + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + */ + ComputeInstanceTargetEnvironment.prototype.zone = ""; + + /** + * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment instance + */ + ComputeInstanceTargetEnvironment.create = function create(properties) { + return new ComputeInstanceTargetEnvironment(properties); + }; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceTargetEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceTargetEnvironment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceTargetEnvironment message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceTargetEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + */ + ComputeInstanceTargetEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceTargetEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.zone = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + return object; + }; + + /** + * Converts this ComputeInstanceTargetEnvironment to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceTargetEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceTargetEnvironment + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment"; + }; + + return ComputeInstanceTargetEnvironment; + })(); + + v1.ComputeInstanceDataSourceProperties = (function() { + + /** + * Properties of a ComputeInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceDataSourceProperties + * @property {string|null} [name] ComputeInstanceDataSourceProperties name + * @property {string|null} [description] ComputeInstanceDataSourceProperties description + * @property {string|null} [machineType] ComputeInstanceDataSourceProperties machineType + * @property {number|Long|null} [totalDiskCount] ComputeInstanceDataSourceProperties totalDiskCount + * @property {number|Long|null} [totalDiskSizeGb] ComputeInstanceDataSourceProperties totalDiskSizeGb + */ + + /** + * Constructs a new ComputeInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceDataSourceProperties. + * @implements IComputeInstanceDataSourceProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set + */ + function ComputeInstanceDataSourceProperties(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]]; + } + + /** + * ComputeInstanceDataSourceProperties name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.name = ""; + + /** + * ComputeInstanceDataSourceProperties description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.description = ""; + + /** + * ComputeInstanceDataSourceProperties machineType. + * @member {string} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.machineType = ""; + + /** + * ComputeInstanceDataSourceProperties totalDiskCount. + * @member {number|Long} totalDiskCount + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.totalDiskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeInstanceDataSourceProperties totalDiskSizeGb. + * @member {number|Long} totalDiskSizeGb + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.totalDiskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties instance + */ + ComputeInstanceDataSourceProperties.create = function create(properties) { + return new ComputeInstanceDataSourceProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceDataSourceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); + if (message.totalDiskCount != null && Object.hasOwnProperty.call(message, "totalDiskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalDiskCount); + if (message.totalDiskSizeGb != null && Object.hasOwnProperty.call(message, "totalDiskSizeGb")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalDiskSizeGb); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceDataSourceProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.machineType = reader.string(); + break; + } + case 4: { + message.totalDiskCount = reader.int64(); + break; + } + case 5: { + message.totalDiskSizeGb = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceDataSourceProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceDataSourceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) + if (!$util.isInteger(message.totalDiskCount) && !(message.totalDiskCount && $util.isInteger(message.totalDiskCount.low) && $util.isInteger(message.totalDiskCount.high))) + return "totalDiskCount: integer|Long expected"; + if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) + if (!$util.isInteger(message.totalDiskSizeGb) && !(message.totalDiskSizeGb && $util.isInteger(message.totalDiskSizeGb.low) && $util.isInteger(message.totalDiskSizeGb.high))) + return "totalDiskSizeGb: integer|Long expected"; + return null; + }; + + /** + * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + */ + ComputeInstanceDataSourceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.totalDiskCount != null) + if ($util.Long) + (message.totalDiskCount = $util.Long.fromValue(object.totalDiskCount)).unsigned = false; + else if (typeof object.totalDiskCount === "string") + message.totalDiskCount = parseInt(object.totalDiskCount, 10); + else if (typeof object.totalDiskCount === "number") + message.totalDiskCount = object.totalDiskCount; + else if (typeof object.totalDiskCount === "object") + message.totalDiskCount = new $util.LongBits(object.totalDiskCount.low >>> 0, object.totalDiskCount.high >>> 0).toNumber(); + if (object.totalDiskSizeGb != null) + if ($util.Long) + (message.totalDiskSizeGb = $util.Long.fromValue(object.totalDiskSizeGb)).unsigned = false; + else if (typeof object.totalDiskSizeGb === "string") + message.totalDiskSizeGb = parseInt(object.totalDiskSizeGb, 10); + else if (typeof object.totalDiskSizeGb === "number") + message.totalDiskSizeGb = object.totalDiskSizeGb; + else if (typeof object.totalDiskSizeGb === "object") + message.totalDiskSizeGb = new $util.LongBits(object.totalDiskSizeGb.low >>> 0, object.totalDiskSizeGb.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceDataSourceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.machineType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalDiskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalDiskCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalDiskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalDiskSizeGb = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) + if (typeof message.totalDiskCount === "number") + object.totalDiskCount = options.longs === String ? String(message.totalDiskCount) : message.totalDiskCount; + else + object.totalDiskCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskCount) : options.longs === Number ? new $util.LongBits(message.totalDiskCount.low >>> 0, message.totalDiskCount.high >>> 0).toNumber() : message.totalDiskCount; + if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) + if (typeof message.totalDiskSizeGb === "number") + object.totalDiskSizeGb = options.longs === String ? String(message.totalDiskSizeGb) : message.totalDiskSizeGb; + else + object.totalDiskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskSizeGb) : options.longs === Number ? new $util.LongBits(message.totalDiskSizeGb.low >>> 0, message.totalDiskSizeGb.high >>> 0).toNumber() : message.totalDiskSizeGb; + return object; + }; + + /** + * Converts this ComputeInstanceDataSourceProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceDataSourceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceDataSourceProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties"; + }; + + return ComputeInstanceDataSourceProperties; + })(); + + v1.AdvancedMachineFeatures = (function() { + + /** + * Properties of an AdvancedMachineFeatures. + * @memberof google.cloud.backupdr.v1 + * @interface IAdvancedMachineFeatures + * @property {boolean|null} [enableNestedVirtualization] AdvancedMachineFeatures enableNestedVirtualization + * @property {number|null} [threadsPerCore] AdvancedMachineFeatures threadsPerCore + * @property {number|null} [visibleCoreCount] AdvancedMachineFeatures visibleCoreCount + * @property {boolean|null} [enableUefiNetworking] AdvancedMachineFeatures enableUefiNetworking + */ + + /** + * Constructs a new AdvancedMachineFeatures. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AdvancedMachineFeatures. + * @implements IAdvancedMachineFeatures + * @constructor + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set + */ + function AdvancedMachineFeatures(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]]; + } + + /** + * AdvancedMachineFeatures enableNestedVirtualization. + * @member {boolean|null|undefined} enableNestedVirtualization + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.enableNestedVirtualization = null; + + /** + * AdvancedMachineFeatures threadsPerCore. + * @member {number|null|undefined} threadsPerCore + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.threadsPerCore = null; + + /** + * AdvancedMachineFeatures visibleCoreCount. + * @member {number|null|undefined} visibleCoreCount + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.visibleCoreCount = null; + + /** + * AdvancedMachineFeatures enableUefiNetworking. + * @member {boolean|null|undefined} enableUefiNetworking + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.enableUefiNetworking = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AdvancedMachineFeatures _enableNestedVirtualization. + * @member {"enableNestedVirtualization"|undefined} _enableNestedVirtualization + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableNestedVirtualization", { + get: $util.oneOfGetter($oneOfFields = ["enableNestedVirtualization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AdvancedMachineFeatures _threadsPerCore. + * @member {"threadsPerCore"|undefined} _threadsPerCore + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_threadsPerCore", { + get: $util.oneOfGetter($oneOfFields = ["threadsPerCore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AdvancedMachineFeatures _visibleCoreCount. + * @member {"visibleCoreCount"|undefined} _visibleCoreCount + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_visibleCoreCount", { + get: $util.oneOfGetter($oneOfFields = ["visibleCoreCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AdvancedMachineFeatures _enableUefiNetworking. + * @member {"enableUefiNetworking"|undefined} _enableUefiNetworking + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableUefiNetworking", { + get: $util.oneOfGetter($oneOfFields = ["enableUefiNetworking"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures instance + */ + AdvancedMachineFeatures.create = function create(properties) { + return new AdvancedMachineFeatures(properties); + }; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableNestedVirtualization != null && Object.hasOwnProperty.call(message, "enableNestedVirtualization")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableNestedVirtualization); + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threadsPerCore); + if (message.visibleCoreCount != null && Object.hasOwnProperty.call(message, "visibleCoreCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.visibleCoreCount); + if (message.enableUefiNetworking != null && Object.hasOwnProperty.call(message, "enableUefiNetworking")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableUefiNetworking); + return writer; + }; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableNestedVirtualization = reader.bool(); + break; + } + case 2: { + message.threadsPerCore = reader.int32(); + break; + } + case 3: { + message.visibleCoreCount = reader.int32(); + break; + } + case 4: { + message.enableUefiNetworking = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedMachineFeatures message. + * @function verify + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedMachineFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + properties._enableNestedVirtualization = 1; + if (typeof message.enableNestedVirtualization !== "boolean") + return "enableNestedVirtualization: boolean expected"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + properties._threadsPerCore = 1; + if (!$util.isInteger(message.threadsPerCore)) + return "threadsPerCore: integer expected"; + } + if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { + properties._visibleCoreCount = 1; + if (!$util.isInteger(message.visibleCoreCount)) + return "visibleCoreCount: integer expected"; + } + if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { + properties._enableUefiNetworking = 1; + if (typeof message.enableUefiNetworking !== "boolean") + return "enableUefiNetworking: boolean expected"; + } + return null; + }; + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + */ + AdvancedMachineFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AdvancedMachineFeatures) + return object; + var message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); + if (object.enableNestedVirtualization != null) + message.enableNestedVirtualization = Boolean(object.enableNestedVirtualization); + if (object.threadsPerCore != null) + message.threadsPerCore = object.threadsPerCore | 0; + if (object.visibleCoreCount != null) + message.visibleCoreCount = object.visibleCoreCount | 0; + if (object.enableUefiNetworking != null) + message.enableUefiNetworking = Boolean(object.enableUefiNetworking); + return message; + }; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.AdvancedMachineFeatures} message AdvancedMachineFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedMachineFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + object.enableNestedVirtualization = message.enableNestedVirtualization; + if (options.oneofs) + object._enableNestedVirtualization = "enableNestedVirtualization"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + object.threadsPerCore = message.threadsPerCore; + if (options.oneofs) + object._threadsPerCore = "threadsPerCore"; + } + if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { + object.visibleCoreCount = message.visibleCoreCount; + if (options.oneofs) + object._visibleCoreCount = "visibleCoreCount"; + } + if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { + object.enableUefiNetworking = message.enableUefiNetworking; + if (options.oneofs) + object._enableUefiNetworking = "enableUefiNetworking"; + } + return object; + }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + * @returns {Object.} JSON object + */ + AdvancedMachineFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedMachineFeatures + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedMachineFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AdvancedMachineFeatures"; + }; + + return AdvancedMachineFeatures; + })(); + + v1.ConfidentialInstanceConfig = (function() { + + /** + * Properties of a ConfidentialInstanceConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IConfidentialInstanceConfig + * @property {boolean|null} [enableConfidentialCompute] ConfidentialInstanceConfig enableConfidentialCompute + */ + + /** + * Constructs a new ConfidentialInstanceConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ConfidentialInstanceConfig. + * @implements IConfidentialInstanceConfig + * @constructor + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig=} [properties] Properties to set + */ + function ConfidentialInstanceConfig(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]]; + } + + /** + * ConfidentialInstanceConfig enableConfidentialCompute. + * @member {boolean|null|undefined} enableConfidentialCompute + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @instance + */ + ConfidentialInstanceConfig.prototype.enableConfidentialCompute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConfidentialInstanceConfig _enableConfidentialCompute. + * @member {"enableConfidentialCompute"|undefined} _enableConfidentialCompute + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @instance + */ + Object.defineProperty(ConfidentialInstanceConfig.prototype, "_enableConfidentialCompute", { + get: $util.oneOfGetter($oneOfFields = ["enableConfidentialCompute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig instance + */ + ConfidentialInstanceConfig.create = function create(properties) { + return new ConfidentialInstanceConfig(properties); + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableConfidentialCompute); + return writer; + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableConfidentialCompute = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidentialInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + properties._enableConfidentialCompute = 1; + if (typeof message.enableConfidentialCompute !== "boolean") + return "enableConfidentialCompute: boolean expected"; + } + return null; + }; + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + */ + ConfidentialInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig(); + if (object.enableConfidentialCompute != null) + message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); + return message; + }; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.ConfidentialInstanceConfig} message ConfidentialInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidentialInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + object.enableConfidentialCompute = message.enableConfidentialCompute; + if (options.oneofs) + object._enableConfidentialCompute = "enableConfidentialCompute"; + } + return object; + }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ConfidentialInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidentialInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidentialInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ConfidentialInstanceConfig"; + }; + + return ConfidentialInstanceConfig; + })(); + + v1.DisplayDevice = (function() { + + /** + * Properties of a DisplayDevice. + * @memberof google.cloud.backupdr.v1 + * @interface IDisplayDevice + * @property {boolean|null} [enableDisplay] DisplayDevice enableDisplay + */ + + /** + * Constructs a new DisplayDevice. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DisplayDevice. + * @implements IDisplayDevice + * @constructor + * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set + */ + function DisplayDevice(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]]; + } + + /** + * DisplayDevice enableDisplay. + * @member {boolean|null|undefined} enableDisplay + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + */ + DisplayDevice.prototype.enableDisplay = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisplayDevice _enableDisplay. + * @member {"enableDisplay"|undefined} _enableDisplay + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + */ + Object.defineProperty(DisplayDevice.prototype, "_enableDisplay", { + get: $util.oneOfGetter($oneOfFields = ["enableDisplay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice instance + */ + DisplayDevice.create = function create(properties) { + return new DisplayDevice(properties); + }; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableDisplay != null && Object.hasOwnProperty.call(message, "enableDisplay")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableDisplay); + return writer; + }; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DisplayDevice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableDisplay = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisplayDevice message. + * @function verify + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisplayDevice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + properties._enableDisplay = 1; + if (typeof message.enableDisplay !== "boolean") + return "enableDisplay: boolean expected"; + } + return null; + }; + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + */ + DisplayDevice.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DisplayDevice) + return object; + var message = new $root.google.cloud.backupdr.v1.DisplayDevice(); + if (object.enableDisplay != null) + message.enableDisplay = Boolean(object.enableDisplay); + return message; + }; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.DisplayDevice} message DisplayDevice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisplayDevice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + object.enableDisplay = message.enableDisplay; + if (options.oneofs) + object._enableDisplay = "enableDisplay"; + } + return object; + }; + + /** + * Converts this DisplayDevice to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + * @returns {Object.} JSON object + */ + DisplayDevice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisplayDevice + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisplayDevice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DisplayDevice"; + }; + + return DisplayDevice; + })(); + + v1.AcceleratorConfig = (function() { + + /** + * Properties of an AcceleratorConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IAcceleratorConfig + * @property {string|null} [acceleratorType] AcceleratorConfig acceleratorType + * @property {number|null} [acceleratorCount] AcceleratorConfig acceleratorCount + */ + + /** + * Constructs a new AcceleratorConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AcceleratorConfig. + * @implements IAcceleratorConfig + * @constructor + * @param {google.cloud.backupdr.v1.IAcceleratorConfig=} [properties] Properties to set + */ + function AcceleratorConfig(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]]; + } + + /** + * AcceleratorConfig acceleratorType. + * @member {string|null|undefined} acceleratorType + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorType = null; + + /** + * AcceleratorConfig acceleratorCount. + * @member {number|null|undefined} acceleratorCount + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AcceleratorConfig _acceleratorType. + * @member {"acceleratorType"|undefined} _acceleratorType + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorType", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorConfig _acceleratorCount. + * @member {"acceleratorCount"|undefined} _acceleratorCount + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorCount", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.IAcceleratorConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig instance + */ + AcceleratorConfig.create = function create(properties) { + return new AcceleratorConfig(properties); + }; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.acceleratorType); + if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.acceleratorCount); + return writer; + }; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AcceleratorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.acceleratorType = reader.string(); + break; + } + case 2: { + message.acceleratorCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + properties._acceleratorType = 1; + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + properties._acceleratorCount = 1; + if (!$util.isInteger(message.acceleratorCount)) + return "acceleratorCount: integer expected"; + } + return null; + }; + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig + */ + AcceleratorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AcceleratorConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.AcceleratorConfig(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + if (object.acceleratorCount != null) + message.acceleratorCount = object.acceleratorCount | 0; + return message; + }; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.AcceleratorConfig} message AcceleratorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + object.acceleratorType = message.acceleratorType; + if (options.oneofs) + object._acceleratorType = "acceleratorType"; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + object.acceleratorCount = message.acceleratorCount; + if (options.oneofs) + object._acceleratorCount = "acceleratorCount"; + } + return object; + }; + + /** + * Converts this AcceleratorConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + * @returns {Object.} JSON object + */ + AcceleratorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcceleratorConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcceleratorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AcceleratorConfig"; + }; + + return AcceleratorConfig; + })(); + + v1.CustomerEncryptionKey = (function() { + + /** + * Properties of a CustomerEncryptionKey. + * @memberof google.cloud.backupdr.v1 + * @interface ICustomerEncryptionKey + * @property {string|null} [rawKey] CustomerEncryptionKey rawKey + * @property {string|null} [rsaEncryptedKey] CustomerEncryptionKey rsaEncryptedKey + * @property {string|null} [kmsKeyName] CustomerEncryptionKey kmsKeyName + * @property {string|null} [kmsKeyServiceAccount] CustomerEncryptionKey kmsKeyServiceAccount + */ + + /** + * Constructs a new CustomerEncryptionKey. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CustomerEncryptionKey. + * @implements ICustomerEncryptionKey + * @constructor + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set + */ + function CustomerEncryptionKey(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]]; + } + + /** + * CustomerEncryptionKey rawKey. + * @member {string|null|undefined} rawKey + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.rawKey = null; + + /** + * CustomerEncryptionKey rsaEncryptedKey. + * @member {string|null|undefined} rsaEncryptedKey + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.rsaEncryptedKey = null; + + /** + * CustomerEncryptionKey kmsKeyName. + * @member {string|null|undefined} kmsKeyName + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyName = null; + + /** + * CustomerEncryptionKey kmsKeyServiceAccount. + * @member {string|null|undefined} kmsKeyServiceAccount + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyServiceAccount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomerEncryptionKey key. + * @member {"rawKey"|"rsaEncryptedKey"|"kmsKeyName"|undefined} key + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["rawKey", "rsaEncryptedKey", "kmsKeyName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerEncryptionKey _kmsKeyServiceAccount. + * @member {"kmsKeyServiceAccount"|undefined} _kmsKeyServiceAccount + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "_kmsKeyServiceAccount", { + get: $util.oneOfGetter($oneOfFields = ["kmsKeyServiceAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey instance + */ + CustomerEncryptionKey.create = function create(properties) { + return new CustomerEncryptionKey(properties); + }; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rawKey != null && Object.hasOwnProperty.call(message, "rawKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rawKey); + if (message.rsaEncryptedKey != null && Object.hasOwnProperty.call(message, "rsaEncryptedKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rsaEncryptedKey); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyName); + if (message.kmsKeyServiceAccount != null && Object.hasOwnProperty.call(message, "kmsKeyServiceAccount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kmsKeyServiceAccount); + return writer; + }; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rawKey = reader.string(); + break; + } + case 2: { + message.rsaEncryptedKey = reader.string(); + break; + } + case 3: { + message.kmsKeyName = reader.string(); + break; + } + case 4: { + message.kmsKeyServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEncryptionKey message. + * @function verify + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEncryptionKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + properties.key = 1; + if (!$util.isString(message.rawKey)) + return "rawKey: string expected"; + } + if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { + if (properties.key === 1) + return "key: multiple values"; + properties.key = 1; + if (!$util.isString(message.rsaEncryptedKey)) + return "rsaEncryptedKey: string expected"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + if (properties.key === 1) + return "key: multiple values"; + properties.key = 1; + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + properties._kmsKeyServiceAccount = 1; + if (!$util.isString(message.kmsKeyServiceAccount)) + return "kmsKeyServiceAccount: string expected"; + } + return null; + }; + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + */ + CustomerEncryptionKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CustomerEncryptionKey) + return object; + var message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); + if (object.rawKey != null) + message.rawKey = String(object.rawKey); + if (object.rsaEncryptedKey != null) + message.rsaEncryptedKey = String(object.rsaEncryptedKey); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyServiceAccount != null) + message.kmsKeyServiceAccount = String(object.kmsKeyServiceAccount); + return message; + }; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.CustomerEncryptionKey} message CustomerEncryptionKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEncryptionKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + object.rawKey = message.rawKey; + if (options.oneofs) + object.key = "rawKey"; + } + if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { + object.rsaEncryptedKey = message.rsaEncryptedKey; + if (options.oneofs) + object.key = "rsaEncryptedKey"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + object.kmsKeyName = message.kmsKeyName; + if (options.oneofs) + object.key = "kmsKeyName"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + object.kmsKeyServiceAccount = message.kmsKeyServiceAccount; + if (options.oneofs) + object._kmsKeyServiceAccount = "kmsKeyServiceAccount"; + } + return object; + }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + * @returns {Object.} JSON object + */ + CustomerEncryptionKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerEncryptionKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CustomerEncryptionKey"; + }; + + return CustomerEncryptionKey; + })(); + + v1.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.backupdr.v1 + * @interface IEntry + * @property {string|null} [key] Entry key + * @property {string|null} [value] Entry value + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set + */ + function Entry(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]]; + } + + /** + * Entry key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Entry.prototype.key = null; + + /** + * Entry value. + * @member {string|null|undefined} value + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Entry.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Entry _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Object.defineProperty(Entry.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Entry _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Object.defineProperty(Entry.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Entry) + return object; + var message = new $root.google.cloud.backupdr.v1.Entry(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Entry"; + }; + + return Entry; + })(); + + v1.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.backupdr.v1 + * @interface IMetadata + * @property {Array.|null} [items] Metadata items + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.items = []; + 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]]; + } + + /** + * Metadata items. + * @member {Array.} items + * @memberof google.cloud.backupdr.v1.Metadata + * @instance + */ + Metadata.prototype.items = $util.emptyArray; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.backupdr.v1.Entry.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.backupdr.v1.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Entry.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Metadata) + return object; + var message = new $root.google.cloud.backupdr.v1.Metadata(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.backupdr.v1.Metadata.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Metadata.items: object expected"); + message.items[i] = $root.google.cloud.backupdr.v1.Entry.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.backupdr.v1.Entry.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Metadata"; + }; + + return Metadata; + })(); + + v1.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.backupdr.v1 + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {string|null} [ipAddress] NetworkInterface ipAddress + * @property {string|null} [ipv6Address] NetworkInterface ipv6Address + * @property {number|null} [internalIpv6PrefixLength] NetworkInterface internalIpv6PrefixLength + * @property {string|null} [name] NetworkInterface name + * @property {Array.|null} [accessConfigs] NetworkInterface accessConfigs + * @property {Array.|null} [ipv6AccessConfigs] NetworkInterface ipv6AccessConfigs + * @property {Array.|null} [aliasIpRanges] NetworkInterface aliasIpRanges + * @property {google.cloud.backupdr.v1.NetworkInterface.StackType|null} [stackType] NetworkInterface stackType + * @property {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null} [ipv6AccessType] NetworkInterface ipv6AccessType + * @property {number|null} [queueCount] NetworkInterface queueCount + * @property {google.cloud.backupdr.v1.NetworkInterface.NicType|null} [nicType] NetworkInterface nicType + * @property {string|null} [networkAttachment] NetworkInterface networkAttachment + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + this.accessConfigs = []; + this.ipv6AccessConfigs = []; + this.aliasIpRanges = []; + 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]]; + } + + /** + * NetworkInterface network. + * @member {string|null|undefined} network + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = null; + + /** + * NetworkInterface subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = null; + + /** + * NetworkInterface ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipAddress = null; + + /** + * NetworkInterface ipv6Address. + * @member {string|null|undefined} ipv6Address + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6Address = null; + + /** + * NetworkInterface internalIpv6PrefixLength. + * @member {number|null|undefined} internalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.internalIpv6PrefixLength = null; + + /** + * NetworkInterface name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.name = null; + + /** + * NetworkInterface accessConfigs. + * @member {Array.} accessConfigs + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.accessConfigs = $util.emptyArray; + + /** + * NetworkInterface ipv6AccessConfigs. + * @member {Array.} ipv6AccessConfigs + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6AccessConfigs = $util.emptyArray; + + /** + * NetworkInterface aliasIpRanges. + * @member {Array.} aliasIpRanges + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.aliasIpRanges = $util.emptyArray; + + /** + * NetworkInterface stackType. + * @member {google.cloud.backupdr.v1.NetworkInterface.StackType|null|undefined} stackType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.stackType = null; + + /** + * NetworkInterface ipv6AccessType. + * @member {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null|undefined} ipv6AccessType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6AccessType = null; + + /** + * NetworkInterface queueCount. + * @member {number|null|undefined} queueCount + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.queueCount = null; + + /** + * NetworkInterface nicType. + * @member {google.cloud.backupdr.v1.NetworkInterface.NicType|null|undefined} nicType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.nicType = null; + + /** + * NetworkInterface networkAttachment. + * @member {string|null|undefined} networkAttachment + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.networkAttachment = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkInterface _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _ipv6Address. + * @member {"ipv6Address"|undefined} _ipv6Address + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_ipv6Address", { + get: $util.oneOfGetter($oneOfFields = ["ipv6Address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _internalIpv6PrefixLength. + * @member {"internalIpv6PrefixLength"|undefined} _internalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_internalIpv6PrefixLength", { + get: $util.oneOfGetter($oneOfFields = ["internalIpv6PrefixLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _stackType. + * @member {"stackType"|undefined} _stackType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_stackType", { + get: $util.oneOfGetter($oneOfFields = ["stackType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _ipv6AccessType. + * @member {"ipv6AccessType"|undefined} _ipv6AccessType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_ipv6AccessType", { + get: $util.oneOfGetter($oneOfFields = ["ipv6AccessType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _queueCount. + * @member {"queueCount"|undefined} _queueCount + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_queueCount", { + get: $util.oneOfGetter($oneOfFields = ["queueCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _nicType. + * @member {"nicType"|undefined} _nicType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_nicType", { + get: $util.oneOfGetter($oneOfFields = ["nicType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _networkAttachment. + * @member {"networkAttachment"|undefined} _networkAttachment + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_networkAttachment", { + get: $util.oneOfGetter($oneOfFields = ["networkAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipv6Address); + if (message.internalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "internalIpv6PrefixLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.internalIpv6PrefixLength); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.accessConfigs != null && message.accessConfigs.length) + for (var i = 0; i < message.accessConfigs.length; ++i) + $root.google.cloud.backupdr.v1.AccessConfig.encode(message.accessConfigs[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.ipv6AccessConfigs != null && message.ipv6AccessConfigs.length) + for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) + $root.google.cloud.backupdr.v1.AccessConfig.encode(message.ipv6AccessConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.aliasIpRanges != null && message.aliasIpRanges.length) + for (var i = 0; i < message.aliasIpRanges.length; ++i) + $root.google.cloud.backupdr.v1.AliasIpRange.encode(message.aliasIpRanges[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.stackType != null && Object.hasOwnProperty.call(message, "stackType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.stackType); + if (message.ipv6AccessType != null && Object.hasOwnProperty.call(message, "ipv6AccessType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.ipv6AccessType); + if (message.queueCount != null && Object.hasOwnProperty.call(message, "queueCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.queueCount); + if (message.nicType != null && Object.hasOwnProperty.call(message, "nicType")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.nicType); + if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.networkAttachment); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.ipAddress = reader.string(); + break; + } + case 4: { + message.ipv6Address = reader.string(); + break; + } + case 5: { + message.internalIpv6PrefixLength = reader.int32(); + break; + } + case 6: { + message.name = reader.string(); + break; + } + case 7: { + if (!(message.accessConfigs && message.accessConfigs.length)) + message.accessConfigs = []; + message.accessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.ipv6AccessConfigs && message.ipv6AccessConfigs.length)) + message.ipv6AccessConfigs = []; + message.ipv6AccessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.aliasIpRanges && message.aliasIpRanges.length)) + message.aliasIpRanges = []; + message.aliasIpRanges.push($root.google.cloud.backupdr.v1.AliasIpRange.decode(reader, reader.uint32())); + break; + } + case 10: { + message.stackType = reader.int32(); + break; + } + case 11: { + message.ipv6AccessType = reader.int32(); + break; + } + case 12: { + message.queueCount = reader.int32(); + break; + } + case 13: { + message.nicType = reader.int32(); + break; + } + case 14: { + message.networkAttachment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + properties._ipv6Address = 1; + if (!$util.isString(message.ipv6Address)) + return "ipv6Address: string expected"; + } + if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { + properties._internalIpv6PrefixLength = 1; + if (!$util.isInteger(message.internalIpv6PrefixLength)) + return "internalIpv6PrefixLength: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.accessConfigs != null && message.hasOwnProperty("accessConfigs")) { + if (!Array.isArray(message.accessConfigs)) + return "accessConfigs: array expected"; + for (var i = 0; i < message.accessConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.accessConfigs[i]); + if (error) + return "accessConfigs." + error; + } + } + if (message.ipv6AccessConfigs != null && message.hasOwnProperty("ipv6AccessConfigs")) { + if (!Array.isArray(message.ipv6AccessConfigs)) + return "ipv6AccessConfigs: array expected"; + for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.ipv6AccessConfigs[i]); + if (error) + return "ipv6AccessConfigs." + error; + } + } + if (message.aliasIpRanges != null && message.hasOwnProperty("aliasIpRanges")) { + if (!Array.isArray(message.aliasIpRanges)) + return "aliasIpRanges: array expected"; + for (var i = 0; i < message.aliasIpRanges.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AliasIpRange.verify(message.aliasIpRanges[i]); + if (error) + return "aliasIpRanges." + error; + } + } + if (message.stackType != null && message.hasOwnProperty("stackType")) { + properties._stackType = 1; + switch (message.stackType) { + default: + return "stackType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { + properties._ipv6AccessType = 1; + switch (message.ipv6AccessType) { + default: + return "ipv6AccessType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.queueCount != null && message.hasOwnProperty("queueCount")) { + properties._queueCount = 1; + if (!$util.isInteger(message.queueCount)) + return "queueCount: integer expected"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + properties._nicType = 1; + switch (message.nicType) { + default: + return "nicType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { + properties._networkAttachment = 1; + if (!$util.isString(message.networkAttachment)) + return "networkAttachment: string expected"; + } + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.NetworkInterface) + return object; + var message = new $root.google.cloud.backupdr.v1.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.ipv6Address != null) + message.ipv6Address = String(object.ipv6Address); + if (object.internalIpv6PrefixLength != null) + message.internalIpv6PrefixLength = object.internalIpv6PrefixLength | 0; + if (object.name != null) + message.name = String(object.name); + if (object.accessConfigs) { + if (!Array.isArray(object.accessConfigs)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: array expected"); + message.accessConfigs = []; + for (var i = 0; i < object.accessConfigs.length; ++i) { + if (typeof object.accessConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: object expected"); + message.accessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.accessConfigs[i]); + } + } + if (object.ipv6AccessConfigs) { + if (!Array.isArray(object.ipv6AccessConfigs)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: array expected"); + message.ipv6AccessConfigs = []; + for (var i = 0; i < object.ipv6AccessConfigs.length; ++i) { + if (typeof object.ipv6AccessConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: object expected"); + message.ipv6AccessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.ipv6AccessConfigs[i]); + } + } + if (object.aliasIpRanges) { + if (!Array.isArray(object.aliasIpRanges)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: array expected"); + message.aliasIpRanges = []; + for (var i = 0; i < object.aliasIpRanges.length; ++i) { + if (typeof object.aliasIpRanges[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: object expected"); + message.aliasIpRanges[i] = $root.google.cloud.backupdr.v1.AliasIpRange.fromObject(object.aliasIpRanges[i]); + } + } + switch (object.stackType) { + default: + if (typeof object.stackType === "number") { + message.stackType = object.stackType; + break; + } + break; + case "STACK_TYPE_UNSPECIFIED": + case 0: + message.stackType = 0; + break; + case "IPV4_ONLY": + case 1: + message.stackType = 1; + break; + case "IPV4_IPV6": + case 2: + message.stackType = 2; + break; + } + switch (object.ipv6AccessType) { + default: + if (typeof object.ipv6AccessType === "number") { + message.ipv6AccessType = object.ipv6AccessType; + break; + } + break; + case "UNSPECIFIED_IPV6_ACCESS_TYPE": + case 0: + message.ipv6AccessType = 0; + break; + case "INTERNAL": + case 1: + message.ipv6AccessType = 1; + break; + case "EXTERNAL": + case 2: + message.ipv6AccessType = 2; + break; + } + if (object.queueCount != null) + message.queueCount = object.queueCount | 0; + switch (object.nicType) { + default: + if (typeof object.nicType === "number") { + message.nicType = object.nicType; + break; + } + break; + case "NIC_TYPE_UNSPECIFIED": + case 0: + message.nicType = 0; + break; + case "VIRTIO_NET": + case 1: + message.nicType = 1; + break; + case "GVNIC": + case 2: + message.nicType = 2; + break; + } + if (object.networkAttachment != null) + message.networkAttachment = String(object.networkAttachment); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.accessConfigs = []; + object.ipv6AccessConfigs = []; + object.aliasIpRanges = []; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + object.ipv6Address = message.ipv6Address; + if (options.oneofs) + object._ipv6Address = "ipv6Address"; + } + if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { + object.internalIpv6PrefixLength = message.internalIpv6PrefixLength; + if (options.oneofs) + object._internalIpv6PrefixLength = "internalIpv6PrefixLength"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.accessConfigs && message.accessConfigs.length) { + object.accessConfigs = []; + for (var j = 0; j < message.accessConfigs.length; ++j) + object.accessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.accessConfigs[j], options); + } + if (message.ipv6AccessConfigs && message.ipv6AccessConfigs.length) { + object.ipv6AccessConfigs = []; + for (var j = 0; j < message.ipv6AccessConfigs.length; ++j) + object.ipv6AccessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.ipv6AccessConfigs[j], options); + } + if (message.aliasIpRanges && message.aliasIpRanges.length) { + object.aliasIpRanges = []; + for (var j = 0; j < message.aliasIpRanges.length; ++j) + object.aliasIpRanges[j] = $root.google.cloud.backupdr.v1.AliasIpRange.toObject(message.aliasIpRanges[j], options); + } + if (message.stackType != null && message.hasOwnProperty("stackType")) { + object.stackType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] === undefined ? message.stackType : $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] : message.stackType; + if (options.oneofs) + object._stackType = "stackType"; + } + if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { + object.ipv6AccessType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] === undefined ? message.ipv6AccessType : $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] : message.ipv6AccessType; + if (options.oneofs) + object._ipv6AccessType = "ipv6AccessType"; + } + if (message.queueCount != null && message.hasOwnProperty("queueCount")) { + object.queueCount = message.queueCount; + if (options.oneofs) + object._queueCount = "queueCount"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + object.nicType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] === undefined ? message.nicType : $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] : message.nicType; + if (options.oneofs) + object._nicType = "nicType"; + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { + object.networkAttachment = message.networkAttachment; + if (options.oneofs) + object._networkAttachment = "networkAttachment"; + } + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkInterface"; + }; + + /** + * StackType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.StackType + * @enum {number} + * @property {number} STACK_TYPE_UNSPECIFIED=0 STACK_TYPE_UNSPECIFIED value + * @property {number} IPV4_ONLY=1 IPV4_ONLY value + * @property {number} IPV4_IPV6=2 IPV4_IPV6 value + */ + NetworkInterface.StackType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STACK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IPV4_ONLY"] = 1; + values[valuesById[2] = "IPV4_IPV6"] = 2; + return values; + })(); + + /** + * Ipv6AccessType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType + * @enum {number} + * @property {number} UNSPECIFIED_IPV6_ACCESS_TYPE=0 UNSPECIFIED_IPV6_ACCESS_TYPE value + * @property {number} INTERNAL=1 INTERNAL value + * @property {number} EXTERNAL=2 EXTERNAL value + */ + NetworkInterface.Ipv6AccessType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED_IPV6_ACCESS_TYPE"] = 0; + values[valuesById[1] = "INTERNAL"] = 1; + values[valuesById[2] = "EXTERNAL"] = 2; + return values; + })(); + + /** + * NicType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.NicType + * @enum {number} + * @property {number} NIC_TYPE_UNSPECIFIED=0 NIC_TYPE_UNSPECIFIED value + * @property {number} VIRTIO_NET=1 VIRTIO_NET value + * @property {number} GVNIC=2 GVNIC value + */ + NetworkInterface.NicType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NIC_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTIO_NET"] = 1; + values[valuesById[2] = "GVNIC"] = 2; + return values; + })(); + + return NetworkInterface; + })(); + + v1.NetworkPerformanceConfig = (function() { + + /** + * Properties of a NetworkPerformanceConfig. + * @memberof google.cloud.backupdr.v1 + * @interface INetworkPerformanceConfig + * @property {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null} [totalEgressBandwidthTier] NetworkPerformanceConfig totalEgressBandwidthTier + */ + + /** + * Constructs a new NetworkPerformanceConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a NetworkPerformanceConfig. + * @implements INetworkPerformanceConfig + * @constructor + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set + */ + function NetworkPerformanceConfig(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]]; + } + + /** + * NetworkPerformanceConfig totalEgressBandwidthTier. + * @member {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null|undefined} totalEgressBandwidthTier + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + */ + NetworkPerformanceConfig.prototype.totalEgressBandwidthTier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkPerformanceConfig _totalEgressBandwidthTier. + * @member {"totalEgressBandwidthTier"|undefined} _totalEgressBandwidthTier + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + */ + Object.defineProperty(NetworkPerformanceConfig.prototype, "_totalEgressBandwidthTier", { + get: $util.oneOfGetter($oneOfFields = ["totalEgressBandwidthTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkPerformanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig instance + */ + NetworkPerformanceConfig.create = function create(properties) { + return new NetworkPerformanceConfig(properties); + }; + + /** + * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPerformanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalEgressBandwidthTier != null && Object.hasOwnProperty.call(message, "totalEgressBandwidthTier")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalEgressBandwidthTier); + return writer; + }; + + /** + * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPerformanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPerformanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.totalEgressBandwidthTier = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPerformanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPerformanceConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPerformanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { + properties._totalEgressBandwidthTier = 1; + switch (message.totalEgressBandwidthTier) { + default: + return "totalEgressBandwidthTier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + */ + NetworkPerformanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.NetworkPerformanceConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); + switch (object.totalEgressBandwidthTier) { + default: + if (typeof object.totalEgressBandwidthTier === "number") { + message.totalEgressBandwidthTier = object.totalEgressBandwidthTier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.totalEgressBandwidthTier = 0; + break; + case "DEFAULT": + case 1: + message.totalEgressBandwidthTier = 1; + break; + case "TIER_1": + case 2: + message.totalEgressBandwidthTier = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.NetworkPerformanceConfig} message NetworkPerformanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPerformanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { + object.totalEgressBandwidthTier = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] === undefined ? message.totalEgressBandwidthTier : $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] : message.totalEgressBandwidthTier; + if (options.oneofs) + object._totalEgressBandwidthTier = "totalEgressBandwidthTier"; + } + return object; + }; + + /** + * Converts this NetworkPerformanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkPerformanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPerformanceConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPerformanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkPerformanceConfig"; + }; + + /** + * Tier enum. + * @name google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} TIER_1=2 TIER_1 value + */ + NetworkPerformanceConfig.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "TIER_1"] = 2; + return values; + })(); + + return NetworkPerformanceConfig; + })(); + + v1.AccessConfig = (function() { + + /** + * Properties of an AccessConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IAccessConfig + * @property {google.cloud.backupdr.v1.AccessConfig.AccessType|null} [type] AccessConfig type + * @property {string|null} [name] AccessConfig name + * @property {string|null} [externalIp] AccessConfig externalIp + * @property {string|null} [externalIpv6] AccessConfig externalIpv6 + * @property {number|null} [externalIpv6PrefixLength] AccessConfig externalIpv6PrefixLength + * @property {boolean|null} [setPublicPtr] AccessConfig setPublicPtr + * @property {string|null} [publicPtrDomainName] AccessConfig publicPtrDomainName + * @property {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null} [networkTier] AccessConfig networkTier + */ + + /** + * Constructs a new AccessConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AccessConfig. + * @implements IAccessConfig + * @constructor + * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set + */ + function AccessConfig(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]]; + } + + /** + * AccessConfig type. + * @member {google.cloud.backupdr.v1.AccessConfig.AccessType|null|undefined} type + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.type = null; + + /** + * AccessConfig name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.name = null; + + /** + * AccessConfig externalIp. + * @member {string|null|undefined} externalIp + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIp = null; + + /** + * AccessConfig externalIpv6. + * @member {string|null|undefined} externalIpv6 + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIpv6 = null; + + /** + * AccessConfig externalIpv6PrefixLength. + * @member {number|null|undefined} externalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIpv6PrefixLength = null; + + /** + * AccessConfig setPublicPtr. + * @member {boolean|null|undefined} setPublicPtr + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.setPublicPtr = null; + + /** + * AccessConfig publicPtrDomainName. + * @member {string|null|undefined} publicPtrDomainName + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.publicPtrDomainName = null; + + /** + * AccessConfig networkTier. + * @member {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null|undefined} networkTier + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.networkTier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessConfig _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _externalIp. + * @member {"externalIp"|undefined} _externalIp + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_externalIp", { + get: $util.oneOfGetter($oneOfFields = ["externalIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _externalIpv6. + * @member {"externalIpv6"|undefined} _externalIpv6 + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_externalIpv6", { + get: $util.oneOfGetter($oneOfFields = ["externalIpv6"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _externalIpv6PrefixLength. + * @member {"externalIpv6PrefixLength"|undefined} _externalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_externalIpv6PrefixLength", { + get: $util.oneOfGetter($oneOfFields = ["externalIpv6PrefixLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _setPublicPtr. + * @member {"setPublicPtr"|undefined} _setPublicPtr + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_setPublicPtr", { + get: $util.oneOfGetter($oneOfFields = ["setPublicPtr"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _publicPtrDomainName. + * @member {"publicPtrDomainName"|undefined} _publicPtrDomainName + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_publicPtrDomainName", { + get: $util.oneOfGetter($oneOfFields = ["publicPtrDomainName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _networkTier. + * @member {"networkTier"|undefined} _networkTier + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_networkTier", { + get: $util.oneOfGetter($oneOfFields = ["networkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig instance + */ + AccessConfig.create = function create(properties) { + return new AccessConfig(properties); + }; + + /** + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalIp); + if (message.externalIpv6 != null && Object.hasOwnProperty.call(message, "externalIpv6")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.externalIpv6); + if (message.externalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "externalIpv6PrefixLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.externalIpv6PrefixLength); + if (message.setPublicPtr != null && Object.hasOwnProperty.call(message, "setPublicPtr")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.setPublicPtr); + if (message.publicPtrDomainName != null && Object.hasOwnProperty.call(message, "publicPtrDomainName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.publicPtrDomainName); + if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.networkTier); + return writer; + }; + + /** + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AccessConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.externalIp = reader.string(); + break; + } + case 4: { + message.externalIpv6 = reader.string(); + break; + } + case 5: { + message.externalIpv6PrefixLength = reader.int32(); + break; + } + case 6: { + message.setPublicPtr = reader.bool(); + break; + } + case 7: { + message.publicPtrDomainName = reader.string(); + break; + } + case 8: { + message.networkTier = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + properties._externalIp = 1; + if (!$util.isString(message.externalIp)) + return "externalIp: string expected"; + } + if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { + properties._externalIpv6 = 1; + if (!$util.isString(message.externalIpv6)) + return "externalIpv6: string expected"; + } + if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { + properties._externalIpv6PrefixLength = 1; + if (!$util.isInteger(message.externalIpv6PrefixLength)) + return "externalIpv6PrefixLength: integer expected"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + properties._setPublicPtr = 1; + if (typeof message.setPublicPtr !== "boolean") + return "setPublicPtr: boolean expected"; + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + properties._publicPtrDomainName = 1; + if (!$util.isString(message.publicPtrDomainName)) + return "publicPtrDomainName: string expected"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + properties._networkTier = 1; + switch (message.networkTier) { + default: + return "networkTier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + */ + AccessConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AccessConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.AccessConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "ACCESS_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ONE_TO_ONE_NAT": + case 1: + message.type = 1; + break; + case "DIRECT_IPV6": + case 2: + message.type = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.externalIp != null) + message.externalIp = String(object.externalIp); + if (object.externalIpv6 != null) + message.externalIpv6 = String(object.externalIpv6); + if (object.externalIpv6PrefixLength != null) + message.externalIpv6PrefixLength = object.externalIpv6PrefixLength | 0; + if (object.setPublicPtr != null) + message.setPublicPtr = Boolean(object.setPublicPtr); + if (object.publicPtrDomainName != null) + message.publicPtrDomainName = String(object.publicPtrDomainName); + switch (object.networkTier) { + default: + if (typeof object.networkTier === "number") { + message.networkTier = object.networkTier; + break; + } + break; + case "NETWORK_TIER_UNSPECIFIED": + case 0: + message.networkTier = 0; + break; + case "PREMIUM": + case 1: + message.networkTier = 1; + break; + case "STANDARD": + case 2: + message.networkTier = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.AccessConfig} message AccessConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + object.externalIp = message.externalIp; + if (options.oneofs) + object._externalIp = "externalIp"; + } + if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { + object.externalIpv6 = message.externalIpv6; + if (options.oneofs) + object._externalIpv6 = "externalIpv6"; + } + if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { + object.externalIpv6PrefixLength = message.externalIpv6PrefixLength; + if (options.oneofs) + object._externalIpv6PrefixLength = "externalIpv6PrefixLength"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + object.setPublicPtr = message.setPublicPtr; + if (options.oneofs) + object._setPublicPtr = "setPublicPtr"; + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + object.publicPtrDomainName = message.publicPtrDomainName; + if (options.oneofs) + object._publicPtrDomainName = "publicPtrDomainName"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + object.networkTier = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] === undefined ? message.networkTier : $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] : message.networkTier; + if (options.oneofs) + object._networkTier = "networkTier"; + } + return object; + }; + + /** + * Converts this AccessConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + * @returns {Object.} JSON object + */ + AccessConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AccessConfig"; + }; + + /** + * AccessType enum. + * @name google.cloud.backupdr.v1.AccessConfig.AccessType + * @enum {number} + * @property {number} ACCESS_TYPE_UNSPECIFIED=0 ACCESS_TYPE_UNSPECIFIED value + * @property {number} ONE_TO_ONE_NAT=1 ONE_TO_ONE_NAT value + * @property {number} DIRECT_IPV6=2 DIRECT_IPV6 value + */ + AccessConfig.AccessType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ONE_TO_ONE_NAT"] = 1; + values[valuesById[2] = "DIRECT_IPV6"] = 2; + return values; + })(); + + /** + * NetworkTier enum. + * @name google.cloud.backupdr.v1.AccessConfig.NetworkTier + * @enum {number} + * @property {number} NETWORK_TIER_UNSPECIFIED=0 NETWORK_TIER_UNSPECIFIED value + * @property {number} PREMIUM=1 PREMIUM value + * @property {number} STANDARD=2 STANDARD value + */ + AccessConfig.NetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NETWORK_TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "PREMIUM"] = 1; + values[valuesById[2] = "STANDARD"] = 2; + return values; + })(); + + return AccessConfig; + })(); + + v1.AliasIpRange = (function() { + + /** + * Properties of an AliasIpRange. + * @memberof google.cloud.backupdr.v1 + * @interface IAliasIpRange + * @property {string|null} [ipCidrRange] AliasIpRange ipCidrRange + * @property {string|null} [subnetworkRangeName] AliasIpRange subnetworkRangeName + */ + + /** + * Constructs a new AliasIpRange. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AliasIpRange. + * @implements IAliasIpRange + * @constructor + * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set + */ + function AliasIpRange(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]]; + } + + /** + * AliasIpRange ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.ipCidrRange = null; + + /** + * AliasIpRange subnetworkRangeName. + * @member {string|null|undefined} subnetworkRangeName + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.subnetworkRangeName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AliasIpRange _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + Object.defineProperty(AliasIpRange.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AliasIpRange _subnetworkRangeName. + * @member {"subnetworkRangeName"|undefined} _subnetworkRangeName + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + Object.defineProperty(AliasIpRange.prototype, "_subnetworkRangeName", { + get: $util.oneOfGetter($oneOfFields = ["subnetworkRangeName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AliasIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange instance + */ + AliasIpRange.create = function create(properties) { + return new AliasIpRange(properties); + }; + + /** + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipCidrRange); + if (message.subnetworkRangeName != null && Object.hasOwnProperty.call(message, "subnetworkRangeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetworkRangeName); + return writer; + }; + + /** + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AliasIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ipCidrRange = reader.string(); + break; + } + case 2: { + message.subnetworkRangeName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AliasIpRange message. + * @function verify + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AliasIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + properties._subnetworkRangeName = 1; + if (!$util.isString(message.subnetworkRangeName)) + return "subnetworkRangeName: string expected"; + } + return null; + }; + + /** + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + */ + AliasIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AliasIpRange) + return object; + var message = new $root.google.cloud.backupdr.v1.AliasIpRange(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.subnetworkRangeName != null) + message.subnetworkRangeName = String(object.subnetworkRangeName); + return message; + }; + + /** + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.AliasIpRange} message AliasIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AliasIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + object.subnetworkRangeName = message.subnetworkRangeName; + if (options.oneofs) + object._subnetworkRangeName = "subnetworkRangeName"; + } + return object; + }; + + /** + * Converts this AliasIpRange to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + * @returns {Object.} JSON object + */ + AliasIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AliasIpRange + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AliasIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AliasIpRange"; + }; + + return AliasIpRange; + })(); + + v1.InstanceParams = (function() { + + /** + * Properties of an InstanceParams. + * @memberof google.cloud.backupdr.v1 + * @interface IInstanceParams + * @property {Object.|null} [resourceManagerTags] InstanceParams resourceManagerTags + */ + + /** + * Constructs a new InstanceParams. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an InstanceParams. + * @implements IInstanceParams + * @constructor + * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set + */ + function InstanceParams(properties) { + this.resourceManagerTags = {}; + 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]]; + } + + /** + * InstanceParams resourceManagerTags. + * @member {Object.} resourceManagerTags + * @memberof google.cloud.backupdr.v1.InstanceParams + * @instance + */ + InstanceParams.prototype.resourceManagerTags = $util.emptyObject; + + /** + * Creates a new InstanceParams instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams instance + */ + InstanceParams.create = function create(properties) { + return new InstanceParams(properties); + }; + + /** + * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceManagerTags != null && Object.hasOwnProperty.call(message, "resourceManagerTags")) + for (var keys = Object.keys(message.resourceManagerTags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceManagerTags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InstanceParams(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.resourceManagerTags === $util.emptyObject) + message.resourceManagerTags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceManagerTags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceParams message. + * @function verify + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceManagerTags != null && message.hasOwnProperty("resourceManagerTags")) { + if (!$util.isObject(message.resourceManagerTags)) + return "resourceManagerTags: object expected"; + var key = Object.keys(message.resourceManagerTags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceManagerTags[key[i]])) + return "resourceManagerTags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + */ + InstanceParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.InstanceParams) + return object; + var message = new $root.google.cloud.backupdr.v1.InstanceParams(); + if (object.resourceManagerTags) { + if (typeof object.resourceManagerTags !== "object") + throw TypeError(".google.cloud.backupdr.v1.InstanceParams.resourceManagerTags: object expected"); + message.resourceManagerTags = {}; + for (var keys = Object.keys(object.resourceManagerTags), i = 0; i < keys.length; ++i) + message.resourceManagerTags[keys[i]] = String(object.resourceManagerTags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.InstanceParams} message InstanceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceManagerTags = {}; + var keys2; + if (message.resourceManagerTags && (keys2 = Object.keys(message.resourceManagerTags)).length) { + object.resourceManagerTags = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceManagerTags[keys2[j]] = message.resourceManagerTags[keys2[j]]; + } + return object; + }; + + /** + * Converts this InstanceParams to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.InstanceParams + * @instance + * @returns {Object.} JSON object + */ + InstanceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceParams + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.InstanceParams"; + }; + + return InstanceParams; + })(); + + v1.AllocationAffinity = (function() { + + /** + * Properties of an AllocationAffinity. + * @memberof google.cloud.backupdr.v1 + * @interface IAllocationAffinity + * @property {google.cloud.backupdr.v1.AllocationAffinity.Type|null} [consumeAllocationType] AllocationAffinity consumeAllocationType + * @property {string|null} [key] AllocationAffinity key + * @property {Array.|null} [values] AllocationAffinity values + */ + + /** + * Constructs a new AllocationAffinity. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AllocationAffinity. + * @implements IAllocationAffinity + * @constructor + * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set + */ + function AllocationAffinity(properties) { + this.values = []; + 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]]; + } + + /** + * AllocationAffinity consumeAllocationType. + * @member {google.cloud.backupdr.v1.AllocationAffinity.Type|null|undefined} consumeAllocationType + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.consumeAllocationType = null; + + /** + * AllocationAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.key = null; + + /** + * AllocationAffinity values. + * @member {Array.} values + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AllocationAffinity _consumeAllocationType. + * @member {"consumeAllocationType"|undefined} _consumeAllocationType + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + Object.defineProperty(AllocationAffinity.prototype, "_consumeAllocationType", { + get: $util.oneOfGetter($oneOfFields = ["consumeAllocationType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AllocationAffinity _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + Object.defineProperty(AllocationAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AllocationAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity instance + */ + AllocationAffinity.create = function create(properties) { + return new AllocationAffinity(properties); + }; + + /** + * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumeAllocationType != null && Object.hasOwnProperty.call(message, "consumeAllocationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.consumeAllocationType); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consumeAllocationType = reader.int32(); + break; + } + case 2: { + message.key = reader.string(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationAffinity message. + * @function verify + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { + properties._consumeAllocationType = 1; + switch (message.consumeAllocationType) { + default: + return "consumeAllocationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates an AllocationAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + */ + AllocationAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AllocationAffinity) + return object; + var message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); + switch (object.consumeAllocationType) { + default: + if (typeof object.consumeAllocationType === "number") { + message.consumeAllocationType = object.consumeAllocationType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.consumeAllocationType = 0; + break; + case "NO_RESERVATION": + case 1: + message.consumeAllocationType = 1; + break; + case "ANY_RESERVATION": + case 2: + message.consumeAllocationType = 2; + break; + case "SPECIFIC_RESERVATION": + case 3: + message.consumeAllocationType = 3; + break; + } + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.backupdr.v1.AllocationAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from an AllocationAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.AllocationAffinity} message AllocationAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { + object.consumeAllocationType = options.enums === String ? $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] === undefined ? message.consumeAllocationType : $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] : message.consumeAllocationType; + if (options.oneofs) + object._consumeAllocationType = "consumeAllocationType"; + } + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this AllocationAffinity to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + * @returns {Object.} JSON object + */ + AllocationAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllocationAffinity + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllocationAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AllocationAffinity"; + }; + + /** + * Type enum. + * @name google.cloud.backupdr.v1.AllocationAffinity.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} NO_RESERVATION=1 NO_RESERVATION value + * @property {number} ANY_RESERVATION=2 ANY_RESERVATION value + * @property {number} SPECIFIC_RESERVATION=3 SPECIFIC_RESERVATION value + */ + AllocationAffinity.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_RESERVATION"] = 1; + values[valuesById[2] = "ANY_RESERVATION"] = 2; + values[valuesById[3] = "SPECIFIC_RESERVATION"] = 3; + return values; + })(); + + return AllocationAffinity; + })(); + + v1.Scheduling = (function() { + + /** + * Properties of a Scheduling. + * @memberof google.cloud.backupdr.v1 + * @interface IScheduling + * @property {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null} [onHostMaintenance] Scheduling onHostMaintenance + * @property {boolean|null} [automaticRestart] Scheduling automaticRestart + * @property {boolean|null} [preemptible] Scheduling preemptible + * @property {Array.|null} [nodeAffinities] Scheduling nodeAffinities + * @property {number|null} [minNodeCpus] Scheduling minNodeCpus + * @property {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null} [provisioningModel] Scheduling provisioningModel + * @property {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null} [instanceTerminationAction] Scheduling instanceTerminationAction + * @property {google.cloud.backupdr.v1.ISchedulingDuration|null} [localSsdRecoveryTimeout] Scheduling localSsdRecoveryTimeout + */ + + /** + * Constructs a new Scheduling. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Scheduling. + * @implements IScheduling + * @constructor + * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set + */ + function Scheduling(properties) { + this.nodeAffinities = []; + 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]]; + } + + /** + * Scheduling onHostMaintenance. + * @member {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null|undefined} onHostMaintenance + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.onHostMaintenance = null; + + /** + * Scheduling automaticRestart. + * @member {boolean|null|undefined} automaticRestart + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.automaticRestart = null; + + /** + * Scheduling preemptible. + * @member {boolean|null|undefined} preemptible + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.preemptible = null; + + /** + * Scheduling nodeAffinities. + * @member {Array.} nodeAffinities + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.nodeAffinities = $util.emptyArray; + + /** + * Scheduling minNodeCpus. + * @member {number|null|undefined} minNodeCpus + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.minNodeCpus = null; + + /** + * Scheduling provisioningModel. + * @member {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null|undefined} provisioningModel + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.provisioningModel = null; + + /** + * Scheduling instanceTerminationAction. + * @member {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null|undefined} instanceTerminationAction + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.instanceTerminationAction = null; + + /** + * Scheduling localSsdRecoveryTimeout. + * @member {google.cloud.backupdr.v1.ISchedulingDuration|null|undefined} localSsdRecoveryTimeout + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.localSsdRecoveryTimeout = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Scheduling _onHostMaintenance. + * @member {"onHostMaintenance"|undefined} _onHostMaintenance + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_onHostMaintenance", { + get: $util.oneOfGetter($oneOfFields = ["onHostMaintenance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _automaticRestart. + * @member {"automaticRestart"|undefined} _automaticRestart + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_automaticRestart", { + get: $util.oneOfGetter($oneOfFields = ["automaticRestart"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _preemptible. + * @member {"preemptible"|undefined} _preemptible + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_preemptible", { + get: $util.oneOfGetter($oneOfFields = ["preemptible"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _minNodeCpus. + * @member {"minNodeCpus"|undefined} _minNodeCpus + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_minNodeCpus", { + get: $util.oneOfGetter($oneOfFields = ["minNodeCpus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _provisioningModel. + * @member {"provisioningModel"|undefined} _provisioningModel + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_provisioningModel", { + get: $util.oneOfGetter($oneOfFields = ["provisioningModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _instanceTerminationAction. + * @member {"instanceTerminationAction"|undefined} _instanceTerminationAction + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_instanceTerminationAction", { + get: $util.oneOfGetter($oneOfFields = ["instanceTerminationAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _localSsdRecoveryTimeout. + * @member {"localSsdRecoveryTimeout"|undefined} _localSsdRecoveryTimeout + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_localSsdRecoveryTimeout", { + get: $util.oneOfGetter($oneOfFields = ["localSsdRecoveryTimeout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Scheduling instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling instance + */ + Scheduling.create = function create(properties) { + return new Scheduling(properties); + }; + + /** + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onHostMaintenance != null && Object.hasOwnProperty.call(message, "onHostMaintenance")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.onHostMaintenance); + if (message.automaticRestart != null && Object.hasOwnProperty.call(message, "automaticRestart")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.automaticRestart); + if (message.preemptible != null && Object.hasOwnProperty.call(message, "preemptible")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preemptible); + if (message.nodeAffinities != null && message.nodeAffinities.length) + for (var i = 0; i < message.nodeAffinities.length; ++i) + $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.minNodeCpus != null && Object.hasOwnProperty.call(message, "minNodeCpus")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minNodeCpus); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.provisioningModel); + if (message.instanceTerminationAction != null && Object.hasOwnProperty.call(message, "instanceTerminationAction")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.instanceTerminationAction); + if (message.localSsdRecoveryTimeout != null && Object.hasOwnProperty.call(message, "localSsdRecoveryTimeout")) + $root.google.cloud.backupdr.v1.SchedulingDuration.encode(message.localSsdRecoveryTimeout, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.onHostMaintenance = reader.int32(); + break; + } + case 2: { + message.automaticRestart = reader.bool(); + break; + } + case 3: { + message.preemptible = reader.bool(); + break; + } + case 4: { + if (!(message.nodeAffinities && message.nodeAffinities.length)) + message.nodeAffinities = []; + message.nodeAffinities.push($root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.decode(reader, reader.uint32())); + break; + } + case 5: { + message.minNodeCpus = reader.int32(); + break; + } + case 6: { + message.provisioningModel = reader.int32(); + break; + } + case 7: { + message.instanceTerminationAction = reader.int32(); + break; + } + case 10: { + message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scheduling message. + * @function verify + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scheduling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + properties._onHostMaintenance = 1; + switch (message.onHostMaintenance) { + default: + return "onHostMaintenance: enum value expected"; + case 0: + case 1: + case 1000: + break; + } + } + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + properties._automaticRestart = 1; + if (typeof message.automaticRestart !== "boolean") + return "automaticRestart: boolean expected"; + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + properties._preemptible = 1; + if (typeof message.preemptible !== "boolean") + return "preemptible: boolean expected"; + } + if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { + if (!Array.isArray(message.nodeAffinities)) + return "nodeAffinities: array expected"; + for (var i = 0; i < message.nodeAffinities.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify(message.nodeAffinities[i]); + if (error) + return "nodeAffinities." + error; + } + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + properties._minNodeCpus = 1; + if (!$util.isInteger(message.minNodeCpus)) + return "minNodeCpus: integer expected"; + } + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { + properties._provisioningModel = 1; + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { + properties._instanceTerminationAction = 1; + switch (message.instanceTerminationAction) { + default: + return "instanceTerminationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { + properties._localSsdRecoveryTimeout = 1; + { + var error = $root.google.cloud.backupdr.v1.SchedulingDuration.verify(message.localSsdRecoveryTimeout); + if (error) + return "localSsdRecoveryTimeout." + error; + } + } + return null; + }; + + /** + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + */ + Scheduling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Scheduling) + return object; + var message = new $root.google.cloud.backupdr.v1.Scheduling(); + switch (object.onHostMaintenance) { + default: + if (typeof object.onHostMaintenance === "number") { + message.onHostMaintenance = object.onHostMaintenance; + break; + } + break; + case "ON_HOST_MAINTENANCE_UNSPECIFIED": + case 0: + message.onHostMaintenance = 0; + break; + case "TERMINATE": + case 1: + message.onHostMaintenance = 1; + break; + case "MIGRATE": + case 1000: + message.onHostMaintenance = 1000; + break; + } + if (object.automaticRestart != null) + message.automaticRestart = Boolean(object.automaticRestart); + if (object.preemptible != null) + message.preemptible = Boolean(object.preemptible); + if (object.nodeAffinities) { + if (!Array.isArray(object.nodeAffinities)) + throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: array expected"); + message.nodeAffinities = []; + for (var i = 0; i < object.nodeAffinities.length; ++i) { + if (typeof object.nodeAffinities[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: object expected"); + message.nodeAffinities[i] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.fromObject(object.nodeAffinities[i]); + } + } + if (object.minNodeCpus != null) + message.minNodeCpus = object.minNodeCpus | 0; + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + } + switch (object.instanceTerminationAction) { + default: + if (typeof object.instanceTerminationAction === "number") { + message.instanceTerminationAction = object.instanceTerminationAction; + break; + } + break; + case "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": + case 0: + message.instanceTerminationAction = 0; + break; + case "DELETE": + case 1: + message.instanceTerminationAction = 1; + break; + case "STOP": + case 2: + message.instanceTerminationAction = 2; + break; + } + if (object.localSsdRecoveryTimeout != null) { + if (typeof object.localSsdRecoveryTimeout !== "object") + throw TypeError(".google.cloud.backupdr.v1.Scheduling.localSsdRecoveryTimeout: object expected"); + message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.fromObject(object.localSsdRecoveryTimeout); + } + return message; + }; + + /** + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.Scheduling} message Scheduling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scheduling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeAffinities = []; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + object.onHostMaintenance = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] === undefined ? message.onHostMaintenance : $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] : message.onHostMaintenance; + if (options.oneofs) + object._onHostMaintenance = "onHostMaintenance"; + } + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + object.automaticRestart = message.automaticRestart; + if (options.oneofs) + object._automaticRestart = "automaticRestart"; + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + object.preemptible = message.preemptible; + if (options.oneofs) + object._preemptible = "preemptible"; + } + if (message.nodeAffinities && message.nodeAffinities.length) { + object.nodeAffinities = []; + for (var j = 0; j < message.nodeAffinities.length; ++j) + object.nodeAffinities[j] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.toObject(message.nodeAffinities[j], options); + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + object.minNodeCpus = message.minNodeCpus; + if (options.oneofs) + object._minNodeCpus = "minNodeCpus"; + } + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { + object.provisioningModel = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (options.oneofs) + object._provisioningModel = "provisioningModel"; + } + if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { + object.instanceTerminationAction = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] === undefined ? message.instanceTerminationAction : $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] : message.instanceTerminationAction; + if (options.oneofs) + object._instanceTerminationAction = "instanceTerminationAction"; + } + if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { + object.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.toObject(message.localSsdRecoveryTimeout, options); + if (options.oneofs) + object._localSsdRecoveryTimeout = "localSsdRecoveryTimeout"; + } + return object; + }; + + /** + * Converts this Scheduling to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + * @returns {Object.} JSON object + */ + Scheduling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Scheduling + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Scheduling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling"; + }; + + /** + * OnHostMaintenance enum. + * @name google.cloud.backupdr.v1.Scheduling.OnHostMaintenance + * @enum {number} + * @property {number} ON_HOST_MAINTENANCE_UNSPECIFIED=0 ON_HOST_MAINTENANCE_UNSPECIFIED value + * @property {number} TERMINATE=1 TERMINATE value + * @property {number} MIGRATE=1000 MIGRATE value + */ + Scheduling.OnHostMaintenance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_HOST_MAINTENANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TERMINATE"] = 1; + values[valuesById[1000] = "MIGRATE"] = 1000; + return values; + })(); + + Scheduling.NodeAffinity = (function() { + + /** + * Properties of a NodeAffinity. + * @memberof google.cloud.backupdr.v1.Scheduling + * @interface INodeAffinity + * @property {string|null} [key] NodeAffinity key + * @property {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null} [operator] NodeAffinity operator + * @property {Array.|null} [values] NodeAffinity values + */ + + /** + * Constructs a new NodeAffinity. + * @memberof google.cloud.backupdr.v1.Scheduling + * @classdesc Represents a NodeAffinity. + * @implements INodeAffinity + * @constructor + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set + */ + function NodeAffinity(properties) { + this.values = []; + 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]]; + } + + /** + * NodeAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.key = null; + + /** + * NodeAffinity operator. + * @member {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null|undefined} operator + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.operator = null; + + /** + * NodeAffinity values. + * @member {Array.} values + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeAffinity _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + Object.defineProperty(NodeAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeAffinity _operator. + * @member {"operator"|undefined} _operator + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + Object.defineProperty(NodeAffinity.prototype, "_operator", { + get: $util.oneOfGetter($oneOfFields = ["operator"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity instance + */ + NodeAffinity.create = function create(properties) { + return new NodeAffinity(properties); + }; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operator); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.operator = reader.int32(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeAffinity message. + * @function verify + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + properties._operator = 1; + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + */ + NodeAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity) + return object; + var message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); + if (object.key != null) + message.key = String(object.key); + switch (object.operator) { + default: + if (typeof object.operator === "number") { + message.operator = object.operator; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.operator = 0; + break; + case "IN": + case 1: + message.operator = 1; + break; + case "NOT_IN": + case 2: + message.operator = 2; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.backupdr.v1.Scheduling.NodeAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.NodeAffinity} message NodeAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + object.operator = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] === undefined ? message.operator : $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] : message.operator; + if (options.oneofs) + object._operator = "operator"; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this NodeAffinity to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + * @returns {Object.} JSON object + */ + NodeAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeAffinity + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling.NodeAffinity"; + }; + + /** + * Operator enum. + * @name google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} IN=1 IN value + * @property {number} NOT_IN=2 NOT_IN value + */ + NodeAffinity.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN"] = 1; + values[valuesById[2] = "NOT_IN"] = 2; + return values; + })(); + + return NodeAffinity; + })(); + + /** + * ProvisioningModel enum. + * @name google.cloud.backupdr.v1.Scheduling.ProvisioningModel + * @enum {number} + * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SPOT=2 SPOT value + */ + Scheduling.ProvisioningModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SPOT"] = 2; + return values; + })(); + + /** + * InstanceTerminationAction enum. + * @name google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction + * @enum {number} + * @property {number} INSTANCE_TERMINATION_ACTION_UNSPECIFIED=0 INSTANCE_TERMINATION_ACTION_UNSPECIFIED value + * @property {number} DELETE=1 DELETE value + * @property {number} STOP=2 STOP value + */ + Scheduling.InstanceTerminationAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TERMINATION_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DELETE"] = 1; + values[valuesById[2] = "STOP"] = 2; + return values; + })(); + + return Scheduling; + })(); + + v1.SchedulingDuration = (function() { + + /** + * Properties of a SchedulingDuration. + * @memberof google.cloud.backupdr.v1 + * @interface ISchedulingDuration + * @property {number|Long|null} [seconds] SchedulingDuration seconds + * @property {number|null} [nanos] SchedulingDuration nanos + */ + + /** + * Constructs a new SchedulingDuration. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a SchedulingDuration. + * @implements ISchedulingDuration + * @constructor + * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set + */ + function SchedulingDuration(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]]; + } + + /** + * SchedulingDuration seconds. + * @member {number|Long|null|undefined} seconds + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + SchedulingDuration.prototype.seconds = null; + + /** + * SchedulingDuration nanos. + * @member {number|null|undefined} nanos + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + SchedulingDuration.prototype.nanos = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SchedulingDuration _seconds. + * @member {"seconds"|undefined} _seconds + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + Object.defineProperty(SchedulingDuration.prototype, "_seconds", { + get: $util.oneOfGetter($oneOfFields = ["seconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SchedulingDuration _nanos. + * @member {"nanos"|undefined} _nanos + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + Object.defineProperty(SchedulingDuration.prototype, "_nanos", { + get: $util.oneOfGetter($oneOfFields = ["nanos"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SchedulingDuration instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration instance + */ + SchedulingDuration.create = function create(properties) { + return new SchedulingDuration(properties); + }; + + /** + * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingDuration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingDuration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulingDuration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingDuration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchedulingDuration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingDuration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulingDuration message. + * @function verify + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulingDuration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.seconds != null && message.hasOwnProperty("seconds")) { + properties._seconds = 1; + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + } + if (message.nanos != null && message.hasOwnProperty("nanos")) { + properties._nanos = 1; + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + } + return null; + }; + + /** + * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + */ + SchedulingDuration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.SchedulingDuration) + return object; + var message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a SchedulingDuration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.SchedulingDuration} message SchedulingDuration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulingDuration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.seconds != null && message.hasOwnProperty("seconds")) { + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (options.oneofs) + object._seconds = "seconds"; + } + if (message.nanos != null && message.hasOwnProperty("nanos")) { + object.nanos = message.nanos; + if (options.oneofs) + object._nanos = "nanos"; + } + return object; + }; + + /** + * Converts this SchedulingDuration to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + * @returns {Object.} JSON object + */ + SchedulingDuration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulingDuration + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulingDuration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.SchedulingDuration"; + }; + + return SchedulingDuration; + })(); + + v1.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.backupdr.v1 + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + 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]]; + } + + /** + * ServiceAccount email. + * @member {string|null|undefined} email + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = null; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ServiceAccount _email. + * @member {"email"|undefined} _email + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + Object.defineProperty(ServiceAccount.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.email != null && message.hasOwnProperty("email")) { + properties._email = 1; + if (!$util.isString(message.email)) + return "email: string expected"; + } + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ServiceAccount) + return object; + var message = new $root.google.cloud.backupdr.v1.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.backupdr.v1.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceAccount"; + }; + + return ServiceAccount; + })(); + + v1.Tags = (function() { + + /** + * Properties of a Tags. + * @memberof google.cloud.backupdr.v1 + * @interface ITags + * @property {Array.|null} [items] Tags items + */ + + /** + * Constructs a new Tags. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Tags. + * @implements ITags + * @constructor + * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set + */ + function Tags(properties) { + this.items = []; + 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]]; + } + + /** + * Tags items. + * @member {Array.} items + * @memberof google.cloud.backupdr.v1.Tags + * @instance + */ + Tags.prototype.items = $util.emptyArray; + + /** + * Creates a new Tags instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Tags} Tags instance + */ + Tags.create = function create(properties) { + return new Tags(properties); + }; + + /** + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.items[i]); + return writer; + }; + + /** + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tags message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Tags(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tags message. + * @function verify + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) + if (!$util.isString(message.items[i])) + return "items: string[] expected"; + } + return null; + }; + + /** + * Creates a Tags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Tags} Tags + */ + Tags.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Tags) + return object; + var message = new $root.google.cloud.backupdr.v1.Tags(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.backupdr.v1.Tags.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) + message.items[i] = String(object.items[i]); + } + return message; + }; + + /** + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.Tags} message Tags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = message.items[j]; + } + return object; + }; + + /** + * Converts this Tags to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Tags + * @instance + * @returns {Object.} JSON object + */ + Tags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tags + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Tags"; + }; + + return Tags; + })(); + + v1.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.backupdr.v1 + * @interface IAttachedDisk + * @property {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null} [initializeParams] AttachedDisk initializeParams + * @property {string|null} [deviceName] AttachedDisk deviceName + * @property {string|null} [kind] AttachedDisk kind + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [diskTypeDeprecated] AttachedDisk diskTypeDeprecated + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null} [mode] AttachedDisk mode + * @property {string|null} [source] AttachedDisk source + * @property {number|Long|null} [index] AttachedDisk index + * @property {boolean|null} [boot] AttachedDisk boot + * @property {boolean|null} [autoDelete] AttachedDisk autoDelete + * @property {Array.|null} [license] AttachedDisk license + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null} [diskInterface] AttachedDisk diskInterface + * @property {Array.|null} [guestOsFeature] AttachedDisk guestOsFeature + * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] AttachedDisk diskEncryptionKey + * @property {number|Long|null} [diskSizeGb] AttachedDisk diskSizeGb + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null} [savedState] AttachedDisk savedState + * @property {string|null} [diskType] AttachedDisk diskType + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [type] AttachedDisk type + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + this.license = []; + this.guestOsFeature = []; + 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]]; + } + + /** + * AttachedDisk initializeParams. + * @member {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null|undefined} initializeParams + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.initializeParams = null; + + /** + * AttachedDisk deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = null; + + /** + * AttachedDisk kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.kind = null; + + /** + * AttachedDisk diskTypeDeprecated. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} diskTypeDeprecated + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskTypeDeprecated = null; + + /** + * AttachedDisk mode. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null|undefined} mode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.mode = null; + + /** + * AttachedDisk source. + * @member {string|null|undefined} source + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.source = null; + + /** + * AttachedDisk index. + * @member {number|Long|null|undefined} index + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.index = null; + + /** + * AttachedDisk boot. + * @member {boolean|null|undefined} boot + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.boot = null; + + /** + * AttachedDisk autoDelete. + * @member {boolean|null|undefined} autoDelete + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.autoDelete = null; + + /** + * AttachedDisk license. + * @member {Array.} license + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.license = $util.emptyArray; + + /** + * AttachedDisk diskInterface. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null|undefined} diskInterface + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskInterface = null; + + /** + * AttachedDisk guestOsFeature. + * @member {Array.} guestOsFeature + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.guestOsFeature = $util.emptyArray; + + /** + * AttachedDisk diskEncryptionKey. + * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskEncryptionKey = null; + + /** + * AttachedDisk diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskSizeGb = null; + + /** + * AttachedDisk savedState. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null|undefined} savedState + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.savedState = null; + + /** + * AttachedDisk diskType. + * @member {string|null|undefined} diskType + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskType = null; + + /** + * AttachedDisk type. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} type + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDisk _initializeParams. + * @member {"initializeParams"|undefined} _initializeParams + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_initializeParams", { + get: $util.oneOfGetter($oneOfFields = ["initializeParams"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _deviceName. + * @member {"deviceName"|undefined} _deviceName + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_deviceName", { + get: $util.oneOfGetter($oneOfFields = ["deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskTypeDeprecated. + * @member {"diskTypeDeprecated"|undefined} _diskTypeDeprecated + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskTypeDeprecated", { + get: $util.oneOfGetter($oneOfFields = ["diskTypeDeprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _mode. + * @member {"mode"|undefined} _mode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _index. + * @member {"index"|undefined} _index + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _boot. + * @member {"boot"|undefined} _boot + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_boot", { + get: $util.oneOfGetter($oneOfFields = ["boot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _autoDelete. + * @member {"autoDelete"|undefined} _autoDelete + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_autoDelete", { + get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskInterface. + * @member {"diskInterface"|undefined} _diskInterface + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskInterface", { + get: $util.oneOfGetter($oneOfFields = ["diskInterface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskEncryptionKey. + * @member {"diskEncryptionKey"|undefined} _diskEncryptionKey + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _savedState. + * @member {"savedState"|undefined} _savedState + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_savedState", { + get: $util.oneOfGetter($oneOfFields = ["savedState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskType. + * @member {"diskType"|undefined} _diskType + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskType", { + get: $util.oneOfGetter($oneOfFields = ["diskType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initializeParams != null && Object.hasOwnProperty.call(message, "initializeParams")) + $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.encode(message.initializeParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceName); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kind); + if (message.diskTypeDeprecated != null && Object.hasOwnProperty.call(message, "diskTypeDeprecated")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.diskTypeDeprecated); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.mode); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.source); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.index); + if (message.boot != null && Object.hasOwnProperty.call(message, "boot")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.boot); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.autoDelete); + if (message.license != null && message.license.length) + for (var i = 0; i < message.license.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.license[i]); + if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.diskInterface); + if (message.guestOsFeature != null && message.guestOsFeature.length) + for (var i = 0; i < message.guestOsFeature.length; ++i) + $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) + $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.diskSizeGb); + if (message.savedState != null && Object.hasOwnProperty.call(message, "savedState")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.savedState); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.diskType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.type); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.decode(reader, reader.uint32()); + break; + } + case 4: { + message.deviceName = reader.string(); + break; + } + case 5: { + message.kind = reader.string(); + break; + } + case 6: { + message.diskTypeDeprecated = reader.int32(); + break; + } + case 7: { + message.mode = reader.int32(); + break; + } + case 8: { + message.source = reader.string(); + break; + } + case 9: { + message.index = reader.int64(); + break; + } + case 10: { + message.boot = reader.bool(); + break; + } + case 11: { + message.autoDelete = reader.bool(); + break; + } + case 12: { + if (!(message.license && message.license.length)) + message.license = []; + message.license.push(reader.string()); + break; + } + case 13: { + message.diskInterface = reader.int32(); + break; + } + case 14: { + if (!(message.guestOsFeature && message.guestOsFeature.length)) + message.guestOsFeature = []; + message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + } + case 15: { + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 16: { + message.diskSizeGb = reader.int64(); + break; + } + case 17: { + message.savedState = reader.int32(); + break; + } + case 18: { + message.diskType = reader.string(); + break; + } + case 19: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + properties._initializeParams = 1; + { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify(message.initializeParams); + if (error) + return "initializeParams." + error; + } + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + properties._deviceName = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { + properties._diskTypeDeprecated = 1; + switch (message.diskTypeDeprecated) { + default: + return "diskTypeDeprecated: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + properties._boot = 1; + if (typeof message.boot !== "boolean") + return "boot: boolean expected"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + properties._autoDelete = 1; + if (typeof message.autoDelete !== "boolean") + return "autoDelete: boolean expected"; + } + if (message.license != null && message.hasOwnProperty("license")) { + if (!Array.isArray(message.license)) + return "license: array expected"; + for (var i = 0; i < message.license.length; ++i) + if (!$util.isString(message.license[i])) + return "license: string[] expected"; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { + properties._diskInterface = 1; + switch (message.diskInterface) { + default: + return "diskInterface: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { + if (!Array.isArray(message.guestOsFeature)) + return "guestOsFeature: array expected"; + for (var i = 0; i < message.guestOsFeature.length; ++i) { + var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); + if (error) + return "guestOsFeature." + error; + } + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + properties._diskEncryptionKey = 1; + { + var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); + if (error) + return "diskEncryptionKey." + error; + } + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message.savedState != null && message.hasOwnProperty("savedState")) { + properties._savedState = 1; + switch (message.savedState) { + default: + return "savedState: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + properties._diskType = 1; + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk) + return object; + var message = new $root.google.cloud.backupdr.v1.AttachedDisk(); + if (object.initializeParams != null) { + if (typeof object.initializeParams !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.initializeParams: object expected"); + message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.fromObject(object.initializeParams); + } + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.kind != null) + message.kind = String(object.kind); + switch (object.diskTypeDeprecated) { + default: + if (typeof object.diskTypeDeprecated === "number") { + message.diskTypeDeprecated = object.diskTypeDeprecated; + break; + } + break; + case "DISK_TYPE_UNSPECIFIED": + case 0: + message.diskTypeDeprecated = 0; + break; + case "SCRATCH": + case 1: + message.diskTypeDeprecated = 1; + break; + case "PERSISTENT": + case 2: + message.diskTypeDeprecated = 2; + break; + } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "DISK_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "READ_WRITE": + case 1: + message.mode = 1; + break; + case "READ_ONLY": + case 2: + message.mode = 2; + break; + case "LOCKED": + case 3: + message.mode = 3; + break; + } + if (object.source != null) + message.source = String(object.source); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.boot != null) + message.boot = Boolean(object.boot); + if (object.autoDelete != null) + message.autoDelete = Boolean(object.autoDelete); + if (object.license) { + if (!Array.isArray(object.license)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.license: array expected"); + message.license = []; + for (var i = 0; i < object.license.length; ++i) + message.license[i] = String(object.license[i]); + } + switch (object.diskInterface) { + default: + if (typeof object.diskInterface === "number") { + message.diskInterface = object.diskInterface; + break; + } + break; + case "DISK_INTERFACE_UNSPECIFIED": + case 0: + message.diskInterface = 0; + break; + case "SCSI": + case 1: + message.diskInterface = 1; + break; + case "NVME": + case 2: + message.diskInterface = 2; + break; + case "NVDIMM": + case 3: + message.diskInterface = 3; + break; + case "ISCSI": + case 4: + message.diskInterface = 4; + break; + } + if (object.guestOsFeature) { + if (!Array.isArray(object.guestOsFeature)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: array expected"); + message.guestOsFeature = []; + for (var i = 0; i < object.guestOsFeature.length; ++i) { + if (typeof object.guestOsFeature[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: object expected"); + message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); + } + } + if (object.diskEncryptionKey != null) { + if (typeof object.diskEncryptionKey !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.diskEncryptionKey: object expected"); + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); + } + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + switch (object.savedState) { + default: + if (typeof object.savedState === "number") { + message.savedState = object.savedState; + break; + } + break; + case "DISK_SAVED_STATE_UNSPECIFIED": + case 0: + message.savedState = 0; + break; + case "PRESERVED": + case 1: + message.savedState = 1; + break; + } + if (object.diskType != null) + message.diskType = String(object.diskType); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DISK_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SCRATCH": + case 1: + message.type = 1; + break; + case "PERSISTENT": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.license = []; + object.guestOsFeature = []; + } + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + object.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.toObject(message.initializeParams, options); + if (options.oneofs) + object._initializeParams = "initializeParams"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object._deviceName = "deviceName"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { + object.diskTypeDeprecated = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] === undefined ? message.diskTypeDeprecated : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] : message.diskTypeDeprecated; + if (options.oneofs) + object._diskTypeDeprecated = "diskTypeDeprecated"; + } + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] === undefined ? message.mode : $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.index != null && message.hasOwnProperty("index")) { + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (options.oneofs) + object._index = "index"; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + object.boot = message.boot; + if (options.oneofs) + object._boot = "boot"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + object.autoDelete = message.autoDelete; + if (options.oneofs) + object._autoDelete = "autoDelete"; + } + if (message.license && message.license.length) { + object.license = []; + for (var j = 0; j < message.license.length; ++j) + object.license[j] = message.license[j]; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { + object.diskInterface = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] === undefined ? message.diskInterface : $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] : message.diskInterface; + if (options.oneofs) + object._diskInterface = "diskInterface"; + } + if (message.guestOsFeature && message.guestOsFeature.length) { + object.guestOsFeature = []; + for (var j = 0; j < message.guestOsFeature.length; ++j) + object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + object.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); + if (options.oneofs) + object._diskEncryptionKey = "diskEncryptionKey"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message.savedState != null && message.hasOwnProperty("savedState")) { + object.savedState = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] === undefined ? message.savedState : $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] : message.savedState; + if (options.oneofs) + object._savedState = "savedState"; + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + object.diskType = message.diskType; + if (options.oneofs) + object._diskType = "diskType"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedDisk + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk"; + }; + + AttachedDisk.InitializeParams = (function() { + + /** + * Properties of an InitializeParams. + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @interface IInitializeParams + * @property {string|null} [diskName] InitializeParams diskName + * @property {Array.|null} [replicaZones] InitializeParams replicaZones + */ + + /** + * Constructs a new InitializeParams. + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @classdesc Represents an InitializeParams. + * @implements IInitializeParams + * @constructor + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set + */ + function InitializeParams(properties) { + this.replicaZones = []; + 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]]; + } + + /** + * InitializeParams diskName. + * @member {string|null|undefined} diskName + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + InitializeParams.prototype.diskName = null; + + /** + * InitializeParams replicaZones. + * @member {Array.} replicaZones + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + InitializeParams.prototype.replicaZones = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InitializeParams _diskName. + * @member {"diskName"|undefined} _diskName + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + Object.defineProperty(InitializeParams.prototype, "_diskName", { + get: $util.oneOfGetter($oneOfFields = ["diskName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InitializeParams instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams instance + */ + InitializeParams.create = function create(properties) { + return new InitializeParams(properties); + }; + + /** + * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskName != null && Object.hasOwnProperty.call(message, "diskName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.diskName); + if (message.replicaZones != null && message.replicaZones.length) + for (var i = 0; i < message.replicaZones.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replicaZones[i]); + return writer; + }; + + /** + * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitializeParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.diskName = reader.string(); + break; + } + case 2: { + if (!(message.replicaZones && message.replicaZones.length)) + message.replicaZones = []; + message.replicaZones.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitializeParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitializeParams message. + * @function verify + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitializeParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskName != null && message.hasOwnProperty("diskName")) { + properties._diskName = 1; + if (!$util.isString(message.diskName)) + return "diskName: string expected"; + } + if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { + if (!Array.isArray(message.replicaZones)) + return "replicaZones: array expected"; + for (var i = 0; i < message.replicaZones.length; ++i) + if (!$util.isString(message.replicaZones[i])) + return "replicaZones: string[] expected"; + } + return null; + }; + + /** + * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + */ + InitializeParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams) + return object; + var message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); + if (object.diskName != null) + message.diskName = String(object.diskName); + if (object.replicaZones) { + if (!Array.isArray(object.replicaZones)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.InitializeParams.replicaZones: array expected"); + message.replicaZones = []; + for (var i = 0; i < object.replicaZones.length; ++i) + message.replicaZones[i] = String(object.replicaZones[i]); + } + return message; + }; + + /** + * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} message InitializeParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitializeParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaZones = []; + if (message.diskName != null && message.hasOwnProperty("diskName")) { + object.diskName = message.diskName; + if (options.oneofs) + object._diskName = "diskName"; + } + if (message.replicaZones && message.replicaZones.length) { + object.replicaZones = []; + for (var j = 0; j < message.replicaZones.length; ++j) + object.replicaZones[j] = message.replicaZones[j]; + } + return object; + }; + + /** + * Converts this InitializeParams to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + * @returns {Object.} JSON object + */ + InitializeParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InitializeParams + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InitializeParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk.InitializeParams"; + }; + + return InitializeParams; + })(); + + /** + * DiskType enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskType + * @enum {number} + * @property {number} DISK_TYPE_UNSPECIFIED=0 DISK_TYPE_UNSPECIFIED value + * @property {number} SCRATCH=1 SCRATCH value + * @property {number} PERSISTENT=2 PERSISTENT value + */ + AttachedDisk.DiskType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCRATCH"] = 1; + values[valuesById[2] = "PERSISTENT"] = 2; + return values; + })(); + + /** + * DiskMode enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskMode + * @enum {number} + * @property {number} DISK_MODE_UNSPECIFIED=0 DISK_MODE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + * @property {number} LOCKED=3 LOCKED value + */ + AttachedDisk.DiskMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + values[valuesById[3] = "LOCKED"] = 3; + return values; + })(); + + /** + * DiskInterface enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskInterface + * @enum {number} + * @property {number} DISK_INTERFACE_UNSPECIFIED=0 DISK_INTERFACE_UNSPECIFIED value + * @property {number} SCSI=1 SCSI value + * @property {number} NVME=2 NVME value + * @property {number} NVDIMM=3 NVDIMM value + * @property {number} ISCSI=4 ISCSI value + */ + AttachedDisk.DiskInterface = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_INTERFACE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCSI"] = 1; + values[valuesById[2] = "NVME"] = 2; + values[valuesById[3] = "NVDIMM"] = 3; + values[valuesById[4] = "ISCSI"] = 4; + return values; + })(); + + /** + * DiskSavedState enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskSavedState + * @enum {number} + * @property {number} DISK_SAVED_STATE_UNSPECIFIED=0 DISK_SAVED_STATE_UNSPECIFIED value + * @property {number} PRESERVED=1 PRESERVED value + */ + AttachedDisk.DiskSavedState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_SAVED_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESERVED"] = 1; + return values; + })(); + + return AttachedDisk; + })(); + + v1.GuestOsFeature = (function() { + + /** + * Properties of a GuestOsFeature. + * @memberof google.cloud.backupdr.v1 + * @interface IGuestOsFeature + * @property {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null} [type] GuestOsFeature type + */ + + /** + * Constructs a new GuestOsFeature. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GuestOsFeature. + * @implements IGuestOsFeature + * @constructor + * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set + */ + function GuestOsFeature(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]]; + } + + /** + * GuestOsFeature type. + * @member {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null|undefined} type + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + */ + GuestOsFeature.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GuestOsFeature _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + */ + Object.defineProperty(GuestOsFeature.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GuestOsFeature instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature instance + */ + GuestOsFeature.create = function create(properties) { + return new GuestOsFeature(properties); + }; + + /** + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestOsFeature message. + * @function verify + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestOsFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + } + return null; + }; + + /** + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + */ + GuestOsFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GuestOsFeature) + return object; + var message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "FEATURE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "VIRTIO_SCSI_MULTIQUEUE": + case 1: + message.type = 1; + break; + case "WINDOWS": + case 2: + message.type = 2; + break; + case "MULTI_IP_SUBNET": + case 3: + message.type = 3; + break; + case "UEFI_COMPATIBLE": + case 4: + message.type = 4; + break; + case "SECURE_BOOT": + case 5: + message.type = 5; + break; + case "GVNIC": + case 6: + message.type = 6; + break; + case "SEV_CAPABLE": + case 7: + message.type = 7; + break; + case "BARE_METAL_LINUX_COMPATIBLE": + case 8: + message.type = 8; + break; + case "SUSPEND_RESUME_COMPATIBLE": + case 9: + message.type = 9; + break; + case "SEV_LIVE_MIGRATABLE": + case 10: + message.type = 10; + break; + case "SEV_SNP_CAPABLE": + case 11: + message.type = 11; + break; + case "TDX_CAPABLE": + case 12: + message.type = 12; + break; + case "IDPF": + case 13: + message.type = 13; + break; + case "SEV_LIVE_MIGRATABLE_V2": + case 14: + message.type = 14; + break; + } + return message; + }; + + /** + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.GuestOsFeature} message GuestOsFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestOsFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this GuestOsFeature to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + * @returns {Object.} JSON object + */ + GuestOsFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GuestOsFeature + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GuestOsFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GuestOsFeature"; + }; + + /** + * FeatureType enum. + * @name google.cloud.backupdr.v1.GuestOsFeature.FeatureType + * @enum {number} + * @property {number} FEATURE_TYPE_UNSPECIFIED=0 FEATURE_TYPE_UNSPECIFIED value + * @property {number} VIRTIO_SCSI_MULTIQUEUE=1 VIRTIO_SCSI_MULTIQUEUE value + * @property {number} WINDOWS=2 WINDOWS value + * @property {number} MULTI_IP_SUBNET=3 MULTI_IP_SUBNET value + * @property {number} UEFI_COMPATIBLE=4 UEFI_COMPATIBLE value + * @property {number} SECURE_BOOT=5 SECURE_BOOT value + * @property {number} GVNIC=6 GVNIC value + * @property {number} SEV_CAPABLE=7 SEV_CAPABLE value + * @property {number} BARE_METAL_LINUX_COMPATIBLE=8 BARE_METAL_LINUX_COMPATIBLE value + * @property {number} SUSPEND_RESUME_COMPATIBLE=9 SUSPEND_RESUME_COMPATIBLE value + * @property {number} SEV_LIVE_MIGRATABLE=10 SEV_LIVE_MIGRATABLE value + * @property {number} SEV_SNP_CAPABLE=11 SEV_SNP_CAPABLE value + * @property {number} TDX_CAPABLE=12 TDX_CAPABLE value + * @property {number} IDPF=13 IDPF value + * @property {number} SEV_LIVE_MIGRATABLE_V2=14 SEV_LIVE_MIGRATABLE_V2 value + */ + GuestOsFeature.FeatureType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTIO_SCSI_MULTIQUEUE"] = 1; + values[valuesById[2] = "WINDOWS"] = 2; + values[valuesById[3] = "MULTI_IP_SUBNET"] = 3; + values[valuesById[4] = "UEFI_COMPATIBLE"] = 4; + values[valuesById[5] = "SECURE_BOOT"] = 5; + values[valuesById[6] = "GVNIC"] = 6; + values[valuesById[7] = "SEV_CAPABLE"] = 7; + values[valuesById[8] = "BARE_METAL_LINUX_COMPATIBLE"] = 8; + values[valuesById[9] = "SUSPEND_RESUME_COMPATIBLE"] = 9; + values[valuesById[10] = "SEV_LIVE_MIGRATABLE"] = 10; + values[valuesById[11] = "SEV_SNP_CAPABLE"] = 11; + values[valuesById[12] = "TDX_CAPABLE"] = 12; + values[valuesById[13] = "IDPF"] = 13; + values[valuesById[14] = "SEV_LIVE_MIGRATABLE_V2"] = 14; + return values; + })(); + + return GuestOsFeature; + })(); + + /** + * KeyRevocationActionType enum. + * @name google.cloud.backupdr.v1.KeyRevocationActionType + * @enum {number} + * @property {number} KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED=0 KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} STOP=2 STOP value + */ + v1.KeyRevocationActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "STOP"] = 2; + return values; + })(); + return v1; })(); @@ -8611,6 +37072,263 @@ return values; })(); + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(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]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + api.ResourceDescriptor = (function() { /** @@ -15468,6 +44186,7 @@ * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ @@ -15602,6 +44321,14 @@ */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + /** * FieldOptions .google.api.resourceReference. * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference @@ -15671,6 +44398,8 @@ } if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); return writer; }; @@ -15779,6 +44508,10 @@ message[".google.api.fieldBehavior"].push(reader.int32()); break; } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } case 1055: { message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); break; @@ -15925,6 +44658,11 @@ break; } } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); if (error) @@ -16144,6 +44882,11 @@ break; } } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } if (object[".google.api.resourceReference"] != null) { if (typeof object[".google.api.resourceReference"] !== "object") throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); @@ -16183,6 +44926,7 @@ object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -16226,6 +44970,8 @@ } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); return object; }; @@ -21536,32 +50282,273 @@ }; /** - * Converts this Duration to JSON. + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(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]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * 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.Any = (function() { @@ -21800,23 +50787,25 @@ return Any; })(); - protobuf.Empty = (function() { + protobuf.FieldMask = (function() { /** - * Properties of an Empty. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface IEmpty + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new Empty. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function Empty(properties) { + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21824,63 +50813,80 @@ } /** - * Creates a new Empty instance using the specified properties. + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. * @function create - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - Empty.create = function create(properties) { - return new Empty(properties); + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, writer) { + FieldMask.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); return writer; }; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decode = function decode(reader, length) { + FieldMask.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -21890,110 +50896,133 @@ }; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decodeDelimited = function decodeDelimited(reader) { + FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Empty message. + * Verifies a FieldMask message. * @function verify - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Empty.verify = function verify(message) { + FieldMask.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } return null; }; /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) return object; - return new $root.google.protobuf.Empty(); + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; }; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; }; /** - * Converts this Empty to JSON. + * Converts this FieldMask to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Empty + * Gets the default type url for FieldMask * @function getTypeUrl - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Empty"; + return typeUrlPrefix + "/google.protobuf.FieldMask"; }; - return Empty; + return FieldMask; })(); - protobuf.Timestamp = (function() { + protobuf.Empty = (function() { /** - * Properties of a Timestamp. + * Properties of an Empty. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IEmpty */ /** - * Constructs a new Timestamp. + * Constructs a new Empty. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents an Empty. + * @implements IEmpty * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - function Timestamp(properties) { + function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22001,91 +51030,63 @@ } /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decode = function decode(reader, length) { + Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } default: reader.skipType(tag & 7); break; @@ -22095,125 +51096,89 @@ }; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Timestamp message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Timestamp.verify = function verify(message) { + Empty.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; return null; }; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.Timestamp} message Timestamp + * @param {google.protobuf.Empty} message Empty * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.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.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; + Empty.toObject = function toObject() { + return {}; }; /** - * Converts this Timestamp to JSON. + * Converts this Empty to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + Empty.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 Empty * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return typeUrlPrefix + "/google.protobuf.Empty"; }; - return Timestamp; + return Empty; })(); protobuf.DoubleValue = (function() { @@ -24083,6 +53048,364 @@ return protobuf; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + /** + * Month enum. + * @name google.type.Month + * @enum {number} + * @property {number} MONTH_UNSPECIFIED=0 MONTH_UNSPECIFIED value + * @property {number} JANUARY=1 JANUARY value + * @property {number} FEBRUARY=2 FEBRUARY value + * @property {number} MARCH=3 MARCH value + * @property {number} APRIL=4 APRIL value + * @property {number} MAY=5 MAY value + * @property {number} JUNE=6 JUNE value + * @property {number} JULY=7 JULY value + * @property {number} AUGUST=8 AUGUST value + * @property {number} SEPTEMBER=9 SEPTEMBER value + * @property {number} OCTOBER=10 OCTOBER value + * @property {number} NOVEMBER=11 NOVEMBER value + * @property {number} DECEMBER=12 DECEMBER value + */ + type.Month = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MONTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "JANUARY"] = 1; + values[valuesById[2] = "FEBRUARY"] = 2; + values[valuesById[3] = "MARCH"] = 3; + values[valuesById[4] = "APRIL"] = 4; + values[valuesById[5] = "MAY"] = 5; + values[valuesById[6] = "JUNE"] = 6; + values[valuesById[7] = "JULY"] = 7; + values[valuesById[8] = "AUGUST"] = 8; + values[valuesById[9] = "SEPTEMBER"] = 9; + values[valuesById[10] = "OCTOBER"] = 10; + values[valuesById[11] = "NOVEMBER"] = 11; + values[valuesById[12] = "DECEMBER"] = 12; + return values; + })(); + + return type; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + 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]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + google.longrunning = (function() { /** @@ -26222,290 +55545,6 @@ return longrunning; })(); - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - 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]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - return google; })(); diff --git a/packages/google-cloud-backupdr/protos/protos.json b/packages/google-cloud-backupdr/protos/protos.json index c0760fa65b1..6a5fd26891d 100644 --- a/packages/google-cloud-backupdr/protos/protos.json +++ b/packages/google-cloud-backupdr/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { @@ -11,7 +14,7 @@ "csharp_namespace": "Google.Cloud.BackupDR.V1", "go_package": "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb", "java_multiple_files": true, - "java_outer_classname": "BackupDRProto", + "java_outer_classname": "BackupvaultGceProto", "java_package": "com.google.cloud.backupdr.v1", "php_namespace": "Google\\Cloud\\BackupDR\\V1", "ruby_package": "Google::Cloud::BackupDR::V1" @@ -112,271 +115,4564 @@ } } ] + }, + "CreateBackupVault": { + "requestType": "CreateBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupVaults", + "(google.api.http).body": "backup_vault", + "(google.api.method_signature)": "parent,backup_vault,backup_vault_id", + "(google.longrunning.operation_info).response_type": "BackupVault", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupVaults", + "body": "backup_vault" + } + }, + { + "(google.api.method_signature)": "parent,backup_vault,backup_vault_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupVault", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListBackupVaults": { + "requestType": "ListBackupVaultsRequest", + "responseType": "ListBackupVaultsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupVaults" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "FetchUsableBackupVaults": { + "requestType": "FetchUsableBackupVaultsRequest", + "responseType": "FetchUsableBackupVaultsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackupVault": { + "requestType": "GetBackupVaultRequest", + "responseType": "BackupVault", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackupVault": { + "requestType": "UpdateBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", + "(google.api.http).body": "backup_vault", + "(google.api.method_signature)": "backup_vault,update_mask", + "(google.longrunning.operation_info).response_type": "BackupVault", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", + "body": "backup_vault" + } + }, + { + "(google.api.method_signature)": "backup_vault,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupVault", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackupVault": { + "requestType": "DeleteBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupVaults/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListDataSources": { + "requestType": "ListDataSourcesRequest", + "responseType": "ListDataSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDataSource": { + "requestType": "GetDataSourceRequest", + "responseType": "DataSource", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDataSource": { + "requestType": "UpdateDataSourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "(google.api.http).body": "data_source", + "(google.api.method_signature)": "data_source,update_mask", + "(google.longrunning.operation_info).response_type": "DataSource", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "body": "data_source" + } + }, + { + "(google.api.method_signature)": "data_source,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DataSource", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestoreBackup": { + "requestType": "RestoreBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RestoreBackupResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestoreBackupResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateBackupPlan": { + "requestType": "CreateBackupPlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlans", + "(google.api.http).body": "backup_plan", + "(google.api.method_signature)": "parent,backup_plan,backup_plan_id", + "(google.longrunning.operation_info).response_type": "BackupPlan", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupPlans", + "body": "backup_plan" + } + }, + { + "(google.api.method_signature)": "parent,backup_plan,backup_plan_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlan", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetBackupPlan": { + "requestType": "GetBackupPlanRequest", + "responseType": "BackupPlan", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupPlans": { + "requestType": "ListBackupPlansRequest", + "responseType": "ListBackupPlansResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlans", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupPlans" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteBackupPlan": { + "requestType": "DeleteBackupPlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlans/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupPlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateBackupPlanAssociation": { + "requestType": "CreateBackupPlanAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "(google.api.http).body": "backup_plan_association", + "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id", + "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "body": "backup_plan_association" + } + }, + { + "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlanAssociation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetBackupPlanAssociation": { + "requestType": "GetBackupPlanAssociationRequest", + "responseType": "BackupPlanAssociation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupPlanAssociations": { + "requestType": "ListBackupPlanAssociationsRequest", + "responseType": "ListBackupPlanAssociationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteBackupPlanAssociation": { + "requestType": "DeleteBackupPlanAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "TriggerBackup": { + "requestType": "TriggerBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,rule_id", + "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,rule_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlanAssociation", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "peeringMode": { + "type": "PeeringMode", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PeeringMode": { + "values": { + "PEERING_MODE_UNSPECIFIED": 0, + "PRIVATE_SERVICE_ACCESS": 1 + } + } + } + }, + "ManagementURI": { + "fields": { + "webUi": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "api": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkforceIdentityBasedManagementURI": { + "fields": { + "firstPartyManagementUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyManagementUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkforceIdentityBasedOAuth2ClientID": { + "fields": { + "firstPartyOauth2ClientId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyOauth2ClientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ManagementServer": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/ManagementServer", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/managementServers/{managementserver}", + "(google.api.resource).plural": "managementServers", + "(google.api.resource).singular": "managementServer" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "InstanceType", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "managementUri": { + "type": "ManagementURI", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "workforceIdentityBasedManagementUri": { + "type": "WorkforceIdentityBasedManagementURI", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "InstanceState", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "networks": { + "rule": "repeated", + "type": "NetworkConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauth2ClientId": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "workforceIdentityBasedOauth2ClientId": { + "type": "WorkforceIdentityBasedOAuth2ClientID", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "baProxyUri": { + "rule": "repeated", + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "BACKUP_RESTORE": 1 + } + }, + "InstanceState": { + "values": { + "INSTANCE_STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "UPDATING": 3, + "DELETING": 4, + "REPAIRING": 5, + "MAINTENANCE": 6, + "ERROR": 7 + } + } + } + }, + "ListManagementServersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ListManagementServersResponse": { + "fields": { + "managementServers": { + "rule": "repeated", + "type": "ManagementServer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetManagementServerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + } + } + } + }, + "CreateManagementServerRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + } + }, + "managementServerId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "managementServer": { + "type": "ManagementServer", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteManagementServerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "additionalInfo": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupPlan": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupPlan", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}", + "(google.api.resource).plural": "backupPlans", + "(google.api.resource).singular": "backupPlan" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupRules": { + "rule": "repeated", + "type": "BackupRule", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backupVault": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "backupVaultServiceAccount": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4 + } + } + } + }, + "BackupRule": { + "oneofs": { + "backupScheduleOneof": { + "oneof": [ + "standardSchedule" + ] + } + }, + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "backupRetentionDays": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "standardSchedule": { + "type": "StandardSchedule", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StandardSchedule": { + "fields": { + "recurrenceType": { + "type": "RecurrenceType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hourlyFrequency": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysOfWeek": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysOfMonth": { + "rule": "repeated", + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "weekDayOfMonth": { + "type": "WeekDayOfMonth", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "months": { + "rule": "repeated", + "type": "google.type.Month", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backupWindow": { + "type": "BackupWindow", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timeZone": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RecurrenceType": { + "values": { + "RECURRENCE_TYPE_UNSPECIFIED": 0, + "HOURLY": 1, + "DAILY": 2, + "WEEKLY": 3, + "MONTHLY": 4, + "YEARLY": 5 + } + } + } + }, + "BackupWindow": { + "fields": { + "startHourOfDay": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endHourOfDay": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WeekDayOfMonth": { + "fields": { + "weekOfMonth": { + "type": "WeekOfMonth", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dayOfWeek": { + "type": "google.type.DayOfWeek", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "WeekOfMonth": { + "values": { + "WEEK_OF_MONTH_UNSPECIFIED": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "FOURTH": 4, + "LAST": 5 + } + } + } + }, + "CreateBackupPlanRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlan": { + "type": "BackupPlan", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlansRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlansResponse": { + "fields": { + "backupPlans": { + "rule": "repeated", + "type": "BackupPlan", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupPlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + } + } + }, + "DeleteBackupPlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BackupPlanAssociation": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupPlanAssociation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}", + "(google.api.resource).plural": "backupPlanAssociations", + "(google.api.resource).singular": "backupPlanAssociation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "resource": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlan": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rulesConfigInfo": { + "rule": "repeated", + "type": "RuleConfigInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSource": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4 + } + } + } + }, + "RuleConfigInfo": { + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupState": { + "type": "LastBackupState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupError": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupConsistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LastBackupState": { + "values": { + "LAST_BACKUP_STATE_UNSPECIFIED": 0, + "FIRST_BACKUP_PENDING": 1, + "PERMISSION_DENIED": 2, + "SUCCEEDED": 3, + "FAILED": 4 + } + } + } + }, + "CreateBackupPlanAssociationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "backupPlanAssociationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlanAssociation": { + "type": "BackupPlanAssociation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlanAssociationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlanAssociationsResponse": { + "fields": { + "backupPlanAssociations": { + "rule": "repeated", + "type": "BackupPlanAssociation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupPlanAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + } + } + }, + "DeleteBackupPlanAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TriggerBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "ruleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BackupVault": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupVault", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}", + "(google.api.resource).plural": "backupVaults", + "(google.api.resource).singular": "backupVault" + }, + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_backupMinimumEnforcedRetentionDuration": { + "oneof": [ + "backupMinimumEnforcedRetentionDuration" + ] + }, + "_deletable": { + "oneof": [ + "deletable" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "_effectiveTime": { + "oneof": [ + "effectiveTime" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "backupMinimumEnforcedRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 20, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "deletable": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "backupCount": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccount": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalStoredBytes": { + "type": "int64", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessRestriction": { + "type": "AccessRestriction", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4 + } + }, + "AccessRestriction": { + "values": { + "ACCESS_RESTRICTION_UNSPECIFIED": 0, + "WITHIN_PROJECT": 1, + "WITHIN_ORGANIZATION": 2, + "UNRESTRICTED": 3 + } + } + } + }, + "DataSource": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/DataSource", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}", + "(google.api.resource).plural": "dataSources", + "(google.api.resource).singular": "dataSource" + }, + "oneofs": { + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_backupCount": { + "oneof": [ + "backupCount" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "_totalStoredBytes": { + "oneof": [ + "totalStoredBytes" + ] + }, + "sourceResource": { + "oneof": [ + "dataSourceGcpResource", + "dataSourceBackupApplianceApplication" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "state": { + "type": "State", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "backupCount": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 14, + "options": { + "proto3_optional": true + } + }, + "totalStoredBytes": { + "type": "int64", + "id": 23, + "options": { + "proto3_optional": true + } + }, + "configState": { + "type": "BackupConfigState", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupConfigInfo": { + "type": "BackupConfigInfo", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceGcpResource": { + "type": "DataSourceGcpResource", + "id": 26 + }, + "dataSourceBackupApplianceApplication": { + "type": "DataSourceBackupApplianceApplication", + "id": 27 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4 + } + } + } + }, + "BackupConfigInfo": { + "oneofs": { + "backupConfig": { + "oneof": [ + "gcpBackupConfig", + "backupApplianceBackupConfig" + ] + } + }, + "fields": { + "lastBackupState": { + "type": "LastBackupState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupConsistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupError": { + "type": "google.rpc.Status", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcpBackupConfig": { + "type": "GcpBackupConfig", + "id": 4 + }, + "backupApplianceBackupConfig": { + "type": "BackupApplianceBackupConfig", + "id": 5 + } + }, + "nested": { + "LastBackupState": { + "values": { + "LAST_BACKUP_STATE_UNSPECIFIED": 0, + "FIRST_BACKUP_PENDING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "PERMISSION_DENIED": 4 + } + } + } + }, + "GcpBackupConfig": { + "fields": { + "backupPlan": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanDescription": { + "type": "string", + "id": 2 + }, + "backupPlanAssociation": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "backupPlanRules": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "BackupApplianceBackupConfig": { + "fields": { + "backupApplianceName": { + "type": "string", + "id": 1 + }, + "backupApplianceId": { + "type": "int64", + "id": 2 + }, + "slaId": { + "type": "int64", + "id": 3 + }, + "applicationName": { + "type": "string", + "id": 4 + }, + "hostName": { + "type": "string", + "id": 5 + }, + "sltName": { + "type": "string", + "id": 6 + }, + "slpName": { + "type": "string", + "id": 7 + } + } + }, + "DataSourceGcpResource": { + "oneofs": { + "gcpResourceProperties": { + "oneof": [ + "computeInstanceDatasourceProperties" + ] + } + }, + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "computeInstanceDatasourceProperties": { + "type": "ComputeInstanceDataSourceProperties", + "id": 4 + } + } + }, + "DataSourceBackupApplianceApplication": { + "fields": { + "applicationName": { + "type": "string", + "id": 1 + }, + "backupAppliance": { + "type": "string", + "id": 2 + }, + "applianceId": { + "type": "int64", + "id": 3 + }, + "type": { + "type": "string", + "id": 4 + }, + "applicationId": { + "type": "int64", + "id": 8 + }, + "hostname": { + "type": "string", + "id": 6 + }, + "hostId": { + "type": "int64", + "id": 7 + } + } + }, + "ServiceLockInfo": { + "fields": { + "operation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupApplianceLockInfo": { + "oneofs": { + "lockSource": { + "oneof": [ + "jobName", + "backupImage", + "slaId" + ] + } + }, + "fields": { + "backupApplianceId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupApplianceName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lockReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobName": { + "type": "string", + "id": 6 + }, + "backupImage": { + "type": "string", + "id": 7 + }, + "slaId": { + "type": "int64", + "id": 8 + } + } + }, + "BackupLock": { + "oneofs": { + "ClientLockInfo": { + "oneof": [ + "backupApplianceLockInfo", + "serviceLockInfo" + ] + } + }, + "fields": { + "lockUntilTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupApplianceLockInfo": { + "type": "BackupApplianceLockInfo", + "id": 3 + }, + "serviceLockInfo": { + "type": "ServiceLockInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}", + "(google.api.resource).plural": "backups", + "(google.api.resource).singular": "backup" + }, + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_enforcedRetentionEndTime": { + "oneof": [ + "enforcedRetentionEndTime" + ] + }, + "_expireTime": { + "oneof": [ + "expireTime" + ] + }, + "_consistencyTime": { + "oneof": [ + "consistencyTime" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "backupProperties": { + "oneof": [ + "computeInstanceBackupProperties", + "backupApplianceBackupProperties" + ] + }, + "planInfo": { + "oneof": [ + "gcpBackupPlanInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enforcedRetentionEndTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "consistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceLocks": { + "rule": "repeated", + "type": "BackupLock", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupApplianceLocks": { + "rule": "repeated", + "type": "BackupLock", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeInstanceBackupProperties": { + "type": "ComputeInstanceBackupProperties", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupApplianceBackupProperties": { + "type": "BackupApplianceBackupProperties", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupType": { + "type": "BackupType", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcpBackupPlanInfo": { + "type": "GCPBackupPlanInfo", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceSizeBytes": { + "type": "int64", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4 + } + }, + "BackupType": { + "values": { + "BACKUP_TYPE_UNSPECIFIED": 0, + "SCHEDULED": 1, + "ON_DEMAND": 2 + } + }, + "GCPBackupPlanInfo": { + "fields": { + "backupPlan": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanRuleId": { + "type": "string", + "id": 2 + } + } + } + } + }, + "CreateBackupVaultRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "backupVaultId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupVault": { + "type": "BackupVault", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupVaultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "BackupVaultView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupVaultsResponse": { + "fields": { + "backupVaults": { + "rule": "repeated", + "type": "BackupVault", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "FetchUsableBackupVaultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchUsableBackupVaultsResponse": { + "fields": { + "backupVaults": { + "rule": "repeated", + "type": "BackupVault", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupVaultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "view": { + "type": "BackupVaultView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupVaultRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupVault": { + "type": "BackupVault", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupVaultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 4 + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDataSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSource" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDataSourcesResponse": { + "fields": { + "dataSources": { + "rule": "repeated", + "type": "DataSource", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDataSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSource" + } + } + } + }, + "UpdateDataSourceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataSource": { + "type": "DataSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/Backup" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "BackupView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "view": { + "type": "BackupView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreBackupRequest": { + "oneofs": { + "targetEnvironment": { + "oneof": [ + "computeInstanceTargetEnvironment" + ] + }, + "instanceProperties": { + "oneof": [ + "computeInstanceRestoreProperties" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeInstanceTargetEnvironment": { + "type": "ComputeInstanceTargetEnvironment", + "id": 3 + }, + "computeInstanceRestoreProperties": { + "type": "ComputeInstanceRestoreProperties", + "id": 4 + } + } + }, + "RestoreBackupResponse": { + "fields": { + "targetResource": { + "type": "TargetResource", + "id": 1 + } + } + }, + "TargetResource": { + "oneofs": { + "targetResourceInfo": { + "oneof": [ + "gcpResource" + ] + } + }, + "fields": { + "gcpResource": { + "type": "GcpResource", + "id": 1 + } + } + }, + "GcpResource": { + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + } + } + }, + "BackupConfigState": { + "values": { + "BACKUP_CONFIG_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PASSIVE": 2 + } + }, + "BackupView": { + "values": { + "BACKUP_VIEW_UNSPECIFIED": 0, + "BACKUP_VIEW_BASIC": 1, + "BACKUP_VIEW_FULL": 2 + } + }, + "BackupVaultView": { + "values": { + "BACKUP_VAULT_VIEW_UNSPECIFIED": 0, + "BACKUP_VAULT_VIEW_BASIC": 1, + "BACKUP_VAULT_VIEW_FULL": 2 + } + }, + "BackupApplianceBackupProperties": { + "oneofs": { + "_generationId": { + "oneof": [ + "generationId" + ] + }, + "_finalizeTime": { + "oneof": [ + "finalizeTime" + ] + }, + "_recoveryRangeStartTime": { + "oneof": [ + "recoveryRangeStartTime" + ] + }, + "_recoveryRangeEndTime": { + "oneof": [ + "recoveryRangeEndTime" + ] + } + }, + "fields": { + "generationId": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "finalizeTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "recoveryRangeStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "recoveryRangeEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ComputeInstanceBackupProperties": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_keyRevocationActionType": { + "oneof": [ + "keyRevocationActionType" + ] + }, + "_sourceInstance": { + "oneof": [ + "sourceInstance" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "tags": { + "type": "Tags", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "machineType": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "networkInterface": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 5 + }, + "disk": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 6 + }, + "metadata": { + "type": "Metadata", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "serviceAccount": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 8 + }, + "scheduling": { + "type": "Scheduling", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "guestAccelerator": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 10 + }, + "minCpuPlatform": { + "type": "string", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "keyRevocationActionType": { + "type": "KeyRevocationActionType", + "id": 12, + "options": { + "proto3_optional": true + } + }, + "sourceInstance": { + "type": "string", + "id": 13, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14 + } + } + }, + "ComputeInstanceRestoreProperties": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_advancedMachineFeatures": { + "oneof": [ + "advancedMachineFeatures" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_confidentialInstanceConfig": { + "oneof": [ + "confidentialInstanceConfig" + ] + }, + "_deletionProtection": { + "oneof": [ + "deletionProtection" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_displayDevice": { + "oneof": [ + "displayDevice" + ] + }, + "_hostname": { + "oneof": [ + "hostname" + ] + }, + "_instanceEncryptionKey": { + "oneof": [ + "instanceEncryptionKey" + ] + }, + "_keyRevocationActionType": { + "oneof": [ + "keyRevocationActionType" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_networkPerformanceConfig": { + "oneof": [ + "networkPerformanceConfig" + ] + }, + "_params": { + "oneof": [ + "params" + ] + }, + "_privateIpv6GoogleAccess": { + "oneof": [ + "privateIpv6GoogleAccess" + ] + }, + "_allocationAffinity": { + "oneof": [ + "allocationAffinity" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "advancedMachineFeatures": { + "type": "AdvancedMachineFeatures", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "confidentialInstanceConfig": { + "type": "ConfidentialInstanceConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deletionProtection": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayDevice": { + "type": "DisplayDevice", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "guestAccelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hostname": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "instanceEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "keyRevocationActionType": { + "type": "KeyRevocationActionType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "machineType": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "metadata": { + "type": "Metadata", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "minCpuPlatform": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkPerformanceConfig": { + "type": "NetworkPerformanceConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "params": { + "type": "InstanceParams", + "id": 19, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY", + "proto3_optional": true + } + }, + "privateIpv6GoogleAccess": { + "type": "InstancePrivateIpv6GoogleAccess", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "allocationAffinity": { + "type": "AllocationAffinity", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduling": { + "type": "Scheduling", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "serviceAccounts": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "type": "Tags", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "InstancePrivateIpv6GoogleAccess": { + "values": { + "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": 0, + "INHERIT_FROM_SUBNETWORK": 1, + "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": 2, + "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": 3 + } + } + } + }, + "ComputeInstanceTargetEnvironment": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "NetworkConfig": { + "ComputeInstanceDataSourceProperties": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "machineType": { + "type": "string", + "id": 3 + }, + "totalDiskCount": { + "type": "int64", + "id": 4 + }, + "totalDiskSizeGb": { + "type": "int64", + "id": 5 + } + } + }, + "AdvancedMachineFeatures": { + "oneofs": { + "_enableNestedVirtualization": { + "oneof": [ + "enableNestedVirtualization" + ] + }, + "_threadsPerCore": { + "oneof": [ + "threadsPerCore" + ] + }, + "_visibleCoreCount": { + "oneof": [ + "visibleCoreCount" + ] + }, + "_enableUefiNetworking": { + "oneof": [ + "enableUefiNetworking" + ] + } + }, + "fields": { + "enableNestedVirtualization": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "threadsPerCore": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "visibleCoreCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "enableUefiNetworking": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ConfidentialInstanceConfig": { + "oneofs": { + "_enableConfidentialCompute": { + "oneof": [ + "enableConfidentialCompute" + ] + } + }, + "fields": { + "enableConfidentialCompute": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "DisplayDevice": { + "oneofs": { + "_enableDisplay": { + "oneof": [ + "enableDisplay" + ] + } + }, + "fields": { + "enableDisplay": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "AcceleratorConfig": { + "oneofs": { + "_acceleratorType": { + "oneof": [ + "acceleratorType" + ] + }, + "_acceleratorCount": { + "oneof": [ + "acceleratorCount" + ] + } + }, + "fields": { + "acceleratorType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "acceleratorCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "CustomerEncryptionKey": { + "oneofs": { + "key": { + "oneof": [ + "rawKey", + "rsaEncryptedKey", + "kmsKeyName" + ] + }, + "_kmsKeyServiceAccount": { + "oneof": [ + "kmsKeyServiceAccount" + ] + } + }, + "fields": { + "rawKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rsaEncryptedKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyServiceAccount": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Entry": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Metadata": { + "fields": { + "items": { + "rule": "repeated", + "type": "Entry", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NetworkInterface": { + "oneofs": { + "_network": { + "oneof": [ + "network" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_ipv6Address": { + "oneof": [ + "ipv6Address" + ] + }, + "_internalIpv6PrefixLength": { + "oneof": [ + "internalIpv6PrefixLength" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_stackType": { + "oneof": [ + "stackType" + ] + }, + "_ipv6AccessType": { + "oneof": [ + "ipv6AccessType" + ] + }, + "_queueCount": { + "oneof": [ + "queueCount" + ] + }, + "_nicType": { + "oneof": [ + "nicType" + ] + }, + "_networkAttachment": { + "oneof": [ + "networkAttachment" + ] + } + }, "fields": { "network": { "type": "string", - "id": 1, + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ipv6Address": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "IPV6", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "internalIpv6PrefixLength": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "accessConfigs": { + "rule": "repeated", + "type": "AccessConfig", + "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "peeringMode": { - "type": "PeeringMode", - "id": 2, + "ipv6AccessConfigs": { + "rule": "repeated", + "type": "AccessConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "aliasIpRanges": { + "rule": "repeated", + "type": "AliasIpRange", + "id": 9, "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "stackType": { + "type": "StackType", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "ipv6AccessType": { + "type": "Ipv6AccessType", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "queueCount": { + "type": "int32", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "nicType": { + "type": "NicType", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkAttachment": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } }, "nested": { - "PeeringMode": { + "StackType": { "values": { - "PEERING_MODE_UNSPECIFIED": 0, - "PRIVATE_SERVICE_ACCESS": 1 + "STACK_TYPE_UNSPECIFIED": 0, + "IPV4_ONLY": 1, + "IPV4_IPV6": 2 + } + }, + "Ipv6AccessType": { + "values": { + "UNSPECIFIED_IPV6_ACCESS_TYPE": 0, + "INTERNAL": 1, + "EXTERNAL": 2 + } + }, + "NicType": { + "values": { + "NIC_TYPE_UNSPECIFIED": 0, + "VIRTIO_NET": 1, + "GVNIC": 2 } } } }, - "ManagementURI": { + "NetworkPerformanceConfig": { + "oneofs": { + "_totalEgressBandwidthTier": { + "oneof": [ + "totalEgressBandwidthTier" + ] + } + }, "fields": { - "webUi": { - "type": "string", + "totalEgressBandwidthTier": { + "type": "Tier", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } - }, - "api": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nested": { + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "DEFAULT": 1, + "TIER_1": 2 } } } }, - "WorkforceIdentityBasedManagementURI": { + "AccessConfig": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_externalIp": { + "oneof": [ + "externalIp" + ] + }, + "_externalIpv6": { + "oneof": [ + "externalIpv6" + ] + }, + "_externalIpv6PrefixLength": { + "oneof": [ + "externalIpv6PrefixLength" + ] + }, + "_setPublicPtr": { + "oneof": [ + "setPublicPtr" + ] + }, + "_publicPtrDomainName": { + "oneof": [ + "publicPtrDomainName" + ] + }, + "_networkTier": { + "oneof": [ + "networkTier" + ] + } + }, "fields": { - "firstPartyManagementUri": { - "type": "string", + "type": { + "type": "AccessType", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "thirdPartyManagementUri": { + "name": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIp": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIpv6": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIpv6PrefixLength": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "setPublicPtr": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "publicPtrDomainName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkTier": { + "type": "NetworkTier", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "AccessType": { + "values": { + "ACCESS_TYPE_UNSPECIFIED": 0, + "ONE_TO_ONE_NAT": 1, + "DIRECT_IPV6": 2 + } + }, + "NetworkTier": { + "values": { + "NETWORK_TIER_UNSPECIFIED": 0, + "PREMIUM": 1, + "STANDARD": 2 } } } }, - "WorkforceIdentityBasedOAuth2ClientID": { + "AliasIpRange": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_subnetworkRangeName": { + "oneof": [ + "subnetworkRangeName" + ] + } + }, "fields": { - "firstPartyOauth2ClientId": { + "ipCidrRange": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "thirdPartyOauth2ClientId": { + "subnetworkRangeName": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, - "ManagementServer": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/ManagementServer", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/managementServers/{managementserver}", - "(google.api.resource).plural": "managementServers", - "(google.api.resource).singular": "managementServer" - }, + "InstanceParams": { "fields": { - "name": { + "resourceManagerTags": { + "keyType": "string", "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "IDENTIFIER" + "(google.api.field_behavior)": "OPTIONAL" } + } + } + }, + "AllocationAffinity": { + "oneofs": { + "_consumeAllocationType": { + "oneof": [ + "consumeAllocationType" + ] }, - "description": { + "_key": { + "oneof": [ + "key" + ] + } + }, + "fields": { + "consumeAllocationType": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "key": { "type": "string", - "id": 9, + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "labels": { - "keyType": "string", + "values": { + "rule": "repeated", "type": "string", - "id": 4, + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "NO_RESERVATION": 1, + "ANY_RESERVATION": 2, + "SPECIFIC_RESERVATION": 3 + } + } + } + }, + "Scheduling": { + "oneofs": { + "_onHostMaintenance": { + "oneof": [ + "onHostMaintenance" + ] + }, + "_automaticRestart": { + "oneof": [ + "automaticRestart" + ] + }, + "_preemptible": { + "oneof": [ + "preemptible" + ] + }, + "_minNodeCpus": { + "oneof": [ + "minNodeCpus" + ] + }, + "_provisioningModel": { + "oneof": [ + "provisioningModel" + ] + }, + "_instanceTerminationAction": { + "oneof": [ + "instanceTerminationAction" + ] + }, + "_localSsdRecoveryTimeout": { + "oneof": [ + "localSsdRecoveryTimeout" + ] + } + }, + "fields": { + "onHostMaintenance": { + "type": "OnHostMaintenance", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "createTime": { - "type": "google.protobuf.Timestamp", + "automaticRestart": { + "type": "bool", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "updateTime": { - "type": "google.protobuf.Timestamp", + "preemptible": { + "type": "bool", "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "type": { - "type": "InstanceType", - "id": 14, + "nodeAffinities": { + "rule": "repeated", + "type": "NodeAffinity", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "managementUri": { - "type": "ManagementURI", - "id": 11, + "minNodeCpus": { + "type": "int32", + "id": 5, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "workforceIdentityBasedManagementUri": { - "type": "WorkforceIdentityBasedManagementURI", - "id": 16, + "provisioningModel": { + "type": "ProvisioningModel", + "id": 6, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "state": { - "type": "InstanceState", + "instanceTerminationAction": { + "type": "InstanceTerminationAction", "id": 7, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "networks": { - "rule": "repeated", - "type": "NetworkConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "etag": { - "type": "string", - "id": 13, + "localSsdRecoveryTimeout": { + "type": "SchedulingDuration", + "id": 10, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } - }, - "oauth2ClientId": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nested": { + "OnHostMaintenance": { + "values": { + "ON_HOST_MAINTENANCE_UNSPECIFIED": 0, + "TERMINATE": 1, + "MIGRATE": 1000 } }, - "workforceIdentityBasedOauth2ClientId": { - "type": "WorkforceIdentityBasedOAuth2ClientID", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "NodeAffinity": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_operator": { + "oneof": [ + "operator" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "operator": { + "type": "Operator", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "IN": 1, + "NOT_IN": 2 + } + } } }, - "baProxyUri": { - "rule": "repeated", - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "ProvisioningModel": { + "values": { + "PROVISIONING_MODEL_UNSPECIFIED": 0, + "STANDARD": 1, + "SPOT": 2 } }, - "satisfiesPzs": { - "type": "google.protobuf.BoolValue", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "InstanceTerminationAction": { + "values": { + "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": 0, + "DELETE": 1, + "STOP": 2 } + } + } + }, + "SchedulingDuration": { + "oneofs": { + "_seconds": { + "oneof": [ + "seconds" + ] }, - "satisfiesPzi": { - "type": "bool", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "_nanos": { + "oneof": [ + "nanos" + ] } }, - "nested": { - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "BACKUP_RESTORE": 1 + "fields": { + "seconds": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "InstanceState": { - "values": { - "INSTANCE_STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "UPDATING": 3, - "DELETING": 4, - "REPAIRING": 5, - "MAINTENANCE": 6, - "ERROR": 7 + "nanos": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, - "ListManagementServersRequest": { + "ServiceAccount": { "oneofs": { - "_filter": { - "oneof": [ - "filter" - ] - }, - "_orderBy": { + "_email": { "oneof": [ - "orderBy" + "email" ] } }, "fields": { - "parent": { + "email": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "pageSize": { - "type": "int32", + "scopes": { + "rule": "repeated", + "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } - }, - "pageToken": { + } + } + }, + "Tags": { + "fields": { + "items": { + "rule": "repeated", "type": "string", - "id": 3, + "id": 1, "options": { "(google.api.field_behavior)": "OPTIONAL" } + } + } + }, + "AttachedDisk": { + "oneofs": { + "_initializeParams": { + "oneof": [ + "initializeParams" + ] }, - "filter": { + "_deviceName": { + "oneof": [ + "deviceName" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_diskTypeDeprecated": { + "oneof": [ + "diskTypeDeprecated" + ] + }, + "_mode": { + "oneof": [ + "mode" + ] + }, + "_source": { + "oneof": [ + "source" + ] + }, + "_index": { + "oneof": [ + "index" + ] + }, + "_boot": { + "oneof": [ + "boot" + ] + }, + "_autoDelete": { + "oneof": [ + "autoDelete" + ] + }, + "_diskInterface": { + "oneof": [ + "diskInterface" + ] + }, + "_diskEncryptionKey": { + "oneof": [ + "diskEncryptionKey" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_savedState": { + "oneof": [ + "savedState" + ] + }, + "_diskType": { + "oneof": [ + "diskType" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "initializeParams": { + "type": "InitializeParams", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deviceName": { "type": "string", "id": 4, "options": { @@ -384,158 +4680,232 @@ "proto3_optional": true } }, - "orderBy": { + "kind": { "type": "string", "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } - } - } - }, - "ListManagementServersResponse": { - "fields": { - "managementServers": { - "rule": "repeated", - "type": "ManagementServer", - "id": 1 }, - "nextPageToken": { - "type": "string", - "id": 2 + "diskTypeDeprecated": { + "type": "DiskType", + "id": 6, + "options": { + "deprecated": true, + "proto3_optional": true + } }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetManagementServerRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, + "mode": { + "type": "DiskMode", + "id": 7, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } - } - } - }, - "CreateManagementServerRequest": { - "fields": { - "parent": { + }, + "source": { "type": "string", - "id": 1, + "id": 8, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "managementServerId": { - "type": "string", - "id": 2, + "index": { + "type": "int64", + "id": 9, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "managementServer": { - "type": "ManagementServer", - "id": 3, + "boot": { + "type": "bool", + "id": 10, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "requestId": { + "autoDelete": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "license": { + "rule": "repeated", "type": "string", - "id": 4, + "id": 12, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "DeleteManagementServerRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, + }, + "diskInterface": { + "type": "DiskInterface", + "id": 13, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "requestId": { - "type": "string", - "id": 2, + "guestOsFeature": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 14, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, + }, + "diskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 15, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, + "diskSizeGb": { + "type": "int64", + "id": 16, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "target": { - "type": "string", - "id": 3, + "savedState": { + "type": "DiskSavedState", + "id": 17, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true } }, - "verb": { + "diskType": { "type": "string", - "id": 4, + "id": 18, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true } }, - "statusMessage": { - "type": "string", - "id": 5, + "type": { + "type": "DiskType", + "id": 19, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "InitializeParams": { + "oneofs": { + "_diskName": { + "oneof": [ + "diskName" + ] + } + }, + "fields": { + "diskName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "replicaZones": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } } }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "DiskType": { + "values": { + "DISK_TYPE_UNSPECIFIED": 0, + "SCRATCH": 1, + "PERSISTENT": 2 } }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "DiskMode": { + "values": { + "DISK_MODE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2, + "LOCKED": 3 } }, - "additionalInfo": { - "keyType": "string", - "type": "string", - "id": 8, + "DiskInterface": { + "values": { + "DISK_INTERFACE_UNSPECIFIED": 0, + "SCSI": 1, + "NVME": 2, + "NVDIMM": 3, + "ISCSI": 4 + } + }, + "DiskSavedState": { + "values": { + "DISK_SAVED_STATE_UNSPECIFIED": 0, + "PRESERVED": 1 + } + } + } + }, + "GuestOsFeature": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "type": { + "type": "FeatureType", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "proto3_optional": true + } + } + }, + "nested": { + "FeatureType": { + "values": { + "FEATURE_TYPE_UNSPECIFIED": 0, + "VIRTIO_SCSI_MULTIQUEUE": 1, + "WINDOWS": 2, + "MULTI_IP_SUBNET": 3, + "UEFI_COMPATIBLE": 4, + "SECURE_BOOT": 5, + "GVNIC": 6, + "SEV_CAPABLE": 7, + "BARE_METAL_LINUX_COMPATIBLE": 8, + "SUSPEND_RESUME_COMPATIBLE": 9, + "SEV_LIVE_MIGRATABLE": 10, + "SEV_SNP_CAPABLE": 11, + "TDX_CAPABLE": 12, + "IDPF": 13, + "SEV_LIVE_MIGRATABLE_V2": 14 } } } + }, + "KeyRevocationActionType": { + "values": { + "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": 0, + "NONE": 1, + "STOP": 2 + } } } } @@ -954,6 +5324,30 @@ "IDENTIFIER": 8 } }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, @@ -2320,6 +6714,18 @@ } } }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, "Any": { "fields": { "type_url": { @@ -2332,21 +6738,18 @@ } } }, - "Empty": { - "fields": {} - }, - "Timestamp": { + "FieldMask": { "fields": { - "seconds": { - "type": "int64", + "paths": { + "rule": "repeated", + "type": "string", "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 } } }, + "Empty": { + "fields": {} + }, "DoubleValue": { "fields": { "value": { @@ -2421,6 +6824,75 @@ } } }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/month;month", + "java_multiple_files": true, + "java_outer_classname": "MonthProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "Month": { + "values": { + "MONTH_UNSPECIFIED": 0, + "JANUARY": 1, + "FEBRUARY": 2, + "MARCH": 3, + "APRIL": 4, + "MAY": 5, + "JUNE": 6, + "JULY": 7, + "AUGUST": 8, + "SEPTEMBER": 9, + "OCTOBER": 10, + "NOVEMBER": 11, + "DECEMBER": 12 + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, "longrunning": { "options": { "cc_enable_arenas": true, @@ -2636,35 +7108,6 @@ } } } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } } } } diff --git a/packages/google-cloud-backupdr/samples/README.md b/packages/google-cloud-backupdr/samples/README.md index cb1951e106d..27db6e74ed5 100644 --- a/packages/google-cloud-backupdr/samples/README.md +++ b/packages/google-cloud-backupdr/samples/README.md @@ -12,10 +12,40 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Backup_d_r.abandon_backup](#backup_d_r.abandon_backup) + * [Backup_d_r.create_backup_plan](#backup_d_r.create_backup_plan) + * [Backup_d_r.create_backup_plan_association](#backup_d_r.create_backup_plan_association) + * [Backup_d_r.create_backup_vault](#backup_d_r.create_backup_vault) * [Backup_d_r.create_management_server](#backup_d_r.create_management_server) + * [Backup_d_r.delete_backup](#backup_d_r.delete_backup) + * [Backup_d_r.delete_backup_plan](#backup_d_r.delete_backup_plan) + * [Backup_d_r.delete_backup_plan_association](#backup_d_r.delete_backup_plan_association) + * [Backup_d_r.delete_backup_vault](#backup_d_r.delete_backup_vault) * [Backup_d_r.delete_management_server](#backup_d_r.delete_management_server) + * [Backup_d_r.fetch_access_token](#backup_d_r.fetch_access_token) + * [Backup_d_r.fetch_usable_backup_vaults](#backup_d_r.fetch_usable_backup_vaults) + * [Backup_d_r.finalize_backup](#backup_d_r.finalize_backup) + * [Backup_d_r.get_backup](#backup_d_r.get_backup) + * [Backup_d_r.get_backup_plan](#backup_d_r.get_backup_plan) + * [Backup_d_r.get_backup_plan_association](#backup_d_r.get_backup_plan_association) + * [Backup_d_r.get_backup_vault](#backup_d_r.get_backup_vault) + * [Backup_d_r.get_data_source](#backup_d_r.get_data_source) * [Backup_d_r.get_management_server](#backup_d_r.get_management_server) + * [Backup_d_r.initiate_backup](#backup_d_r.initiate_backup) + * [Backup_d_r.list_backup_plan_associations](#backup_d_r.list_backup_plan_associations) + * [Backup_d_r.list_backup_plans](#backup_d_r.list_backup_plans) + * [Backup_d_r.list_backup_vaults](#backup_d_r.list_backup_vaults) + * [Backup_d_r.list_backups](#backup_d_r.list_backups) + * [Backup_d_r.list_data_sources](#backup_d_r.list_data_sources) * [Backup_d_r.list_management_servers](#backup_d_r.list_management_servers) + * [Backup_d_r.remove_data_source](#backup_d_r.remove_data_source) + * [Backup_d_r.restore_backup](#backup_d_r.restore_backup) + * [Backup_d_r.set_internal_status](#backup_d_r.set_internal_status) + * [Backup_d_r.test_iam_permissions](#backup_d_r.test_iam_permissions) + * [Backup_d_r.trigger_backup](#backup_d_r.trigger_backup) + * [Backup_d_r.update_backup](#backup_d_r.update_backup) + * [Backup_d_r.update_backup_vault](#backup_d_r.update_backup_vault) + * [Backup_d_r.update_data_source](#backup_d_r.update_data_source) * [Quickstart](#quickstart) ## Before you begin @@ -33,6 +63,74 @@ Before running the samples, make sure you've followed the steps outlined in +### Backup_d_r.abandon_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js` + + +----- + + + + +### Backup_d_r.create_backup_plan + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js` + + +----- + + + + +### Backup_d_r.create_backup_plan_association + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js` + + +----- + + + + +### Backup_d_r.create_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js` + + +----- + + + + ### Backup_d_r.create_management_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js). @@ -50,6 +148,74 @@ __Usage:__ +### Backup_d_r.delete_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js` + + +----- + + + + +### Backup_d_r.delete_backup_plan + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js` + + +----- + + + + +### Backup_d_r.delete_backup_plan_association + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js` + + +----- + + + + +### Backup_d_r.delete_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js` + + +----- + + + + ### Backup_d_r.delete_management_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js). @@ -67,6 +233,142 @@ __Usage:__ +### Backup_d_r.fetch_access_token + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js` + + +----- + + + + +### Backup_d_r.fetch_usable_backup_vaults + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js` + + +----- + + + + +### Backup_d_r.finalize_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js` + + +----- + + + + +### Backup_d_r.get_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js` + + +----- + + + + +### Backup_d_r.get_backup_plan + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js` + + +----- + + + + +### Backup_d_r.get_backup_plan_association + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js` + + +----- + + + + +### Backup_d_r.get_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js` + + +----- + + + + +### Backup_d_r.get_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js` + + +----- + + + + ### Backup_d_r.get_management_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js). @@ -84,6 +386,108 @@ __Usage:__ +### Backup_d_r.initiate_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js` + + +----- + + + + +### Backup_d_r.list_backup_plan_associations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js` + + +----- + + + + +### Backup_d_r.list_backup_plans + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js` + + +----- + + + + +### Backup_d_r.list_backup_vaults + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js` + + +----- + + + + +### Backup_d_r.list_backups + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js` + + +----- + + + + +### Backup_d_r.list_data_sources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js` + + +----- + + + + ### Backup_d_r.list_management_servers View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js). @@ -101,6 +505,142 @@ __Usage:__ +### Backup_d_r.remove_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js` + + +----- + + + + +### Backup_d_r.restore_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js` + + +----- + + + + +### Backup_d_r.set_internal_status + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js` + + +----- + + + + +### Backup_d_r.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js` + + +----- + + + + +### Backup_d_r.trigger_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js` + + +----- + + + + +### Backup_d_r.update_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js` + + +----- + + + + +### Backup_d_r.update_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js` + + +----- + + + + +### Backup_d_r.update_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js` + + +----- + + + + ### Quickstart View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/quickstart.js). diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js new file mode 100644 index 00000000000..a0918427786 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js @@ -0,0 +1,77 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(dataSource) { + // [START backupdr_v1_generated_BackupDR_AbandonBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callAbandonBackup() { + // Construct request + const request = { + dataSource, + }; + + // Run request + const [operation] = await backupdrClient.abandonBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAbandonBackup(); + // [END backupdr_v1_generated_BackupDR_AbandonBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js new file mode 100644 index 00000000000..e64200d286e --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js @@ -0,0 +1,91 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupPlanId, backupPlan) { + // [START backupdr_v1_generated_BackupDR_CreateBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + */ + // const parent = 'abc123' + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + */ + // const backupPlanId = 'abc123' + /** + * Required. The `BackupPlan` resource object to create. + */ + // const backupPlan = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupPlan() { + // Construct request + const request = { + parent, + backupPlanId, + backupPlan, + }; + + // Run request + const [operation] = await backupdrClient.createBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupPlan(); + // [END backupdr_v1_generated_BackupDR_CreateBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js new file mode 100644 index 00000000000..11a85b7c441 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js @@ -0,0 +1,89 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupPlanAssociationId, backupPlanAssociation) { + // [START backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + */ + // const parent = 'abc123' + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + */ + // const backupPlanAssociationId = 'abc123' + /** + * Required. The resource being created + */ + // const backupPlanAssociation = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupPlanAssociation() { + // Construct request + const request = { + parent, + backupPlanAssociationId, + backupPlanAssociation, + }; + + // Run request + const [operation] = await backupdrClient.createBackupPlanAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js new file mode 100644 index 00000000000..2fe111a58f8 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js @@ -0,0 +1,93 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupVaultId, backupVault) { + // [START backupdr_v1_generated_BackupDR_CreateBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + */ + // const backupVaultId = 'abc123' + /** + * Required. The resource being created + */ + // const backupVault = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupVault() { + // Construct request + const request = { + parent, + backupVaultId, + backupVault, + }; + + // Run request + const [operation] = await backupdrClient.createBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupVault(); + // [END backupdr_v1_generated_BackupDR_CreateBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js index 5670ead5da4..f14ca310e86 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js @@ -30,8 +30,8 @@ function main(parent, managementServerId, managementServer) { */ /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js new file mode 100644 index 00000000000..fc987c807df --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js @@ -0,0 +1,76 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackup(); + // [END backupdr_v1_generated_BackupDR_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js new file mode 100644 index 00000000000..808b705c69b --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js @@ -0,0 +1,77 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupPlan(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js new file mode 100644 index 00000000000..50f03c1829e --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js @@ -0,0 +1,77 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupPlanAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupPlanAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js new file mode 100644 index 00000000000..6252bf9d7cf --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js @@ -0,0 +1,97 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + */ + // const force = true + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + */ + // const etag = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + */ + // const allowMissing = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupVault() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupVault(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js new file mode 100644 index 00000000000..f322b28083c --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js @@ -0,0 +1,69 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, generationId) { + // [START backupdr_v1_generated_BackupDR_FetchAccessToken_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name for the location for which static IPs should be + * returned. + * Must be in the format + * 'projects/* /locations/* /backupVaults/* /dataSources'. + */ + // const name = 'abc123' + /** + * Required. The generation of the backup to update. + */ + // const generationId = 1234 + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchAccessToken() { + // Construct request + const request = { + name, + generationId, + }; + + // Run request + const response = await backupdrClient.fetchAccessToken(request); + console.log(response); + } + + callFetchAccessToken(); + // [END backupdr_v1_generated_BackupDR_FetchAccessToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js new file mode 100644 index 00000000000..6b32fe8b894 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js @@ -0,0 +1,85 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchUsableBackupVaults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.fetchUsableBackupVaultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchUsableBackupVaults(); + // [END backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js new file mode 100644 index 00000000000..458004f5820 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js @@ -0,0 +1,109 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(dataSource, backupId) { + // [START backupdr_v1_generated_BackupDR_FinalizeBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * This will be assigned to the description field of the newly created Backup. + */ + // const description = 'abc123' + /** + * The point in time when this backup was captured from the source. This will + * be assigned to the consistency_time field of the newly created Backup. + */ + // const consistencyTime = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Required. Resource ID of the Backup resource to be finalized. This must be + * the same backup_id that was used in the InitiateBackupRequest. + */ + // const backupId = 'abc123' + /** + * The earliest timestamp of data available in this Backup. This will set on + * the newly created Backup. + */ + // const recoveryRangeStartTime = {} + /** + * The latest timestamp of data available in this Backup. This will be set on + * the newly created Backup. + */ + // const recoveryRangeEndTime = {} + /** + * The ExpireTime on the backup will be set to FinalizeTime plus this + * duration. If the resulting ExpireTime is less than + * EnforcedRetentionEndTime, then ExpireTime is set to + * EnforcedRetentionEndTime. + */ + // const retentionDuration = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFinalizeBackup() { + // Construct request + const request = { + dataSource, + backupId, + }; + + // Run request + const [operation] = await backupdrClient.finalizeBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callFinalizeBackup(); + // [END backupdr_v1_generated_BackupDR_FinalizeBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js new file mode 100644 index 00000000000..25d41ba5f59 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js @@ -0,0 +1,67 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + */ + // const name = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackup(request); + console.log(response); + } + + callGetBackup(); + // [END backupdr_v1_generated_BackupDR_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js new file mode 100644 index 00000000000..f7fa54ebe7c --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupPlan(request); + console.log(response); + } + + callGetBackupPlan(); + // [END backupdr_v1_generated_BackupDR_GetBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js new file mode 100644 index 00000000000..92f8a9b7ff3 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupPlanAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupPlanAssociation(request); + console.log(response); + } + + callGetBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js new file mode 100644 index 00000000000..1f000c8433e --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js @@ -0,0 +1,67 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + */ + // const name = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupVault() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupVault(request); + console.log(response); + } + + callGetBackupVault(); + // [END backupdr_v1_generated_BackupDR_GetBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js new file mode 100644 index 00000000000..7500e457572 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js @@ -0,0 +1,62 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetDataSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getDataSource(request); + console.log(response); + } + + callGetDataSource(); + // [END backupdr_v1_generated_BackupDR_GetDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js index afa3ba0f8b2..11cc5ae277f 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' */ // const name = 'abc123' diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js new file mode 100644 index 00000000000..3074e90ead4 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js @@ -0,0 +1,81 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(dataSource, backupId) { + // [START backupdr_v1_generated_BackupDR_InitiateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Required. Resource ID of the Backup resource. + */ + // const backupId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callInitiateBackup() { + // Construct request + const request = { + dataSource, + backupId, + }; + + // Run request + const response = await backupdrClient.initiateBackup(request); + console.log(response); + } + + callInitiateBackup(); + // [END backupdr_v1_generated_BackupDR_InitiateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js new file mode 100644 index 00000000000..0f2b5ee7e12 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js @@ -0,0 +1,81 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupPlanAssociations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupPlanAssociationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlanAssociations(); + // [END backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js new file mode 100644 index 00000000000..2118748eca9 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js @@ -0,0 +1,93 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupPlans_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The value of + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Optional. Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupPlans() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupPlansAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlans(); + // [END backupdr_v1_generated_BackupDR_ListBackupPlans_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js new file mode 100644 index 00000000000..dca6928eade --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js @@ -0,0 +1,90 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupVaults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupVaults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupVaultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupVaults(); + // [END backupdr_v1_generated_BackupDR_ListBackupVaults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js new file mode 100644 index 00000000000..d72a8fd2d9f --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js @@ -0,0 +1,90 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END backupdr_v1_generated_BackupDR_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js new file mode 100644 index 00000000000..3858f996f71 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js @@ -0,0 +1,85 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListDataSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListDataSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listDataSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataSources(); + // [END backupdr_v1_generated_BackupDR_ListDataSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js index 4acf62dd19c..262d1a29e3c 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js @@ -30,10 +30,11 @@ function main(parent) { */ /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js new file mode 100644 index 00000000000..0dee36fae52 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js @@ -0,0 +1,76 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_RemoveDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callRemoveDataSource() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.removeDataSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRemoveDataSource(); + // [END backupdr_v1_generated_BackupDR_RemoveDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js new file mode 100644 index 00000000000..3b156cdc818 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js @@ -0,0 +1,85 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_RestoreBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the Backup instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Compute Engine target environment to be used during restore. + */ + // const computeInstanceTargetEnvironment = {} + /** + * Compute Engine instance properties to be overridden during restore. + */ + // const computeInstanceRestoreProperties = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callRestoreBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.restoreBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreBackup(); + // [END backupdr_v1_generated_BackupDR_RestoreBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js new file mode 100644 index 00000000000..fdc8f37cd03 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js @@ -0,0 +1,87 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(dataSource, value, backupConfigState) { + // [START backupdr_v1_generated_BackupDR_SetInternalStatus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * Required. The value required for this method to work. This field must be + * the 32-byte SHA256 hash of the DataSourceID. The DataSourceID used here is + * only the final piece of the fully qualified resource path for this + * DataSource (i.e. the part after '.../dataSources/'). This field exists to + * make this method difficult to call since it is intended for use only by + * Backup Appliances. + */ + // const value = Buffer.from('string') + /** + * Required. Output only. The new BackupConfigState to set for the DataSource. + */ + // const backupConfigState = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. The request + * ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callSetInternalStatus() { + // Construct request + const request = { + dataSource, + value, + backupConfigState, + }; + + // Run request + const [operation] = await backupdrClient.setInternalStatus(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSetInternalStatus(); + // [END backupdr_v1_generated_BackupDR_SetInternalStatus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js new file mode 100644 index 00000000000..e2905be7ced --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js @@ -0,0 +1,70 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(resource, permissions) { + // [START backupdr_v1_generated_BackupDR_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await backupdrClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END backupdr_v1_generated_BackupDR_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js new file mode 100644 index 00000000000..4d212d1ced7 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js @@ -0,0 +1,82 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, ruleId) { + // [START backupdr_v1_generated_BackupDR_TriggerBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + /** + * Required. backup rule_id for which a backup needs to be triggered. + */ + // const ruleId = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callTriggerBackup() { + // Construct request + const request = { + name, + ruleId, + }; + + // Run request + const [operation] = await backupdrClient.triggerBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTriggerBackup(); + // [END backupdr_v1_generated_BackupDR_TriggerBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js new file mode 100644 index 00000000000..06b0a51edd7 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js @@ -0,0 +1,85 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, backup) { + // [START backupdr_v1_generated_BackupDR_UpdateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backup = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + updateMask, + backup, + }; + + // Run request + const [operation] = await backupdrClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackup(); + // [END backupdr_v1_generated_BackupDR_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js new file mode 100644 index 00000000000..62444645da6 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js @@ -0,0 +1,95 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, backupVault) { + // [START backupdr_v1_generated_BackupDR_UpdateBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backupVault = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + */ + // const force = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackupVault() { + // Construct request + const request = { + updateMask, + backupVault, + }; + + // Run request + const [operation] = await backupdrClient.updateBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackupVault(); + // [END backupdr_v1_generated_BackupDR_UpdateBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js new file mode 100644 index 00000000000..707ff65f27d --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js @@ -0,0 +1,89 @@ +// Copyright 2024 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 +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, dataSource) { + // [START backupdr_v1_generated_BackupDR_UpdateDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const dataSource = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Enable upsert. + */ + // const allowMissing = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateDataSource() { + // Construct request + const request = { + updateMask, + dataSource, + }; + + // Run request + const [operation] = await backupdrClient.updateDataSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDataSource(); + // [END backupdr_v1_generated_BackupDR_UpdateDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json b/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json index b273e8759e1..9774bcfa0db 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json +++ b/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 77, "type": "FULL" } ], @@ -202,6 +202,1162 @@ } } } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupVault_async", + "title": "BackupDR createBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Creates a new BackupVault in a given project and location.", + "canonical": true, + "file": "backup_d_r.create_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_vault_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_vault", + "type": ".google.cloud.backupdr.v1.BackupVault" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupVaults_async", + "title": "BackupDR listBackupVaults Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupVaults in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_vaults.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupVaultView" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupVaultsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async", + "title": "BackupDR fetchUsableBackupVaults Sample", + "origin": "API_DEFINITION", + "description": " FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.", + "canonical": true, + "file": "backup_d_r.fetch_usable_backup_vaults.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchUsableBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "FetchUsableBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupVault_async", + "title": "BackupDR getBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a BackupVault.", + "canonical": true, + "file": "backup_d_r.get_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupVaultView" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupVault", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupVault_async", + "title": "BackupDR updateBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a BackupVault.", + "canonical": true, + "file": "backup_d_r.update_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup_vault", + "type": ".google.cloud.backupdr.v1.BackupVault" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupVault_async", + "title": "BackupDR deleteBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Deletes a BackupVault.", + "canonical": true, + "file": "backup_d_r.delete_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListDataSources_async", + "title": "BackupDR listDataSources Sample", + "origin": "API_DEFINITION", + "description": " Lists DataSources in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_data_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataSources", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListDataSourcesResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListDataSources", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetDataSource_async", + "title": "BackupDR getDataSource Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a DataSource.", + "canonical": true, + "file": "backup_d_r.get_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.DataSource", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateDataSource_async", + "title": "BackupDR updateDataSource Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a DataSource.", + "canonical": true, + "file": "backup_d_r.update_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "data_source", + "type": ".google.cloud.backupdr.v1.DataSource" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackups_async", + "title": "BackupDR listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists Backups in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupView" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackup_async", + "title": "BackupDR getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a Backup.", + "canonical": true, + "file": "backup_d_r.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupView" + } + ], + "resultType": ".google.cloud.backupdr.v1.Backup", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackup_async", + "title": "BackupDR updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a Backup.", + "canonical": true, + "file": "backup_d_r.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup", + "type": ".google.cloud.backupdr.v1.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackup_async", + "title": "BackupDR deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Backup.", + "canonical": true, + "file": "backup_d_r.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_RestoreBackup_async", + "title": "BackupDR restoreBackup Sample", + "origin": "API_DEFINITION", + "description": " Restore from a Backup", + "canonical": true, + "file": "backup_d_r.restore_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "compute_instance_target_environment", + "type": ".google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment" + }, + { + "name": "compute_instance_restore_properties", + "type": ".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "RestoreBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlan_async", + "title": "BackupDR createBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Create a BackupPlan", + "canonical": true, + "file": "backup_d_r.create_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan", + "type": ".google.cloud.backupdr.v1.BackupPlan" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlan_async", + "title": "BackupDR getBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackupPlan.", + "canonical": true, + "file": "backup_d_r.get_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupPlan", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlans_async", + "title": "BackupDR listBackupPlans Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlans in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_plans.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupPlansResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlan_async", + "title": "BackupDR deleteBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single BackupPlan.", + "canonical": true, + "file": "backup_d_r.delete_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async", + "title": "BackupDR createBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Create a BackupPlanAssociation", + "canonical": true, + "file": "backup_d_r.create_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_association_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_association", + "type": ".google.cloud.backupdr.v1.BackupPlanAssociation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async", + "title": "BackupDR getBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackupPlanAssociation.", + "canonical": true, + "file": "backup_d_r.get_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupPlanAssociation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async", + "title": "BackupDR listBackupPlanAssociations Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlanAssociations in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_plan_associations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlanAssociations", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupPlanAssociations", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async", + "title": "BackupDR deleteBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single BackupPlanAssociation.", + "canonical": true, + "file": "backup_d_r.delete_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_TriggerBackup_async", + "title": "BackupDR triggerBackup Sample", + "origin": "API_DEFINITION", + "description": " Triggers a new Backup.", + "canonical": true, + "file": "backup_d_r.trigger_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TriggerBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rule_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "TriggerBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts b/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts index f793a7c9a33..2e2d2ae78bf 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts @@ -214,6 +214,21 @@ export class BackupDRClient { // 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}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}' + ), + backupPlanPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}' + ), + backupPlanAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}' + ), + backupVaultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}' + ), + dataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}' + ), locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), @@ -234,6 +249,36 @@ export class BackupDRClient { 'nextPageToken', 'managementServers' ), + listBackupVaults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupVaults' + ), + fetchUsableBackupVaults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupVaults' + ), + listDataSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataSources' + ), + listBackups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backups' + ), + listBackupPlans: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupPlans' + ), + listBackupPlanAssociations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupPlanAssociations' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -303,6 +348,78 @@ export class BackupDRClient { const deleteManagementServerMetadata = protoFilesRoot.lookup( '.google.cloud.backupdr.v1.OperationMetadata' ) as gax.protobuf.Type; + const createBackupVaultResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupVault' + ) as gax.protobuf.Type; + const createBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupVaultResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupVault' + ) as gax.protobuf.Type; + const updateBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupVaultResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateDataSourceResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.DataSource' + ) as gax.protobuf.Type; + const updateDataSourceMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.Backup' + ) as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.Backup' + ) as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const restoreBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.RestoreBackupResponse' + ) as gax.protobuf.Type; + const restoreBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createBackupPlanResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlan' + ) as gax.protobuf.Type; + const createBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupPlanResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createBackupPlanAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlanAssociation' + ) as gax.protobuf.Type; + const createBackupPlanAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupPlanAssociationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupPlanAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const triggerBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlanAssociation' + ) as gax.protobuf.Type; + const triggerBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createManagementServer: new this._gaxModule.LongrunningDescriptor( @@ -323,6 +440,74 @@ export class BackupDRClient { deleteManagementServerMetadata ) ), + createBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupVaultResponse.decode.bind(createBackupVaultResponse), + createBackupVaultMetadata.decode.bind(createBackupVaultMetadata) + ), + updateBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupVaultResponse.decode.bind(updateBackupVaultResponse), + updateBackupVaultMetadata.decode.bind(updateBackupVaultMetadata) + ), + deleteBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupVaultResponse.decode.bind(deleteBackupVaultResponse), + deleteBackupVaultMetadata.decode.bind(deleteBackupVaultMetadata) + ), + updateDataSource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDataSourceResponse.decode.bind(updateDataSourceResponse), + updateDataSourceMetadata.decode.bind(updateDataSourceMetadata) + ), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata) + ), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata) + ), + restoreBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreBackupResponse.decode.bind(restoreBackupResponse), + restoreBackupMetadata.decode.bind(restoreBackupMetadata) + ), + createBackupPlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupPlanResponse.decode.bind(createBackupPlanResponse), + createBackupPlanMetadata.decode.bind(createBackupPlanMetadata) + ), + deleteBackupPlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupPlanResponse.decode.bind(deleteBackupPlanResponse), + deleteBackupPlanMetadata.decode.bind(deleteBackupPlanMetadata) + ), + createBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupPlanAssociationResponse.decode.bind( + createBackupPlanAssociationResponse + ), + createBackupPlanAssociationMetadata.decode.bind( + createBackupPlanAssociationMetadata + ) + ), + deleteBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupPlanAssociationResponse.decode.bind( + deleteBackupPlanAssociationResponse + ), + deleteBackupPlanAssociationMetadata.decode.bind( + deleteBackupPlanAssociationMetadata + ) + ), + triggerBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + triggerBackupResponse.decode.bind(triggerBackupResponse), + triggerBackupMetadata.decode.bind(triggerBackupMetadata) + ), }; // Put together the default options sent with requests. @@ -379,6 +564,29 @@ export class BackupDRClient { 'getManagementServer', 'createManagementServer', 'deleteManagementServer', + 'createBackupVault', + 'listBackupVaults', + 'fetchUsableBackupVaults', + 'getBackupVault', + 'updateBackupVault', + 'deleteBackupVault', + 'listDataSources', + 'getDataSource', + 'updateDataSource', + 'listBackups', + 'getBackup', + 'updateBackup', + 'deleteBackup', + 'restoreBackup', + 'createBackupPlan', + 'getBackupPlan', + 'listBackupPlans', + 'deleteBackupPlan', + 'createBackupPlanAssociation', + 'getBackupPlanAssociation', + 'listBackupPlanAssociations', + 'deleteBackupPlanAssociation', + 'triggerBackup', ]; for (const methodName of backupDRStubMethods) { const callPromise = this.backupDRStub.then( @@ -503,7 +711,7 @@ export class BackupDRClient { * The request object that will be sent. * @param {string} request.name * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * @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. @@ -587,110 +795,73 @@ export class BackupDRClient { this.initialize(); return this.innerApiCalls.getManagementServer(request, options, callback); } - /** - * Creates a new ManagementServer in a given project and location. + * Gets details of a BackupVault. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. - * @param {string} request.managementServerId - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * @param {google.cloud.backupdr.v1.ManagementServer} request.managementServer - * Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} request.name + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault * @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 } + * The first element of the array is an object representing {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. + * 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/backup_d_r.create_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async + * @example include:samples/generated/v1/backup_d_r.get_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupVault_async */ - createManagementServer( - request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | undefined, {} | undefined, ] >; - createManagementServer( - request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | null | undefined, {} | null | undefined > ): void; - createManagementServer( - request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, callback: Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | null | undefined, {} | null | undefined > ): void; - createManagementServer( - request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, optionsOrCallback?: | CallOptions | Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + | protos.google.cloud.backupdr.v1.IGetBackupVaultRequest + | null + | undefined, {} | null | undefined >, callback?: Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | null | undefined, {} | null | undefined > ): Promise< [ - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | undefined, {} | undefined, ] > | void { @@ -707,144 +878,75 @@ export class BackupDRClient { 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.createManagementServer( - request, - options, - callback - ); - } - /** - * Check the status of the long running operation returned by `createManagementServer()`. - * @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/backup_d_r.create_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async - */ - async checkCreateManagementServerProgress( - name: string - ): Promise< - LROperation< - protos.google.cloud.backupdr.v1.ManagementServer, - protos.google.cloud.backupdr.v1.OperationMetadata - > - > { - 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.createManagementServer, - this._gaxModule.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.cloud.backupdr.v1.ManagementServer, - protos.google.cloud.backupdr.v1.OperationMetadata - >; + return this.innerApiCalls.getBackupVault(request, options, callback); } /** - * Deletes a single ManagementServer. + * Gets details of a DataSource. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the resource - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' * @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 } + * The first element of the array is an object representing {@link protos.google.cloud.backupdr.v1.DataSource|DataSource}. + * 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/backup_d_r.delete_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + * @example include:samples/generated/v1/backup_d_r.get_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_GetDataSource_async */ - deleteManagementServer( - request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + getDataSource( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | undefined, {} | undefined, ] >; - deleteManagementServer( - request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + getDataSource( + request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | null | undefined, {} | null | undefined > ): void; - deleteManagementServer( - request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + getDataSource( + request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | null | undefined, {} | null | undefined > ): void; - deleteManagementServer( - request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + getDataSource( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, optionsOrCallback?: | CallOptions | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + | protos.google.cloud.backupdr.v1.IGetDataSourceRequest + | null + | undefined, {} | null | undefined >, callback?: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | null | undefined, {} | null | undefined > ): Promise< [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | undefined, {} | undefined, ] > | void { @@ -864,56 +966,3830 @@ export class BackupDRClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteManagementServer( + return this.innerApiCalls.getDataSource(request, options, callback); + } + /** + * Gets details of a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @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.cloud.backupdr.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/backup_d_r.get_backup.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackup_async + */ + getBackup( + request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | undefined, + {} | undefined, + ] + >; + getBackup( + request: protos.google.cloud.backupdr.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request: protos.google.cloud.backupdr.v1.IGetBackupRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.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); + } + /** + * Gets details of a single BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `BackupPlan` to retrieve. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @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.cloud.backupdr.v1.BackupPlan|BackupPlan}. + * 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/backup_d_r.get_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlan_async + */ + getBackupPlan( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | undefined, + {} | undefined, + ] + >; + getBackupPlan( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackupPlan( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackupPlan( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + | protos.google.cloud.backupdr.v1.IGetBackupPlanRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | 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.getBackupPlan(request, options, callback); + } + /** + * Gets details of a single BackupPlanAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @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.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. + * 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/backup_d_r.get_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async + */ + getBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + ( + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | undefined + ), + {} | undefined, + ] + >; + getBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + ( + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | 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.getBackupPlanAssociation( request, options, callback ); } + /** - * Check the status of the long running operation returned by `deleteManagementServer()`. - * @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. + * Creates a new ManagementServer in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + * @param {string} request.managementServerId + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * @param {google.cloud.backupdr.v1.ManagementServer} request.managementServer + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.delete_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + * @example include:samples/generated/v1/backup_d_r.create_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async */ - async checkDeleteManagementServerProgress( - name: string + createManagementServer( + request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + options?: CallOptions ): Promise< - LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.backupdr.v1.OperationMetadata - > - > { - 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.deleteManagementServer, - this._gaxModule.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, + [ + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createManagementServer( + request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createManagementServer( + request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createManagementServer( + request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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.createManagementServer( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createManagementServer()`. + * @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/backup_d_r.create_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async + */ + async checkCreateManagementServerProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.ManagementServer, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.createManagementServer, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.ManagementServer, protos.google.cloud.backupdr.v1.OperationMetadata >; } /** - * Lists ManagementServers in a given project and location. + * Deletes a single ManagementServer. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.delete_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + */ + deleteManagementServer( + request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteManagementServer( + request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteManagementServer( + request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteManagementServer( + request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteManagementServer( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteManagementServer()`. + * @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/backup_d_r.delete_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + */ + async checkDeleteManagementServerProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.deleteManagementServer, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Creates a new BackupVault in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.backupVaultId + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @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/backup_d_r.create_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async + */ + createBackupVault( + request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBackupVault( + request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupVault( + request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupVault( + request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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.createBackupVault(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createBackupVault()`. + * @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/backup_d_r.create_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async + */ + async checkCreateBackupVaultProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.createBackupVault, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Updates the settings of a BackupVault. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {boolean} [request.force] + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * @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/backup_d_r.update_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async + */ + updateBackupVault( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateBackupVault( + request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackupVault( + request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackupVault( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + 'backup_vault.name': request.backupVault!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBackupVault(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateBackupVault()`. + * @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/backup_d_r.update_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async + */ + async checkUpdateBackupVaultProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.updateBackupVault, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a BackupVault. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.force] + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * @param {string} request.etag + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {boolean} [request.allowMissing] + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * @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/backup_d_r.delete_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async + */ + deleteBackupVault( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackupVault( + request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupVault( + request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupVault( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackupVault(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteBackupVault()`. + * @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/backup_d_r.delete_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async + */ + async checkDeleteBackupVaultProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.deleteBackupVault, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Updates the settings of a DataSource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.DataSource} request.dataSource + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. Enable upsert. + * @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/backup_d_r.update_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async + */ + updateDataSource( + request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateDataSource( + request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDataSource( + request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDataSource( + request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + 'data_source.name': request.dataSource!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateDataSource(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateDataSource()`. + * @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/backup_d_r.update_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async + */ + async checkUpdateDataSourceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.DataSource, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.updateDataSource, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.DataSource, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Updates the settings of a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.Backup} request.backup + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.update_backup.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateBackup( + request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateBackup()`. + * @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/backup_d_r.update_backup.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async + */ + async checkUpdateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.updateBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.delete_backup.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackup( + request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteBackup()`. + * @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/backup_d_r.delete_backup.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async + */ + async checkDeleteBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.deleteBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Restore from a Backup + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Backup instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} request.computeInstanceTargetEnvironment + * Compute Engine target environment to be used during restore. + * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} request.computeInstanceRestoreProperties + * Compute Engine instance properties to be overridden during restore. + * @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/backup_d_r.restore_backup.js + * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async + */ + restoreBackup( + request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + restoreBackup( + request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreBackup( + request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreBackup( + request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.restoreBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `restoreBackup()`. + * @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/backup_d_r.restore_backup.js + * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async + */ + async checkRestoreBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.RestoreBackupResponse, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.restoreBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.RestoreBackupResponse, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Create a BackupPlan + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @param {string} request.backupPlanId + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /{@link protos.a-z0-9-|a-z}{,62}/. + * @param {google.cloud.backupdr.v1.BackupPlan} request.backupPlan + * Required. The `BackupPlan` resource object to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.create_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async + */ + createBackupPlan( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBackupPlan( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlan( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlan( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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.createBackupPlan(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createBackupPlan()`. + * @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/backup_d_r.create_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async + */ + async checkCreateBackupPlanProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupPlan, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.createBackupPlan, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupPlan, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a single BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `BackupPlan` to delete. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.delete_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async + */ + deleteBackupPlan( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackupPlan( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlan( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlan( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackupPlan(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteBackupPlan()`. + * @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/backup_d_r.delete_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async + */ + async checkDeleteBackupPlanProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.deleteBackupPlan, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Create a BackupPlanAssociation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @param {string} request.backupPlanAssociationId + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} request.backupPlanAssociation + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.create_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async + */ + createBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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.createBackupPlanAssociation( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createBackupPlanAssociation()`. + * @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/backup_d_r.create_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async + */ + async checkCreateBackupPlanAssociationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.createBackupPlanAssociation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a single BackupPlanAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.delete_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async + */ + deleteBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackupPlanAssociation( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteBackupPlanAssociation()`. + * @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/backup_d_r.delete_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async + */ + async checkDeleteBackupPlanAssociationProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.deleteBackupPlanAssociation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Triggers a new Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {string} request.ruleId + * Required. backup rule_id for which a backup needs to be triggered. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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/backup_d_r.trigger_backup.js + * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async + */ + triggerBackup( + request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + triggerBackup( + request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + triggerBackup( + request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + triggerBackup( + request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.triggerBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `triggerBackup()`. + * @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/backup_d_r.trigger_backup.js + * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async + */ + async checkTriggerBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + 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.triggerBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Lists ManagementServers in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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 Array of {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listManagementServersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listManagementServers( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse, + ] + >; + listManagementServers( + request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + > + ): void; + listManagementServers( + request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + > + ): void; + listManagementServers( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse, + ] + > | 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.listManagementServers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listManagementServersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listManagementServersStream( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listManagementServers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listManagementServers.createStream( + this.innerApiCalls.listManagementServers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listManagementServers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_management_servers.js + * region_tag:backupdr_v1_generated_BackupDR_ListManagementServers_async + */ + listManagementServersAsync( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listManagementServers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listManagementServers.asyncIterate( + this.innerApiCalls['listManagementServers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupVaults in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @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 Array of {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupVaultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupVaults( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse, + ] + >; + listBackupVaults( + request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + listBackupVaults( + request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + listBackupVaults( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse, + ] + > | 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.listBackupVaults(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupVaultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupVaultsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBackupVaults.createStream( + this.innerApiCalls.listBackupVaults as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBackupVaults`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_backup_vaults.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupVaults_async + */ + listBackupVaultsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBackupVaults.asyncIterate( + this.innerApiCalls['listBackupVaults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * FetchUsableBackupVaults lists usable BackupVaults in a given project and + * location. Usable BackupVault are the ones that user has + * backupdr.backupVaults.get permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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 Array of {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `fetchUsableBackupVaultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + fetchUsableBackupVaults( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, + ] + >; + fetchUsableBackupVaults( + request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + fetchUsableBackupVaults( + request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + fetchUsableBackupVaults( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, + ] + > | 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.fetchUsableBackupVaults( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `fetchUsableBackupVaultsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + fetchUsableBackupVaultsStream( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['fetchUsableBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchUsableBackupVaults.createStream( + this.innerApiCalls.fetchUsableBackupVaults as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `fetchUsableBackupVaults`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js + * region_tag:backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async + */ + fetchUsableBackupVaultsAsync( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['fetchUsableBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.fetchUsableBackupVaults.asyncIterate( + this.innerApiCalls['fetchUsableBackupVaults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataSources in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @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 Array of {@link protos.google.cloud.backupdr.v1.DataSource|DataSource}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDataSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDataSources( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest | null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse, + ] + >; + listDataSources( + request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + > + ): void; + listDataSources( + request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + > + ): void; + listDataSources( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest | null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse, + ] + > | 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.listDataSources(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.DataSource|DataSource} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDataSourcesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listDataSourcesStream( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataSources.createStream( + this.innerApiCalls.listDataSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDataSources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.DataSource|DataSource}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_data_sources.js + * region_tag:backupdr_v1_generated_BackupDR_ListDataSources_async + */ + listDataSourcesAsync( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDataSources.asyncIterate( + this.innerApiCalls['listDataSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Backups in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @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 Array of {@link protos.google.cloud.backupdr.v1.Backup|Backup}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackups( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupsResponse, + ] + >; + listBackups( + request: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.backupdr.v1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.backupdr.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.backupdr.v1.IBackup + > + ): void; + listBackups( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + | protos.google.cloud.backupdr.v1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackup + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.backupdr.v1.IBackup + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupsResponse, + ] + > | 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); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.Backup|Backup} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBackups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.Backup|Backup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_backups.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupPlans in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the results. + * @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 Array of {@link protos.google.cloud.backupdr.v1.BackupPlan|BackupPlan}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listBackupPlansAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupPlans( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse, + ] + >; + listBackupPlans( + request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan + > + ): void; + listBackupPlans( + request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan + > + ): void; + listBackupPlans( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse, + ] + > | 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.listBackupPlans(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupPlan|BackupPlan} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listBackupPlansAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listBackupPlansStream( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options?: CallOptions + ): Transform { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listBackupPlans']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBackupPlans.createStream( + this.innerApiCalls.listBackupPlans as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBackupPlans`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.BackupPlan|BackupPlan}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_backup_plans.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlans_async + */ + listBackupPlansAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + 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 ?? '', + }); + const defaultCallSettings = this._defaults['listBackupPlans']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listBackupPlans.asyncIterate( + this.innerApiCalls['listBackupPlans'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupPlanAssociations in a given project and location. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the * `{location}` value. * @param {number} [request.pageSize] * Optional. Requested page size. Server may return fewer items than @@ -921,75 +4797,73 @@ export class BackupDRClient { * @param {string} [request.pageToken] * Optional. A token identifying a page of results the server should return. * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. + * Optional. Filtering results * @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 Array of {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. - * We recommend using `listManagementServersAsync()` + * We recommend using `listBackupPlanAssociationsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ - listManagementServers( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.backupdr.v1.IManagementServer[], - protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, - protos.google.cloud.backupdr.v1.IListManagementServersResponse, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, ] >; - listManagementServers( - request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation > ): void; - listManagementServers( - request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation > ): void; - listManagementServers( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation >, callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation > ): Promise< [ - protos.google.cloud.backupdr.v1.IManagementServer[], - protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, - protos.google.cloud.backupdr.v1.IListManagementServersResponse, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, ] > | void { request = request || {}; @@ -1008,7 +4882,11 @@ export class BackupDRClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listManagementServers(request, options, callback); + return this.innerApiCalls.listBackupPlanAssociations( + request, + options, + callback + ); } /** @@ -1016,10 +4894,11 @@ export class BackupDRClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the * `{location}` value. * @param {number} [request.pageSize] * Optional. Requested page size. Server may return fewer items than @@ -1027,22 +4906,20 @@ export class BackupDRClient { * @param {string} [request.pageToken] * Optional. A token identifying a page of results the server should return. * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. + * Optional. Filtering results * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer} on 'data' event. + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. - * We recommend using `listManagementServersAsync()` + * We recommend using `listBackupPlanAssociationsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ - listManagementServersStream( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociationsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options?: CallOptions ): Transform { request = request || {}; @@ -1053,27 +4930,28 @@ export class BackupDRClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listManagementServers']; + const defaultCallSettings = this._defaults['listBackupPlanAssociations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listManagementServers.createStream( - this.innerApiCalls.listManagementServers as GaxCall, + return this.descriptors.page.listBackupPlanAssociations.createStream( + this.innerApiCalls.listBackupPlanAssociations as GaxCall, request, callSettings ); } /** - * Equivalent to `listManagementServers`, but returns an iterable object. + * Equivalent to `listBackupPlanAssociations`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the * `{location}` value. * @param {number} [request.pageSize] * Optional. Requested page size. Server may return fewer items than @@ -1081,25 +4959,23 @@ export class BackupDRClient { * @param {string} [request.pageToken] * Optional. A token identifying a page of results the server should return. * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. + * Optional. Filtering results * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.list_management_servers.js - * region_tag:backupdr_v1_generated_BackupDR_ListManagementServers_async + * @example include:samples/generated/v1/backup_d_r.list_backup_plan_associations.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async */ - listManagementServersAsync( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociationsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1108,14 +4984,14 @@ export class BackupDRClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listManagementServers']; + const defaultCallSettings = this._defaults['listBackupPlanAssociations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listManagementServers.asyncIterate( - this.innerApiCalls['listManagementServers'] as GaxCall, + return this.descriptors.page.listBackupPlanAssociations.asyncIterate( + this.innerApiCalls['listBackupPlanAssociations'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** * Gets the access control policy for a resource. Returns an empty policy @@ -1512,6 +5388,325 @@ export class BackupDRClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath( + project: string, + location: string, + backupvault: string, + datasource: string, + backup: string + ) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + 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 backupvault from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backupvault; + } + + /** + * Parse the datasource from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).datasource; + } + + /** + * 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 backupPlan resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @returns {string} Resource name string. + */ + backupPlanPath(project: string, location: string, backupPlan: string) { + return this.pathTemplates.backupPlanPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + }); + } + + /** + * Parse the project from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName) + .project; + } + + /** + * Parse the location from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName) + .location; + } + + /** + * Parse the backup_plan from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName) + .backup_plan; + } + + /** + * Return a fully-qualified backupPlanAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan_association + * @returns {string} Resource name string. + */ + backupPlanAssociationPath( + project: string, + location: string, + backupPlanAssociation: string + ) { + return this.pathTemplates.backupPlanAssociationPathTemplate.render({ + project: project, + location: location, + backup_plan_association: backupPlanAssociation, + }); + } + + /** + * Parse the project from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match( + backupPlanAssociationName + ).project; + } + + /** + * Parse the location from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanAssociationName( + backupPlanAssociationName: string + ) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match( + backupPlanAssociationName + ).location; + } + + /** + * Parse the backup_plan_association from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the backup_plan_association. + */ + matchBackupPlanAssociationFromBackupPlanAssociationName( + backupPlanAssociationName: string + ) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match( + backupPlanAssociationName + ).backup_plan_association; + } + + /** + * Return a fully-qualified backupVault resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @returns {string} Resource name string. + */ + backupVaultPath(project: string, location: string, backupvault: string) { + return this.pathTemplates.backupVaultPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + }); + } + + /** + * Parse the project from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName) + .project; + } + + /** + * Parse the location from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName) + .location; + } + + /** + * Parse the backupvault from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName) + .backupvault; + } + + /** + * Return a fully-qualified dataSource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @returns {string} Resource name string. + */ + dataSourcePath( + project: string, + location: string, + backupvault: string, + datasource: string + ) { + return this.pathTemplates.dataSourcePathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + }); + } + + /** + * Parse the project from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .project; + } + + /** + * Parse the location from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .location; + } + + /** + * Parse the backupvault from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .backupvault; + } + + /** + * Parse the datasource from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .datasource; + } + /** * Return a fully-qualified location resource name string. * diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json b/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json index 120fe4b7bcf..38b3cbc1a37 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json @@ -51,6 +51,111 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "FetchUsableBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlans": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlanAssociations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TriggerBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json b/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json index 33bf9e3abd8..79496ec85e7 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json @@ -1,3 +1,8 @@ [ - "../../protos/google/cloud/backupdr/v1/backupdr.proto" + "../../protos/google/cloud/backupdr/v1/backupdr.proto", + "../../protos/google/cloud/backupdr/v1/backupplan.proto", + "../../protos/google/cloud/backupdr/v1/backupplanassociation.proto", + "../../protos/google/cloud/backupdr/v1/backupvault.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_ba.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_gce.proto" ] diff --git a/packages/google-cloud-backupdr/src/v1/gapic_metadata.json b/packages/google-cloud-backupdr/src/v1/gapic_metadata.json index dcbec27da8a..c23b63f10dc 100644 --- a/packages/google-cloud-backupdr/src/v1/gapic_metadata.json +++ b/packages/google-cloud-backupdr/src/v1/gapic_metadata.json @@ -15,6 +15,31 @@ "getManagementServer" ] }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, "CreateManagementServer": { "methods": [ "createManagementServer" @@ -25,12 +50,114 @@ "deleteManagementServer" ] }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, "ListManagementServers": { "methods": [ "listManagementServers", "listManagementServersStream", "listManagementServersAsync" ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults", + "listBackupVaultsStream", + "listBackupVaultsAsync" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults", + "fetchUsableBackupVaultsStream", + "fetchUsableBackupVaultsAsync" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations", + "listBackupPlanAssociationsStream", + "listBackupPlanAssociationsAsync" + ] } } }, @@ -42,6 +169,31 @@ "getManagementServer" ] }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, "CreateManagementServer": { "methods": [ "createManagementServer" @@ -52,12 +204,114 @@ "deleteManagementServer" ] }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, "ListManagementServers": { "methods": [ "listManagementServers", "listManagementServersStream", "listManagementServersAsync" ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults", + "listBackupVaultsStream", + "listBackupVaultsAsync" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults", + "fetchUsableBackupVaultsStream", + "fetchUsableBackupVaultsAsync" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations", + "listBackupPlanAssociationsStream", + "listBackupPlanAssociationsAsync" + ] } } } diff --git a/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts b/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts index 3c35c290267..198fdb633df 100644 --- a/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts +++ b/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts @@ -472,69 +472,64 @@ describe('v1.BackupDRClient', () => { }); }); - describe('createManagementServer', () => { - it('invokes createManagementServer without error', async () => { + describe('getBackupVault', () => { + it('invokes getBackupVault without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.backupdr.v1.BackupVault() ); - client.innerApiCalls.createManagementServer = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createManagementServer(request); - const [response] = await operation.promise(); + client.innerApiCalls.getBackupVault = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupVault(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createManagementServer without error using callback', async () => { + it('invokes getBackupVault without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.backupdr.v1.BackupVault() ); - client.innerApiCalls.createManagementServer = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getBackupVault = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createManagementServer( + client.getBackupVault( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - > | null + result?: protos.google.cloud.backupdr.v1.IBackupVault | null ) => { if (err) { reject(err); @@ -544,194 +539,5021 @@ describe('v1.BackupDRClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createManagementServer with call error', async () => { + it('invokes getBackupVault with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createManagementServer = stubLongRunningCall( + client.innerApiCalls.getBackupVault = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.createManagementServer(request), - expectedError - ); + await assert.rejects(client.getBackupVault(request), expectedError); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createManagementServer with LRO error', async () => { + it('invokes getBackupVault with closed client', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createManagementServer = stubLongRunningCall( - undefined, - undefined, - expectedError + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackupVault(request), expectedError); + }); + }); + + describe('getDataSource', () => { + it('invokes getDataSource without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() ); - const [operation] = await client.createManagementServer(request); - await assert.rejects(operation.promise(), expectedError); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSource() + ); + client.innerApiCalls.getDataSource = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSource(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getDataSource as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getDataSource as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateManagementServerProgress without error', async () => { + it('invokes getDataSource without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() ); - 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.checkCreateManagementServerProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSource() + ); + client.innerApiCalls.getDataSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IDataSource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateManagementServerProgress with error', async () => { + it('invokes getDataSource with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.innerApiCalls.getDataSource = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.checkCreateManagementServerProgress(''), - expectedError + await assert.rejects(client.getDataSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataSource(request), expectedError); }); }); - describe('deleteManagementServer', () => { - it('invokes deleteManagementServer without error', async () => { + describe('getBackup', () => { + it('invokes getBackup without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + '.google.cloud.backupdr.v1.GetBackupRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.backupdr.v1.Backup() ); - client.innerApiCalls.deleteManagementServer = - stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteManagementServer(request); - const [response] = await operation.promise(); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.getBackup as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.getBackup as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteManagementServer without error using callback', async () => { + it('invokes getBackup without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + '.google.cloud.backupdr.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.Backup() + ); + client.innerApiCalls.getBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.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 backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.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 backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupRequest', ['name'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('getBackupPlan', () => { + it('invokes getBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlan() + ); + client.innerApiCalls.getBackupPlan = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupPlan(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlan() + ); + client.innerApiCalls.getBackupPlan = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlan( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupPlan | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupPlan = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBackupPlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackupPlan(request), expectedError); + }); + }); + + describe('getBackupPlanAssociation', () => { + it('invokes getBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() + ); + client.innerApiCalls.getBackupPlanAssociation = + stubSimpleCall(expectedResponse); + const [response] = await client.getBackupPlanAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() + ); + client.innerApiCalls.getBackupPlanAssociation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlanAssociation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupPlanAssociation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getBackupPlanAssociation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getBackupPlanAssociation(request), + expectedError + ); + }); + }); + + describe('createManagementServer', () => { + it('invokes createManagementServer without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createManagementServer = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createManagementServer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createManagementServer = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createManagementServer( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createManagementServer = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createManagementServer(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createManagementServer = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createManagementServer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateManagementServerProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateManagementServerProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateManagementServerProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateManagementServerProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteManagementServer', () => { + it('invokes deleteManagementServer without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteManagementServer = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteManagementServer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteManagementServer = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteManagementServer( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteManagementServer = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteManagementServer(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteManagementServer = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteManagementServer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteManagementServerProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteManagementServerProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteManagementServerProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteManagementServerProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackupVault', () => { + it('invokes createBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupVault = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupVault = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupVault( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupVault = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackupVault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupVault = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupVaultProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupVaultProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackupVault', () => { + it('invokes updateBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupVault = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupVault = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackupVault( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupVault = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackupVault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupVault = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupVaultProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupVaultProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackupVault', () => { + it('invokes deleteBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupVault = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupVault = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupVault( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupVault = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackupVault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupVault = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupVaultProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupVaultProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDataSource', () => { + it('invokes updateDataSource without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataSource = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDataSource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataSource = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataSource( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataSource = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataSource = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDataSource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDataSourceProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateDataSourceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDataSourceProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateDataSourceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.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 without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.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 call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + 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 LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), 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 checkDeleteBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restoreBackup', () => { + it('invokes restoreBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreBackup = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restoreBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restoreBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkRestoreBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkRestoreBackupProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackupPlan', () => { + it('invokes createBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlan = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupPlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlan = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupPlan( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlan = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackupPlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlan = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackupPlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupPlanProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupPlanProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackupPlan', () => { + it('invokes deleteBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlan = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupPlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlan = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupPlan( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackupPlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackupPlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupPlanProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupPlanProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackupPlanAssociation', () => { + it('invokes createBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlanAssociation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupPlanAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlanAssociation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupPlanAssociation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createBackupPlanAssociation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackupPlanAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupPlanAssociationProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanAssociationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupPlanAssociationProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanAssociationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackupPlanAssociation', () => { + it('invokes deleteBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlanAssociation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupPlanAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlanAssociation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupPlanAssociation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteBackupPlanAssociation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackupPlanAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupPlanAssociationProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanAssociationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupPlanAssociationProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanAssociationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('triggerBackup', () => { + it('invokes triggerBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.triggerBackup = + stubLongRunningCall(expectedResponse); + const [operation] = await client.triggerBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.triggerBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.triggerBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.triggerBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.triggerBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.triggerBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.triggerBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTriggerBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkTriggerBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTriggerBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkTriggerBackupProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listManagementServers', () => { + it('invokes listManagementServers without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.innerApiCalls.listManagementServers = + stubSimpleCall(expectedResponse); + const [response] = await client.listManagementServers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServers without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.innerApiCalls.listManagementServers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listManagementServers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IManagementServer[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServers with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listManagementServers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listManagementServers(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServersStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.descriptors.page.listManagementServers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listManagementServersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listManagementServers, request) + ); + assert( + ( + client.descriptors.page.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listManagementServersStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listManagementServers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listManagementServersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listManagementServers, request) + ); + assert( + ( + client.descriptors.page.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listManagementServers without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.descriptors.page.listManagementServers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; + const iterable = client.listManagementServersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listManagementServers with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listManagementServers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listManagementServersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupVaults', () => { + it('invokes listBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.listBackupVaults = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupVaults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaults without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.listBackupVaults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupVaults( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupVault[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupVaults = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackupVaults(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaultsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.listBackupVaults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupVaults, request) + ); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listBackupVaultsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupVaults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupVaults, request) + ); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.listBackupVaults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + const iterable = client.listBackupVaultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupVaults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupVaults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupVaultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupVaults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('fetchUsableBackupVaults', () => { + it('invokes fetchUsableBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.fetchUsableBackupVaults = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchUsableBackupVaults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaults without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.fetchUsableBackupVaults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchUsableBackupVaults( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupVault[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.fetchUsableBackupVaults(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaultsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.fetchUsableBackupVaults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.fetchUsableBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.fetchUsableBackupVaults, request) + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchUsableBackupVaultsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchUsableBackupVaults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchUsableBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.fetchUsableBackupVaults, request) + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchUsableBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.fetchUsableBackupVaults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + const iterable = client.fetchUsableBackupVaultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchUsableBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchUsableBackupVaults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchUsableBackupVaultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDataSources', () => { + it('invokes listDataSources without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.innerApiCalls.listDataSources = stubSimpleCall(expectedResponse); + const [response] = await client.listDataSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.innerApiCalls.listDataSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataSources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IDataSource[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDataSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourcesStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.DataSource) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listDataSourcesStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.DataSource) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDataSources without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; + const iterable = client.listDataSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDataSources with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + 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 backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackup[] | 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 backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.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 listBackupsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.listBackups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.Backup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.Backup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listBackupPlans', () => { + it('invokes listBackupPlans without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.innerApiCalls.listBackupPlans = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupPlans(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackupPlans as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupPlans as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlans without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] ); - client.innerApiCalls.deleteManagementServer = - stubLongRunningCallWithCallback(expectedResponse); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.innerApiCalls.listBackupPlans = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteManagementServer( + client.listBackupPlans( request, ( err?: Error | null, - result?: LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - > | null + result?: protos.google.cloud.backupdr.v1.IBackupPlan[] | null ) => { if (err) { reject(err); @@ -741,206 +5563,313 @@ describe('v1.BackupDRClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteManagementServer with call error', async () => { + it('invokes listBackupPlans with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', - ['name'] + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteManagementServer = stubLongRunningCall( + client.innerApiCalls.listBackupPlans = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.deleteManagementServer(request), - expectedError - ); + await assert.rejects(client.listBackupPlans(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteManagementServer with LRO error', async () => { + it('invokes listBackupPlansStream without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', - ['name'] + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteManagementServer = stubLongRunningCall( - undefined, - undefined, - expectedError + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.descriptors.page.listBackupPlans.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupPlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupPlan) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupPlans, request) + ); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); - const [operation] = await client.deleteManagementServer(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteManagementServerProgress without error', async () => { + it('invokes listBackupPlansStream with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlans.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupPlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupPlan) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupPlans, request) + ); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteManagementServerProgress( - expectedResponse.name + it('uses async iteration with listBackupPlans without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.descriptors.page.listBackupPlans.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; + const iterable = client.listBackupPlansAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupPlans.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteManagementServerProgress with error', async () => { + it('uses async iteration with listBackupPlans with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + client.descriptors.page.listBackupPlans.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupPlansAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupPlans.asyncIterate as SinonStub + ).getCall(0).args[1], + request ); - await assert.rejects( - client.checkDeleteManagementServerProgress(''), - expectedError + assert( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('listManagementServers', () => { - it('invokes listManagementServers without error', async () => { + describe('listBackupPlanAssociations', () => { + it('invokes listBackupPlanAssociations without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.innerApiCalls.listManagementServers = + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall(expectedResponse); - const [response] = await client.listManagementServers(request); + const [response] = await client.listBackupPlanAssociations(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listManagementServers without error using callback', async () => { + it('invokes listBackupPlanAssociations without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.innerApiCalls.listManagementServers = + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listManagementServers( + client.listBackupPlanAssociations( request, ( err?: Error | null, - result?: protos.google.cloud.backupdr.v1.IManagementServer[] | null + result?: + | protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] + | null ) => { if (err) { reject(err); @@ -953,84 +5882,84 @@ describe('v1.BackupDRClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listManagementServers with error', async () => { + it('invokes listBackupPlanAssociations with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listManagementServers = stubSimpleCall( + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.listManagementServers(request), + client.listBackupPlanAssociations(request), expectedError ); const actualRequest = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listManagementServersStream without error', async () => { + it('invokes listBackupPlanAssociationsStream without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.descriptors.page.listManagementServers.createStream = + client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listManagementServersStream(request); + const stream = client.listBackupPlanAssociationsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; stream.on( 'data', - (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { responses.push(response); } ); @@ -1045,15 +5974,15 @@ describe('v1.BackupDRClient', () => { assert.deepStrictEqual(responses, expectedResponse); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listManagementServers, request) + .calledWith(client.innerApiCalls.listBackupPlanAssociations, request) ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) @@ -1063,31 +5992,31 @@ describe('v1.BackupDRClient', () => { ); }); - it('invokes listManagementServersStream with error', async () => { + it('invokes listBackupPlanAssociationsStream with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listManagementServers.createStream = + client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listManagementServersStream(request); + const stream = client.listBackupPlanAssociationsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; stream.on( 'data', - (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { responses.push(response); } ); @@ -1101,15 +6030,15 @@ describe('v1.BackupDRClient', () => { await assert.rejects(promise, expectedError); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listManagementServers, request) + .calledWith(client.innerApiCalls.listBackupPlanAssociations, request) ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) @@ -1119,50 +6048,51 @@ describe('v1.BackupDRClient', () => { ); }); - it('uses async iteration with listManagementServers without error', async () => { + it('uses async iteration with listBackupPlanAssociations without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.descriptors.page.listManagementServers.asyncIterate = + client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; - const iterable = client.listManagementServersAsync(request); + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = + []; + const iterable = client.listBackupPlanAssociationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ) .getCall(0) @@ -1172,27 +6102,27 @@ describe('v1.BackupDRClient', () => { ); }); - it('uses async iteration with listManagementServers with error', async () => { + it('uses async iteration with listBackupPlanAssociations with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listManagementServers.asyncIterate = + client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listManagementServersAsync(request); + const iterable = client.listBackupPlanAssociationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1200,14 +6130,14 @@ describe('v1.BackupDRClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ) .getCall(0) @@ -2046,6 +6976,379 @@ describe('v1.BackupDRClient', () => { }); describe('Path templates', () => { + describe('backup', () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backupvault: 'backupvaultValue', + datasource: 'datasourceValue', + backup: 'backupValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + 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', + 'backupvaultValue', + 'datasourceValue', + '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('matchBackupvaultFromBackupName', () => { + const result = client.matchBackupvaultFromBackupName(fakePath); + assert.strictEqual(result, 'backupvaultValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasourceFromBackupName', () => { + const result = client.matchDatasourceFromBackupName(fakePath); + assert.strictEqual(result, 'datasourceValue'); + 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('backupPlan', () => { + const fakePath = '/rendered/path/backupPlan'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup_plan: 'backupPlanValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPlanPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPlanPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPlanPath', () => { + const result = client.backupPlanPath( + 'projectValue', + 'locationValue', + 'backupPlanValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPlanPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupPlanName', () => { + const result = client.matchProjectFromBackupPlanName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupPlanName', () => { + const result = client.matchLocationFromBackupPlanName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupPlanFromBackupPlanName', () => { + const result = client.matchBackupPlanFromBackupPlanName(fakePath); + assert.strictEqual(result, 'backupPlanValue'); + assert( + (client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('backupPlanAssociation', () => { + const fakePath = '/rendered/path/backupPlanAssociation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup_plan_association: 'backupPlanAssociationValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPlanAssociationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPlanAssociationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPlanAssociationPath', () => { + const result = client.backupPlanAssociationPath( + 'projectValue', + 'locationValue', + 'backupPlanAssociationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupPlanAssociationName', () => { + const result = + client.matchProjectFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupPlanAssociationName', () => { + const result = + client.matchLocationFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupPlanAssociationFromBackupPlanAssociationName', () => { + const result = + client.matchBackupPlanAssociationFromBackupPlanAssociationName( + fakePath + ); + assert.strictEqual(result, 'backupPlanAssociationValue'); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('backupVault', () => { + const fakePath = '/rendered/path/backupVault'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backupvault: 'backupvaultValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupVaultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupVaultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupVaultPath', () => { + const result = client.backupVaultPath( + 'projectValue', + 'locationValue', + 'backupvaultValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupVaultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupVaultName', () => { + const result = client.matchProjectFromBackupVaultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupVaultName', () => { + const result = client.matchLocationFromBackupVaultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupvaultFromBackupVaultName', () => { + const result = client.matchBackupvaultFromBackupVaultName(fakePath); + assert.strictEqual(result, 'backupvaultValue'); + assert( + (client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataSource', () => { + const fakePath = '/rendered/path/dataSource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backupvault: 'backupvaultValue', + datasource: 'datasourceValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataSourcePath', () => { + const result = client.dataSourcePath( + 'projectValue', + 'locationValue', + 'backupvaultValue', + 'datasourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataSourceName', () => { + const result = client.matchProjectFromDataSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataSourceName', () => { + const result = client.matchLocationFromDataSourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupvaultFromDataSourceName', () => { + const result = client.matchBackupvaultFromDataSourceName(fakePath); + assert.strictEqual(result, 'backupvaultValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasourceFromDataSourceName', () => { + const result = client.matchDatasourceFromDataSourceName(fakePath); + assert.strictEqual(result, 'datasourceValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('location', () => { const fakePath = '/rendered/path/location'; const expectedParameters = {