Class BackupDRClient

java.lang.Object
com.google.cloud.backupdr.v1.BackupDRClient
All Implemented Interfaces:
BackgroundResource, AutoCloseable

@Generated("by gapic-generator-java") public class BackupDRClient extends Object implements BackgroundResource
Service Description: The BackupDR Service

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (BackupDRClient backupDRClient = BackupDRClient.create()) {
   ManagementServerName name =
       ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
   ManagementServer response = backupDRClient.getManagementServer(name);
 }
 

Note: close() needs to be called on the BackupDRClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

ListManagementServers

Lists ManagementServers in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listManagementServers(ListManagementServersRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listManagementServers(LocationName parent)

  • listManagementServers(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listManagementServersPagedCallable()

  • listManagementServersCallable()

GetManagementServer

Gets details of a single ManagementServer.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getManagementServer(GetManagementServerRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getManagementServer(ManagementServerName name)

  • getManagementServer(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getManagementServerCallable()

CreateManagementServer

Creates a new ManagementServer in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createManagementServerAsync(CreateManagementServerRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createManagementServerAsync(LocationName parent, ManagementServer managementServer, String managementServerId)

  • createManagementServerAsync(String parent, ManagementServer managementServer, String managementServerId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createManagementServerOperationCallable()

  • createManagementServerCallable()

DeleteManagementServer

Deletes a single ManagementServer.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteManagementServerAsync(DeleteManagementServerRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteManagementServerAsync(ManagementServerName name)

  • deleteManagementServerAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteManagementServerOperationCallable()

  • deleteManagementServerCallable()

CreateBackupVault

Creates a new BackupVault in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createBackupVaultAsync(CreateBackupVaultRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createBackupVaultAsync(LocationName parent, BackupVault backupVault, String backupVaultId)

  • createBackupVaultAsync(String parent, BackupVault backupVault, String backupVaultId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createBackupVaultOperationCallable()

  • createBackupVaultCallable()

ListBackupVaults

Lists BackupVaults in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listBackupVaults(ListBackupVaultsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listBackupVaults(LocationName parent)

  • listBackupVaults(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listBackupVaultsPagedCallable()

  • listBackupVaultsCallable()

FetchUsableBackupVaults

FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchUsableBackupVaults(FetchUsableBackupVaultsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchUsableBackupVaults(LocationName parent)

  • fetchUsableBackupVaults(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchUsableBackupVaultsPagedCallable()

  • fetchUsableBackupVaultsCallable()

GetBackupVault

Gets details of a BackupVault.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getBackupVault(GetBackupVaultRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getBackupVault(BackupVaultName name)

  • getBackupVault(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getBackupVaultCallable()

UpdateBackupVault

Updates the settings of a BackupVault.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateBackupVaultAsync(UpdateBackupVaultRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateBackupVaultAsync(BackupVault backupVault, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateBackupVaultOperationCallable()

  • updateBackupVaultCallable()

DeleteBackupVault

Deletes a BackupVault.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteBackupVaultAsync(DeleteBackupVaultRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteBackupVaultAsync(BackupVaultName name)

  • deleteBackupVaultAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteBackupVaultOperationCallable()

  • deleteBackupVaultCallable()

ListDataSources

Lists DataSources in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listDataSources(ListDataSourcesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listDataSources(BackupVaultName parent)

  • listDataSources(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listDataSourcesPagedCallable()

  • listDataSourcesCallable()

GetDataSource

Gets details of a DataSource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getDataSource(GetDataSourceRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getDataSource(DataSourceName name)

  • getDataSource(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getDataSourceCallable()

UpdateDataSource

Updates the settings of a DataSource.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateDataSourceAsync(UpdateDataSourceRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateDataSourceAsync(DataSource dataSource, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateDataSourceOperationCallable()

  • updateDataSourceCallable()

ListBackups

Lists Backups in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listBackups(ListBackupsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listBackups(DataSourceName parent)

  • listBackups(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listBackupsPagedCallable()

  • listBackupsCallable()

FetchBackupsForResourceType

Fetch Backups for a given resource type.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchBackupsForResourceType(FetchBackupsForResourceTypeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchBackupsForResourceType(DataSourceName parent, String resourceType)

  • fetchBackupsForResourceType(String parent, String resourceType)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchBackupsForResourceTypePagedCallable()

  • fetchBackupsForResourceTypeCallable()

GetBackup

Gets details of a Backup.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getBackup(GetBackupRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getBackup(BackupName name)

  • getBackup(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getBackupCallable()

UpdateBackup

Updates the settings of a Backup.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateBackupAsync(UpdateBackupRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateBackupAsync(Backup backup, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateBackupOperationCallable()

  • updateBackupCallable()

DeleteBackup

Deletes a Backup.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteBackupAsync(DeleteBackupRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteBackupAsync(BackupName name)

  • deleteBackupAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteBackupOperationCallable()

  • deleteBackupCallable()

RestoreBackup

Restore from a Backup

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • restoreBackupAsync(RestoreBackupRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • restoreBackupAsync(BackupName name)

  • restoreBackupAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • restoreBackupOperationCallable()

  • restoreBackupCallable()

CreateBackupPlan

Create a BackupPlan

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createBackupPlanAsync(CreateBackupPlanRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createBackupPlanAsync(LocationName parent, BackupPlan backupPlan, String backupPlanId)

  • createBackupPlanAsync(String parent, BackupPlan backupPlan, String backupPlanId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createBackupPlanOperationCallable()

  • createBackupPlanCallable()

UpdateBackupPlan

Update a BackupPlan.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateBackupPlanAsync(UpdateBackupPlanRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateBackupPlanAsync(BackupPlan backupPlan, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateBackupPlanOperationCallable()

  • updateBackupPlanCallable()

GetBackupPlan

Gets details of a single BackupPlan.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getBackupPlan(GetBackupPlanRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getBackupPlan(BackupPlanName name)

  • getBackupPlan(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getBackupPlanCallable()

ListBackupPlans

Lists BackupPlans in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listBackupPlans(ListBackupPlansRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listBackupPlans(LocationName parent)

  • listBackupPlans(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listBackupPlansPagedCallable()

  • listBackupPlansCallable()

DeleteBackupPlan

Deletes a single BackupPlan.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteBackupPlanAsync(DeleteBackupPlanRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteBackupPlanAsync(BackupPlanName name)

  • deleteBackupPlanAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteBackupPlanOperationCallable()

  • deleteBackupPlanCallable()

GetBackupPlanRevision

Gets details of a single BackupPlanRevision.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getBackupPlanRevision(GetBackupPlanRevisionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getBackupPlanRevision(BackupPlanRevisionName name)

  • getBackupPlanRevision(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getBackupPlanRevisionCallable()

ListBackupPlanRevisions

Lists BackupPlanRevisions in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listBackupPlanRevisions(ListBackupPlanRevisionsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listBackupPlanRevisions(BackupPlanName parent)

  • listBackupPlanRevisions(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listBackupPlanRevisionsPagedCallable()

  • listBackupPlanRevisionsCallable()

CreateBackupPlanAssociation

Create a BackupPlanAssociation

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createBackupPlanAssociationAsync(CreateBackupPlanAssociationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • createBackupPlanAssociationAsync(LocationName parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId)

  • createBackupPlanAssociationAsync(String parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createBackupPlanAssociationOperationCallable()

  • createBackupPlanAssociationCallable()

UpdateBackupPlanAssociation

Update a BackupPlanAssociation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateBackupPlanAssociationAsync(UpdateBackupPlanAssociationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • updateBackupPlanAssociationAsync(BackupPlanAssociation backupPlanAssociation, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateBackupPlanAssociationOperationCallable()

  • updateBackupPlanAssociationCallable()

GetBackupPlanAssociation

Gets details of a single BackupPlanAssociation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getBackupPlanAssociation(GetBackupPlanAssociationRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getBackupPlanAssociation(BackupPlanAssociationName name)

  • getBackupPlanAssociation(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getBackupPlanAssociationCallable()

ListBackupPlanAssociations

Lists BackupPlanAssociations in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listBackupPlanAssociations(ListBackupPlanAssociationsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listBackupPlanAssociations(LocationName parent)

  • listBackupPlanAssociations(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listBackupPlanAssociationsPagedCallable()

  • listBackupPlanAssociationsCallable()

FetchBackupPlanAssociationsForResourceType

List BackupPlanAssociations for a given resource type.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchBackupPlanAssociationsForResourceType(FetchBackupPlanAssociationsForResourceTypeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchBackupPlanAssociationsForResourceType(LocationName parent, String resourceType)

  • fetchBackupPlanAssociationsForResourceType(String parent, String resourceType)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchBackupPlanAssociationsForResourceTypePagedCallable()

  • fetchBackupPlanAssociationsForResourceTypeCallable()

DeleteBackupPlanAssociation

Deletes a single BackupPlanAssociation.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteBackupPlanAssociationAsync(DeleteBackupPlanAssociationRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • deleteBackupPlanAssociationAsync(BackupPlanAssociationName name)

  • deleteBackupPlanAssociationAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteBackupPlanAssociationOperationCallable()

  • deleteBackupPlanAssociationCallable()

TriggerBackup

Triggers a new Backup.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • triggerBackupAsync(TriggerBackupRequest request)

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

  • triggerBackupAsync(BackupPlanAssociationName name, String ruleId)

  • triggerBackupAsync(String name, String ruleId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • triggerBackupOperationCallable()

  • triggerBackupCallable()

GetDataSourceReference

Gets details of a single DataSourceReference.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getDataSourceReference(GetDataSourceReferenceRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getDataSourceReference(DataSourceReferenceName name)

  • getDataSourceReference(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getDataSourceReferenceCallable()

ListDataSourceReferences

Lists DataSourceReferences for a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listDataSourceReferences(ListDataSourceReferencesRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listDataSourceReferences(LocationName parent)

  • listDataSourceReferences(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listDataSourceReferencesPagedCallable()

  • listDataSourceReferencesCallable()

FetchDataSourceReferencesForResourceType

Fetch DataSourceReferences for a given project, location and resource type.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • fetchDataSourceReferencesForResourceType(FetchDataSourceReferencesForResourceTypeRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • fetchDataSourceReferencesForResourceType(LocationName parent, String resourceType)

  • fetchDataSourceReferencesForResourceType(String parent, String resourceType)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • fetchDataSourceReferencesForResourceTypePagedCallable()

  • fetchDataSourceReferencesForResourceTypeCallable()

InitializeService

Initializes the service related config for a project.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • initializeServiceAsync(InitializeServiceRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • initializeServiceOperationCallable()

  • initializeServiceCallable()

ListLocations

Lists information about the supported locations for this service.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

SetIamPolicy

Sets the access control policy on the specified resource. Replacesany existing policy.

Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • setIamPolicy(SetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • setIamPolicyCallable()

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getIamPolicy(GetIamPolicyRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getIamPolicyCallable()

TestIamPermissions

Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • testIamPermissions(TestIamPermissionsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • testIamPermissionsCallable()

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of BackupDRSettings to create(). For example:

To customize credentials:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 BackupDRSettings backupDRSettings =
     BackupDRSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
 

To customize the endpoint:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 BackupDRSettings backupDRSettings =
     BackupDRSettings.newBuilder().setEndpoint(myEndpoint).build();
 BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // 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.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 BackupDRSettings backupDRSettings = BackupDRSettings.newHttpJsonBuilder().build();
 BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

  • Constructor Details

    • BackupDRClient

      protected BackupDRClient(BackupDRSettings settings) throws IOException
      Constructs an instance of BackupDRClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
      Throws:
      IOException
    • BackupDRClient

      protected BackupDRClient(BackupDRStub stub)
  • Method Details

    • create

      public static final BackupDRClient create() throws IOException
      Constructs an instance of BackupDRClient with default settings.
      Throws:
      IOException
    • create

      public static final BackupDRClient create(BackupDRSettings settings) throws IOException
      Constructs an instance of BackupDRClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
      Throws:
      IOException
    • create

      public static final BackupDRClient create(BackupDRStub stub)
      Constructs an instance of BackupDRClient, using the given stub for making calls. This is for advanced usage - prefer using create(BackupDRSettings).
    • getSettings

      public final BackupDRSettings getSettings()
    • getStub

      public BackupDRStub getStub()
    • getOperationsClient

      public final OperationsClient getOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • getHttpJsonOperationsClient

      @BetaApi public final OperationsClient getHttpJsonOperationsClient()
      Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
    • listManagementServers

      public final BackupDRClient.ListManagementServersPagedResponse listManagementServers(LocationName parent)
      Lists ManagementServers in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (ManagementServer element : backupDRClient.listManagementServers(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listManagementServers

      public final BackupDRClient.ListManagementServersPagedResponse listManagementServers(String parent)
      Lists ManagementServers in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (ManagementServer element : backupDRClient.listManagementServers(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listManagementServers

      Lists ManagementServers in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListManagementServersRequest request =
             ListManagementServersRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (ManagementServer element : backupDRClient.listManagementServers(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listManagementServersPagedCallable

      Lists ManagementServers in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListManagementServersRequest request =
             ListManagementServersRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<ManagementServer> future =
             backupDRClient.listManagementServersPagedCallable().futureCall(request);
         // Do something.
         for (ManagementServer element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listManagementServersCallable

      public final UnaryCallable<ListManagementServersRequest,ListManagementServersResponse> listManagementServersCallable()
      Lists ManagementServers in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListManagementServersRequest request =
             ListManagementServersRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListManagementServersResponse response =
               backupDRClient.listManagementServersCallable().call(request);
           for (ManagementServer element : response.getManagementServersList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getManagementServer

      public final ManagementServer getManagementServer(ManagementServerName name)
      Gets details of a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ManagementServerName name =
             ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
         ManagementServer response = backupDRClient.getManagementServer(name);
       }
       
      Parameters:
      name - Required. Name of the management server resource name, in the format 'projects/{project_id}/locations/{location}/managementServers/{resource_name}'
      Throws:
      ApiException - if the remote call fails
    • getManagementServer

      public final ManagementServer getManagementServer(String name)
      Gets details of a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]").toString();
         ManagementServer response = backupDRClient.getManagementServer(name);
       }
       
      Parameters:
      name - Required. Name of the management server resource name, in the format 'projects/{project_id}/locations/{location}/managementServers/{resource_name}'
      Throws:
      ApiException - if the remote call fails
    • getManagementServer

      public final ManagementServer getManagementServer(GetManagementServerRequest request)
      Gets details of a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetManagementServerRequest request =
             GetManagementServerRequest.newBuilder()
                 .setName(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .build();
         ManagementServer response = backupDRClient.getManagementServer(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getManagementServerCallable

      public final UnaryCallable<GetManagementServerRequest,ManagementServer> getManagementServerCallable()
      Gets details of a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetManagementServerRequest request =
             GetManagementServerRequest.newBuilder()
                 .setName(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .build();
         ApiFuture<ManagementServer> future =
             backupDRClient.getManagementServerCallable().futureCall(request);
         // Do something.
         ManagementServer response = future.get();
       }
       
    • createManagementServerAsync

      public final OperationFuture<ManagementServer,OperationMetadata> createManagementServerAsync(LocationName parent, ManagementServer managementServer, String managementServerId)
      Creates a new ManagementServer in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         ManagementServer managementServer = ManagementServer.newBuilder().build();
         String managementServerId = "managementServerId-1229628127";
         ManagementServer response =
             backupDRClient
                 .createManagementServerAsync(parent, managementServer, managementServerId)
                 .get();
       }
       
      Parameters:
      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**.
      managementServer - Required. A [management server resource][google.cloud.backupdr.v1.ManagementServer]
      managementServerId - Required. The name of the management server to create. The name must be unique for the specified project and location.
      Throws:
      ApiException - if the remote call fails
    • createManagementServerAsync

      public final OperationFuture<ManagementServer,OperationMetadata> createManagementServerAsync(String parent, ManagementServer managementServer, String managementServerId)
      Creates a new ManagementServer in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         ManagementServer managementServer = ManagementServer.newBuilder().build();
         String managementServerId = "managementServerId-1229628127";
         ManagementServer response =
             backupDRClient
                 .createManagementServerAsync(parent, managementServer, managementServerId)
                 .get();
       }
       
      Parameters:
      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**.
      managementServer - Required. A [management server resource][google.cloud.backupdr.v1.ManagementServer]
      managementServerId - Required. The name of the management server to create. The name must be unique for the specified project and location.
      Throws:
      ApiException - if the remote call fails
    • createManagementServerAsync

      public final OperationFuture<ManagementServer,OperationMetadata> createManagementServerAsync(CreateManagementServerRequest request)
      Creates a new ManagementServer in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateManagementServerRequest request =
             CreateManagementServerRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setManagementServerId("managementServerId-1229628127")
                 .setManagementServer(ManagementServer.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ManagementServer response = backupDRClient.createManagementServerAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createManagementServerOperationCallable

      public final OperationCallable<CreateManagementServerRequest,ManagementServer,OperationMetadata> createManagementServerOperationCallable()
      Creates a new ManagementServer in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateManagementServerRequest request =
             CreateManagementServerRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setManagementServerId("managementServerId-1229628127")
                 .setManagementServer(ManagementServer.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<ManagementServer, OperationMetadata> future =
             backupDRClient.createManagementServerOperationCallable().futureCall(request);
         // Do something.
         ManagementServer response = future.get();
       }
       
    • createManagementServerCallable

      public final UnaryCallable<CreateManagementServerRequest,Operation> createManagementServerCallable()
      Creates a new ManagementServer in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateManagementServerRequest request =
             CreateManagementServerRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setManagementServerId("managementServerId-1229628127")
                 .setManagementServer(ManagementServer.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             backupDRClient.createManagementServerCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteManagementServerAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteManagementServerAsync(ManagementServerName name)
      Deletes a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ManagementServerName name =
             ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]");
         backupDRClient.deleteManagementServerAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • deleteManagementServerAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteManagementServerAsync(String name)
      Deletes a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]").toString();
         backupDRClient.deleteManagementServerAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource
      Throws:
      ApiException - if the remote call fails
    • deleteManagementServerAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteManagementServerAsync(DeleteManagementServerRequest request)
      Deletes a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteManagementServerRequest request =
             DeleteManagementServerRequest.newBuilder()
                 .setName(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         backupDRClient.deleteManagementServerAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteManagementServerOperationCallable

      public final OperationCallable<DeleteManagementServerRequest,com.google.protobuf.Empty,OperationMetadata> deleteManagementServerOperationCallable()
      Deletes a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteManagementServerRequest request =
             DeleteManagementServerRequest.newBuilder()
                 .setName(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             backupDRClient.deleteManagementServerOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteManagementServerCallable

      public final UnaryCallable<DeleteManagementServerRequest,Operation> deleteManagementServerCallable()
      Deletes a single ManagementServer.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteManagementServerRequest request =
             DeleteManagementServerRequest.newBuilder()
                 .setName(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             backupDRClient.deleteManagementServerCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • createBackupVaultAsync

      public final OperationFuture<BackupVault,OperationMetadata> createBackupVaultAsync(LocationName parent, BackupVault backupVault, String backupVaultId)
      Creates a new BackupVault in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         BackupVault backupVault = BackupVault.newBuilder().build();
         String backupVaultId = "backupVaultId-1897432373";
         BackupVault response =
             backupDRClient.createBackupVaultAsync(parent, backupVault, backupVaultId).get();
       }
       
      Parameters:
      parent - Required. Value for parent.
      backupVault - Required. The resource being created
      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
      Throws:
      ApiException - if the remote call fails
    • createBackupVaultAsync

      public final OperationFuture<BackupVault,OperationMetadata> createBackupVaultAsync(String parent, BackupVault backupVault, String backupVaultId)
      Creates a new BackupVault in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         BackupVault backupVault = BackupVault.newBuilder().build();
         String backupVaultId = "backupVaultId-1897432373";
         BackupVault response =
             backupDRClient.createBackupVaultAsync(parent, backupVault, backupVaultId).get();
       }
       
      Parameters:
      parent - Required. Value for parent.
      backupVault - Required. The resource being created
      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
      Throws:
      ApiException - if the remote call fails
    • createBackupVaultAsync

      public final OperationFuture<BackupVault,OperationMetadata> createBackupVaultAsync(CreateBackupVaultRequest request)
      Creates a new BackupVault in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupVaultRequest request =
             CreateBackupVaultRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupVaultId("backupVaultId-1897432373")
                 .setBackupVault(BackupVault.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setValidateOnly(true)
                 .build();
         BackupVault response = backupDRClient.createBackupVaultAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createBackupVaultOperationCallable

      public final OperationCallable<CreateBackupVaultRequest,BackupVault,OperationMetadata> createBackupVaultOperationCallable()
      Creates a new BackupVault in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupVaultRequest request =
             CreateBackupVaultRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupVaultId("backupVaultId-1897432373")
                 .setBackupVault(BackupVault.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setValidateOnly(true)
                 .build();
         OperationFuture<BackupVault, OperationMetadata> future =
             backupDRClient.createBackupVaultOperationCallable().futureCall(request);
         // Do something.
         BackupVault response = future.get();
       }
       
    • createBackupVaultCallable

      public final UnaryCallable<CreateBackupVaultRequest,Operation> createBackupVaultCallable()
      Creates a new BackupVault in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupVaultRequest request =
             CreateBackupVaultRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupVaultId("backupVaultId-1897432373")
                 .setBackupVault(BackupVault.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setValidateOnly(true)
                 .build();
         ApiFuture<Operation> future = backupDRClient.createBackupVaultCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • listBackupVaults

      public final BackupDRClient.ListBackupVaultsPagedResponse listBackupVaults(LocationName parent)
      Lists BackupVaults in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (BackupVault element : backupDRClient.listBackupVaults(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listBackupVaults

      public final BackupDRClient.ListBackupVaultsPagedResponse listBackupVaults(String parent)
      Lists BackupVaults in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (BackupVault element : backupDRClient.listBackupVaults(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listBackupVaults

      Lists BackupVaults in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupVaultsRequest request =
             ListBackupVaultsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupVaultView.forNumber(0))
                 .build();
         for (BackupVault element : backupDRClient.listBackupVaults(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listBackupVaultsPagedCallable

      Lists BackupVaults in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupVaultsRequest request =
             ListBackupVaultsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupVaultView.forNumber(0))
                 .build();
         ApiFuture<BackupVault> future =
             backupDRClient.listBackupVaultsPagedCallable().futureCall(request);
         // Do something.
         for (BackupVault element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listBackupVaultsCallable

      public final UnaryCallable<ListBackupVaultsRequest,ListBackupVaultsResponse> listBackupVaultsCallable()
      Lists BackupVaults in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupVaultsRequest request =
             ListBackupVaultsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupVaultView.forNumber(0))
                 .build();
         while (true) {
           ListBackupVaultsResponse response = backupDRClient.listBackupVaultsCallable().call(request);
           for (BackupVault element : response.getBackupVaultsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • fetchUsableBackupVaults

      public final BackupDRClient.FetchUsableBackupVaultsPagedResponse fetchUsableBackupVaults(LocationName parent)
      FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (BackupVault element : backupDRClient.fetchUsableBackupVaults(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • fetchUsableBackupVaults

      public final BackupDRClient.FetchUsableBackupVaultsPagedResponse fetchUsableBackupVaults(String parent)
      FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (BackupVault element : backupDRClient.fetchUsableBackupVaults(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • fetchUsableBackupVaults

      FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchUsableBackupVaultsRequest request =
             FetchUsableBackupVaultsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (BackupVault element : backupDRClient.fetchUsableBackupVaults(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • fetchUsableBackupVaultsPagedCallable

      FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchUsableBackupVaultsRequest request =
             FetchUsableBackupVaultsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<BackupVault> future =
             backupDRClient.fetchUsableBackupVaultsPagedCallable().futureCall(request);
         // Do something.
         for (BackupVault element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • fetchUsableBackupVaultsCallable

      public final UnaryCallable<FetchUsableBackupVaultsRequest,FetchUsableBackupVaultsResponse> fetchUsableBackupVaultsCallable()
      FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchUsableBackupVaultsRequest request =
             FetchUsableBackupVaultsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           FetchUsableBackupVaultsResponse response =
               backupDRClient.fetchUsableBackupVaultsCallable().call(request);
           for (BackupVault element : response.getBackupVaultsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getBackupVault

      public final BackupVault getBackupVault(BackupVaultName name)
      Gets details of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupVaultName name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]");
         BackupVault response = backupDRClient.getBackupVault(name);
       }
       
      Parameters:
      name - Required. Name of the backupvault store resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}'
      Throws:
      ApiException - if the remote call fails
    • getBackupVault

      public final BackupVault getBackupVault(String name)
      Gets details of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString();
         BackupVault response = backupDRClient.getBackupVault(name);
       }
       
      Parameters:
      name - Required. Name of the backupvault store resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}'
      Throws:
      ApiException - if the remote call fails
    • getBackupVault

      public final BackupVault getBackupVault(GetBackupVaultRequest request)
      Gets details of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupVaultRequest request =
             GetBackupVaultRequest.newBuilder()
                 .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setView(BackupVaultView.forNumber(0))
                 .build();
         BackupVault response = backupDRClient.getBackupVault(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getBackupVaultCallable

      public final UnaryCallable<GetBackupVaultRequest,BackupVault> getBackupVaultCallable()
      Gets details of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupVaultRequest request =
             GetBackupVaultRequest.newBuilder()
                 .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setView(BackupVaultView.forNumber(0))
                 .build();
         ApiFuture<BackupVault> future = backupDRClient.getBackupVaultCallable().futureCall(request);
         // Do something.
         BackupVault response = future.get();
       }
       
    • updateBackupVaultAsync

      public final OperationFuture<BackupVault,OperationMetadata> updateBackupVaultAsync(BackupVault backupVault, com.google.protobuf.FieldMask updateMask)
      Updates the settings of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupVault backupVault = BackupVault.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         BackupVault response = backupDRClient.updateBackupVaultAsync(backupVault, updateMask).get();
       }
       
      Parameters:
      backupVault - Required. The resource being updated
      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.
      Throws:
      ApiException - if the remote call fails
    • updateBackupVaultAsync

      public final OperationFuture<BackupVault,OperationMetadata> updateBackupVaultAsync(UpdateBackupVaultRequest request)
      Updates the settings of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupVaultRequest request =
             UpdateBackupVaultRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackupVault(BackupVault.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setValidateOnly(true)
                 .setForce(true)
                 .setForceUpdateAccessRestriction(true)
                 .build();
         BackupVault response = backupDRClient.updateBackupVaultAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateBackupVaultOperationCallable

      public final OperationCallable<UpdateBackupVaultRequest,BackupVault,OperationMetadata> updateBackupVaultOperationCallable()
      Updates the settings of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupVaultRequest request =
             UpdateBackupVaultRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackupVault(BackupVault.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setValidateOnly(true)
                 .setForce(true)
                 .setForceUpdateAccessRestriction(true)
                 .build();
         OperationFuture<BackupVault, OperationMetadata> future =
             backupDRClient.updateBackupVaultOperationCallable().futureCall(request);
         // Do something.
         BackupVault response = future.get();
       }
       
    • updateBackupVaultCallable

      public final UnaryCallable<UpdateBackupVaultRequest,Operation> updateBackupVaultCallable()
      Updates the settings of a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupVaultRequest request =
             UpdateBackupVaultRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackupVault(BackupVault.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setValidateOnly(true)
                 .setForce(true)
                 .setForceUpdateAccessRestriction(true)
                 .build();
         ApiFuture<Operation> future = backupDRClient.updateBackupVaultCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteBackupVaultAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultAsync(BackupVaultName name)
      Deletes a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupVaultName name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]");
         backupDRClient.deleteBackupVaultAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupVaultAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultAsync(String name)
      Deletes a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString();
         backupDRClient.deleteBackupVaultAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupVaultAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultAsync(DeleteBackupVaultRequest request)
      Deletes a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupVaultRequest request =
             DeleteBackupVaultRequest.newBuilder()
                 .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setRequestId("requestId693933066")
                 .setForce(true)
                 .setEtag("etag3123477")
                 .setValidateOnly(true)
                 .setAllowMissing(true)
                 .setIgnoreBackupPlanReferences(true)
                 .build();
         backupDRClient.deleteBackupVaultAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupVaultOperationCallable

      public final OperationCallable<DeleteBackupVaultRequest,com.google.protobuf.Empty,OperationMetadata> deleteBackupVaultOperationCallable()
      Deletes a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupVaultRequest request =
             DeleteBackupVaultRequest.newBuilder()
                 .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setRequestId("requestId693933066")
                 .setForce(true)
                 .setEtag("etag3123477")
                 .setValidateOnly(true)
                 .setAllowMissing(true)
                 .setIgnoreBackupPlanReferences(true)
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             backupDRClient.deleteBackupVaultOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteBackupVaultCallable

      public final UnaryCallable<DeleteBackupVaultRequest,Operation> deleteBackupVaultCallable()
      Deletes a BackupVault.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupVaultRequest request =
             DeleteBackupVaultRequest.newBuilder()
                 .setName(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setRequestId("requestId693933066")
                 .setForce(true)
                 .setEtag("etag3123477")
                 .setValidateOnly(true)
                 .setAllowMissing(true)
                 .setIgnoreBackupPlanReferences(true)
                 .build();
         ApiFuture<Operation> future = backupDRClient.deleteBackupVaultCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • listDataSources

      public final BackupDRClient.ListDataSourcesPagedResponse listDataSources(BackupVaultName parent)
      Lists DataSources in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupVaultName parent = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]");
         for (DataSource element : backupDRClient.listDataSources(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listDataSources

      public final BackupDRClient.ListDataSourcesPagedResponse listDataSources(String parent)
      Lists DataSources in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString();
         for (DataSource element : backupDRClient.listDataSources(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listDataSources

      Lists DataSources in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListDataSourcesRequest request =
             ListDataSourcesRequest.newBuilder()
                 .setParent(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (DataSource element : backupDRClient.listDataSources(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listDataSourcesPagedCallable

      Lists DataSources in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListDataSourcesRequest request =
             ListDataSourcesRequest.newBuilder()
                 .setParent(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<DataSource> future =
             backupDRClient.listDataSourcesPagedCallable().futureCall(request);
         // Do something.
         for (DataSource element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listDataSourcesCallable

      public final UnaryCallable<ListDataSourcesRequest,ListDataSourcesResponse> listDataSourcesCallable()
      Lists DataSources in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListDataSourcesRequest request =
             ListDataSourcesRequest.newBuilder()
                 .setParent(BackupVaultName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListDataSourcesResponse response = backupDRClient.listDataSourcesCallable().call(request);
           for (DataSource element : response.getDataSourcesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getDataSource

      public final DataSource getDataSource(DataSourceName name)
      Gets details of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DataSourceName name =
             DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]");
         DataSource response = backupDRClient.getDataSource(name);
       }
       
      Parameters:
      name - Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}'
      Throws:
      ApiException - if the remote call fails
    • getDataSource

      public final DataSource getDataSource(String name)
      Gets details of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]").toString();
         DataSource response = backupDRClient.getDataSource(name);
       }
       
      Parameters:
      name - Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}'
      Throws:
      ApiException - if the remote call fails
    • getDataSource

      public final DataSource getDataSource(GetDataSourceRequest request)
      Gets details of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetDataSourceRequest request =
             GetDataSourceRequest.newBuilder()
                 .setName(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .build();
         DataSource response = backupDRClient.getDataSource(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getDataSourceCallable

      public final UnaryCallable<GetDataSourceRequest,DataSource> getDataSourceCallable()
      Gets details of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetDataSourceRequest request =
             GetDataSourceRequest.newBuilder()
                 .setName(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .build();
         ApiFuture<DataSource> future = backupDRClient.getDataSourceCallable().futureCall(request);
         // Do something.
         DataSource response = future.get();
       }
       
    • updateDataSourceAsync

      public final OperationFuture<DataSource,OperationMetadata> updateDataSourceAsync(DataSource dataSource, com.google.protobuf.FieldMask updateMask)
      Updates the settings of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DataSource dataSource = DataSource.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         DataSource response = backupDRClient.updateDataSourceAsync(dataSource, updateMask).get();
       }
       
      Parameters:
      dataSource - Required. The resource being updated
      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.
      Throws:
      ApiException - if the remote call fails
    • updateDataSourceAsync

      public final OperationFuture<DataSource,OperationMetadata> updateDataSourceAsync(UpdateDataSourceRequest request)
      Updates the settings of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateDataSourceRequest request =
             UpdateDataSourceRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setDataSource(DataSource.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setAllowMissing(true)
                 .build();
         DataSource response = backupDRClient.updateDataSourceAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateDataSourceOperationCallable

      public final OperationCallable<UpdateDataSourceRequest,DataSource,OperationMetadata> updateDataSourceOperationCallable()
      Updates the settings of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateDataSourceRequest request =
             UpdateDataSourceRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setDataSource(DataSource.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setAllowMissing(true)
                 .build();
         OperationFuture<DataSource, OperationMetadata> future =
             backupDRClient.updateDataSourceOperationCallable().futureCall(request);
         // Do something.
         DataSource response = future.get();
       }
       
    • updateDataSourceCallable

      public final UnaryCallable<UpdateDataSourceRequest,Operation> updateDataSourceCallable()
      Updates the settings of a DataSource.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateDataSourceRequest request =
             UpdateDataSourceRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setDataSource(DataSource.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .setAllowMissing(true)
                 .build();
         ApiFuture<Operation> future = backupDRClient.updateDataSourceCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • listBackups

      public final BackupDRClient.ListBackupsPagedResponse listBackups(DataSourceName parent)
      Lists Backups in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DataSourceName parent =
             DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]");
         for (Backup element : backupDRClient.listBackups(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listBackups

      public final BackupDRClient.ListBackupsPagedResponse listBackups(String parent)
      Lists Backups in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent =
             DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]").toString();
         for (Backup element : backupDRClient.listBackups(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listBackups

      public final BackupDRClient.ListBackupsPagedResponse listBackups(ListBackupsRequest request)
      Lists Backups in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupsRequest request =
             ListBackupsRequest.newBuilder()
                 .setParent(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupView.forNumber(0))
                 .build();
         for (Backup element : backupDRClient.listBackups(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listBackupsPagedCallable

      Lists Backups in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupsRequest request =
             ListBackupsRequest.newBuilder()
                 .setParent(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupView.forNumber(0))
                 .build();
         ApiFuture<Backup> future = backupDRClient.listBackupsPagedCallable().futureCall(request);
         // Do something.
         for (Backup element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listBackupsCallable

      public final UnaryCallable<ListBackupsRequest,ListBackupsResponse> listBackupsCallable()
      Lists Backups in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupsRequest request =
             ListBackupsRequest.newBuilder()
                 .setParent(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupView.forNumber(0))
                 .build();
         while (true) {
           ListBackupsResponse response = backupDRClient.listBackupsCallable().call(request);
           for (Backup element : response.getBackupsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • fetchBackupsForResourceType

      public final BackupDRClient.FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(DataSourceName parent, String resourceType)
      Fetch Backups for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DataSourceName parent =
             DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]");
         String resourceType = "resourceType-384364440";
         for (Backup element :
             backupDRClient.fetchBackupsForResourceType(parent, resourceType).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Datasources are the parent resource for the backups. Format: projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}
      resourceType - Required. The type of the GCP resource. Ex: sqladmin.googleapis.com/Instance
      Throws:
      ApiException - if the remote call fails
    • fetchBackupsForResourceType

      public final BackupDRClient.FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(String parent, String resourceType)
      Fetch Backups for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent =
             DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]").toString();
         String resourceType = "resourceType-384364440";
         for (Backup element :
             backupDRClient.fetchBackupsForResourceType(parent, resourceType).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. Datasources are the parent resource for the backups. Format: projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}
      resourceType - Required. The type of the GCP resource. Ex: sqladmin.googleapis.com/Instance
      Throws:
      ApiException - if the remote call fails
    • fetchBackupsForResourceType

      Fetch Backups for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchBackupsForResourceTypeRequest request =
             FetchBackupsForResourceTypeRequest.newBuilder()
                 .setParent(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupView.forNumber(0))
                 .build();
         for (Backup element : backupDRClient.fetchBackupsForResourceType(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • fetchBackupsForResourceTypePagedCallable

      Fetch Backups for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchBackupsForResourceTypeRequest request =
             FetchBackupsForResourceTypeRequest.newBuilder()
                 .setParent(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupView.forNumber(0))
                 .build();
         ApiFuture<Backup> future =
             backupDRClient.fetchBackupsForResourceTypePagedCallable().futureCall(request);
         // Do something.
         for (Backup element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • fetchBackupsForResourceTypeCallable

      public final UnaryCallable<FetchBackupsForResourceTypeRequest,FetchBackupsForResourceTypeResponse> fetchBackupsForResourceTypeCallable()
      Fetch Backups for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchBackupsForResourceTypeRequest request =
             FetchBackupsForResourceTypeRequest.newBuilder()
                 .setParent(
                     DataSourceName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]")
                         .toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .setView(BackupView.forNumber(0))
                 .build();
         while (true) {
           FetchBackupsForResourceTypeResponse response =
               backupDRClient.fetchBackupsForResourceTypeCallable().call(request);
           for (Backup element : response.getBackupsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getBackup

      public final Backup getBackup(BackupName name)
      Gets details of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupName name =
             BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]");
         Backup response = backupDRClient.getBackup(name);
       }
       
      Parameters:
      name - Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}'
      Throws:
      ApiException - if the remote call fails
    • getBackup

      public final Backup getBackup(String name)
      Gets details of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                 .toString();
         Backup response = backupDRClient.getBackup(name);
       }
       
      Parameters:
      name - Required. Name of the data source resource name, in the format 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}'
      Throws:
      ApiException - if the remote call fails
    • getBackup

      public final Backup getBackup(GetBackupRequest request)
      Gets details of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupRequest request =
             GetBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setView(BackupView.forNumber(0))
                 .build();
         Backup response = backupDRClient.getBackup(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getBackupCallable

      public final UnaryCallable<GetBackupRequest,Backup> getBackupCallable()
      Gets details of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupRequest request =
             GetBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setView(BackupView.forNumber(0))
                 .build();
         ApiFuture<Backup> future = backupDRClient.getBackupCallable().futureCall(request);
         // Do something.
         Backup response = future.get();
       }
       
    • updateBackupAsync

      public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(Backup backup, com.google.protobuf.FieldMask updateMask)
      Updates the settings of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         Backup backup = Backup.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         Backup response = backupDRClient.updateBackupAsync(backup, updateMask).get();
       }
       
      Parameters:
      backup - Required. The resource being updated
      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.
      Throws:
      ApiException - if the remote call fails
    • updateBackupAsync

      public final OperationFuture<Backup,OperationMetadata> updateBackupAsync(UpdateBackupRequest request)
      Updates the settings of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupRequest request =
             UpdateBackupRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackup(Backup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         Backup response = backupDRClient.updateBackupAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateBackupOperationCallable

      public final OperationCallable<UpdateBackupRequest,Backup,OperationMetadata> updateBackupOperationCallable()
      Updates the settings of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupRequest request =
             UpdateBackupRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackup(Backup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Backup, OperationMetadata> future =
             backupDRClient.updateBackupOperationCallable().futureCall(request);
         // Do something.
         Backup response = future.get();
       }
       
    • updateBackupCallable

      public final UnaryCallable<UpdateBackupRequest,Operation> updateBackupCallable()
      Updates the settings of a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupRequest request =
             UpdateBackupRequest.newBuilder()
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setBackup(Backup.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = backupDRClient.updateBackupCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • deleteBackupAsync

      public final OperationFuture<Backup,OperationMetadata> deleteBackupAsync(BackupName name)
      Deletes a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupName name =
             BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]");
         Backup response = backupDRClient.deleteBackupAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupAsync

      public final OperationFuture<Backup,OperationMetadata> deleteBackupAsync(String name)
      Deletes a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                 .toString();
         Backup response = backupDRClient.deleteBackupAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the resource.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupAsync

      public final OperationFuture<Backup,OperationMetadata> deleteBackupAsync(DeleteBackupRequest request)
      Deletes a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupRequest request =
             DeleteBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         Backup response = backupDRClient.deleteBackupAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupOperationCallable

      public final OperationCallable<DeleteBackupRequest,Backup,OperationMetadata> deleteBackupOperationCallable()
      Deletes a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupRequest request =
             DeleteBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Backup, OperationMetadata> future =
             backupDRClient.deleteBackupOperationCallable().futureCall(request);
         // Do something.
         Backup response = future.get();
       }
       
    • deleteBackupCallable

      public final UnaryCallable<DeleteBackupRequest,Operation> deleteBackupCallable()
      Deletes a Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupRequest request =
             DeleteBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = backupDRClient.deleteBackupCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • restoreBackupAsync

      public final OperationFuture<RestoreBackupResponse,OperationMetadata> restoreBackupAsync(BackupName name)
      Restore from a Backup

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupName name =
             BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]");
         RestoreBackupResponse response = backupDRClient.restoreBackupAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the Backup instance, in the format 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'.
      Throws:
      ApiException - if the remote call fails
    • restoreBackupAsync

      public final OperationFuture<RestoreBackupResponse,OperationMetadata> restoreBackupAsync(String name)
      Restore from a Backup

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             BackupName.of("[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                 .toString();
         RestoreBackupResponse response = backupDRClient.restoreBackupAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the Backup instance, in the format 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'.
      Throws:
      ApiException - if the remote call fails
    • restoreBackupAsync

      Restore from a Backup

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         RestoreBackupRequest request =
             RestoreBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setClearOverridesFieldMask(FieldMask.newBuilder().build())
                 .build();
         RestoreBackupResponse response = backupDRClient.restoreBackupAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • restoreBackupOperationCallable

      public final OperationCallable<RestoreBackupRequest,RestoreBackupResponse,OperationMetadata> restoreBackupOperationCallable()
      Restore from a Backup

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         RestoreBackupRequest request =
             RestoreBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setClearOverridesFieldMask(FieldMask.newBuilder().build())
                 .build();
         OperationFuture<RestoreBackupResponse, OperationMetadata> future =
             backupDRClient.restoreBackupOperationCallable().futureCall(request);
         // Do something.
         RestoreBackupResponse response = future.get();
       }
       
    • restoreBackupCallable

      public final UnaryCallable<RestoreBackupRequest,Operation> restoreBackupCallable()
      Restore from a Backup

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         RestoreBackupRequest request =
             RestoreBackupRequest.newBuilder()
                 .setName(
                     BackupName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUPVAULT]", "[DATASOURCE]", "[BACKUP]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .setClearOverridesFieldMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Operation> future = backupDRClient.restoreBackupCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • createBackupPlanAsync

      public final OperationFuture<BackupPlan,OperationMetadata> createBackupPlanAsync(LocationName parent, BackupPlan backupPlan, String backupPlanId)
      Create a BackupPlan

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         BackupPlan backupPlan = BackupPlan.newBuilder().build();
         String backupPlanId = "backupPlanId-84871546";
         BackupPlan response =
             backupDRClient.createBackupPlanAsync(parent, backupPlan, backupPlanId).get();
       }
       
      Parameters:
      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**.
      backupPlan - Required. The `BackupPlan` resource object to create.
      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, /[a-z][a-z0-9-]{,62}/.
      Throws:
      ApiException - if the remote call fails
    • createBackupPlanAsync

      public final OperationFuture<BackupPlan,OperationMetadata> createBackupPlanAsync(String parent, BackupPlan backupPlan, String backupPlanId)
      Create a BackupPlan

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         BackupPlan backupPlan = BackupPlan.newBuilder().build();
         String backupPlanId = "backupPlanId-84871546";
         BackupPlan response =
             backupDRClient.createBackupPlanAsync(parent, backupPlan, backupPlanId).get();
       }
       
      Parameters:
      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**.
      backupPlan - Required. The `BackupPlan` resource object to create.
      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, /[a-z][a-z0-9-]{,62}/.
      Throws:
      ApiException - if the remote call fails
    • createBackupPlanAsync

      public final OperationFuture<BackupPlan,OperationMetadata> createBackupPlanAsync(CreateBackupPlanRequest request)
      Create a BackupPlan

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupPlanRequest request =
             CreateBackupPlanRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupPlanId("backupPlanId-84871546")
                 .setBackupPlan(BackupPlan.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         BackupPlan response = backupDRClient.createBackupPlanAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createBackupPlanOperationCallable

      public final OperationCallable<CreateBackupPlanRequest,BackupPlan,OperationMetadata> createBackupPlanOperationCallable()
      Create a BackupPlan

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupPlanRequest request =
             CreateBackupPlanRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupPlanId("backupPlanId-84871546")
                 .setBackupPlan(BackupPlan.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<BackupPlan, OperationMetadata> future =
             backupDRClient.createBackupPlanOperationCallable().futureCall(request);
         // Do something.
         BackupPlan response = future.get();
       }
       
    • createBackupPlanCallable

      public final UnaryCallable<CreateBackupPlanRequest,Operation> createBackupPlanCallable()
      Create a BackupPlan

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupPlanRequest request =
             CreateBackupPlanRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupPlanId("backupPlanId-84871546")
                 .setBackupPlan(BackupPlan.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = backupDRClient.createBackupPlanCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateBackupPlanAsync

      public final OperationFuture<BackupPlan,OperationMetadata> updateBackupPlanAsync(BackupPlan backupPlan, com.google.protobuf.FieldMask updateMask)
      Update a BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlan backupPlan = BackupPlan.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         BackupPlan response = backupDRClient.updateBackupPlanAsync(backupPlan, updateMask).get();
       }
       
      Parameters:
      backupPlan - Required. The resource being updated
      updateMask - Required. The list of fields to update. Field mask is used to specify the fields to be overwritten in the BackupPlan 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. Currently, these fields are supported in update: description, schedules, retention period, adding and removing Backup Rules.
      Throws:
      ApiException - if the remote call fails
    • updateBackupPlanAsync

      public final OperationFuture<BackupPlan,OperationMetadata> updateBackupPlanAsync(UpdateBackupPlanRequest request)
      Update a BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupPlanRequest request =
             UpdateBackupPlanRequest.newBuilder()
                 .setBackupPlan(BackupPlan.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         BackupPlan response = backupDRClient.updateBackupPlanAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateBackupPlanOperationCallable

      public final OperationCallable<UpdateBackupPlanRequest,BackupPlan,OperationMetadata> updateBackupPlanOperationCallable()
      Update a BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupPlanRequest request =
             UpdateBackupPlanRequest.newBuilder()
                 .setBackupPlan(BackupPlan.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<BackupPlan, OperationMetadata> future =
             backupDRClient.updateBackupPlanOperationCallable().futureCall(request);
         // Do something.
         BackupPlan response = future.get();
       }
       
    • updateBackupPlanCallable

      public final UnaryCallable<UpdateBackupPlanRequest,Operation> updateBackupPlanCallable()
      Update a BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupPlanRequest request =
             UpdateBackupPlanRequest.newBuilder()
                 .setBackupPlan(BackupPlan.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = backupDRClient.updateBackupPlanCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getBackupPlan

      public final BackupPlan getBackupPlan(BackupPlanName name)
      Gets details of a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanName name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]");
         BackupPlan response = backupDRClient.getBackupPlan(name);
       }
       
      Parameters:
      name - Required. The resource name of the `BackupPlan` to retrieve.

      Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`

      Throws:
      ApiException - if the remote call fails
    • getBackupPlan

      public final BackupPlan getBackupPlan(String name)
      Gets details of a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString();
         BackupPlan response = backupDRClient.getBackupPlan(name);
       }
       
      Parameters:
      name - Required. The resource name of the `BackupPlan` to retrieve.

      Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`

      Throws:
      ApiException - if the remote call fails
    • getBackupPlan

      public final BackupPlan getBackupPlan(GetBackupPlanRequest request)
      Gets details of a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupPlanRequest request =
             GetBackupPlanRequest.newBuilder()
                 .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .build();
         BackupPlan response = backupDRClient.getBackupPlan(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getBackupPlanCallable

      public final UnaryCallable<GetBackupPlanRequest,BackupPlan> getBackupPlanCallable()
      Gets details of a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupPlanRequest request =
             GetBackupPlanRequest.newBuilder()
                 .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .build();
         ApiFuture<BackupPlan> future = backupDRClient.getBackupPlanCallable().futureCall(request);
         // Do something.
         BackupPlan response = future.get();
       }
       
    • listBackupPlans

      public final BackupDRClient.ListBackupPlansPagedResponse listBackupPlans(LocationName parent)
      Lists BackupPlans in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (BackupPlan element : backupDRClient.listBackupPlans(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlans

      public final BackupDRClient.ListBackupPlansPagedResponse listBackupPlans(String parent)
      Lists BackupPlans in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (BackupPlan element : backupDRClient.listBackupPlans(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      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.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlans

      Lists BackupPlans in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlansRequest request =
             ListBackupPlansRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (BackupPlan element : backupDRClient.listBackupPlans(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlansPagedCallable

      Lists BackupPlans in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlansRequest request =
             ListBackupPlansRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<BackupPlan> future =
             backupDRClient.listBackupPlansPagedCallable().futureCall(request);
         // Do something.
         for (BackupPlan element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listBackupPlansCallable

      public final UnaryCallable<ListBackupPlansRequest,ListBackupPlansResponse> listBackupPlansCallable()
      Lists BackupPlans in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlansRequest request =
             ListBackupPlansRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListBackupPlansResponse response = backupDRClient.listBackupPlansCallable().call(request);
           for (BackupPlan element : response.getBackupPlansList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteBackupPlanAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAsync(BackupPlanName name)
      Deletes a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanName name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]");
         backupDRClient.deleteBackupPlanAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the `BackupPlan` to delete.

      Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`

      Throws:
      ApiException - if the remote call fails
    • deleteBackupPlanAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAsync(String name)
      Deletes a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString();
         backupDRClient.deleteBackupPlanAsync(name).get();
       }
       
      Parameters:
      name - Required. The resource name of the `BackupPlan` to delete.

      Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`

      Throws:
      ApiException - if the remote call fails
    • deleteBackupPlanAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAsync(DeleteBackupPlanRequest request)
      Deletes a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupPlanRequest request =
             DeleteBackupPlanRequest.newBuilder()
                 .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         backupDRClient.deleteBackupPlanAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupPlanOperationCallable

      public final OperationCallable<DeleteBackupPlanRequest,com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanOperationCallable()
      Deletes a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupPlanRequest request =
             DeleteBackupPlanRequest.newBuilder()
                 .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             backupDRClient.deleteBackupPlanOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteBackupPlanCallable

      public final UnaryCallable<DeleteBackupPlanRequest,Operation> deleteBackupPlanCallable()
      Deletes a single BackupPlan.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupPlanRequest request =
             DeleteBackupPlanRequest.newBuilder()
                 .setName(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = backupDRClient.deleteBackupPlanCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • getBackupPlanRevision

      public final BackupPlanRevision getBackupPlanRevision(BackupPlanRevisionName name)
      Gets details of a single BackupPlanRevision.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanRevisionName name =
             BackupPlanRevisionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]");
         BackupPlanRevision response = backupDRClient.getBackupPlanRevision(name);
       }
       
      Parameters:
      name - Required. The resource name of the `BackupPlanRevision` to retrieve.

      Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}`

      Throws:
      ApiException - if the remote call fails
    • getBackupPlanRevision

      public final BackupPlanRevision getBackupPlanRevision(String name)
      Gets details of a single BackupPlanRevision.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             BackupPlanRevisionName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]")
                 .toString();
         BackupPlanRevision response = backupDRClient.getBackupPlanRevision(name);
       }
       
      Parameters:
      name - Required. The resource name of the `BackupPlanRevision` to retrieve.

      Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}`

      Throws:
      ApiException - if the remote call fails
    • getBackupPlanRevision

      public final BackupPlanRevision getBackupPlanRevision(GetBackupPlanRevisionRequest request)
      Gets details of a single BackupPlanRevision.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupPlanRevisionRequest request =
             GetBackupPlanRevisionRequest.newBuilder()
                 .setName(
                     BackupPlanRevisionName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]")
                         .toString())
                 .build();
         BackupPlanRevision response = backupDRClient.getBackupPlanRevision(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getBackupPlanRevisionCallable

      public final UnaryCallable<GetBackupPlanRevisionRequest,BackupPlanRevision> getBackupPlanRevisionCallable()
      Gets details of a single BackupPlanRevision.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupPlanRevisionRequest request =
             GetBackupPlanRevisionRequest.newBuilder()
                 .setName(
                     BackupPlanRevisionName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]", "[REVISION]")
                         .toString())
                 .build();
         ApiFuture<BackupPlanRevision> future =
             backupDRClient.getBackupPlanRevisionCallable().futureCall(request);
         // Do something.
         BackupPlanRevision response = future.get();
       }
       
    • listBackupPlanRevisions

      public final BackupDRClient.ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(BackupPlanName parent)
      Lists BackupPlanRevisions in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanName parent = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]");
         for (BackupPlanRevision element :
             backupDRClient.listBackupPlanRevisions(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location for which to retrieve `BackupPlanRevisions` information. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlanRevisions

      public final BackupDRClient.ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(String parent)
      Lists BackupPlanRevisions in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString();
         for (BackupPlanRevision element :
             backupDRClient.listBackupPlanRevisions(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The project and location for which to retrieve `BackupPlanRevisions` information. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlanRevisions

      Lists BackupPlanRevisions in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlanRevisionsRequest request =
             ListBackupPlanRevisionsRequest.newBuilder()
                 .setParent(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (BackupPlanRevision element :
             backupDRClient.listBackupPlanRevisions(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlanRevisionsPagedCallable

      Lists BackupPlanRevisions in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlanRevisionsRequest request =
             ListBackupPlanRevisionsRequest.newBuilder()
                 .setParent(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<BackupPlanRevision> future =
             backupDRClient.listBackupPlanRevisionsPagedCallable().futureCall(request);
         // Do something.
         for (BackupPlanRevision element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listBackupPlanRevisionsCallable

      public final UnaryCallable<ListBackupPlanRevisionsRequest,ListBackupPlanRevisionsResponse> listBackupPlanRevisionsCallable()
      Lists BackupPlanRevisions in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlanRevisionsRequest request =
             ListBackupPlanRevisionsRequest.newBuilder()
                 .setParent(BackupPlanName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListBackupPlanRevisionsResponse response =
               backupDRClient.listBackupPlanRevisionsCallable().call(request);
           for (BackupPlanRevision element : response.getBackupPlanRevisionsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • createBackupPlanAssociationAsync

      public final OperationFuture<BackupPlanAssociation,OperationMetadata> createBackupPlanAssociationAsync(LocationName parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId)
      Create a BackupPlanAssociation

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         BackupPlanAssociation backupPlanAssociation = BackupPlanAssociation.newBuilder().build();
         String backupPlanAssociationId = "backupPlanAssociationId567762737";
         BackupPlanAssociation response =
             backupDRClient
                 .createBackupPlanAssociationAsync(
                     parent, backupPlanAssociation, backupPlanAssociationId)
                 .get();
       }
       
      Parameters:
      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**.
      backupPlanAssociation - Required. The resource being created
      backupPlanAssociationId - Required. The name of the backup plan association to create. The name must be unique for the specified project and location.
      Throws:
      ApiException - if the remote call fails
    • createBackupPlanAssociationAsync

      public final OperationFuture<BackupPlanAssociation,OperationMetadata> createBackupPlanAssociationAsync(String parent, BackupPlanAssociation backupPlanAssociation, String backupPlanAssociationId)
      Create a BackupPlanAssociation

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         BackupPlanAssociation backupPlanAssociation = BackupPlanAssociation.newBuilder().build();
         String backupPlanAssociationId = "backupPlanAssociationId567762737";
         BackupPlanAssociation response =
             backupDRClient
                 .createBackupPlanAssociationAsync(
                     parent, backupPlanAssociation, backupPlanAssociationId)
                 .get();
       }
       
      Parameters:
      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**.
      backupPlanAssociation - Required. The resource being created
      backupPlanAssociationId - Required. The name of the backup plan association to create. The name must be unique for the specified project and location.
      Throws:
      ApiException - if the remote call fails
    • createBackupPlanAssociationAsync

      public final OperationFuture<BackupPlanAssociation,OperationMetadata> createBackupPlanAssociationAsync(CreateBackupPlanAssociationRequest request)
      Create a BackupPlanAssociation

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupPlanAssociationRequest request =
             CreateBackupPlanAssociationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupPlanAssociationId("backupPlanAssociationId567762737")
                 .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         BackupPlanAssociation response =
             backupDRClient.createBackupPlanAssociationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • createBackupPlanAssociationOperationCallable

      public final OperationCallable<CreateBackupPlanAssociationRequest,BackupPlanAssociation,OperationMetadata> createBackupPlanAssociationOperationCallable()
      Create a BackupPlanAssociation

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupPlanAssociationRequest request =
             CreateBackupPlanAssociationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupPlanAssociationId("backupPlanAssociationId567762737")
                 .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<BackupPlanAssociation, OperationMetadata> future =
             backupDRClient.createBackupPlanAssociationOperationCallable().futureCall(request);
         // Do something.
         BackupPlanAssociation response = future.get();
       }
       
    • createBackupPlanAssociationCallable

      public final UnaryCallable<CreateBackupPlanAssociationRequest,Operation> createBackupPlanAssociationCallable()
      Create a BackupPlanAssociation

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         CreateBackupPlanAssociationRequest request =
             CreateBackupPlanAssociationRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setBackupPlanAssociationId("backupPlanAssociationId567762737")
                 .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             backupDRClient.createBackupPlanAssociationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • updateBackupPlanAssociationAsync

      public final OperationFuture<BackupPlanAssociation,OperationMetadata> updateBackupPlanAssociationAsync(BackupPlanAssociation backupPlanAssociation, com.google.protobuf.FieldMask updateMask)
      Update a BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanAssociation backupPlanAssociation = BackupPlanAssociation.newBuilder().build();
         FieldMask updateMask = FieldMask.newBuilder().build();
         BackupPlanAssociation response =
             backupDRClient.updateBackupPlanAssociationAsync(backupPlanAssociation, updateMask).get();
       }
       
      Parameters:
      backupPlanAssociation - Required. The resource being updated
      updateMask - Required. The list of fields to update. Field mask is used to specify the fields to be overwritten in the BackupPlanAssociation 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. Currently backup_plan_association.backup_plan is the only supported field.
      Throws:
      ApiException - if the remote call fails
    • updateBackupPlanAssociationAsync

      public final OperationFuture<BackupPlanAssociation,OperationMetadata> updateBackupPlanAssociationAsync(UpdateBackupPlanAssociationRequest request)
      Update a BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupPlanAssociationRequest request =
             UpdateBackupPlanAssociationRequest.newBuilder()
                 .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         BackupPlanAssociation response =
             backupDRClient.updateBackupPlanAssociationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • updateBackupPlanAssociationOperationCallable

      public final OperationCallable<UpdateBackupPlanAssociationRequest,BackupPlanAssociation,OperationMetadata> updateBackupPlanAssociationOperationCallable()
      Update a BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupPlanAssociationRequest request =
             UpdateBackupPlanAssociationRequest.newBuilder()
                 .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<BackupPlanAssociation, OperationMetadata> future =
             backupDRClient.updateBackupPlanAssociationOperationCallable().futureCall(request);
         // Do something.
         BackupPlanAssociation response = future.get();
       }
       
    • updateBackupPlanAssociationCallable

      public final UnaryCallable<UpdateBackupPlanAssociationRequest,Operation> updateBackupPlanAssociationCallable()
      Update a BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         UpdateBackupPlanAssociationRequest request =
             UpdateBackupPlanAssociationRequest.newBuilder()
                 .setBackupPlanAssociation(BackupPlanAssociation.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             backupDRClient.updateBackupPlanAssociationCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getBackupPlanAssociation

      public final BackupPlanAssociation getBackupPlanAssociation(BackupPlanAssociationName name)
      Gets details of a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanAssociationName name =
             BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]");
         BackupPlanAssociation response = backupDRClient.getBackupPlanAssociation(name);
       }
       
      Parameters:
      name - Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
      Throws:
      ApiException - if the remote call fails
    • getBackupPlanAssociation

      public final BackupPlanAssociation getBackupPlanAssociation(String name)
      Gets details of a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                 .toString();
         BackupPlanAssociation response = backupDRClient.getBackupPlanAssociation(name);
       }
       
      Parameters:
      name - Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
      Throws:
      ApiException - if the remote call fails
    • getBackupPlanAssociation

      public final BackupPlanAssociation getBackupPlanAssociation(GetBackupPlanAssociationRequest request)
      Gets details of a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupPlanAssociationRequest request =
             GetBackupPlanAssociationRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .build();
         BackupPlanAssociation response = backupDRClient.getBackupPlanAssociation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getBackupPlanAssociationCallable

      public final UnaryCallable<GetBackupPlanAssociationRequest,BackupPlanAssociation> getBackupPlanAssociationCallable()
      Gets details of a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetBackupPlanAssociationRequest request =
             GetBackupPlanAssociationRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .build();
         ApiFuture<BackupPlanAssociation> future =
             backupDRClient.getBackupPlanAssociationCallable().futureCall(request);
         // Do something.
         BackupPlanAssociation response = future.get();
       }
       
    • listBackupPlanAssociations

      public final BackupDRClient.ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(LocationName parent)
      Lists BackupPlanAssociations in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (BackupPlanAssociation element :
             backupDRClient.listBackupPlanAssociations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - 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.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlanAssociations

      public final BackupDRClient.ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(String parent)
      Lists BackupPlanAssociations in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (BackupPlanAssociation element :
             backupDRClient.listBackupPlanAssociations(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - 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.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlanAssociations

      Lists BackupPlanAssociations in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlanAssociationsRequest request =
             ListBackupPlanAssociationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         for (BackupPlanAssociation element :
             backupDRClient.listBackupPlanAssociations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listBackupPlanAssociationsPagedCallable

      Lists BackupPlanAssociations in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlanAssociationsRequest request =
             ListBackupPlanAssociationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         ApiFuture<BackupPlanAssociation> future =
             backupDRClient.listBackupPlanAssociationsPagedCallable().futureCall(request);
         // Do something.
         for (BackupPlanAssociation element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listBackupPlanAssociationsCallable

      public final UnaryCallable<ListBackupPlanAssociationsRequest,ListBackupPlanAssociationsResponse> listBackupPlanAssociationsCallable()
      Lists BackupPlanAssociations in a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListBackupPlanAssociationsRequest request =
             ListBackupPlanAssociationsRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .build();
         while (true) {
           ListBackupPlanAssociationsResponse response =
               backupDRClient.listBackupPlanAssociationsCallable().call(request);
           for (BackupPlanAssociation element : response.getBackupPlanAssociationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • fetchBackupPlanAssociationsForResourceType

      public final BackupDRClient.FetchBackupPlanAssociationsForResourceTypePagedResponse fetchBackupPlanAssociationsForResourceType(LocationName parent, String resourceType)
      List BackupPlanAssociations for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         String resourceType = "resourceType-384364440";
         for (BackupPlanAssociation element :
             backupDRClient
                 .fetchBackupPlanAssociationsForResourceType(parent, resourceType)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource name. Format: projects/{project}/locations/{location}
      resourceType - Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance
      Throws:
      ApiException - if the remote call fails
    • fetchBackupPlanAssociationsForResourceType

      public final BackupDRClient.FetchBackupPlanAssociationsForResourceTypePagedResponse fetchBackupPlanAssociationsForResourceType(String parent, String resourceType)
      List BackupPlanAssociations for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         String resourceType = "resourceType-384364440";
         for (BackupPlanAssociation element :
             backupDRClient
                 .fetchBackupPlanAssociationsForResourceType(parent, resourceType)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource name. Format: projects/{project}/locations/{location}
      resourceType - Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance
      Throws:
      ApiException - if the remote call fails
    • fetchBackupPlanAssociationsForResourceType

      List BackupPlanAssociations for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchBackupPlanAssociationsForResourceTypeRequest request =
             FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (BackupPlanAssociation element :
             backupDRClient.fetchBackupPlanAssociationsForResourceType(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • fetchBackupPlanAssociationsForResourceTypePagedCallable

      List BackupPlanAssociations for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchBackupPlanAssociationsForResourceTypeRequest request =
             FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<BackupPlanAssociation> future =
             backupDRClient
                 .fetchBackupPlanAssociationsForResourceTypePagedCallable()
                 .futureCall(request);
         // Do something.
         for (BackupPlanAssociation element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • fetchBackupPlanAssociationsForResourceTypeCallable

      List BackupPlanAssociations for a given resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchBackupPlanAssociationsForResourceTypeRequest request =
             FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           FetchBackupPlanAssociationsForResourceTypeResponse response =
               backupDRClient.fetchBackupPlanAssociationsForResourceTypeCallable().call(request);
           for (BackupPlanAssociation element : response.getBackupPlanAssociationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • deleteBackupPlanAssociationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAssociationAsync(BackupPlanAssociationName name)
      Deletes a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanAssociationName name =
             BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]");
         backupDRClient.deleteBackupPlanAssociationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
      Throws:
      ApiException - if the remote call fails
    • deleteBackupPlanAssociationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAssociationAsync(String name)
      Deletes a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                 .toString();
         backupDRClient.deleteBackupPlanAssociationAsync(name).get();
       }
       
      Parameters:
      name - Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
      Throws:
      ApiException - if the remote call fails
    • deleteBackupPlanAssociationAsync

      public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAssociationAsync(DeleteBackupPlanAssociationRequest request)
      Deletes a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupPlanAssociationRequest request =
             DeleteBackupPlanAssociationRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         backupDRClient.deleteBackupPlanAssociationAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • deleteBackupPlanAssociationOperationCallable

      public final OperationCallable<DeleteBackupPlanAssociationRequest,com.google.protobuf.Empty,OperationMetadata> deleteBackupPlanAssociationOperationCallable()
      Deletes a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupPlanAssociationRequest request =
             DeleteBackupPlanAssociationRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<Empty, OperationMetadata> future =
             backupDRClient.deleteBackupPlanAssociationOperationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • deleteBackupPlanAssociationCallable

      public final UnaryCallable<DeleteBackupPlanAssociationRequest,Operation> deleteBackupPlanAssociationCallable()
      Deletes a single BackupPlanAssociation.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DeleteBackupPlanAssociationRequest request =
             DeleteBackupPlanAssociationRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future =
             backupDRClient.deleteBackupPlanAssociationCallable().futureCall(request);
         // Do something.
         future.get();
       }
       
    • triggerBackupAsync

      Triggers a new Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         BackupPlanAssociationName name =
             BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]");
         String ruleId = "ruleId-919875273";
         BackupPlanAssociation response = backupDRClient.triggerBackupAsync(name, ruleId).get();
       }
       
      Parameters:
      name - Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
      ruleId - Required. backup rule_id for which a backup needs to be triggered.
      Throws:
      ApiException - if the remote call fails
    • triggerBackupAsync

      public final OperationFuture<BackupPlanAssociation,OperationMetadata> triggerBackupAsync(String name, String ruleId)
      Triggers a new Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             BackupPlanAssociationName.of("[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                 .toString();
         String ruleId = "ruleId-919875273";
         BackupPlanAssociation response = backupDRClient.triggerBackupAsync(name, ruleId).get();
       }
       
      Parameters:
      name - Required. Name of the backup plan association resource, in the format `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
      ruleId - Required. backup rule_id for which a backup needs to be triggered.
      Throws:
      ApiException - if the remote call fails
    • triggerBackupAsync

      Triggers a new Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         TriggerBackupRequest request =
             TriggerBackupRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .setRuleId("ruleId-919875273")
                 .setRequestId("requestId693933066")
                 .build();
         BackupPlanAssociation response = backupDRClient.triggerBackupAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • triggerBackupOperationCallable

      public final OperationCallable<TriggerBackupRequest,BackupPlanAssociation,OperationMetadata> triggerBackupOperationCallable()
      Triggers a new Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         TriggerBackupRequest request =
             TriggerBackupRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .setRuleId("ruleId-919875273")
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<BackupPlanAssociation, OperationMetadata> future =
             backupDRClient.triggerBackupOperationCallable().futureCall(request);
         // Do something.
         BackupPlanAssociation response = future.get();
       }
       
    • triggerBackupCallable

      public final UnaryCallable<TriggerBackupRequest,Operation> triggerBackupCallable()
      Triggers a new Backup.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         TriggerBackupRequest request =
             TriggerBackupRequest.newBuilder()
                 .setName(
                     BackupPlanAssociationName.of(
                             "[PROJECT]", "[LOCATION]", "[BACKUP_PLAN_ASSOCIATION]")
                         .toString())
                 .setRuleId("ruleId-919875273")
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = backupDRClient.triggerBackupCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • getDataSourceReference

      public final DataSourceReference getDataSourceReference(DataSourceReferenceName name)
      Gets details of a single DataSourceReference.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         DataSourceReferenceName name =
             DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]");
         DataSourceReference response = backupDRClient.getDataSourceReference(name);
       }
       
      Parameters:
      name - Required. The name of the DataSourceReference to retrieve. Format: projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}
      Throws:
      ApiException - if the remote call fails
    • getDataSourceReference

      public final DataSourceReference getDataSourceReference(String name)
      Gets details of a single DataSourceReference.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String name =
             DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]")
                 .toString();
         DataSourceReference response = backupDRClient.getDataSourceReference(name);
       }
       
      Parameters:
      name - Required. The name of the DataSourceReference to retrieve. Format: projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}
      Throws:
      ApiException - if the remote call fails
    • getDataSourceReference

      public final DataSourceReference getDataSourceReference(GetDataSourceReferenceRequest request)
      Gets details of a single DataSourceReference.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetDataSourceReferenceRequest request =
             GetDataSourceReferenceRequest.newBuilder()
                 .setName(
                     DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]")
                         .toString())
                 .build();
         DataSourceReference response = backupDRClient.getDataSourceReference(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getDataSourceReferenceCallable

      public final UnaryCallable<GetDataSourceReferenceRequest,DataSourceReference> getDataSourceReferenceCallable()
      Gets details of a single DataSourceReference.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetDataSourceReferenceRequest request =
             GetDataSourceReferenceRequest.newBuilder()
                 .setName(
                     DataSourceReferenceName.of("[PROJECT]", "[LOCATION]", "[DATA_SOURCE_REFERENCE]")
                         .toString())
                 .build();
         ApiFuture<DataSourceReference> future =
             backupDRClient.getDataSourceReferenceCallable().futureCall(request);
         // Do something.
         DataSourceReference response = future.get();
       }
       
    • listDataSourceReferences

      public final BackupDRClient.ListDataSourceReferencesPagedResponse listDataSourceReferences(LocationName parent)
      Lists DataSourceReferences for a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         for (DataSourceReference element :
             backupDRClient.listDataSourceReferences(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource name. Format: projects/{project}/locations/{location}
      Throws:
      ApiException - if the remote call fails
    • listDataSourceReferences

      public final BackupDRClient.ListDataSourceReferencesPagedResponse listDataSourceReferences(String parent)
      Lists DataSourceReferences for a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         for (DataSourceReference element :
             backupDRClient.listDataSourceReferences(parent).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource name. Format: projects/{project}/locations/{location}
      Throws:
      ApiException - if the remote call fails
    • listDataSourceReferences

      Lists DataSourceReferences for a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListDataSourceReferencesRequest request =
             ListDataSourceReferencesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (DataSourceReference element :
             backupDRClient.listDataSourceReferences(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listDataSourceReferencesPagedCallable

      Lists DataSourceReferences for a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListDataSourceReferencesRequest request =
             ListDataSourceReferencesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<DataSourceReference> future =
             backupDRClient.listDataSourceReferencesPagedCallable().futureCall(request);
         // Do something.
         for (DataSourceReference element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listDataSourceReferencesCallable

      public final UnaryCallable<ListDataSourceReferencesRequest,ListDataSourceReferencesResponse> listDataSourceReferencesCallable()
      Lists DataSourceReferences for a given project and location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListDataSourceReferencesRequest request =
             ListDataSourceReferencesRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           ListDataSourceReferencesResponse response =
               backupDRClient.listDataSourceReferencesCallable().call(request);
           for (DataSourceReference element : response.getDataSourceReferencesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • fetchDataSourceReferencesForResourceType

      public final BackupDRClient.FetchDataSourceReferencesForResourceTypePagedResponse fetchDataSourceReferencesForResourceType(LocationName parent, String resourceType)
      Fetch DataSourceReferences for a given project, location and resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
         String resourceType = "resourceType-384364440";
         for (DataSourceReference element :
             backupDRClient
                 .fetchDataSourceReferencesForResourceType(parent, resourceType)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource name. Format: projects/{project}/locations/{location}
      resourceType - Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance
      Throws:
      ApiException - if the remote call fails
    • fetchDataSourceReferencesForResourceType

      public final BackupDRClient.FetchDataSourceReferencesForResourceTypePagedResponse fetchDataSourceReferencesForResourceType(String parent, String resourceType)
      Fetch DataSourceReferences for a given project, location and resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
         String resourceType = "resourceType-384364440";
         for (DataSourceReference element :
             backupDRClient
                 .fetchDataSourceReferencesForResourceType(parent, resourceType)
                 .iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      parent - Required. The parent resource name. Format: projects/{project}/locations/{location}
      resourceType - Required. The type of the GCP resource. Ex: sql.googleapis.com/Instance
      Throws:
      ApiException - if the remote call fails
    • fetchDataSourceReferencesForResourceType

      Fetch DataSourceReferences for a given project, location and resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchDataSourceReferencesForResourceTypeRequest request =
             FetchDataSourceReferencesForResourceTypeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         for (DataSourceReference element :
             backupDRClient.fetchDataSourceReferencesForResourceType(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • fetchDataSourceReferencesForResourceTypePagedCallable

      Fetch DataSourceReferences for a given project, location and resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchDataSourceReferencesForResourceTypeRequest request =
             FetchDataSourceReferencesForResourceTypeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         ApiFuture<DataSourceReference> future =
             backupDRClient
                 .fetchDataSourceReferencesForResourceTypePagedCallable()
                 .futureCall(request);
         // Do something.
         for (DataSourceReference element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • fetchDataSourceReferencesForResourceTypeCallable

      Fetch DataSourceReferences for a given project, location and resource type.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         FetchDataSourceReferencesForResourceTypeRequest request =
             FetchDataSourceReferencesForResourceTypeRequest.newBuilder()
                 .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
                 .setResourceType("resourceType-384364440")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .setFilter("filter-1274492040")
                 .setOrderBy("orderBy-1207110587")
                 .build();
         while (true) {
           FetchDataSourceReferencesForResourceTypeResponse response =
               backupDRClient.fetchDataSourceReferencesForResourceTypeCallable().call(request);
           for (DataSourceReference element : response.getDataSourceReferencesList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • initializeServiceAsync

      Initializes the service related config for a project.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         InitializeServiceRequest request =
             InitializeServiceRequest.newBuilder()
                 .setName("name3373707")
                 .setResourceType("resourceType-384364440")
                 .setRequestId("requestId693933066")
                 .build();
         InitializeServiceResponse response = backupDRClient.initializeServiceAsync(request).get();
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • initializeServiceOperationCallable

      public final OperationCallable<InitializeServiceRequest,InitializeServiceResponse,OperationMetadata> initializeServiceOperationCallable()
      Initializes the service related config for a project.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         InitializeServiceRequest request =
             InitializeServiceRequest.newBuilder()
                 .setName("name3373707")
                 .setResourceType("resourceType-384364440")
                 .setRequestId("requestId693933066")
                 .build();
         OperationFuture<InitializeServiceResponse, OperationMetadata> future =
             backupDRClient.initializeServiceOperationCallable().futureCall(request);
         // Do something.
         InitializeServiceResponse response = future.get();
       }
       
    • initializeServiceCallable

      public final UnaryCallable<InitializeServiceRequest,Operation> initializeServiceCallable()
      Initializes the service related config for a project.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         InitializeServiceRequest request =
             InitializeServiceRequest.newBuilder()
                 .setName("name3373707")
                 .setResourceType("resourceType-384364440")
                 .setRequestId("requestId693933066")
                 .build();
         ApiFuture<Operation> future = backupDRClient.initializeServiceCallable().futureCall(request);
         // Do something.
         Operation response = future.get();
       }
       
    • listLocations

      Lists information about the supported locations for this service.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         for (Location element : backupDRClient.listLocations(request).iterateAll()) {
           // doThingsWith(element);
         }
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • listLocationsPagedCallable

      Lists information about the supported locations for this service.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         ApiFuture<Location> future = backupDRClient.listLocationsPagedCallable().futureCall(request);
         // Do something.
         for (Location element : future.get().iterateAll()) {
           // doThingsWith(element);
         }
       }
       
    • listLocationsCallable

      public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
      Lists information about the supported locations for this service.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         ListLocationsRequest request =
             ListLocationsRequest.newBuilder()
                 .setName("name3373707")
                 .setFilter("filter-1274492040")
                 .setPageSize(883849137)
                 .setPageToken("pageToken873572522")
                 .build();
         while (true) {
           ListLocationsResponse response = backupDRClient.listLocationsCallable().call(request);
           for (Location element : response.getLocationsList()) {
             // doThingsWith(element);
           }
           String nextPageToken = response.getNextPageToken();
           if (!Strings.isNullOrEmpty(nextPageToken)) {
             request = request.toBuilder().setPageToken(nextPageToken).build();
           } else {
             break;
           }
         }
       }
       
    • getLocation

      public final Location getLocation(GetLocationRequest request)
      Gets information about a location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         Location response = backupDRClient.getLocation(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getLocationCallable

      public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
      Gets information about a location.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
         ApiFuture<Location> future = backupDRClient.getLocationCallable().futureCall(request);
         // Do something.
         Location response = future.get();
       }
       
    • setIamPolicy

      public final Policy setIamPolicy(SetIamPolicyRequest request)
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         Policy response = backupDRClient.setIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • setIamPolicyCallable

      public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()
      Sets the access control policy on the specified resource. Replacesany existing policy.

      Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         SetIamPolicyRequest request =
             SetIamPolicyRequest.newBuilder()
                 .setResource(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .setPolicy(Policy.newBuilder().build())
                 .setUpdateMask(FieldMask.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = backupDRClient.setIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • getIamPolicy

      public final Policy getIamPolicy(GetIamPolicyRequest request)
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         Policy response = backupDRClient.getIamPolicy(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • getIamPolicyCallable

      public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()
      Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         GetIamPolicyRequest request =
             GetIamPolicyRequest.newBuilder()
                 .setResource(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .setOptions(GetPolicyOptions.newBuilder().build())
                 .build();
         ApiFuture<Policy> future = backupDRClient.getIamPolicyCallable().futureCall(request);
         // Do something.
         Policy response = future.get();
       }
       
    • testIamPermissions

      public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         TestIamPermissionsResponse response = backupDRClient.testIamPermissions(request);
       }
       
      Parameters:
      request - The request object containing all of the parameters for the API call.
      Throws:
      ApiException - if the remote call fails
    • testIamPermissionsCallable

      public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()
      Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.

      Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.

      Sample code:

      
       // 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.
       // - It may require specifying regional endpoints when creating the service client as shown in
       // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
       try (BackupDRClient backupDRClient = BackupDRClient.create()) {
         TestIamPermissionsRequest request =
             TestIamPermissionsRequest.newBuilder()
                 .setResource(
                     ManagementServerName.of("[PROJECT]", "[LOCATION]", "[MANAGEMENTSERVER]")
                         .toString())
                 .addAllPermissions(new ArrayList<String>())
                 .build();
         ApiFuture<TestIamPermissionsResponse> future =
             backupDRClient.testIamPermissionsCallable().futureCall(request);
         // Do something.
         TestIamPermissionsResponse response = future.get();
       }
       
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
    • shutdown

      public void shutdown()
      Specified by:
      shutdown in interface BackgroundResource
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface BackgroundResource
    • isTerminated

      public boolean isTerminated()
      Specified by:
      isTerminated in interface BackgroundResource
    • shutdownNow

      public void shutdownNow()
      Specified by:
      shutdownNow in interface BackgroundResource
    • awaitTermination

      public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
      Specified by:
      awaitTermination in interface BackgroundResource
      Throws:
      InterruptedException