# Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client (v0.28.0)

0.28.0 (latest) 0.27.0 0.26.0 0.25.0 0.24.0 0.23.1 0.22.0 0.21.0 0.20.1 0.19.1 0.18.0 0.17.0 0.16.0 0.15.0 0.14.2 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.2 0.6.0 0.5.0 0.4.0 0.3.0 0.2.1 0.1.0 Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.

Client for the CmekConfigService service.


<br />

Service for managing CMEK related tasks

## Inherits

- Object

## Includes

- [Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the CmekConfigService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all CmekConfigService clients
::Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the CmekConfigService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client#Google__Cloud__DiscoveryEngine__V1beta__CmekConfigService__Client_configure_class_ "Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client-Configuration "Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client-Configuration))

### #delete_cmek_config

    def delete_cmek_config(request, options = nil) -> ::Gapic::Operation
    def delete_cmek_config(name: nil) -> ::Gapic::Operation

De-provisions a CmekConfig.
**Overloads**

    def delete_cmek_config(request, options = nil) -> ::Gapic::Operation

Pass arguments to `delete_cmek_config` via a request object, either of type [DeleteCmekConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DeleteCmekConfigRequest "Google::Cloud::DiscoveryEngine::V1beta::DeleteCmekConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::DeleteCmekConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-DeleteCmekConfigRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_cmek_config(name: nil) -> ::Gapic::Operation

Pass arguments to `delete_cmek_config` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The resource name of the [CmekConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfig "Google::Cloud::DiscoveryEngine::V1beta::CmekConfig (class)") to delete, such as `projects/{project}/locations/{location}/cmekConfigs/{cmek_config}`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::Operation)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::DeleteCmekConfigRequest.new

# Call the delete_cmek_config method.
result = client.delete_cmek_config request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```

### #get_cmek_config

    def get_cmek_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig
    def get_cmek_config(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig

Gets the [CmekConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfig "Google::Cloud::DiscoveryEngine::V1beta::CmekConfig (class)").
**Overloads**

    def get_cmek_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig

Pass arguments to `get_cmek_config` via a request object, either of type [GetCmekConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetCmekConfigRequest "Google::Cloud::DiscoveryEngine::V1beta::GetCmekConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::GetCmekConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-GetCmekConfigRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_cmek_config(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig

Pass arguments to `get_cmek_config` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. Resource name of [CmekConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfig "Google::Cloud::DiscoveryEngine::V1beta::CmekConfig (class)"), such as `projects/*/locations/*/cmekConfig` or `projects/*/locations/*/cmekConfigs/*`.


  If the caller does not have permission to access the
  [CmekConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfig "Google::Cloud::DiscoveryEngine::V1beta::CmekConfig (class)"), regardless of
  whether or not it exists, a PERMISSION_DENIED error is returned.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfig))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfig))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::GetCmekConfigRequest.new

# Call the get_cmek_config method.
result = client.get_cmek_config request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::CmekConfig.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new CmekConfigService client object.
**Yields**

- (config) --- Configure the CmekConfigService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_cmek_configs

    def list_cmek_configs(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsResponse
    def list_cmek_configs(parent: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsResponse

Lists all the {::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig CmekConfig}s
with the project.
**Overloads**

    def list_cmek_configs(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsResponse

Pass arguments to `list_cmek_configs` via a request object, either of type [ListCmekConfigsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCmekConfigsRequest "Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCmekConfigsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_cmek_configs(parent: nil) -> ::Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsResponse

Pass arguments to `list_cmek_configs` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **parent** (::String) --- Required. The parent location resource name, such as `projects/{project}/locations/{location}`.


  If the caller does not have permission to list
  {::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig CmekConfig}s under this
  location, regardless of whether or not a CmekConfig exists, a
  PERMISSION_DENIED error is returned.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCmekConfigsResponse))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsResponse](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-ListCmekConfigsResponse))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsRequest.new

# Call the list_cmek_configs method.
result = client.list_cmek_configs request

# The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ListCmekConfigsResponse.
p result
```

### #location_client

    def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.
**Returns**

- (Google::Cloud::Location::Locations::Client)

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfigService-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)

### #update_cmek_config

    def update_cmek_config(request, options = nil) -> ::Gapic::Operation
    def update_cmek_config(config: nil, set_default: nil) -> ::Gapic::Operation

Provisions a CMEK key for use in a location of a customer's project.
This method will also conduct location validation on the provided
cmekConfig to make sure the key is valid and can be used in the
selected location.
**Overloads**

    def update_cmek_config(request, options = nil) -> ::Gapic::Operation

Pass arguments to `update_cmek_config` via a request object, either of type [UpdateCmekConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UpdateCmekConfigRequest "Google::Cloud::DiscoveryEngine::V1beta::UpdateCmekConfigRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::DiscoveryEngine::V1beta::UpdateCmekConfigRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-UpdateCmekConfigRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def update_cmek_config(config: nil, set_default: nil) -> ::Gapic::Operation

Pass arguments to `update_cmek_config` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **config** ([::Google::Cloud::DiscoveryEngine::V1beta::CmekConfig](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-CmekConfig), ::Hash) --- Required. The CmekConfig resource.
- **set_default** (::Boolean) --- Set the following CmekConfig as the default to be used for child resources if one is not specified.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::Operation)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/discovery_engine/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1beta::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1beta::UpdateCmekConfigRequest.new

# Call the update_cmek_config method.
result = client.update_cmek_config request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end
```