> [!WARNING]
> **Beta**
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-sql/google-cloud-sql/src/main/java/com/google/cloud/sql/v1beta4/SqlBackupRunsServiceClient.java) | [Product Reference](https://cloud.google.com/sql/) |

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


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsDeleteRequest request =
           SqlBackupRunsDeleteRequest.newBuilder()
               .setId(3355)
               .setInstance("instance555127957")
               .setProject("project-309310695")
               .build();
       Operation response = sqlBackupRunsServiceClient.delete(request);
     }
     
<br />

Note: close() needs to be called on the SqlBackupRunsServiceClient 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 |
|---|---|---|
| Delete | Deletes the backup taken by a backup run. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - delete(SqlBackupRunsDeleteRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteCallable() |
| Get | Retrieves a resource containing information about a backup run. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - get(SqlBackupRunsGetRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getCallable() |
| Insert | Creates a new backup run on demand. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - insert(SqlBackupRunsInsertRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - insertCallable() |
| List | Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - list(SqlBackupRunsListRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listCallable() |
[Methods]

<br />

See the individual methods for example code.

<br />

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.

<br />

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

<br />

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
         SqlBackupRunsServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
     
<br />

To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
         SqlBackupRunsServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
     
<br />

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


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     SqlBackupRunsServiceSettings sqlBackupRunsServiceSettings =
         SqlBackupRunsServiceSettings.newHttpJsonBuilder().build();
     SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create(sqlBackupRunsServiceSettings);
     
<br />

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

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> SqlBackupRunsServiceClient

## Static Methods

### create()

    public static final SqlBackupRunsServiceClient create()

Constructs an instance of SqlBackupRunsServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(SqlBackupRunsServiceSettings settings)

    public static final SqlBackupRunsServiceClient create(SqlBackupRunsServiceSettings settings)

Constructs an instance of SqlBackupRunsServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(SqlBackupRunsServiceStub stub)

    public static final SqlBackupRunsServiceClient create(SqlBackupRunsServiceStub stub)

Constructs an instance of SqlBackupRunsServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(SqlBackupRunsServiceSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.stub.SqlBackupRunsServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsServiceClient` |   |

## Constructors

### SqlBackupRunsServiceClient(SqlBackupRunsServiceSettings settings)

    protected SqlBackupRunsServiceClient(SqlBackupRunsServiceSettings settings)

Constructs an instance of SqlBackupRunsServiceClient, 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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsServiceSettings` |

### SqlBackupRunsServiceClient(SqlBackupRunsServiceStub stub)

    protected SqlBackupRunsServiceClient(SqlBackupRunsServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.stub.SqlBackupRunsServiceStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### delete(SqlBackupRunsDeleteRequest request)

    public final Operation delete(SqlBackupRunsDeleteRequest request)

Deletes the backup taken by a backup run.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsDeleteRequest request =
           SqlBackupRunsDeleteRequest.newBuilder()
               .setId(3355)
               .setInstance("instance555127957")
               .setProject("project-309310695")
               .build();
       Operation response = sqlBackupRunsServiceClient.delete(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.Operation` |   |

### deleteCallable()

    public final UnaryCallable<SqlBackupRunsDeleteRequest,Operation> deleteCallable()

Deletes the backup taken by a backup run.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsDeleteRequest request =
           SqlBackupRunsDeleteRequest.newBuilder()
               .setId(3355)
               .setInstance("instance555127957")
               .setProject("project-309310695")
               .build();
       ApiFuture<Operation> future = sqlBackupRunsServiceClient.deleteCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsDeleteRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.Operation>` |   |

### get(SqlBackupRunsGetRequest request)

    public final BackupRun get(SqlBackupRunsGetRequest request)

Retrieves a resource containing information about a backup run.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsGetRequest request =
           SqlBackupRunsGetRequest.newBuilder()
               .setId(3355)
               .setInstance("instance555127957")
               .setProject("project-309310695")
               .build();
       BackupRun response = sqlBackupRunsServiceClient.get(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.BackupRun` |   |

### getCallable()

    public final UnaryCallable<SqlBackupRunsGetRequest,BackupRun> getCallable()

Retrieves a resource containing information about a backup run.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsGetRequest request =
           SqlBackupRunsGetRequest.newBuilder()
               .setId(3355)
               .setInstance("instance555127957")
               .setProject("project-309310695")
               .build();
       ApiFuture<BackupRun> future = sqlBackupRunsServiceClient.getCallable().futureCall(request);
       // Do something.
       BackupRun response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsGetRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.BackupRun>` |   |

### getSettings()

    public final @Nullable SqlBackupRunsServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `@org.jspecify.annotations.Nullable com.google.cloud.sql.v1beta4.SqlBackupRunsServiceSettings` |   |

### getStub()

    public SqlBackupRunsServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.stub.SqlBackupRunsServiceStub` |   |

### insert(SqlBackupRunsInsertRequest request)

    public final Operation insert(SqlBackupRunsInsertRequest request)

Creates a new backup run on demand.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsInsertRequest request =
           SqlBackupRunsInsertRequest.newBuilder()
               .setInstance("instance555127957")
               .setProject("project-309310695")
               .setBody(BackupRun.newBuilder().build())
               .build();
       Operation response = sqlBackupRunsServiceClient.insert(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.Operation` |   |

### insertCallable()

    public final UnaryCallable<SqlBackupRunsInsertRequest,Operation> insertCallable()

Creates a new backup run on demand.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsInsertRequest request =
           SqlBackupRunsInsertRequest.newBuilder()
               .setInstance("instance555127957")
               .setProject("project-309310695")
               .setBody(BackupRun.newBuilder().build())
               .build();
       ApiFuture<Operation> future = sqlBackupRunsServiceClient.insertCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsInsertRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.Operation>` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### list(SqlBackupRunsListRequest request)

    public final BackupRunsListResponse list(SqlBackupRunsListRequest request)

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsListRequest request =
           SqlBackupRunsListRequest.newBuilder()
               .setInstance("instance555127957")
               .setMaxResults(1128457243)
               .setPageToken("pageToken873572522")
               .setProject("project-309310695")
               .build();
       BackupRunsListResponse response = sqlBackupRunsServiceClient.list(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.BackupRunsListResponse` |   |

### listCallable()

    public final UnaryCallable<SqlBackupRunsListRequest,BackupRunsListResponse> listCallable()

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

<br />

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (SqlBackupRunsServiceClient sqlBackupRunsServiceClient =
         SqlBackupRunsServiceClient.create()) {
       SqlBackupRunsListRequest request =
           SqlBackupRunsListRequest.newBuilder()
               .setInstance("instance555127957")
               .setMaxResults(1128457243)
               .setPageToken("pageToken873572522")
               .setProject("project-309310695")
               .build();
       ApiFuture<BackupRunsListResponse> future =
           sqlBackupRunsServiceClient.listCallable().futureCall(request);
       // Do something.
       BackupRunsListResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.SqlBackupRunsListRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-sql/latest/com.google.cloud.sql.v1beta4.BackupRunsListResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()