Class CmekServiceClient (1.60.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: Dataplex Cmek Service

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


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   EncryptionConfigName name =
       EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]");
   EncryptionConfig response = cmekServiceClient.getEncryptionConfig(name);
 }
 

Note: close() needs to be called on the CmekServiceClient 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

CreateEncryptionConfig

Create an EncryptionConfig.

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

  • createEncryptionConfigAsync(CreateEncryptionConfigRequest request)

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

  • createEncryptionConfigAsync(OrganizationLocationName parent, EncryptionConfig encryptionConfig, String encryptionConfigId)

  • createEncryptionConfigAsync(String parent, EncryptionConfig encryptionConfig, String encryptionConfigId)

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

  • createEncryptionConfigOperationCallable()

  • createEncryptionConfigCallable()

UpdateEncryptionConfig

Update an EncryptionConfig.

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

  • updateEncryptionConfigAsync(UpdateEncryptionConfigRequest request)

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

  • updateEncryptionConfigAsync(EncryptionConfig encryptionConfig, 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.

  • updateEncryptionConfigOperationCallable()

  • updateEncryptionConfigCallable()

DeleteEncryptionConfig

Delete an EncryptionConfig.

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

  • deleteEncryptionConfigAsync(DeleteEncryptionConfigRequest request)

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

  • deleteEncryptionConfigAsync(EncryptionConfigName name)

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

  • deleteEncryptionConfigOperationCallable()

  • deleteEncryptionConfigCallable()

ListEncryptionConfigs

List EncryptionConfigs.

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

  • listEncryptionConfigs(ListEncryptionConfigsRequest request)

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

  • listEncryptionConfigs(OrganizationLocationName parent)

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

  • listEncryptionConfigsPagedCallable()

  • listEncryptionConfigsCallable()

GetEncryptionConfig

Get an EncryptionConfig.

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

  • getEncryptionConfig(GetEncryptionConfigRequest request)

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

  • getEncryptionConfig(EncryptionConfigName name)

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

  • getEncryptionConfigCallable()

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

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 CmekServiceSettings 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
 CmekServiceSettings cmekServiceSettings =
     CmekServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 CmekServiceClient cmekServiceClient = CmekServiceClient.create(cmekServiceSettings);
 

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
 CmekServiceSettings cmekServiceSettings =
     CmekServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 CmekServiceClient cmekServiceClient = CmekServiceClient.create(cmekServiceSettings);
 

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
 CmekServiceSettings cmekServiceSettings = CmekServiceSettings.newHttpJsonBuilder().build();
 CmekServiceClient cmekServiceClient = CmekServiceClient.create(cmekServiceSettings);
 

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

Inheritance

java.lang.Object > CmekServiceClient

Static Methods

create()

public static final CmekServiceClient create()

Constructs an instance of CmekServiceClient with default settings.

Returns
Type Description
CmekServiceClient
Exceptions
Type Description
IOException

create(CmekServiceSettings settings)

public static final CmekServiceClient create(CmekServiceSettings settings)

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

create(CmekServiceStub stub)

public static final CmekServiceClient create(CmekServiceStub stub)

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

Parameter
Name Description
stub CmekServiceStub
Returns
Type Description
CmekServiceClient

Constructors

CmekServiceClient(CmekServiceSettings settings)

protected CmekServiceClient(CmekServiceSettings settings)

Constructs an instance of CmekServiceClient, 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 CmekServiceSettings

CmekServiceClient(CmekServiceStub stub)

protected CmekServiceClient(CmekServiceStub stub)
Parameter
Name Description
stub CmekServiceStub

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

createEncryptionConfigAsync(CreateEncryptionConfigRequest request)

public final OperationFuture<EncryptionConfig,OperationMetadata> createEncryptionConfigAsync(CreateEncryptionConfigRequest request)

Create an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   CreateEncryptionConfigRequest request =
       CreateEncryptionConfigRequest.newBuilder()
           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
           .setEncryptionConfigId("encryptionConfigId-1583151968")
           .setEncryptionConfig(EncryptionConfig.newBuilder().build())
           .build();
   EncryptionConfig response = cmekServiceClient.createEncryptionConfigAsync(request).get();
 }
 
Parameter
Name Description
request CreateEncryptionConfigRequest

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

Returns
Type Description
OperationFuture<EncryptionConfig,OperationMetadata>

createEncryptionConfigAsync(OrganizationLocationName parent, EncryptionConfig encryptionConfig, String encryptionConfigId)

public final OperationFuture<EncryptionConfig,OperationMetadata> createEncryptionConfigAsync(OrganizationLocationName parent, EncryptionConfig encryptionConfig, String encryptionConfigId)

Create an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   EncryptionConfig encryptionConfig = EncryptionConfig.newBuilder().build();
   String encryptionConfigId = "encryptionConfigId-1583151968";
   EncryptionConfig response =
       cmekServiceClient
           .createEncryptionConfigAsync(parent, encryptionConfig, encryptionConfigId)
           .get();
 }
 
Parameters
Name Description
parent OrganizationLocationName

Required. The location at which the EncryptionConfig is to be created.

encryptionConfig EncryptionConfig

Required. The EncryptionConfig to create.

encryptionConfigId String

Required. The ID of the EncryptionConfig to create. The ID must contain only letters (a-z, A-Z), numbers (0-9), and hyphens (-). The maximum size is 63 characters. The first character must be a letter. The last character must be a letter or a number.

Returns
Type Description
OperationFuture<EncryptionConfig,OperationMetadata>

createEncryptionConfigAsync(String parent, EncryptionConfig encryptionConfig, String encryptionConfigId)

public final OperationFuture<EncryptionConfig,OperationMetadata> createEncryptionConfigAsync(String parent, EncryptionConfig encryptionConfig, String encryptionConfigId)

Create an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
   EncryptionConfig encryptionConfig = EncryptionConfig.newBuilder().build();
   String encryptionConfigId = "encryptionConfigId-1583151968";
   EncryptionConfig response =
       cmekServiceClient
           .createEncryptionConfigAsync(parent, encryptionConfig, encryptionConfigId)
           .get();
 }
 
Parameters
Name Description
parent String

Required. The location at which the EncryptionConfig is to be created.

encryptionConfig EncryptionConfig

Required. The EncryptionConfig to create.

encryptionConfigId String

Required. The ID of the EncryptionConfig to create. The ID must contain only letters (a-z, A-Z), numbers (0-9), and hyphens (-). The maximum size is 63 characters. The first character must be a letter. The last character must be a letter or a number.

Returns
Type Description
OperationFuture<EncryptionConfig,OperationMetadata>

createEncryptionConfigCallable()

public final UnaryCallable<CreateEncryptionConfigRequest,Operation> createEncryptionConfigCallable()

Create an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   CreateEncryptionConfigRequest request =
       CreateEncryptionConfigRequest.newBuilder()
           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
           .setEncryptionConfigId("encryptionConfigId-1583151968")
           .setEncryptionConfig(EncryptionConfig.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       cmekServiceClient.createEncryptionConfigCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateEncryptionConfigRequest,Operation>

createEncryptionConfigOperationCallable()

public final OperationCallable<CreateEncryptionConfigRequest,EncryptionConfig,OperationMetadata> createEncryptionConfigOperationCallable()

Create an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   CreateEncryptionConfigRequest request =
       CreateEncryptionConfigRequest.newBuilder()
           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
           .setEncryptionConfigId("encryptionConfigId-1583151968")
           .setEncryptionConfig(EncryptionConfig.newBuilder().build())
           .build();
   OperationFuture<EncryptionConfig, OperationMetadata> future =
       cmekServiceClient.createEncryptionConfigOperationCallable().futureCall(request);
   // Do something.
   EncryptionConfig response = future.get();
 }
 
Returns
Type Description
OperationCallable<CreateEncryptionConfigRequest,EncryptionConfig,OperationMetadata>

deleteEncryptionConfigAsync(DeleteEncryptionConfigRequest request)

public final OperationFuture<Empty,OperationMetadata> deleteEncryptionConfigAsync(DeleteEncryptionConfigRequest request)

Delete an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   DeleteEncryptionConfigRequest request =
       DeleteEncryptionConfigRequest.newBuilder()
           .setName(
               EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   cmekServiceClient.deleteEncryptionConfigAsync(request).get();
 }
 
Parameter
Name Description
request DeleteEncryptionConfigRequest

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

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEncryptionConfigAsync(EncryptionConfigName name)

public final OperationFuture<Empty,OperationMetadata> deleteEncryptionConfigAsync(EncryptionConfigName name)

Delete an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   EncryptionConfigName name =
       EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]");
   cmekServiceClient.deleteEncryptionConfigAsync(name).get();
 }
 
Parameter
Name Description
name EncryptionConfigName

Required. The name of the EncryptionConfig to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEncryptionConfigAsync(String name)

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

Delete an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   String name =
       EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]").toString();
   cmekServiceClient.deleteEncryptionConfigAsync(name).get();
 }
 
Parameter
Name Description
name String

Required. The name of the EncryptionConfig to delete.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteEncryptionConfigCallable()

public final UnaryCallable<DeleteEncryptionConfigRequest,Operation> deleteEncryptionConfigCallable()

Delete an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   DeleteEncryptionConfigRequest request =
       DeleteEncryptionConfigRequest.newBuilder()
           .setName(
               EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   ApiFuture<Operation> future =
       cmekServiceClient.deleteEncryptionConfigCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteEncryptionConfigRequest,Operation>

deleteEncryptionConfigOperationCallable()

public final OperationCallable<DeleteEncryptionConfigRequest,Empty,OperationMetadata> deleteEncryptionConfigOperationCallable()

Delete an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   DeleteEncryptionConfigRequest request =
       DeleteEncryptionConfigRequest.newBuilder()
           .setName(
               EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]")
                   .toString())
           .setEtag("etag3123477")
           .build();
   OperationFuture<Empty, OperationMetadata> future =
       cmekServiceClient.deleteEncryptionConfigOperationCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
OperationCallable<DeleteEncryptionConfigRequest,Empty,OperationMetadata>

getEncryptionConfig(EncryptionConfigName name)

public final EncryptionConfig getEncryptionConfig(EncryptionConfigName name)

Get an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   EncryptionConfigName name =
       EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]");
   EncryptionConfig response = cmekServiceClient.getEncryptionConfig(name);
 }
 
Parameter
Name Description
name EncryptionConfigName

Required. The name of the EncryptionConfig to fetch.

Returns
Type Description
EncryptionConfig

getEncryptionConfig(GetEncryptionConfigRequest request)

public final EncryptionConfig getEncryptionConfig(GetEncryptionConfigRequest request)

Get an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   GetEncryptionConfigRequest request =
       GetEncryptionConfigRequest.newBuilder()
           .setName(
               EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]")
                   .toString())
           .build();
   EncryptionConfig response = cmekServiceClient.getEncryptionConfig(request);
 }
 
Parameter
Name Description
request GetEncryptionConfigRequest

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

Returns
Type Description
EncryptionConfig

getEncryptionConfig(String name)

public final EncryptionConfig getEncryptionConfig(String name)

Get an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   String name =
       EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]").toString();
   EncryptionConfig response = cmekServiceClient.getEncryptionConfig(name);
 }
 
Parameter
Name Description
name String

Required. The name of the EncryptionConfig to fetch.

Returns
Type Description
EncryptionConfig

getEncryptionConfigCallable()

public final UnaryCallable<GetEncryptionConfigRequest,EncryptionConfig> getEncryptionConfigCallable()

Get an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   GetEncryptionConfigRequest request =
       GetEncryptionConfigRequest.newBuilder()
           .setName(
               EncryptionConfigName.of("[ORGANIZATION]", "[LOCATION]", "[ENCRYPTION_CONFIG]")
                   .toString())
           .build();
   ApiFuture<EncryptionConfig> future =
       cmekServiceClient.getEncryptionConfigCallable().futureCall(request);
   // Do something.
   EncryptionConfig response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetEncryptionConfigRequest,EncryptionConfig>

getHttpJsonOperationsClient()

public final OperationsClient getHttpJsonOperationsClient()

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

Returns
Type Description
OperationsClient

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 (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = cmekServiceClient.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 (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = cmekServiceClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<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
OperationsClient

getSettings()

public final CmekServiceSettings getSettings()
Returns
Type Description
CmekServiceSettings

getStub()

public CmekServiceStub getStub()
Returns
Type Description
CmekServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listEncryptionConfigs(ListEncryptionConfigsRequest request)

public final CmekServiceClient.ListEncryptionConfigsPagedResponse listEncryptionConfigs(ListEncryptionConfigsRequest request)

List EncryptionConfigs.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   ListEncryptionConfigsRequest request =
       ListEncryptionConfigsRequest.newBuilder()
           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   for (EncryptionConfig element :
       cmekServiceClient.listEncryptionConfigs(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListEncryptionConfigsRequest

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

Returns
Type Description
CmekServiceClient.ListEncryptionConfigsPagedResponse

listEncryptionConfigs(OrganizationLocationName parent)

public final CmekServiceClient.ListEncryptionConfigsPagedResponse listEncryptionConfigs(OrganizationLocationName parent)

List EncryptionConfigs.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
   for (EncryptionConfig element :
       cmekServiceClient.listEncryptionConfigs(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent OrganizationLocationName

Required. The location for which the EncryptionConfig is to be listed.

Returns
Type Description
CmekServiceClient.ListEncryptionConfigsPagedResponse

listEncryptionConfigs(String parent)

public final CmekServiceClient.ListEncryptionConfigsPagedResponse listEncryptionConfigs(String parent)

List EncryptionConfigs.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
   for (EncryptionConfig element :
       cmekServiceClient.listEncryptionConfigs(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The location for which the EncryptionConfig is to be listed.

Returns
Type Description
CmekServiceClient.ListEncryptionConfigsPagedResponse

listEncryptionConfigsCallable()

public final UnaryCallable<ListEncryptionConfigsRequest,ListEncryptionConfigsResponse> listEncryptionConfigsCallable()

List EncryptionConfigs.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   ListEncryptionConfigsRequest request =
       ListEncryptionConfigsRequest.newBuilder()
           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   while (true) {
     ListEncryptionConfigsResponse response =
         cmekServiceClient.listEncryptionConfigsCallable().call(request);
     for (EncryptionConfig element : response.getEncryptionConfigsList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListEncryptionConfigsRequest,ListEncryptionConfigsResponse>

listEncryptionConfigsPagedCallable()

public final UnaryCallable<ListEncryptionConfigsRequest,CmekServiceClient.ListEncryptionConfigsPagedResponse> listEncryptionConfigsPagedCallable()

List EncryptionConfigs.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   ListEncryptionConfigsRequest request =
       ListEncryptionConfigsRequest.newBuilder()
           .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setFilter("filter-1274492040")
           .setOrderBy("orderBy-1207110587")
           .build();
   ApiFuture<EncryptionConfig> future =
       cmekServiceClient.listEncryptionConfigsPagedCallable().futureCall(request);
   // Do something.
   for (EncryptionConfig element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListEncryptionConfigsRequest,ListEncryptionConfigsPagedResponse>

listLocations(ListLocationsRequest request)

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

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateEncryptionConfigAsync(EncryptionConfig encryptionConfig, FieldMask updateMask)

public final OperationFuture<EncryptionConfig,OperationMetadata> updateEncryptionConfigAsync(EncryptionConfig encryptionConfig, FieldMask updateMask)

Update an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   EncryptionConfig encryptionConfig = EncryptionConfig.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   EncryptionConfig response =
       cmekServiceClient.updateEncryptionConfigAsync(encryptionConfig, updateMask).get();
 }
 
Parameters
Name Description
encryptionConfig EncryptionConfig

Required. The EncryptionConfig to update.

updateMask FieldMask

Optional. Mask of fields to update. The service treats an omitted field mask as an implied field mask equivalent to all fields that are populated (have a non-empty value).

Returns
Type Description
OperationFuture<EncryptionConfig,OperationMetadata>

updateEncryptionConfigAsync(UpdateEncryptionConfigRequest request)

public final OperationFuture<EncryptionConfig,OperationMetadata> updateEncryptionConfigAsync(UpdateEncryptionConfigRequest request)

Update an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   UpdateEncryptionConfigRequest request =
       UpdateEncryptionConfigRequest.newBuilder()
           .setEncryptionConfig(EncryptionConfig.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   EncryptionConfig response = cmekServiceClient.updateEncryptionConfigAsync(request).get();
 }
 
Parameter
Name Description
request UpdateEncryptionConfigRequest

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

Returns
Type Description
OperationFuture<EncryptionConfig,OperationMetadata>

updateEncryptionConfigCallable()

public final UnaryCallable<UpdateEncryptionConfigRequest,Operation> updateEncryptionConfigCallable()

Update an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   UpdateEncryptionConfigRequest request =
       UpdateEncryptionConfigRequest.newBuilder()
           .setEncryptionConfig(EncryptionConfig.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Operation> future =
       cmekServiceClient.updateEncryptionConfigCallable().futureCall(request);
   // Do something.
   Operation response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateEncryptionConfigRequest,Operation>

updateEncryptionConfigOperationCallable()

public final OperationCallable<UpdateEncryptionConfigRequest,EncryptionConfig,OperationMetadata> updateEncryptionConfigOperationCallable()

Update an EncryptionConfig.

Sample code:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (CmekServiceClient cmekServiceClient = CmekServiceClient.create()) {
   UpdateEncryptionConfigRequest request =
       UpdateEncryptionConfigRequest.newBuilder()
           .setEncryptionConfig(EncryptionConfig.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   OperationFuture<EncryptionConfig, OperationMetadata> future =
       cmekServiceClient.updateEncryptionConfigOperationCallable().futureCall(request);
   // Do something.
   EncryptionConfig response = future.get();
 }
 
Returns
Type Description
OperationCallable<UpdateEncryptionConfigRequest,EncryptionConfig,OperationMetadata>