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: + * + *
{@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);
+ * }
+ * }
+ *
+ * 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(). + * + *
| 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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteManagementServer |
+ * Deletes a single ManagementServer. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetBackupVault |
+ * Gets details of a BackupVault. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteBackupVault |
+ * Deletes a BackupVault. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetDataSource |
+ * Gets details of a DataSource. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetBackup |
+ * Gets details of a Backup. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteBackup |
+ * Deletes a Backup. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
RestoreBackup |
+ * Restore from a Backup |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateBackupPlan |
+ * Create a BackupPlan |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateBackupPlan |
+ * Update a BackupPlan. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteBackupPlan |
+ * Deletes a single BackupPlan. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateBackupPlanAssociation |
+ * Create a BackupPlanAssociation |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateBackupPlanAssociation |
+ * Update a BackupPlanAssociation. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteBackupPlanAssociation |
+ * Deletes a single BackupPlanAssociation. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
TriggerBackup |
+ * Triggers a new Backup. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateAutoProtectionPolicy |
+ * Creates a new AutoProtectionPolicy in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListAutoProtectionPolicies |
+ * Lists AutoProtectionPolicies for a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetAutoProtectionPolicy |
+ * Gets details of a single AutoProtectionPolicy. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateAutoProtectionPolicy |
+ * Updates the parameters of a single AutoProtectionPolicy. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteAutoProtectionPolicy |
+ * Deletes a single AutoProtectionPolicy. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateAutoProtectionPolicyBinding |
+ * Creates a new AutoProtectionPolicyBinding in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetAutoProtectionPolicyBinding |
+ * Returns the auto protection policy binding read from the CCFE tables. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListAutoProtectionPolicyBindings |
+ * Returns the auto protection policy bindings read from the CCFE tables. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListAppliedAutoProtectionPolicies |
+ * Lists AppliedAutoProtectionPolicies in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
InitiateDeleteAutoProtectionPolicyBinding |
+ * InitiateDeleteAutoProtectionPolicyBinding initiates delete for AutoProtectionPolicy Binding |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetBindingMatchingResource |
+ * Gets details of a single Binding Matching Resource. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListBindingMatchingResources |
+ * Lists Binding Matching Resources for a given AutoProtectionPolicyBinding. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListLocations |
+ * Lists information about the supported locations for this service. + * This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: ***Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project. + * For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
GetLocation |
+ * Gets information about a location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
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: + * + *
{@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
+ * BackupDRSettings backupDRSettings =
+ * BackupDRSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
+ * }
+ *
+ * To customize the endpoint: + * + *
{@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
+ * 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: + * + *
{@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
+ * BackupDRSettings backupDRSettings = BackupDRSettings.newHttpJsonBuilder().build();
+ * BackupDRClient backupDRClient = BackupDRClient.create(backupDRSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@NullMarked +@BetaApi +@Generated("by gapic-generator-java") +public class BackupDRClient implements BackgroundResource { + private final @Nullable BackupDRSettings settings; + private final BackupDRStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of BackupDRClient with default settings. */ + public static final BackupDRClient create() throws IOException { + return create(BackupDRSettings.newBuilder().build()); + } + + /** + * 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. + */ + public static final BackupDRClient create(BackupDRSettings settings) throws IOException { + return new BackupDRClient(settings); + } + + /** + * Constructs an instance of BackupDRClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(BackupDRSettings). + */ + public static final BackupDRClient create(BackupDRStub stub) { + return new BackupDRClient(stub); + } + + /** + * 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. + */ + protected BackupDRClient(BackupDRSettings settings) throws IOException { + this.settings = settings; + this.stub = ((BackupDRStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected BackupDRClient(BackupDRStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final @Nullable BackupDRSettings getSettings() { + return settings; + } + + public BackupDRStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists ManagementServers in a given project and location. + * + *
Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve management servers
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve management servers
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListManagementServersPagedResponse listManagementServers(
+ ListManagementServersRequest request) {
+ return listManagementServersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists ManagementServers in a given project and location.
+ *
+ * Sample code: + * + *
{@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 future =
+ * backupDRClient.listManagementServersPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ManagementServer element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the management server resource name, in the format
+ * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ManagementServer getManagementServer(@Nullable ManagementServerName name) {
+ GetManagementServerRequest request =
+ GetManagementServerRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getManagementServer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single ManagementServer.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the management server resource name, in the format
+ * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ManagementServer getManagementServer(String name) {
+ GetManagementServerRequest request =
+ GetManagementServerRequest.newBuilder().setName(name).build();
+ return getManagementServer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single ManagementServer.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ManagementServer getManagementServer(GetManagementServerRequest request) {
+ return getManagementServerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single ManagementServer.
+ *
+ * Sample code: + * + *
{@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 future =
+ * backupDRClient.getManagementServerCallable().futureCall(request);
+ * // Do something.
+ * ManagementServer response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param parent Required. The management server project and location in the format
+ * 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR locations map
+ * to Google Cloud regions, for example **us-central1**.
+ * @param managementServer Required. A [management server
+ * resource][google.cloud.backupdr.v1.ManagementServer]
+ * @param managementServerId Required. The name of the management server to create. The name must
+ * be unique for the specified project and location.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param parent Required. The management server project and location in the format
+ * 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR locations map
+ * to Google Cloud regions, for example **us-central1**.
+ * @param managementServer Required. A [management server
+ * resource][google.cloud.backupdr.v1.ManagementServer]
+ * @param managementServerId Required. The name of the management server to create. The name must
+ * be unique for the specified project and location.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.createManagementServerOperationCallable().futureCall(request);
+ * // Do something.
+ * ManagementServer response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future =
+ * backupDRClient.createManagementServerCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.deleteManagementServerOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future =
+ * backupDRClient.deleteManagementServerCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param backupVault Required. The resource being created
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param backupVault Required. The resource being created
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.createBackupVaultOperationCallable().futureCall(request);
+ * // Do something.
+ * BackupVault response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.createBackupVaultCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backupvault stores
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backupvault stores
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupVaultsPagedResponse listBackupVaults(ListBackupVaultsRequest request) {
+ return listBackupVaultsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupVaults in a given project and location.
+ *
+ * Sample code: + * + *
{@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 future =
+ * backupDRClient.listBackupVaultsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (BackupVault element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backupvault stores
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backupvault stores
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchUsableBackupVaultsPagedResponse fetchUsableBackupVaults(
+ FetchUsableBackupVaultsRequest request) {
+ return fetchUsableBackupVaultsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable
+ * BackupVault are the ones that user has backupdr.backupVaults.get permission.
+ *
+ * Sample code: + * + *
{@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 future =
+ * backupDRClient.fetchUsableBackupVaultsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (BackupVault element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backupvault store resource name, in the format
+ * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupVault getBackupVault(@Nullable BackupVaultName name) {
+ GetBackupVaultRequest request =
+ GetBackupVaultRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getBackupVault(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a BackupVault.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backupvault store resource name, in the format
+ * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupVault getBackupVault(String name) {
+ GetBackupVaultRequest request = GetBackupVaultRequest.newBuilder().setName(name).build();
+ return getBackupVault(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a BackupVault.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupVault getBackupVault(GetBackupVaultRequest request) {
+ return getBackupVaultCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a BackupVault.
+ *
+ * Sample code: + * + *
{@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 future = backupDRClient.getBackupVaultCallable().futureCall(request);
+ * // Do something.
+ * BackupVault response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param backupVault Required. The resource being updated
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.updateBackupVaultOperationCallable().futureCall(request);
+ * // Do something.
+ * BackupVault response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.updateBackupVaultCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.deleteBackupVaultOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.deleteBackupVaultCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve data sources
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve data sources
+ * information, in the format 'projects/{project_id}/locations/{location}'. In Google Cloud
+ * Backup and DR, locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataSourcesPagedResponse listDataSources(ListDataSourcesRequest request) {
+ return listDataSourcesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataSources in a given project and location.
+ *
+ * Sample code: + * + *
{@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 future =
+ * backupDRClient.listDataSourcesPagedCallable().futureCall(request);
+ * // Do something.
+ * for (DataSource element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the data source resource name, in the format
+ * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSource getDataSource(@Nullable DataSourceName name) {
+ GetDataSourceRequest request =
+ GetDataSourceRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getDataSource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a DataSource.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the data source resource name, in the format
+ * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSource getDataSource(String name) {
+ GetDataSourceRequest request = GetDataSourceRequest.newBuilder().setName(name).build();
+ return getDataSource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a DataSource.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSource getDataSource(GetDataSourceRequest request) {
+ return getDataSourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a DataSource.
+ *
+ * Sample code: + * + *
{@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 future = backupDRClient.getDataSourceCallable().futureCall(request);
+ * // Do something.
+ * DataSource response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param dataSource Required. The resource being updated
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.updateDataSourceOperationCallable().futureCall(request);
+ * // Do something.
+ * DataSource response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.updateDataSourceCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backup information, in
+ * the format 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR,
+ * locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backup information, in
+ * the format 'projects/{project_id}/locations/{location}'. In Google Cloud Backup and DR,
+ * locations map to Google Cloud regions, for example
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) {
+ return listBackupsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Backups in a given project and location.
+ *
+ * Sample code: + * + *
{@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 future = backupDRClient.listBackupsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Backup element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Datasources are the parent resource for the backups. Format:
+ * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}
+ * @param resourceType Required. The type of the GCP resource. Ex:
+ * sqladmin.googleapis.com/Instance
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(
+ @Nullable DataSourceName parent, String resourceType) {
+ FetchBackupsForResourceTypeRequest request =
+ FetchBackupsForResourceTypeRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setResourceType(resourceType)
+ .build();
+ return fetchBackupsForResourceType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch Backups for a given resource type.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Datasources are the parent resource for the backups. Format:
+ * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId}
+ * @param resourceType Required. The type of the GCP resource. Ex:
+ * sqladmin.googleapis.com/Instance
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(
+ String parent, String resourceType) {
+ FetchBackupsForResourceTypeRequest request =
+ FetchBackupsForResourceTypeRequest.newBuilder()
+ .setParent(parent)
+ .setResourceType(resourceType)
+ .build();
+ return fetchBackupsForResourceType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch Backups for a given resource type.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchBackupsForResourceTypePagedResponse fetchBackupsForResourceType(
+ FetchBackupsForResourceTypeRequest request) {
+ return fetchBackupsForResourceTypePagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch Backups for a given resource type.
+ *
+ * Sample code: + * + *
{@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 future =
+ * backupDRClient.fetchBackupsForResourceTypePagedCallable().futureCall(request);
+ * // Do something.
+ * for (Backup element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ FetchBackupsForResourceTypeRequest, FetchBackupsForResourceTypePagedResponse>
+ fetchBackupsForResourceTypePagedCallable() {
+ return stub.fetchBackupsForResourceTypePagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch Backups for a given resource type.
+ *
+ * Sample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ FetchBackupsForResourceTypeRequest, FetchBackupsForResourceTypeResponse>
+ fetchBackupsForResourceTypeCallable() {
+ return stub.fetchBackupsForResourceTypeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a Backup.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the data source resource name, in the format
+ * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Backup getBackup(@Nullable BackupName name) {
+ GetBackupRequest request =
+ GetBackupRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getBackup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a Backup.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the data source resource name, in the format
+ * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}'
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Backup getBackup(String name) {
+ GetBackupRequest request = GetBackupRequest.newBuilder().setName(name).build();
+ return getBackup(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a Backup.
+ *
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Backup getBackup(GetBackupRequest request) {
+ return getBackupCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a Backup.
+ *
+ * Sample code: + * + *
{@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 future = backupDRClient.getBackupCallable().futureCall(request);
+ * // Do something.
+ * Backup response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param backup Required. The resource being updated
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.updateBackupOperationCallable().futureCall(request);
+ * // Do something.
+ * Backup response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.updateBackupCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.deleteBackupOperationCallable().futureCall(request);
+ * // Do something.
+ * Backup response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.deleteBackupCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Backup instance, in the format
+ * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the Backup instance, in the format
+ * 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.restoreBackupOperationCallable().futureCall(request);
+ * // Do something.
+ * RestoreBackupResponse response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.restoreBackupCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param parent Required. The `BackupPlan` project and location in the format
+ * `projects/{project}/locations/{location}`. In Google Cloud Backup and DR locations map to
+ * Google Cloud regions, for example **us-central1**.
+ * @param backupPlan Required. The `BackupPlan` resource object to create.
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param parent Required. The `BackupPlan` project and location in the format
+ * `projects/{project}/locations/{location}`. In Google Cloud Backup and DR locations map to
+ * Google Cloud regions, for example **us-central1**.
+ * @param backupPlan Required. The `BackupPlan` resource object to create.
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.createBackupPlanOperationCallable().futureCall(request);
+ * // Do something.
+ * BackupPlan response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.createBackupPlanCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param backupPlan Required. The resource being updated
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample code: + * + *
{@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 future =
+ * backupDRClient.updateBackupPlanOperationCallable().futureCall(request);
+ * // Do something.
+ * BackupPlan response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample code: + * + *
{@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 future = backupDRClient.updateBackupPlanCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the `BackupPlan` to retrieve.
+ * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupPlan getBackupPlan(@Nullable BackupPlanName name) { + GetBackupPlanRequest request = + GetBackupPlanRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getBackupPlan(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single BackupPlan. + * + *
Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the `BackupPlan` to retrieve.
+ * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BackupPlan getBackupPlan(String name) { + GetBackupPlanRequest request = GetBackupPlanRequest.newBuilder().setName(name).build(); + return getBackupPlan(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single BackupPlan. + * + *
Sample code: + * + *
{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupPlan getBackupPlan(GetBackupPlanRequest request) {
+ return getBackupPlanCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single BackupPlan.
+ *
+ * Sample code: + * + *
{@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 future = backupDRClient.getBackupPlanCallable().futureCall(request);
+ * // Do something.
+ * BackupPlan response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve `BackupPlans`
+ * information. Format: `projects/{project}/locations/{location}`. In Google Cloud Backup and
+ * DR, locations map to Google Cloud regions, for e.g.
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve `BackupPlans`
+ * information. Format: `projects/{project}/locations/{location}`. In Google Cloud Backup and
+ * DR, locations map to Google Cloud regions, for e.g.
+ * Sample code: + * + *
{@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupPlansPagedResponse listBackupPlans(ListBackupPlansRequest request) {
+ return listBackupPlansPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlans in a given project and location.
+ *
+ * Sample code: + * + *
{@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 future =
+ * backupDRClient.listBackupPlansPagedCallable().futureCall(request);
+ * // Do something.
+ * for (BackupPlan element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample code: + * + *
{@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();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the `BackupPlan` to delete.
+ * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Format:
+ * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupPlanRevision getBackupPlanRevision(@Nullable BackupPlanRevisionName name) {
+ GetBackupPlanRevisionRequest request =
+ GetBackupPlanRevisionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getBackupPlanRevision(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single BackupPlanRevision.
+ *
+ * Sample code:
+ *
+ * Format:
+ * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupPlanRevision getBackupPlanRevision(String name) {
+ GetBackupPlanRevisionRequest request =
+ GetBackupPlanRevisionRequest.newBuilder().setName(name).build();
+ return getBackupPlanRevision(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single BackupPlanRevision.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field:
+ * ***Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ * Sample code:
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field:
+ * ***Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ * Sample code:
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field:
+ * ***Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * 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:
+ *
+ * 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:
+ *
+ * {@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();
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the `BackupPlan` to delete.
+ * {@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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
+ */
+ public final OperationCallable{@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
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the `BackupPlanRevision` to retrieve.
+ * {@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);
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the `BackupPlanRevision` to retrieve.
+ * {@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupPlanRevision getBackupPlanRevision(GetBackupPlanRevisionRequest request) {
+ return getBackupPlanRevisionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single BackupPlanRevision.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve `BackupPlanRevisions`
+ * information. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`.
+ * In Google Cloud Backup and DR, locations map to Google Cloud regions, for e.g.
+ *
+ *
+ *
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(
+ @Nullable BackupPlanName parent) {
+ ListBackupPlanRevisionsRequest request =
+ ListBackupPlanRevisionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listBackupPlanRevisions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlanRevisions in a given project and location.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve `BackupPlanRevisions`
+ * information. Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}`.
+ * In Google Cloud Backup and DR, locations map to Google Cloud regions, for e.g.
+ *
+ *
+ *
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(String parent) {
+ ListBackupPlanRevisionsRequest request =
+ ListBackupPlanRevisionsRequest.newBuilder().setParent(parent).build();
+ return listBackupPlanRevisions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlanRevisions in a given project and location.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupPlanRevisionsPagedResponse listBackupPlanRevisions(
+ ListBackupPlanRevisionsRequest request) {
+ return listBackupPlanRevisionsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlanRevisions in a given project and location.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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();
+ * }
+ * }
+ *
+ * @param parent Required. The backup plan association project and location in the format
+ * `projects/{project_id}/locations/{location}`. In Backup and DR locations map to Google
+ * Cloud regions, for example **us-central1**.
+ * @param backupPlanAssociation Required. The resource being created
+ * @param backupPlanAssociationId Required. The name of the backup plan association to create. The
+ * name must be unique for the specified project and location.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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();
+ * }
+ * }
+ *
+ * @param parent Required. The backup plan association project and location in the format
+ * `projects/{project_id}/locations/{location}`. In Backup and DR locations map to Google
+ * Cloud regions, for example **us-central1**.
+ * @param backupPlanAssociation Required. The resource being created
+ * @param backupPlanAssociationId Required. The name of the backup plan association to create. The
+ * name must be unique for the specified project and location.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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
+ */
+ public final OperationCallable<
+ CreateBackupPlanAssociationRequest, BackupPlanAssociation, OperationMetadata>
+ createBackupPlanAssociationOperationCallable() {
+ return stub.createBackupPlanAssociationOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Create a BackupPlanAssociation
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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();
+ * }
+ * }
+ *
+ * @param backupPlanAssociation Required. The resource being updated
+ * @param 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 com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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
+ */
+ public final OperationCallable<
+ UpdateBackupPlanAssociationRequest, BackupPlanAssociation, OperationMetadata>
+ updateBackupPlanAssociationOperationCallable() {
+ return stub.updateBackupPlanAssociationOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Update a BackupPlanAssociation.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup plan association resource, in the format
+ * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupPlanAssociation getBackupPlanAssociation(
+ @Nullable BackupPlanAssociationName name) {
+ GetBackupPlanAssociationRequest request =
+ GetBackupPlanAssociationRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getBackupPlanAssociation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single BackupPlanAssociation.
+ *
+ * {@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);
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup plan association resource, in the format
+ * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupPlanAssociation getBackupPlanAssociation(String name) {
+ GetBackupPlanAssociationRequest request =
+ GetBackupPlanAssociationRequest.newBuilder().setName(name).build();
+ return getBackupPlanAssociation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single BackupPlanAssociation.
+ *
+ * {@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BackupPlanAssociation getBackupPlanAssociation(
+ GetBackupPlanAssociationRequest request) {
+ return getBackupPlanAssociationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single BackupPlanAssociation.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backup Plan Associations
+ * information, in the format `projects/{project_id}/locations/{location}`. In Backup and DR,
+ * locations map to Google Cloud regions, for example **us-central1**. To
+ * retrieve backup plan associations for all locations, use "-" for the `{location}` value.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(
+ @Nullable LocationName parent) {
+ ListBackupPlanAssociationsRequest request =
+ ListBackupPlanAssociationsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listBackupPlanAssociations(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlanAssociations in a given project and location.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve backup Plan Associations
+ * information, in the format `projects/{project_id}/locations/{location}`. In Backup and DR,
+ * locations map to Google Cloud regions, for example **us-central1**. To
+ * retrieve backup plan associations for all locations, use "-" for the `{location}` value.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(String parent) {
+ ListBackupPlanAssociationsRequest request =
+ ListBackupPlanAssociationsRequest.newBuilder().setParent(parent).build();
+ return listBackupPlanAssociations(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlanAssociations in a given project and location.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBackupPlanAssociationsPagedResponse listBackupPlanAssociations(
+ ListBackupPlanAssociationsRequest request) {
+ return listBackupPlanAssociationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlanAssociations in a given project and location.
+ *
+ * {@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
+ */
+ public final UnaryCallable<
+ ListBackupPlanAssociationsRequest, ListBackupPlanAssociationsPagedResponse>
+ listBackupPlanAssociationsPagedCallable() {
+ return stub.listBackupPlanAssociationsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists BackupPlanAssociations in a given project and location.
+ *
+ * {@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name. Format:
+ * projects/{project}/locations/{location}
+ * @param resourceType Required. The type of the Google Cloud resource. Ex:
+ * sql.googleapis.com/Instance
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchBackupPlanAssociationsForResourceTypePagedResponse
+ fetchBackupPlanAssociationsForResourceType(
+ @Nullable LocationName parent, String resourceType) {
+ FetchBackupPlanAssociationsForResourceTypeRequest request =
+ FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setResourceType(resourceType)
+ .build();
+ return fetchBackupPlanAssociationsForResourceType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List BackupPlanAssociations for a given resource type.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name. Format:
+ * projects/{project}/locations/{location}
+ * @param resourceType Required. The type of the Google Cloud resource. Ex:
+ * sql.googleapis.com/Instance
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchBackupPlanAssociationsForResourceTypePagedResponse
+ fetchBackupPlanAssociationsForResourceType(String parent, String resourceType) {
+ FetchBackupPlanAssociationsForResourceTypeRequest request =
+ FetchBackupPlanAssociationsForResourceTypeRequest.newBuilder()
+ .setParent(parent)
+ .setResourceType(resourceType)
+ .build();
+ return fetchBackupPlanAssociationsForResourceType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List BackupPlanAssociations for a given resource type.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchBackupPlanAssociationsForResourceTypePagedResponse
+ fetchBackupPlanAssociationsForResourceType(
+ FetchBackupPlanAssociationsForResourceTypeRequest request) {
+ return fetchBackupPlanAssociationsForResourceTypePagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List BackupPlanAssociations for a given resource type.
+ *
+ * {@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
+ */
+ public final UnaryCallable<
+ FetchBackupPlanAssociationsForResourceTypeRequest,
+ FetchBackupPlanAssociationsForResourceTypePagedResponse>
+ fetchBackupPlanAssociationsForResourceTypePagedCallable() {
+ return stub.fetchBackupPlanAssociationsForResourceTypePagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * List BackupPlanAssociations for a given resource type.
+ *
+ * {@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ FetchBackupPlanAssociationsForResourceTypeRequest,
+ FetchBackupPlanAssociationsForResourceTypeResponse>
+ fetchBackupPlanAssociationsForResourceTypeCallable() {
+ return stub.fetchBackupPlanAssociationsForResourceTypeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a single BackupPlanAssociation.
+ *
+ * {@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup plan association resource, in the format
+ * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup plan association resource, in the format
+ * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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")
+ * .setAutoProtectionPolicyBinding(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * backupDRClient.deleteBackupPlanAssociationAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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")
+ * .setAutoProtectionPolicyBinding(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@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")
+ * .setAutoProtectionPolicyBinding(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup plan association resource, in the format
+ * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
+ * @param ruleId Optional. backup rule_id for which a backup needs to be triggered. If not
+ * specified, on-demand backup with custom retention will be triggered.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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();
+ * }
+ * }
+ *
+ * @param name Required. Name of the backup plan association resource, in the format
+ * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}`
+ * @param ruleId Optional. backup rule_id for which a backup needs to be triggered. If not
+ * specified, on-demand backup with custom retention will be triggered.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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")
+ * .setCustomRetentionDays(-352387226)
+ * .putAllLabels(new HashMap
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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")
+ * .setCustomRetentionDays(-352387226)
+ * .putAllLabels(new HashMap
+ */
+ public final OperationCallable{@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")
+ * .setCustomRetentionDays(-352387226)
+ * .putAllLabels(new HashMap
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the DataSourceReference to retrieve. Format:
+ * projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSourceReference getDataSourceReference(@Nullable DataSourceReferenceName name) {
+ GetDataSourceReferenceRequest request =
+ GetDataSourceReferenceRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getDataSourceReference(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single DataSourceReference.
+ *
+ * {@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);
+ * }
+ * }
+ *
+ * @param name Required. The name of the DataSourceReference to retrieve. Format:
+ * projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSourceReference getDataSourceReference(String name) {
+ GetDataSourceReferenceRequest request =
+ GetDataSourceReferenceRequest.newBuilder().setName(name).build();
+ return getDataSourceReference(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single DataSourceReference.
+ *
+ * {@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataSourceReference getDataSourceReference(GetDataSourceReferenceRequest request) {
+ return getDataSourceReferenceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single DataSourceReference.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name. Format:
+ * projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataSourceReferencesPagedResponse listDataSourceReferences(
+ @Nullable LocationName parent) {
+ ListDataSourceReferencesRequest request =
+ ListDataSourceReferencesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listDataSourceReferences(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataSourceReferences for a given project and location.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name. Format:
+ * projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataSourceReferencesPagedResponse listDataSourceReferences(String parent) {
+ ListDataSourceReferencesRequest request =
+ ListDataSourceReferencesRequest.newBuilder().setParent(parent).build();
+ return listDataSourceReferences(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataSourceReferences for a given project and location.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataSourceReferencesPagedResponse listDataSourceReferences(
+ ListDataSourceReferencesRequest request) {
+ return listDataSourceReferencesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataSourceReferences for a given project and location.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name. Format:
+ * projects/{project}/locations/{location}
+ * @param resourceType Required. The type of the Google Cloud resource. Ex:
+ * sql.googleapis.com/Instance
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchDataSourceReferencesForResourceTypePagedResponse
+ fetchDataSourceReferencesForResourceType(@Nullable LocationName parent, String resourceType) {
+ FetchDataSourceReferencesForResourceTypeRequest request =
+ FetchDataSourceReferencesForResourceTypeRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setResourceType(resourceType)
+ .build();
+ return fetchDataSourceReferencesForResourceType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch DataSourceReferences for a given project, location and resource type.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource name. Format:
+ * projects/{project}/locations/{location}
+ * @param resourceType Required. The type of the Google Cloud resource. Ex:
+ * sql.googleapis.com/Instance
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchDataSourceReferencesForResourceTypePagedResponse
+ fetchDataSourceReferencesForResourceType(String parent, String resourceType) {
+ FetchDataSourceReferencesForResourceTypeRequest request =
+ FetchDataSourceReferencesForResourceTypeRequest.newBuilder()
+ .setParent(parent)
+ .setResourceType(resourceType)
+ .build();
+ return fetchDataSourceReferencesForResourceType(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch DataSourceReferences for a given project, location and resource type.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final FetchDataSourceReferencesForResourceTypePagedResponse
+ fetchDataSourceReferencesForResourceType(
+ FetchDataSourceReferencesForResourceTypeRequest request) {
+ return fetchDataSourceReferencesForResourceTypePagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch DataSourceReferences for a given project, location and resource type.
+ *
+ * {@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
+ */
+ public final UnaryCallable<
+ FetchDataSourceReferencesForResourceTypeRequest,
+ FetchDataSourceReferencesForResourceTypePagedResponse>
+ fetchDataSourceReferencesForResourceTypePagedCallable() {
+ return stub.fetchDataSourceReferencesForResourceTypePagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Fetch DataSourceReferences for a given project, location and resource type.
+ *
+ * {@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ FetchDataSourceReferencesForResourceTypeRequest,
+ FetchDataSourceReferencesForResourceTypeResponse>
+ fetchDataSourceReferencesForResourceTypeCallable() {
+ return stub.fetchDataSourceReferencesForResourceTypeCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Initializes the service related config for a project.
+ *
+ * {@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")
+ * .setBackupPlanLocation("backupPlanLocation543722720")
+ * .setValidateOnly(true)
+ * .build();
+ * InitializeServiceResponse response = backupDRClient.initializeServiceAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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")
+ * .setBackupPlanLocation("backupPlanLocation543722720")
+ * .setValidateOnly(true)
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ InitializeServiceRequest, InitializeServiceResponse, OperationMetadata>
+ initializeServiceOperationCallable() {
+ return stub.initializeServiceOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Initializes the service related config for a project.
+ *
+ * {@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")
+ * .setBackupPlanLocation("backupPlanLocation543722720")
+ * .setValidateOnly(true)
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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]");
+ * AutoProtectionPolicy autoProtectionPolicy = AutoProtectionPolicy.newBuilder().build();
+ * String autoProtectionPolicyId = "autoProtectionPolicyId1759243253";
+ * AutoProtectionPolicy response =
+ * backupDRClient
+ * .createAutoProtectionPolicyAsync(parent, autoProtectionPolicy, autoProtectionPolicyId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this policy will be created. Format:
+ * projects/{project}/locations/{location}
+ * @param autoProtectionPolicy Required. The AutoProtectionPolicy resource to create.
+ * @param autoProtectionPolicyId Required. The ID to use for the policy. This will become the
+ * final component of the policy's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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();
+ * AutoProtectionPolicy autoProtectionPolicy = AutoProtectionPolicy.newBuilder().build();
+ * String autoProtectionPolicyId = "autoProtectionPolicyId1759243253";
+ * AutoProtectionPolicy response =
+ * backupDRClient
+ * .createAutoProtectionPolicyAsync(parent, autoProtectionPolicy, autoProtectionPolicyId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this policy will be created. Format:
+ * projects/{project}/locations/{location}
+ * @param autoProtectionPolicy Required. The AutoProtectionPolicy resource to create.
+ * @param autoProtectionPolicyId Required. The ID to use for the policy. This will become the
+ * final component of the policy's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * CreateAutoProtectionPolicyRequest request =
+ * CreateAutoProtectionPolicyRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setAutoProtectionPolicyId("autoProtectionPolicyId1759243253")
+ * .setAutoProtectionPolicy(AutoProtectionPolicy.newBuilder().build())
+ * .build();
+ * AutoProtectionPolicy response = backupDRClient.createAutoProtectionPolicyAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * CreateAutoProtectionPolicyRequest request =
+ * CreateAutoProtectionPolicyRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setAutoProtectionPolicyId("autoProtectionPolicyId1759243253")
+ * .setAutoProtectionPolicy(AutoProtectionPolicy.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ CreateAutoProtectionPolicyRequest, AutoProtectionPolicy, OperationMetadata>
+ createAutoProtectionPolicyOperationCallable() {
+ return stub.createAutoProtectionPolicyOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new AutoProtectionPolicy in a given project and location.
+ *
+ * {@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()) {
+ * CreateAutoProtectionPolicyRequest request =
+ * CreateAutoProtectionPolicyRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setAutoProtectionPolicyId("autoProtectionPolicyId1759243253")
+ * .setAutoProtectionPolicy(AutoProtectionPolicy.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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 (AutoProtectionPolicy element :
+ * backupDRClient.listAutoProtectionPolicies(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve the list of policies.
+ * Format: projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAutoProtectionPoliciesPagedResponse listAutoProtectionPolicies(
+ @Nullable LocationName parent) {
+ ListAutoProtectionPoliciesRequest request =
+ ListAutoProtectionPoliciesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAutoProtectionPolicies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AutoProtectionPolicies for a given project and location.
+ *
+ * {@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 (AutoProtectionPolicy element :
+ * backupDRClient.listAutoProtectionPolicies(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve the list of policies.
+ * Format: projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAutoProtectionPoliciesPagedResponse listAutoProtectionPolicies(String parent) {
+ ListAutoProtectionPoliciesRequest request =
+ ListAutoProtectionPoliciesRequest.newBuilder().setParent(parent).build();
+ return listAutoProtectionPolicies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AutoProtectionPolicies for a given project and location.
+ *
+ * {@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()) {
+ * ListAutoProtectionPoliciesRequest request =
+ * ListAutoProtectionPoliciesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (AutoProtectionPolicy element :
+ * backupDRClient.listAutoProtectionPolicies(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAutoProtectionPoliciesPagedResponse listAutoProtectionPolicies(
+ ListAutoProtectionPoliciesRequest request) {
+ return listAutoProtectionPoliciesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AutoProtectionPolicies for a given project and location.
+ *
+ * {@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()) {
+ * ListAutoProtectionPoliciesRequest request =
+ * ListAutoProtectionPoliciesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable<
+ ListAutoProtectionPoliciesRequest, ListAutoProtectionPoliciesPagedResponse>
+ listAutoProtectionPoliciesPagedCallable() {
+ return stub.listAutoProtectionPoliciesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AutoProtectionPolicies for a given project and location.
+ *
+ * {@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()) {
+ * ListAutoProtectionPoliciesRequest request =
+ * ListAutoProtectionPoliciesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListAutoProtectionPoliciesResponse response =
+ * backupDRClient.listAutoProtectionPoliciesCallable().call(request);
+ * for (AutoProtectionPolicy element : response.getAutoProtectionPoliciesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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()) {
+ * AutoProtectionPolicyName name =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]");
+ * AutoProtectionPolicy response = backupDRClient.getAutoProtectionPolicy(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the policy to retrieve. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoProtectionPolicy getAutoProtectionPolicy(
+ @Nullable AutoProtectionPolicyName name) {
+ GetAutoProtectionPolicyRequest request =
+ GetAutoProtectionPolicyRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getAutoProtectionPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single AutoProtectionPolicy.
+ *
+ * {@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 =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString();
+ * AutoProtectionPolicy response = backupDRClient.getAutoProtectionPolicy(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the policy to retrieve. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoProtectionPolicy getAutoProtectionPolicy(String name) {
+ GetAutoProtectionPolicyRequest request =
+ GetAutoProtectionPolicyRequest.newBuilder().setName(name).build();
+ return getAutoProtectionPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single AutoProtectionPolicy.
+ *
+ * {@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()) {
+ * GetAutoProtectionPolicyRequest request =
+ * GetAutoProtectionPolicyRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .build();
+ * AutoProtectionPolicy response = backupDRClient.getAutoProtectionPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoProtectionPolicy getAutoProtectionPolicy(
+ GetAutoProtectionPolicyRequest request) {
+ return getAutoProtectionPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single AutoProtectionPolicy.
+ *
+ * {@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()) {
+ * GetAutoProtectionPolicyRequest request =
+ * GetAutoProtectionPolicyRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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()) {
+ * AutoProtectionPolicy autoProtectionPolicy = AutoProtectionPolicy.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * AutoProtectionPolicy response =
+ * backupDRClient.updateAutoProtectionPolicyAsync(autoProtectionPolicy, updateMask).get();
+ * }
+ * }
+ *
+ * @param autoProtectionPolicy Required. The policy to update.
+ * @param updateMask Required. Field mask is used to specify the fields to be overwritten in the
+ * AutoProtectionPolicy 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 all fields will be overwritten.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * UpdateAutoProtectionPolicyRequest request =
+ * UpdateAutoProtectionPolicyRequest.newBuilder()
+ * .setAutoProtectionPolicy(AutoProtectionPolicy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * AutoProtectionPolicy response = backupDRClient.updateAutoProtectionPolicyAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * UpdateAutoProtectionPolicyRequest request =
+ * UpdateAutoProtectionPolicyRequest.newBuilder()
+ * .setAutoProtectionPolicy(AutoProtectionPolicy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ UpdateAutoProtectionPolicyRequest, AutoProtectionPolicy, OperationMetadata>
+ updateAutoProtectionPolicyOperationCallable() {
+ return stub.updateAutoProtectionPolicyOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the parameters of a single AutoProtectionPolicy.
+ *
+ * {@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()) {
+ * UpdateAutoProtectionPolicyRequest request =
+ * UpdateAutoProtectionPolicyRequest.newBuilder()
+ * .setAutoProtectionPolicy(AutoProtectionPolicy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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()) {
+ * AutoProtectionPolicyName name =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]");
+ * backupDRClient.deleteAutoProtectionPolicyAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the policy to delete. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString();
+ * backupDRClient.deleteAutoProtectionPolicyAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the policy to delete. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * DeleteAutoProtectionPolicyRequest request =
+ * DeleteAutoProtectionPolicyRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setEtag("etag3123477")
+ * .build();
+ * backupDRClient.deleteAutoProtectionPolicyAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * DeleteAutoProtectionPolicyRequest request =
+ * DeleteAutoProtectionPolicyRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setEtag("etag3123477")
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable{@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()) {
+ * DeleteAutoProtectionPolicyRequest request =
+ * DeleteAutoProtectionPolicyRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setEtag("etag3123477")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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()) {
+ * AutoProtectionPolicyName parent =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]");
+ * AutoProtectionPolicyBinding autoProtectionPolicyBinding =
+ * AutoProtectionPolicyBinding.newBuilder().build();
+ * String autoProtectionPolicyBindingId = "autoProtectionPolicyBindingId2122957414";
+ * AutoProtectionPolicyBinding response =
+ * backupDRClient
+ * .createAutoProtectionPolicyBindingAsync(
+ * parent, autoProtectionPolicyBinding, autoProtectionPolicyBindingId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this binding will be created. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}
+ * @param autoProtectionPolicyBinding Required. The AutoProtectionPolicyBinding resource to
+ * create.
+ * @param autoProtectionPolicyBindingId Required. The ID to use for the binding. This will become
+ * the final component of the binding's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString();
+ * AutoProtectionPolicyBinding autoProtectionPolicyBinding =
+ * AutoProtectionPolicyBinding.newBuilder().build();
+ * String autoProtectionPolicyBindingId = "autoProtectionPolicyBindingId2122957414";
+ * AutoProtectionPolicyBinding response =
+ * backupDRClient
+ * .createAutoProtectionPolicyBindingAsync(
+ * parent, autoProtectionPolicyBinding, autoProtectionPolicyBindingId)
+ * .get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent resource where this binding will be created. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}
+ * @param autoProtectionPolicyBinding Required. The AutoProtectionPolicyBinding resource to
+ * create.
+ * @param autoProtectionPolicyBindingId Required. The ID to use for the binding. This will become
+ * the final component of the binding's resource name.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * CreateAutoProtectionPolicyBindingRequest request =
+ * CreateAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setAutoProtectionPolicyBindingId("autoProtectionPolicyBindingId2122957414")
+ * .setAutoProtectionPolicyBinding(AutoProtectionPolicyBinding.newBuilder().build())
+ * .build();
+ * AutoProtectionPolicyBinding response =
+ * backupDRClient.createAutoProtectionPolicyBindingAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * CreateAutoProtectionPolicyBindingRequest request =
+ * CreateAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setAutoProtectionPolicyBindingId("autoProtectionPolicyBindingId2122957414")
+ * .setAutoProtectionPolicyBinding(AutoProtectionPolicyBinding.newBuilder().build())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ CreateAutoProtectionPolicyBindingRequest, AutoProtectionPolicyBinding, OperationMetadata>
+ createAutoProtectionPolicyBindingOperationCallable() {
+ return stub.createAutoProtectionPolicyBindingOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new AutoProtectionPolicyBinding in a given project and location.
+ *
+ * {@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()) {
+ * CreateAutoProtectionPolicyBindingRequest request =
+ * CreateAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setAutoProtectionPolicyBindingId("autoProtectionPolicyBindingId2122957414")
+ * .setAutoProtectionPolicyBinding(AutoProtectionPolicyBinding.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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()) {
+ * AutoProtectionPolicyBindingName name =
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]");
+ * AutoProtectionPolicyBinding response = backupDRClient.getAutoProtectionPolicyBinding(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the binding to retrieve. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoProtectionPolicyBinding getAutoProtectionPolicyBinding(
+ @Nullable AutoProtectionPolicyBindingName name) {
+ GetAutoProtectionPolicyBindingRequest request =
+ GetAutoProtectionPolicyBindingRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getAutoProtectionPolicyBinding(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the auto protection policy binding read from the CCFE tables.
+ *
+ * {@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 =
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString();
+ * AutoProtectionPolicyBinding response = backupDRClient.getAutoProtectionPolicyBinding(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the binding to retrieve. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoProtectionPolicyBinding getAutoProtectionPolicyBinding(String name) {
+ GetAutoProtectionPolicyBindingRequest request =
+ GetAutoProtectionPolicyBindingRequest.newBuilder().setName(name).build();
+ return getAutoProtectionPolicyBinding(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the auto protection policy binding read from the CCFE tables.
+ *
+ * {@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()) {
+ * GetAutoProtectionPolicyBindingRequest request =
+ * GetAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * AutoProtectionPolicyBinding response = backupDRClient.getAutoProtectionPolicyBinding(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final AutoProtectionPolicyBinding getAutoProtectionPolicyBinding(
+ GetAutoProtectionPolicyBindingRequest request) {
+ return getAutoProtectionPolicyBindingCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the auto protection policy binding read from the CCFE tables.
+ *
+ * {@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()) {
+ * GetAutoProtectionPolicyBindingRequest request =
+ * GetAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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()) {
+ * AutoProtectionPolicyName parent =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]");
+ * for (AutoProtectionPolicyBinding element :
+ * backupDRClient.listAutoProtectionPolicyBindings(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve the list of policies.
+ * Format: projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAutoProtectionPolicyBindingsPagedResponse listAutoProtectionPolicyBindings(
+ @Nullable AutoProtectionPolicyName parent) {
+ ListAutoProtectionPolicyBindingsRequest request =
+ ListAutoProtectionPolicyBindingsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAutoProtectionPolicyBindings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the auto protection policy bindings read from the CCFE tables.
+ *
+ * {@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 =
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString();
+ * for (AutoProtectionPolicyBinding element :
+ * backupDRClient.listAutoProtectionPolicyBindings(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve the list of policies.
+ * Format: projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAutoProtectionPolicyBindingsPagedResponse listAutoProtectionPolicyBindings(
+ String parent) {
+ ListAutoProtectionPolicyBindingsRequest request =
+ ListAutoProtectionPolicyBindingsRequest.newBuilder().setParent(parent).build();
+ return listAutoProtectionPolicyBindings(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the auto protection policy bindings read from the CCFE tables.
+ *
+ * {@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()) {
+ * ListAutoProtectionPolicyBindingsRequest request =
+ * ListAutoProtectionPolicyBindingsRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (AutoProtectionPolicyBinding element :
+ * backupDRClient.listAutoProtectionPolicyBindings(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAutoProtectionPolicyBindingsPagedResponse listAutoProtectionPolicyBindings(
+ ListAutoProtectionPolicyBindingsRequest request) {
+ return listAutoProtectionPolicyBindingsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the auto protection policy bindings read from the CCFE tables.
+ *
+ * {@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()) {
+ * ListAutoProtectionPolicyBindingsRequest request =
+ * ListAutoProtectionPolicyBindingsRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable<
+ ListAutoProtectionPolicyBindingsRequest, ListAutoProtectionPolicyBindingsPagedResponse>
+ listAutoProtectionPolicyBindingsPagedCallable() {
+ return stub.listAutoProtectionPolicyBindingsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the auto protection policy bindings read from the CCFE tables.
+ *
+ * {@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()) {
+ * ListAutoProtectionPolicyBindingsRequest request =
+ * ListAutoProtectionPolicyBindingsRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyName.of("[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListAutoProtectionPolicyBindingsResponse response =
+ * backupDRClient.listAutoProtectionPolicyBindingsCallable().call(request);
+ * for (AutoProtectionPolicyBinding element : response.getAutoProtectionPolicyBindingsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListAutoProtectionPolicyBindingsRequest, ListAutoProtectionPolicyBindingsResponse>
+ listAutoProtectionPolicyBindingsCallable() {
+ return stub.listAutoProtectionPolicyBindingsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AppliedAutoProtectionPolicies in a given project and location.
+ *
+ * {@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 (AppliedAutoProtectionPolicy element :
+ * backupDRClient.listAppliedAutoProtectionPolicies(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve the list of applied
+ * policies. Format: projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAppliedAutoProtectionPoliciesPagedResponse listAppliedAutoProtectionPolicies(
+ @Nullable LocationName parent) {
+ ListAppliedAutoProtectionPoliciesRequest request =
+ ListAppliedAutoProtectionPoliciesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAppliedAutoProtectionPolicies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AppliedAutoProtectionPolicies in a given project and location.
+ *
+ * {@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 (AppliedAutoProtectionPolicy element :
+ * backupDRClient.listAppliedAutoProtectionPolicies(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location for which to retrieve the list of applied
+ * policies. Format: projects/{project}/locations/{location}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAppliedAutoProtectionPoliciesPagedResponse listAppliedAutoProtectionPolicies(
+ String parent) {
+ ListAppliedAutoProtectionPoliciesRequest request =
+ ListAppliedAutoProtectionPoliciesRequest.newBuilder().setParent(parent).build();
+ return listAppliedAutoProtectionPolicies(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AppliedAutoProtectionPolicies in a given project and location.
+ *
+ * {@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()) {
+ * ListAppliedAutoProtectionPoliciesRequest request =
+ * ListAppliedAutoProtectionPoliciesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (AppliedAutoProtectionPolicy element :
+ * backupDRClient.listAppliedAutoProtectionPolicies(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAppliedAutoProtectionPoliciesPagedResponse listAppliedAutoProtectionPolicies(
+ ListAppliedAutoProtectionPoliciesRequest request) {
+ return listAppliedAutoProtectionPoliciesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AppliedAutoProtectionPolicies in a given project and location.
+ *
+ * {@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()) {
+ * ListAppliedAutoProtectionPoliciesRequest request =
+ * ListAppliedAutoProtectionPoliciesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable<
+ ListAppliedAutoProtectionPoliciesRequest, ListAppliedAutoProtectionPoliciesPagedResponse>
+ listAppliedAutoProtectionPoliciesPagedCallable() {
+ return stub.listAppliedAutoProtectionPoliciesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists AppliedAutoProtectionPolicies in a given project and location.
+ *
+ * {@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()) {
+ * ListAppliedAutoProtectionPoliciesRequest request =
+ * ListAppliedAutoProtectionPoliciesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListAppliedAutoProtectionPoliciesResponse response =
+ * backupDRClient.listAppliedAutoProtectionPoliciesCallable().call(request);
+ * for (AppliedAutoProtectionPolicy element :
+ * response.getAppliedAutoProtectionPoliciesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListAppliedAutoProtectionPoliciesRequest, ListAppliedAutoProtectionPoliciesResponse>
+ listAppliedAutoProtectionPoliciesCallable() {
+ return stub.listAppliedAutoProtectionPoliciesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * InitiateDeleteAutoProtectionPolicyBinding initiates delete for AutoProtectionPolicy Binding
+ *
+ * {@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()) {
+ * AutoProtectionPolicyBindingName name =
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]");
+ * AutoProtectionPolicyBinding response =
+ * backupDRClient.initiateDeleteAutoProtectionPolicyBindingAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the binding to delete. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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 =
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString();
+ * AutoProtectionPolicyBinding response =
+ * backupDRClient.initiateDeleteAutoProtectionPolicyBindingAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the binding to delete. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * InitiateDeleteAutoProtectionPolicyBindingRequest request =
+ * InitiateDeleteAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * AutoProtectionPolicyBinding response =
+ * backupDRClient.initiateDeleteAutoProtectionPolicyBindingAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@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()) {
+ * InitiateDeleteAutoProtectionPolicyBindingRequest request =
+ * InitiateDeleteAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * OperationFuture
+ */
+ public final OperationCallable<
+ InitiateDeleteAutoProtectionPolicyBindingRequest,
+ AutoProtectionPolicyBinding,
+ OperationMetadata>
+ initiateDeleteAutoProtectionPolicyBindingOperationCallable() {
+ return stub.initiateDeleteAutoProtectionPolicyBindingOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * InitiateDeleteAutoProtectionPolicyBinding initiates delete for AutoProtectionPolicy Binding
+ *
+ * {@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()) {
+ * InitiateDeleteAutoProtectionPolicyBindingRequest request =
+ * InitiateDeleteAutoProtectionPolicyBindingRequest.newBuilder()
+ * .setName(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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()) {
+ * BindingMatchingResourceName name =
+ * BindingMatchingResourceName.of(
+ * "[PROJECT]",
+ * "[LOCATION]",
+ * "[AUTO_PROTECTION_POLICY]",
+ * "[BINDING]",
+ * "[MATCHING_RESOURCE]");
+ * BindingMatchingResource response = backupDRClient.getBindingMatchingResource(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the matching resource to retrieve. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}/matchingResources/{matching_resource}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BindingMatchingResource getBindingMatchingResource(
+ @Nullable BindingMatchingResourceName name) {
+ GetBindingMatchingResourceRequest request =
+ GetBindingMatchingResourceRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getBindingMatchingResource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single Binding Matching Resource.
+ *
+ * {@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 =
+ * BindingMatchingResourceName.of(
+ * "[PROJECT]",
+ * "[LOCATION]",
+ * "[AUTO_PROTECTION_POLICY]",
+ * "[BINDING]",
+ * "[MATCHING_RESOURCE]")
+ * .toString();
+ * BindingMatchingResource response = backupDRClient.getBindingMatchingResource(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the matching resource to retrieve. Format:
+ * projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}/matchingResources/{matching_resource}
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BindingMatchingResource getBindingMatchingResource(String name) {
+ GetBindingMatchingResourceRequest request =
+ GetBindingMatchingResourceRequest.newBuilder().setName(name).build();
+ return getBindingMatchingResource(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single Binding Matching Resource.
+ *
+ * {@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()) {
+ * GetBindingMatchingResourceRequest request =
+ * GetBindingMatchingResourceRequest.newBuilder()
+ * .setName(
+ * BindingMatchingResourceName.of(
+ * "[PROJECT]",
+ * "[LOCATION]",
+ * "[AUTO_PROTECTION_POLICY]",
+ * "[BINDING]",
+ * "[MATCHING_RESOURCE]")
+ * .toString())
+ * .build();
+ * BindingMatchingResource response = backupDRClient.getBindingMatchingResource(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BindingMatchingResource getBindingMatchingResource(
+ GetBindingMatchingResourceRequest request) {
+ return getBindingMatchingResourceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single Binding Matching Resource.
+ *
+ * {@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()) {
+ * GetBindingMatchingResourceRequest request =
+ * GetBindingMatchingResourceRequest.newBuilder()
+ * .setName(
+ * BindingMatchingResourceName.of(
+ * "[PROJECT]",
+ * "[LOCATION]",
+ * "[AUTO_PROTECTION_POLICY]",
+ * "[BINDING]",
+ * "[MATCHING_RESOURCE]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@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()) {
+ * AutoProtectionPolicyBindingName parent =
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]");
+ * for (BindingMatchingResource element :
+ * backupDRClient.listBindingMatchingResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project, location, auto protection policy and binding for which to
+ * retrieve `BindingMatchingResources` information. Format:
+ * `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}`.
+ * In Google Cloud Backup and DR, locations map to Google Cloud regions, for example
+ * **us-central1**.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBindingMatchingResourcesPagedResponse listBindingMatchingResources(
+ @Nullable AutoProtectionPolicyBindingName parent) {
+ ListBindingMatchingResourcesRequest request =
+ ListBindingMatchingResourcesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listBindingMatchingResources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Binding Matching Resources for a given AutoProtectionPolicyBinding.
+ *
+ * {@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 =
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString();
+ * for (BindingMatchingResource element :
+ * backupDRClient.listBindingMatchingResources(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project, location, auto protection policy and binding for which to
+ * retrieve `BindingMatchingResources` information. Format:
+ * `projects/{project}/locations/{location}/autoProtectionPolicies/{auto_protection_policy}/bindings/{binding}`.
+ * In Google Cloud Backup and DR, locations map to Google Cloud regions, for example
+ * **us-central1**.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBindingMatchingResourcesPagedResponse listBindingMatchingResources(
+ String parent) {
+ ListBindingMatchingResourcesRequest request =
+ ListBindingMatchingResourcesRequest.newBuilder().setParent(parent).build();
+ return listBindingMatchingResources(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Binding Matching Resources for a given AutoProtectionPolicyBinding.
+ *
+ * {@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()) {
+ * ListBindingMatchingResourcesRequest request =
+ * ListBindingMatchingResourcesRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * for (BindingMatchingResource element :
+ * backupDRClient.listBindingMatchingResources(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListBindingMatchingResourcesPagedResponse listBindingMatchingResources(
+ ListBindingMatchingResourcesRequest request) {
+ return listBindingMatchingResourcesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Binding Matching Resources for a given AutoProtectionPolicyBinding.
+ *
+ * {@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()) {
+ * ListBindingMatchingResourcesRequest request =
+ * ListBindingMatchingResourcesRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable<
+ ListBindingMatchingResourcesRequest, ListBindingMatchingResourcesPagedResponse>
+ listBindingMatchingResourcesPagedCallable() {
+ return stub.listBindingMatchingResourcesPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Binding Matching Resources for a given AutoProtectionPolicyBinding.
+ *
+ * {@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()) {
+ * ListBindingMatchingResourcesRequest request =
+ * ListBindingMatchingResourcesRequest.newBuilder()
+ * .setParent(
+ * AutoProtectionPolicyBindingName.of(
+ * "[PROJECT]", "[LOCATION]", "[AUTO_PROTECTION_POLICY]", "[BINDING]")
+ * .toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .build();
+ * while (true) {
+ * ListBindingMatchingResourcesResponse response =
+ * backupDRClient.listBindingMatchingResourcesCallable().call(request);
+ * for (BindingMatchingResource element : response.getMatchingResourcesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable<
+ ListBindingMatchingResourcesRequest, ListBindingMatchingResourcesResponse>
+ listBindingMatchingResourcesCallable() {
+ return stub.listBindingMatchingResourcesCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * {@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);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the access control policy on the specified resource. Replacesany existing policy.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the access control policy for a resource. Returns an empty policyif the resource exists
+ * and does not have a policy set.
+ *
+ * {@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
+ */
+ public final UnaryCallable{@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
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
+ return testIamPermissionsCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * 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.
+ *
+ * {@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
+ */
+ public final UnaryCallable