# Dialogflow V2 API - Class Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client (v1.16.1)

1.16.1 (latest) 1.16.0 1.15.0 1.14.0 1.13.0 1.12.1 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.0 1.5.0 1.4.1 1.3.0 1.2.0 1.1.1 1.0.0 0.34.0 0.33.0 0.32.2 0.31.0 0.30.0 0.29.0 0.28.0 0.27.0 0.26.2 0.25.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.1 0.16.0 0.15.2 0.14.0 0.13.0 0.12.0 Reference documentation and code samples for the Dialogflow V2 API class Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.

Client for the EncryptionSpecService service.


<br />

Manages encryption spec settings for Dialogflow and Agent Assist.

## Inherits

- Object

## Includes

- [Google::Cloud::Dialogflow::V2::EncryptionSpecService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Paths)

## Methods

### .configure

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

Configure the EncryptionSpecService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client-Configuration "Google::Cloud::Dialogflow::V2::EncryptionSpecService::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-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all EncryptionSpecService clients
::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

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

Configure the EncryptionSpecService 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-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client#Google__Cloud__Dialogflow__V2__EncryptionSpecService__Client_configure_class_ "Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client-Configuration "Google::Cloud::Dialogflow::V2::EncryptionSpecService::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-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client-Configuration))

### #get_encryption_spec

    def get_encryption_spec(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::EncryptionSpec
    def get_encryption_spec(name: nil) -> ::Google::Cloud::Dialogflow::V2::EncryptionSpec

Gets location-level encryption key specification.
**Overloads**

    def get_encryption_spec(request, options = nil) -> ::Google::Cloud::Dialogflow::V2::EncryptionSpec

Pass arguments to `get_encryption_spec` via a request object, either of type [GetEncryptionSpecRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-GetEncryptionSpecRequest "Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-GetEncryptionSpecRequest), ::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_encryption_spec(name: nil) -> ::Google::Cloud::Dialogflow::V2::EncryptionSpec

Pass arguments to `get_encryption_spec` 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 name of the encryption spec resource to get.
**Yields**

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

- **response** ([::Google::Cloud::Dialogflow::V2::EncryptionSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpec))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Cloud::Dialogflow::V2::EncryptionSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpec))
**Raises**

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

Basic example

```ruby
require "google/cloud/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::GetEncryptionSpecRequest.new

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

# The returned object is of type Google::Cloud::Dialogflow::V2::EncryptionSpec.
p result
```

### #initialize

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

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

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

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new do |config|
  config.timeout = 10.0
end
```

### #initialize_encryption_spec

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

Initializes a location-level encryption key specification. An error will
be thrown if the location has resources already created before the
initialization. Once the encryption specification is initialized at a
location, it is immutable and all newly created resources under the
location will be encrypted with the existing specification.
**Overloads**

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

Pass arguments to `initialize_encryption_spec` via a request object, either of type [InitializeEncryptionSpecRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-InitializeEncryptionSpecRequest "Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-InitializeEncryptionSpecRequest), ::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 initialize_encryption_spec(encryption_spec: nil) -> ::Gapic::Operation

Pass arguments to `initialize_encryption_spec` 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**

- **encryption_spec** ([::Google::Cloud::Dialogflow::V2::EncryptionSpec](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpec), ::Hash) --- Required. The encryption spec used for CMEK encryption. It is required that the kms key is in the same region as the endpoint. The same key will be used for all provisioned resources, if encryption is available. If the kms_key_name is left empty, no encryption will be enforced.
**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/dialogflow/v2"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Dialogflow::V2::EncryptionSpecService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Dialogflow::V2::InitializeEncryptionSpecRequest.new

# Call the initialize_encryption_spec method.
result = client.initialize_encryption_spec 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
```

### #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::Dialogflow::V2::EncryptionSpecService::Operations

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

- ([::Google::Cloud::Dialogflow::V2::EncryptionSpecService::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-v2/latest/Google-Cloud-Dialogflow-V2-EncryptionSpecService-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)