# Class MemorystoreClient (0.39.0)

0.39.0 (latest) 0.37.0 0.34.0 0.33.0 0.31.0 0.29.0 0.28.0 0.26.0 0.24.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.16.0 0.14.0 0.13.0 0.10.0 0.9.0 0.8.0 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0

> [!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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/MemorystoreClient.java) | [Product Reference](https://cloud.google.com/memorystore/docs/valkey) | [REST Documentation](https://cloud.google.com/memorystore/docs/valkey/reference/rest) |

Service Description: Service describing handlers for resources

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
       Instance response = memorystoreClient.getInstance(name);
     }
     
Note: close() needs to be called on the MemorystoreClient 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 |
|---|---|---|
| ListInstances | Lists Instances in a given project and location. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listInstances(ListInstancesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listInstances(LocationName parent) - listInstances(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listInstancesPagedCallable() - listInstancesCallable() |
| GetInstance | Gets details of a single Instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getInstance(GetInstanceRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getInstance(InstanceName name) - getInstance(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getInstanceCallable() |
| CreateInstance | Creates a new Instance in a given project and location. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createInstanceAsync(CreateInstanceRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createInstanceAsync(LocationName parent, Instance instance, String instanceId) - createInstanceAsync(String parent, Instance instance, String instanceId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createInstanceOperationCallable() - createInstanceCallable() |
| UpdateInstance | Updates the parameters of a single Instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateInstanceAsync(UpdateInstanceRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - updateInstanceAsync(Instance instance, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateInstanceOperationCallable() - updateInstanceCallable() |
| DeleteInstance | Deletes a single Instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteInstanceAsync(DeleteInstanceRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - deleteInstanceAsync(InstanceName name) - deleteInstanceAsync(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteInstanceOperationCallable() - deleteInstanceCallable() |
| GetCertificateAuthority | Gets details about the certificate authority for an Instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getCertificateAuthority(GetCertificateAuthorityRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getCertificateAuthority(InstanceName name) - getCertificateAuthority(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getCertificateAuthorityCallable() |
| GetSharedRegionalCertificateAuthority | Gets the details of shared regional certificate authority information for Memorystore instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getSharedRegionalCertificateAuthority(GetSharedRegionalCertificateAuthorityRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getSharedRegionalCertificateAuthority(SharedRegionalCertificateAuthorityName name) - getSharedRegionalCertificateAuthority(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getSharedRegionalCertificateAuthorityCallable() |
| ListLocations | Lists information about the supported locations for this service. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listLocations(ListLocationsRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listLocationsPagedCallable() - listLocationsCallable() |
| GetLocation | Gets information about a location. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getLocation(GetLocationRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getLocationCallable() |
[Methods]

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 MemorystoreSettings to
create(). For example:

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     MemorystoreSettings memorystoreSettings =
         MemorystoreSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings);
     
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
     MemorystoreSettings memorystoreSettings =
         MemorystoreSettings.newBuilder().setEndpoint(myEndpoint).build();
     MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings);
     
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
     MemorystoreSettings memorystoreSettings = MemorystoreSettings.newHttpJsonBuilder().build();
     MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings);
     
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) \> MemorystoreClient

## Static Methods

### create()

    public static final MemorystoreClient create()

Constructs an instance of MemorystoreClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient` |   |

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

### create(MemorystoreSettings settings)

    public static final MemorystoreClient create(MemorystoreSettings settings)

Constructs an instance of MemorystoreClient, 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-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient` |   |

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

### create(MemorystoreStub stub)

    public static final MemorystoreClient create(MemorystoreStub stub)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.stub.MemorystoreStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient` |   |

## Constructors

### MemorystoreClient(MemorystoreSettings settings)

    protected MemorystoreClient(MemorystoreSettings settings)

Constructs an instance of MemorystoreClient, 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-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreSettings` |

### MemorystoreClient(MemorystoreStub stub)

    protected MemorystoreClient(MemorystoreStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.stub.MemorystoreStub` |

## 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()

### createInstanceAsync(CreateInstanceRequest request)

    public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(CreateInstanceRequest request)

Creates a new Instance in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       CreateInstanceRequest request =
           CreateInstanceRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setInstanceId("instanceId902024336")
               .setInstance(Instance.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       Instance response = memorystoreClient.createInstanceAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.CreateInstanceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### createInstanceAsync(LocationName parent, Instance instance, String instanceId)

    public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(LocationName parent, Instance instance, String instanceId)

Creates a new Instance in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       Instance instance = Instance.newBuilder().build();
       String instanceId = "instanceId902024336";
       Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.LocationName` Required. The parent resource where this instance will be created. Format: projects/{project}/locations/{location} |
| `instance` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance` Required. The instance to create. |
| `instanceId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID to use for the instance, which will become the final component of the instance's resource name. This value is subject to the following restrictions: - Must be 4-63 characters in length - Must begin with a letter or digit - Must contain only lowercase letters, digits, and hyphens - Must not end with a hyphen - Must be unique within a location <br /> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### createInstanceAsync(String parent, Instance instance, String instanceId)

    public final OperationFuture<Instance,OperationMetadata> createInstanceAsync(String parent, Instance instance, String instanceId)

Creates a new Instance in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       Instance instance = Instance.newBuilder().build();
       String instanceId = "instanceId902024336";
       Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource where this instance will be created. Format: projects/{project}/locations/{location} |
| `instance` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance` Required. The instance to create. |
| `instanceId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID to use for the instance, which will become the final component of the instance's resource name. This value is subject to the following restrictions: - Must be 4-63 characters in length - Must begin with a letter or digit - Must contain only lowercase letters, digits, and hyphens - Must not end with a hyphen - Must be unique within a location <br /> |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### createInstanceCallable()

    public final UnaryCallable<CreateInstanceRequest,Operation> createInstanceCallable()

Creates a new Instance in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       CreateInstanceRequest request =
           CreateInstanceRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setInstanceId("instanceId902024336")
               .setInstance(Instance.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       ApiFuture<Operation> future = memorystoreClient.createInstanceCallable().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-valkey/latest/com.google.cloud.memorystore.v1beta.CreateInstanceRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createInstanceOperationCallable()

    public final OperationCallable<CreateInstanceRequest,Instance,OperationMetadata> createInstanceOperationCallable()

Creates a new Instance in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       CreateInstanceRequest request =
           CreateInstanceRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setInstanceId("instanceId902024336")
               .setInstance(Instance.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       OperationFuture<Instance, OperationMetadata> future =
           memorystoreClient.createInstanceOperationCallable().futureCall(request);
       // Do something.
       Instance response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.CreateInstanceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### deleteInstanceAsync(DeleteInstanceRequest request)

    public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(DeleteInstanceRequest request)

Deletes a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       DeleteInstanceRequest request =
           DeleteInstanceRequest.newBuilder()
               .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .setRequestId("requestId693933066")
               .build();
       memorystoreClient.deleteInstanceAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.DeleteInstanceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### deleteInstanceAsync(InstanceName name)

    public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(InstanceName name)

Deletes a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
       memorystoreClient.deleteInstanceAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.InstanceName` Required. The name of the instance to delete. Format: projects/{project}/locations/{location}/instances/{instance} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### deleteInstanceAsync(String name)

    public final OperationFuture<Empty,OperationMetadata> deleteInstanceAsync(String name)

Deletes a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
       memorystoreClient.deleteInstanceAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the instance to delete. Format: projects/{project}/locations/{location}/instances/{instance} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### deleteInstanceCallable()

    public final UnaryCallable<DeleteInstanceRequest,Operation> deleteInstanceCallable()

Deletes a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       DeleteInstanceRequest request =
           DeleteInstanceRequest.newBuilder()
               .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .setRequestId("requestId693933066")
               .build();
       ApiFuture<Operation> future = memorystoreClient.deleteInstanceCallable().futureCall(request);
       // Do something.
       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-valkey/latest/com.google.cloud.memorystore.v1beta.DeleteInstanceRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### deleteInstanceOperationCallable()

    public final OperationCallable<DeleteInstanceRequest,Empty,OperationMetadata> deleteInstanceOperationCallable()

Deletes a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       DeleteInstanceRequest request =
           DeleteInstanceRequest.newBuilder()
               .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .setRequestId("requestId693933066")
               .build();
       OperationFuture<Empty, OperationMetadata> future =
           memorystoreClient.deleteInstanceOperationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.DeleteInstanceRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### getCertificateAuthority(GetCertificateAuthorityRequest request)

    public final CertificateAuthority getCertificateAuthority(GetCertificateAuthorityRequest request)

Gets details about the certificate authority for an Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetCertificateAuthorityRequest request =
           GetCertificateAuthorityRequest.newBuilder()
               .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .build();
       CertificateAuthority response = memorystoreClient.getCertificateAuthority(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest` 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-valkey/latest/com.google.cloud.memorystore.v1beta.CertificateAuthority` |   |

### getCertificateAuthority(InstanceName name)

    public final CertificateAuthority getCertificateAuthority(InstanceName name)

Gets details about the certificate authority for an Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
       CertificateAuthority response = memorystoreClient.getCertificateAuthority(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.InstanceName` Required. The name of the certificate authority. Format: projects/{project}/locations/{location}/instances/{instance}/certificateAuthority |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.CertificateAuthority` |   |

### getCertificateAuthority(String name)

    public final CertificateAuthority getCertificateAuthority(String name)

Gets details about the certificate authority for an Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
       CertificateAuthority response = memorystoreClient.getCertificateAuthority(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the certificate authority. Format: projects/{project}/locations/{location}/instances/{instance}/certificateAuthority |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.CertificateAuthority` |   |

### getCertificateAuthorityCallable()

    public final UnaryCallable<GetCertificateAuthorityRequest,CertificateAuthority> getCertificateAuthorityCallable()

Gets details about the certificate authority for an Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetCertificateAuthorityRequest request =
           GetCertificateAuthorityRequest.newBuilder()
               .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .build();
       ApiFuture<CertificateAuthority> future =
           memorystoreClient.getCertificateAuthorityCallable().futureCall(request);
       // Do something.
       CertificateAuthority 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-valkey/latest/com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.CertificateAuthority>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature 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.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getInstance(GetInstanceRequest request)

    public final Instance getInstance(GetInstanceRequest request)

Gets details of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetInstanceRequest request =
           GetInstanceRequest.newBuilder()
               .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .build();
       Instance response = memorystoreClient.getInstance(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.GetInstanceRequest` 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-valkey/latest/com.google.cloud.memorystore.v1beta.Instance` |   |

### getInstance(InstanceName name)

    public final Instance getInstance(InstanceName name)

Gets details of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
       Instance response = memorystoreClient.getInstance(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.InstanceName` Required. The name of the instance to retrieve. Format: projects/{project}/locations/{location}/instances/{instance} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance` |   |

### getInstance(String name)

    public final Instance getInstance(String name)

Gets details of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
       Instance response = memorystoreClient.getInstance(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the instance to retrieve. Format: projects/{project}/locations/{location}/instances/{instance} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance` |   |

### getInstanceCallable()

    public final UnaryCallable<GetInstanceRequest,Instance> getInstanceCallable()

Gets details of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetInstanceRequest request =
           GetInstanceRequest.newBuilder()
               .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
               .build();
       ApiFuture<Instance> future = memorystoreClient.getInstanceCallable().futureCall(request);
       // Do something.
       Instance 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-valkey/latest/com.google.cloud.memorystore.v1beta.GetInstanceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance>` |   |

### getLocation(GetLocationRequest request)

    public final Location getLocation(GetLocationRequest request)

Gets information about a location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
       Location response = memorystoreClient.getLocation(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.cloud.location.GetLocationRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.location.Location` |   |

### getLocationCallable()

    public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
       ApiFuture<Location> future = memorystoreClient.getLocationCallable().futureCall(request);
       // Do something.
       Location response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getSettings()

    public final MemorystoreSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreSettings` |   |

### getSharedRegionalCertificateAuthority(GetSharedRegionalCertificateAuthorityRequest request)

    public final SharedRegionalCertificateAuthority getSharedRegionalCertificateAuthority(GetSharedRegionalCertificateAuthorityRequest request)

Gets the details of shared regional certificate authority information for Memorystore instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetSharedRegionalCertificateAuthorityRequest request =
           GetSharedRegionalCertificateAuthorityRequest.newBuilder()
               .setName(
                   SharedRegionalCertificateAuthorityName.of("[PROJECT]", "[LOCATION]").toString())
               .build();
       SharedRegionalCertificateAuthority response =
           memorystoreClient.getSharedRegionalCertificateAuthority(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.GetSharedRegionalCertificateAuthorityRequest` 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-valkey/latest/com.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority` |   |

### getSharedRegionalCertificateAuthority(SharedRegionalCertificateAuthorityName name)

    public final SharedRegionalCertificateAuthority getSharedRegionalCertificateAuthority(SharedRegionalCertificateAuthorityName name)

Gets the details of shared regional certificate authority information for Memorystore instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       SharedRegionalCertificateAuthorityName name =
           SharedRegionalCertificateAuthorityName.of("[PROJECT]", "[LOCATION]");
       SharedRegionalCertificateAuthority response =
           memorystoreClient.getSharedRegionalCertificateAuthority(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthorityName` Required. Regional certificate authority resource name using the form: `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority` where `location_id` refers to a Google Cloud region. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority` |   |

### getSharedRegionalCertificateAuthority(String name)

    public final SharedRegionalCertificateAuthority getSharedRegionalCertificateAuthority(String name)

Gets the details of shared regional certificate authority information for Memorystore instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       String name = SharedRegionalCertificateAuthorityName.of("[PROJECT]", "[LOCATION]").toString();
       SharedRegionalCertificateAuthority response =
           memorystoreClient.getSharedRegionalCertificateAuthority(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. Regional certificate authority resource name using the form: `projects/{project}/locations/{location}/sharedRegionalCertificateAuthority` where `location_id` refers to a Google Cloud region. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority` |   |

### getSharedRegionalCertificateAuthorityCallable()

    public final UnaryCallable<GetSharedRegionalCertificateAuthorityRequest,SharedRegionalCertificateAuthority> getSharedRegionalCertificateAuthorityCallable()

Gets the details of shared regional certificate authority information for Memorystore instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       GetSharedRegionalCertificateAuthorityRequest request =
           GetSharedRegionalCertificateAuthorityRequest.newBuilder()
               .setName(
                   SharedRegionalCertificateAuthorityName.of("[PROJECT]", "[LOCATION]").toString())
               .build();
       ApiFuture<SharedRegionalCertificateAuthority> future =
           memorystoreClient.getSharedRegionalCertificateAuthorityCallable().futureCall(request);
       // Do something.
       SharedRegionalCertificateAuthority 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-valkey/latest/com.google.cloud.memorystore.v1beta.GetSharedRegionalCertificateAuthorityRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.SharedRegionalCertificateAuthority>` |   |

### getStub()

    public MemorystoreStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.stub.MemorystoreStub` |   |

### 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` |   |

### listInstances(ListInstancesRequest request)

    public final MemorystoreClient.ListInstancesPagedResponse listInstances(ListInstancesRequest request)

Lists Instances in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       ListInstancesRequest request =
           ListInstancesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       for (Instance element : memorystoreClient.listInstances(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.ListInstancesRequest` 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-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse` |   |

### listInstances(LocationName parent)

    public final MemorystoreClient.ListInstancesPagedResponse listInstances(LocationName parent)

Lists Instances in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.LocationName` Required. The parent to list instances from. Format: projects/{project}/locations/{location} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse` |   |

### listInstances(String parent)

    public final MemorystoreClient.ListInstancesPagedResponse listInstances(String parent)

Lists Instances in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent to list instances from. Format: projects/{project}/locations/{location} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse` |   |

### listInstancesCallable()

    public final UnaryCallable<ListInstancesRequest,ListInstancesResponse> listInstancesCallable()

Lists Instances in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       ListInstancesRequest request =
           ListInstancesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       while (true) {
         ListInstancesResponse response = memorystoreClient.listInstancesCallable().call(request);
         for (Instance element : response.getInstancesList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **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-valkey/latest/com.google.cloud.memorystore.v1beta.ListInstancesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.ListInstancesResponse>` |   |

### listInstancesPagedCallable()

    public final UnaryCallable<ListInstancesRequest,MemorystoreClient.ListInstancesPagedResponse> listInstancesPagedCallable()

Lists Instances in a given project and location.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       ListInstancesRequest request =
           ListInstancesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       ApiFuture<Instance> future =
           memorystoreClient.listInstancesPagedCallable().futureCall(request);
       // Do something.
       for (Instance element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **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-valkey/latest/com.google.cloud.memorystore.v1beta.ListInstancesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse>` |   |

### listLocations(ListLocationsRequest request)

    public final MemorystoreClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (Location element : memorystoreClient.listLocations(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.cloud.location.ListLocationsRequest` 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-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient.ListLocationsPagedResponse` |   |

### listLocationsCallable()

    public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListLocationsResponse response = memorystoreClient.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;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>` |   |

### listLocationsPagedCallable()

    public final UnaryCallable<ListLocationsRequest,MemorystoreClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       ListLocationsRequest request =
           ListLocationsRequest.newBuilder()
               .setName("name3373707")
               .setFilter("filter-1274492040")
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<Location> future =
           memorystoreClient.listLocationsPagedCallable().futureCall(request);
       // Do something.
       for (Location element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.MemorystoreClient.ListLocationsPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### updateInstanceAsync(Instance instance, FieldMask updateMask)

    public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(Instance instance, FieldMask updateMask)

Updates the parameters of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       Instance instance = Instance.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Instance response = memorystoreClient.updateInstanceAsync(instance, updateMask).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `instance` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance` Required. The instance to update. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Optional. The list of fields to be updated on the instance. At least one field must be specified. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### updateInstanceAsync(UpdateInstanceRequest request)

    public final OperationFuture<Instance,OperationMetadata> updateInstanceAsync(UpdateInstanceRequest request)

Updates the parameters of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       UpdateInstanceRequest request =
           UpdateInstanceRequest.newBuilder()
               .setUpdateMask(FieldMask.newBuilder().build())
               .setInstance(Instance.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       Instance response = memorystoreClient.updateInstanceAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.UpdateInstanceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |

### updateInstanceCallable()

    public final UnaryCallable<UpdateInstanceRequest,Operation> updateInstanceCallable()

Updates the parameters of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       UpdateInstanceRequest request =
           UpdateInstanceRequest.newBuilder()
               .setUpdateMask(FieldMask.newBuilder().build())
               .setInstance(Instance.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       ApiFuture<Operation> future = memorystoreClient.updateInstanceCallable().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-valkey/latest/com.google.cloud.memorystore.v1beta.UpdateInstanceRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### updateInstanceOperationCallable()

    public final OperationCallable<UpdateInstanceRequest,Instance,OperationMetadata> updateInstanceOperationCallable()

Updates the parameters of a single Instance.

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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
       UpdateInstanceRequest request =
           UpdateInstanceRequest.newBuilder()
               .setUpdateMask(FieldMask.newBuilder().build())
               .setInstance(Instance.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       OperationFuture<Instance, OperationMetadata> future =
           memorystoreClient.updateInstanceOperationCallable().futureCall(request);
       // Do something.
       Instance response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.UpdateInstanceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.Instance,https://docs.cloud.google.com/java/docs/reference/google-cloud-valkey/latest/com.google.cloud.memorystore.v1beta.OperationMetadata>` |   |