# Google Cloud Dialogflow V2 Client - Class EncryptionSpec (2.4.0)

2.4.0 (latest) 2.3.1 2.2.1 2.1.2 2.0.1 1.17.2 1.16.0 1.15.1 1.14.0 1.13.0 1.12.3 1.11.0 1.10.2 1.9.0 1.8.0 1.7.2 1.6.0 1.5.0 1.4.0 1.3.2 1.2.0 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Dialogflow V2 Client class EncryptionSpec.

A customer-managed encryption key specification that can be applied to all
created resources (e.g. Conversation).

Generated from protobuf message `google.cloud.dialogflow.v2.EncryptionSpec`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Immutable. The resource name of the encryption key specification resource. Format: projects/{project}/locations/{location}/encryptionSpec |
| `↳ kms_key` | `string` Required. The name of customer-managed encryption key that is used to secure a resource and its sub-resources. If empty, the resource is secured by the default Google encryption key. Only the key in the same location as this resource is allowed to be used for encryption. Format: `projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}` |

### getName

Immutable. The resource name of the encryption key specification resource.

Format:
projects/{project}/locations/{location}/encryptionSpec

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Immutable. The resource name of the encryption key specification resource.

Format:
projects/{project}/locations/{location}/encryptionSpec

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getKmsKey

Required. The name of customer-managed encryption key that is used to
secure a resource and its sub-resources. If empty, the resource is secured
by the default Google encryption key. Only the key in the same location as
this resource is allowed to be used for encryption. Format:
`projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setKmsKey

Required. The name of customer-managed encryption key that is used to
secure a resource and its sub-resources. If empty, the resource is secured
by the default Google encryption key. Only the key in the same location as
this resource is allowed to be used for encryption. Format:
`projects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{key}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |