Class MemoryBankServiceClient (3.68.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: A service for managing memories for LLM applications.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   MemoryName name = MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]");
   Memory response = memoryBankServiceClient.getMemory(name);
 }
 

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

Methods
Method Description Method Variants

CreateMemory

Create a Memory.

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

  • createMemoryAsync(CreateMemoryRequest request)

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

  • createMemoryOperationCallable()

  • createMemoryCallable()

GetMemory

Get a Memory.

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

  • getMemory(GetMemoryRequest request)

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

  • getMemory(MemoryName name)

  • getMemory(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.

  • getMemoryCallable()

UpdateMemory

Update a Memory.

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

  • updateMemoryAsync(UpdateMemoryRequest request)

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

  • updateMemoryAsync(Memory memory, 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.

  • updateMemoryOperationCallable()

  • updateMemoryCallable()

ListMemories

List Memories.

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

  • listMemories(ListMemoriesRequest request)

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

  • listMemories(ReasoningEngineName parent)

  • listMemories(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.

  • listMemoriesPagedCallable()

  • listMemoriesCallable()

DeleteMemory

Delete a Memory.

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

  • deleteMemoryAsync(DeleteMemoryRequest request)

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

  • deleteMemoryAsync(MemoryName name)

  • deleteMemoryAsync(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.

  • deleteMemoryOperationCallable()

  • deleteMemoryCallable()

GenerateMemories

Generate memories.

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

  • generateMemoriesAsync(GenerateMemoriesRequest request)

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

  • generateMemoriesAsync(ReasoningEngineName parent)

  • generateMemoriesAsync(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.

  • generateMemoriesOperationCallable()

  • generateMemoriesCallable()

RetrieveMemories

Retrieve memories.

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

  • retrieveMemories(RetrieveMemoriesRequest request)

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

  • retrieveMemories(ReasoningEngineName parent)

  • retrieveMemories(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.

  • retrieveMemoriesCallable()

ListLocations

Lists information about the supported locations for this service.

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

  • listLocations(ListLocationsRequest request)

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

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

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

  • getLocation(GetLocationRequest request)

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

  • getLocationCallable()

SetIamPolicy

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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

  • setIamPolicy(SetIamPolicyRequest request)

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

  • setIamPolicyCallable()

GetIamPolicy

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

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

  • getIamPolicy(GetIamPolicyRequest request)

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

  • getIamPolicyCallable()

TestIamPermissions

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

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

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

  • testIamPermissions(TestIamPermissionsRequest request)

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

  • testIamPermissionsCallable()

See the individual methods for example code.

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

This class can be customized by passing in a custom instance of MemoryBankServiceSettings 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
 MemoryBankServiceSettings memoryBankServiceSettings =
     MemoryBankServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 MemoryBankServiceClient memoryBankServiceClient =
     MemoryBankServiceClient.create(memoryBankServiceSettings);
 

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
 MemoryBankServiceSettings memoryBankServiceSettings =
     MemoryBankServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 MemoryBankServiceClient memoryBankServiceClient =
     MemoryBankServiceClient.create(memoryBankServiceSettings);
 

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

Inheritance

java.lang.Object > MemoryBankServiceClient

Static Methods

create()

public static final MemoryBankServiceClient create()

Constructs an instance of MemoryBankServiceClient with default settings.

Returns
Type Description
MemoryBankServiceClient
Exceptions
Type Description
IOException

create(MemoryBankServiceSettings settings)

public static final MemoryBankServiceClient create(MemoryBankServiceSettings settings)

Constructs an instance of MemoryBankServiceClient, 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 MemoryBankServiceSettings
Returns
Type Description
MemoryBankServiceClient
Exceptions
Type Description
IOException

create(MemoryBankServiceStub stub)

public static final MemoryBankServiceClient create(MemoryBankServiceStub stub)

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

Parameter
Name Description
stub MemoryBankServiceStub
Returns
Type Description
MemoryBankServiceClient

Constructors

MemoryBankServiceClient(MemoryBankServiceSettings settings)

protected MemoryBankServiceClient(MemoryBankServiceSettings settings)

Constructs an instance of MemoryBankServiceClient, 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 MemoryBankServiceSettings

MemoryBankServiceClient(MemoryBankServiceStub stub)

protected MemoryBankServiceClient(MemoryBankServiceStub stub)
Parameter
Name Description
stub MemoryBankServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createMemoryAsync(CreateMemoryRequest request)

public final OperationFuture<Memory,CreateMemoryOperationMetadata> createMemoryAsync(CreateMemoryRequest request)

Create a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   CreateMemoryRequest request =
       CreateMemoryRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setMemory(Memory.newBuilder().build())
           .build();
   Memory response = memoryBankServiceClient.createMemoryAsync(request).get();
 }
 
Parameter
Name Description
request CreateMemoryRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Memory,CreateMemoryOperationMetadata>

createMemoryCallable()

public final UnaryCallable<CreateMemoryRequest,Operation> createMemoryCallable()

Create a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   CreateMemoryRequest request =
       CreateMemoryRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setMemory(Memory.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       memoryBankServiceClient.createMemoryCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateMemoryRequest,Operation>

createMemoryOperationCallable()

public final OperationCallable<CreateMemoryRequest,Memory,CreateMemoryOperationMetadata> createMemoryOperationCallable()

Create a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   CreateMemoryRequest request =
       CreateMemoryRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setMemory(Memory.newBuilder().build())
           .build();
   OperationFuture<Memory, CreateMemoryOperationMetadata> future =
       memoryBankServiceClient.createMemoryOperationCallable().futureCall(request);
   // Do something.
   Memory response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateMemoryRequest,Memory,CreateMemoryOperationMetadata>

deleteMemoryAsync(DeleteMemoryRequest request)

public final OperationFuture<Empty,DeleteMemoryOperationMetadata> deleteMemoryAsync(DeleteMemoryRequest request)

Delete a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   DeleteMemoryRequest request =
       DeleteMemoryRequest.newBuilder()
           .setName(
               MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]")
                   .toString())
           .build();
   memoryBankServiceClient.deleteMemoryAsync(request).get();
 }
 
Parameter
Name Description
request DeleteMemoryRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,DeleteMemoryOperationMetadata>

deleteMemoryAsync(MemoryName name)

public final OperationFuture<Empty,DeleteMemoryOperationMetadata> deleteMemoryAsync(MemoryName name)

Delete a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   MemoryName name = MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]");
   memoryBankServiceClient.deleteMemoryAsync(name).get();
 }
 
Parameter
Name Description
name MemoryName

Required. The resource name of the Memory to delete. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}

Returns
Type Description
OperationFuture<Empty,DeleteMemoryOperationMetadata>

deleteMemoryAsync(String name)

public final OperationFuture<Empty,DeleteMemoryOperationMetadata> deleteMemoryAsync(String name)

Delete a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   String name =
       MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]").toString();
   memoryBankServiceClient.deleteMemoryAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The resource name of the Memory to delete. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}

Returns
Type Description
OperationFuture<Empty,DeleteMemoryOperationMetadata>

deleteMemoryCallable()

public final UnaryCallable<DeleteMemoryRequest,Operation> deleteMemoryCallable()

Delete a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   DeleteMemoryRequest request =
       DeleteMemoryRequest.newBuilder()
           .setName(
               MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]")
                   .toString())
           .build();
   ApiFuture<Operation> future =
       memoryBankServiceClient.deleteMemoryCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteMemoryRequest,Operation>

deleteMemoryOperationCallable()

public final OperationCallable<DeleteMemoryRequest,Empty,DeleteMemoryOperationMetadata> deleteMemoryOperationCallable()

Delete a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   DeleteMemoryRequest request =
       DeleteMemoryRequest.newBuilder()
           .setName(
               MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]")
                   .toString())
           .build();
   OperationFuture<Empty, DeleteMemoryOperationMetadata> future =
       memoryBankServiceClient.deleteMemoryOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteMemoryRequest,Empty,DeleteMemoryOperationMetadata>

generateMemoriesAsync(GenerateMemoriesRequest request)

public final OperationFuture<GenerateMemoriesResponse,GenerateMemoriesOperationMetadata> generateMemoriesAsync(GenerateMemoriesRequest request)

Generate memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GenerateMemoriesRequest request =
       GenerateMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setDisableConsolidation(true)
           .putAllScope(new HashMap<String, String>())
           .build();
   GenerateMemoriesResponse response =
       memoryBankServiceClient.generateMemoriesAsync(request).get();
 }
 
Parameter
Name Description
request GenerateMemoriesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<GenerateMemoriesResponse,GenerateMemoriesOperationMetadata>

generateMemoriesAsync(ReasoningEngineName parent)

public final OperationFuture<GenerateMemoriesResponse,GenerateMemoriesOperationMetadata> generateMemoriesAsync(ReasoningEngineName parent)

Generate memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ReasoningEngineName parent =
       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
   GenerateMemoriesResponse response =
       memoryBankServiceClient.generateMemoriesAsync(parent).get();
 }
 
Parameter
Name Description
parent ReasoningEngineName

Required. The resource name of the ReasoningEngine to generate memories for. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

Returns
Type Description
OperationFuture<GenerateMemoriesResponse,GenerateMemoriesOperationMetadata>

generateMemoriesAsync(String parent)

public final OperationFuture<GenerateMemoriesResponse,GenerateMemoriesOperationMetadata> generateMemoriesAsync(String parent)

Generate memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   String parent =
       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]").toString();
   GenerateMemoriesResponse response =
       memoryBankServiceClient.generateMemoriesAsync(parent).get();
 }
 
Parameter
Name Description
parent String

Required. The resource name of the ReasoningEngine to generate memories for. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

Returns
Type Description
OperationFuture<GenerateMemoriesResponse,GenerateMemoriesOperationMetadata>

generateMemoriesCallable()

public final UnaryCallable<GenerateMemoriesRequest,Operation> generateMemoriesCallable()

Generate memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GenerateMemoriesRequest request =
       GenerateMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setDisableConsolidation(true)
           .putAllScope(new HashMap<String, String>())
           .build();
   ApiFuture<Operation> future =
       memoryBankServiceClient.generateMemoriesCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GenerateMemoriesRequest,Operation>

generateMemoriesOperationCallable()

public final OperationCallable<GenerateMemoriesRequest,GenerateMemoriesResponse,GenerateMemoriesOperationMetadata> generateMemoriesOperationCallable()

Generate memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GenerateMemoriesRequest request =
       GenerateMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setDisableConsolidation(true)
           .putAllScope(new HashMap<String, String>())
           .build();
   OperationFuture<GenerateMemoriesResponse, GenerateMemoriesOperationMetadata> future =
       memoryBankServiceClient.generateMemoriesOperationCallable().futureCall(request);
   // Do something.
   GenerateMemoriesResponse response = future.get();
 }
 
Returns
Type Description
OperationCallable<GenerateMemoriesRequest,GenerateMemoriesResponse,GenerateMemoriesOperationMetadata>

getIamPolicy(GetIamPolicyRequest request)

public final Policy getIamPolicy(GetIamPolicyRequest request)

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   Policy response = memoryBankServiceClient.getIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.GetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

getIamPolicyCallable()

public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GetIamPolicyRequest request =
       GetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setOptions(GetPolicyOptions.newBuilder().build())
           .build();
   ApiFuture<Policy> future = memoryBankServiceClient.getIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = memoryBankServiceClient.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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future =
       memoryBankServiceClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getMemory(GetMemoryRequest request)

public final Memory getMemory(GetMemoryRequest request)

Get a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GetMemoryRequest request =
       GetMemoryRequest.newBuilder()
           .setName(
               MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]")
                   .toString())
           .build();
   Memory response = memoryBankServiceClient.getMemory(request);
 }
 
Parameter
Name Description
request GetMemoryRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Memory

getMemory(MemoryName name)

public final Memory getMemory(MemoryName name)

Get a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   MemoryName name = MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]");
   Memory response = memoryBankServiceClient.getMemory(name);
 }
 
Parameter
Name Description
name MemoryName

Required. The resource name of the Memory. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}

Returns
Type Description
Memory

getMemory(String name)

public final Memory getMemory(String name)

Get a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   String name =
       MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]").toString();
   Memory response = memoryBankServiceClient.getMemory(name);
 }
 
Parameter
Name Description
name String

Required. The resource name of the Memory. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}

Returns
Type Description
Memory

getMemoryCallable()

public final UnaryCallable<GetMemoryRequest,Memory> getMemoryCallable()

Get a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   GetMemoryRequest request =
       GetMemoryRequest.newBuilder()
           .setName(
               MemoryName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]", "[MEMORY]")
                   .toString())
           .build();
   ApiFuture<Memory> future = memoryBankServiceClient.getMemoryCallable().futureCall(request);
   // Do something.
   Memory response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetMemoryRequest,Memory>

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
OperationsClient

getSettings()

public final MemoryBankServiceSettings getSettings()
Returns
Type Description
MemoryBankServiceSettings

getStub()

public MemoryBankServiceStub getStub()
Returns
Type Description
MemoryBankServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listLocations(ListLocationsRequest request)

public final MemoryBankServiceClient.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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : memoryBankServiceClient.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
MemoryBankServiceClient.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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response =
         memoryBankServiceClient.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
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,MemoryBankServiceClient.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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future =
       memoryBankServiceClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listMemories(ListMemoriesRequest request)

public final MemoryBankServiceClient.ListMemoriesPagedResponse listMemories(ListMemoriesRequest request)

List Memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ListMemoriesRequest request =
       ListMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Memory element : memoryBankServiceClient.listMemories(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListMemoriesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
MemoryBankServiceClient.ListMemoriesPagedResponse

listMemories(ReasoningEngineName parent)

public final MemoryBankServiceClient.ListMemoriesPagedResponse listMemories(ReasoningEngineName parent)

List Memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ReasoningEngineName parent =
       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
   for (Memory element : memoryBankServiceClient.listMemories(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent ReasoningEngineName

Required. The resource name of the ReasoningEngine to list the Memories under. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

Returns
Type Description
MemoryBankServiceClient.ListMemoriesPagedResponse

listMemories(String parent)

public final MemoryBankServiceClient.ListMemoriesPagedResponse listMemories(String parent)

List Memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   String parent =
       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]").toString();
   for (Memory element : memoryBankServiceClient.listMemories(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The resource name of the ReasoningEngine to list the Memories under. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

Returns
Type Description
MemoryBankServiceClient.ListMemoriesPagedResponse

listMemoriesCallable()

public final UnaryCallable<ListMemoriesRequest,ListMemoriesResponse> listMemoriesCallable()

List Memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ListMemoriesRequest request =
       ListMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListMemoriesResponse response =
         memoryBankServiceClient.listMemoriesCallable().call(request);
     for (Memory element : response.getMemoriesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListMemoriesRequest,ListMemoriesResponse>

listMemoriesPagedCallable()

public final UnaryCallable<ListMemoriesRequest,MemoryBankServiceClient.ListMemoriesPagedResponse> listMemoriesPagedCallable()

List Memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ListMemoriesRequest request =
       ListMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Memory> future =
       memoryBankServiceClient.listMemoriesPagedCallable().futureCall(request);
   // Do something.
   for (Memory element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListMemoriesRequest,ListMemoriesPagedResponse>

retrieveMemories(ReasoningEngineName parent)

public final RetrieveMemoriesResponse retrieveMemories(ReasoningEngineName parent)

Retrieve memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   ReasoningEngineName parent =
       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
   RetrieveMemoriesResponse response = memoryBankServiceClient.retrieveMemories(parent);
 }
 
Parameter
Name Description
parent ReasoningEngineName

Required. The resource name of the ReasoningEngine to retrieve memories from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

Returns
Type Description
RetrieveMemoriesResponse

retrieveMemories(RetrieveMemoriesRequest request)

public final RetrieveMemoriesResponse retrieveMemories(RetrieveMemoriesRequest request)

Retrieve memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   RetrieveMemoriesRequest request =
       RetrieveMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .putAllScope(new HashMap<String, String>())
           .build();
   RetrieveMemoriesResponse response = memoryBankServiceClient.retrieveMemories(request);
 }
 
Parameter
Name Description
request RetrieveMemoriesRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
RetrieveMemoriesResponse

retrieveMemories(String parent)

public final RetrieveMemoriesResponse retrieveMemories(String parent)

Retrieve memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   String parent =
       ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]").toString();
   RetrieveMemoriesResponse response = memoryBankServiceClient.retrieveMemories(parent);
 }
 
Parameter
Name Description
parent String

Required. The resource name of the ReasoningEngine to retrieve memories from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

Returns
Type Description
RetrieveMemoriesResponse

retrieveMemoriesCallable()

public final UnaryCallable<RetrieveMemoriesRequest,RetrieveMemoriesResponse> retrieveMemoriesCallable()

Retrieve memories.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   RetrieveMemoriesRequest request =
       RetrieveMemoriesRequest.newBuilder()
           .setParent(
               ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
                   .toString())
           .putAllScope(new HashMap<String, String>())
           .build();
   ApiFuture<RetrieveMemoriesResponse> future =
       memoryBankServiceClient.retrieveMemoriesCallable().futureCall(request);
   // Do something.
   RetrieveMemoriesResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<RetrieveMemoriesRequest,RetrieveMemoriesResponse>

setIamPolicy(SetIamPolicyRequest request)

public final Policy setIamPolicy(SetIamPolicyRequest request)

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Policy response = memoryBankServiceClient.setIamPolicy(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.SetIamPolicyRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.Policy

setIamPolicyCallable()

public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

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

Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIEDerrors.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   SetIamPolicyRequest request =
       SetIamPolicyRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .setPolicy(Policy.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Policy> future = memoryBankServiceClient.setIamPolicyCallable().futureCall(request);
   // Do something.
   Policy response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

testIamPermissions(TestIamPermissionsRequest request)

public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   TestIamPermissionsResponse response = memoryBankServiceClient.testIamPermissions(request);
 }
 
Parameter
Name Description
request com.google.iam.v1.TestIamPermissionsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.iam.v1.TestIamPermissionsResponse

testIamPermissionsCallable()

public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

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

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

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   TestIamPermissionsRequest request =
       TestIamPermissionsRequest.newBuilder()
           .setResource(
               EndpointName.ofProjectLocationEndpointName(
                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
                   .toString())
           .addAllPermissions(new ArrayList<String>())
           .build();
   ApiFuture<TestIamPermissionsResponse> future =
       memoryBankServiceClient.testIamPermissionsCallable().futureCall(request);
   // Do something.
   TestIamPermissionsResponse response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>

updateMemoryAsync(Memory memory, FieldMask updateMask)

public final OperationFuture<Memory,UpdateMemoryOperationMetadata> updateMemoryAsync(Memory memory, FieldMask updateMask)

Update a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   Memory memory = Memory.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Memory response = memoryBankServiceClient.updateMemoryAsync(memory, updateMask).get();
 }
 
Parameters
Name Description
memory Memory

Required. The Memory which replaces the resource on the server.

updateMask FieldMask

Optional. Mask specifying which fields to update. Supported fields:

* display_name * description * fact

Returns
Type Description
OperationFuture<Memory,UpdateMemoryOperationMetadata>

updateMemoryAsync(UpdateMemoryRequest request)

public final OperationFuture<Memory,UpdateMemoryOperationMetadata> updateMemoryAsync(UpdateMemoryRequest request)

Update a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   UpdateMemoryRequest request =
       UpdateMemoryRequest.newBuilder()
           .setMemory(Memory.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Memory response = memoryBankServiceClient.updateMemoryAsync(request).get();
 }
 
Parameter
Name Description
request UpdateMemoryRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Memory,UpdateMemoryOperationMetadata>

updateMemoryCallable()

public final UnaryCallable<UpdateMemoryRequest,Operation> updateMemoryCallable()

Update a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   UpdateMemoryRequest request =
       UpdateMemoryRequest.newBuilder()
           .setMemory(Memory.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       memoryBankServiceClient.updateMemoryCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateMemoryRequest,Operation>

updateMemoryOperationCallable()

public final OperationCallable<UpdateMemoryRequest,Memory,UpdateMemoryOperationMetadata> updateMemoryOperationCallable()

Update a Memory.

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 (MemoryBankServiceClient memoryBankServiceClient = MemoryBankServiceClient.create()) {
   UpdateMemoryRequest request =
       UpdateMemoryRequest.newBuilder()
           .setMemory(Memory.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<Memory, UpdateMemoryOperationMetadata> future =
       memoryBankServiceClient.updateMemoryOperationCallable().futureCall(request);
   // Do something.
   Memory response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateMemoryRequest,Memory,UpdateMemoryOperationMetadata>