# Cloud KMS V1 Client - Class AutokeyConfig (2.9.0)

2.9.0 (latest) 2.8.0 2.7.0 2.6.0 2.5.2 2.4.0 2.3.1 2.2.0 2.1.6 2.0.0 1.23.0 1.22.1 1.21.4 1.20.3 1.19.0 1.18.1 1.17.0 1.16.4 1.15.3 Reference documentation and code samples for the Cloud KMS V1 Client class AutokeyConfig.

Cloud KMS Autokey configuration for a folder.

Generated from protobuf message `google.cloud.kms.v1.AutokeyConfig`

## Namespace

Google \\ Cloud \\ Kms \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Identifier. Name of the [AutokeyConfig](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig) resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or `projects/{PROJECT_NUMBER}/autokeyConfig`. |
| `↳ key_project` | `string` Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or `projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) when a [KeyHandle](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.KeyHandle) is created. On [UpdateAutokeyConfig](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.AutokeyAdminClient#_Google_Cloud_Kms_V1_Client_AutokeyAdminClient__updateAutokeyConfig__), the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on this key project. Once configured, for Cloud KMS Autokey to function properly, this key project must have the Cloud KMS API activated and the Cloud KMS Service Agent for this key project must be granted the `cloudkms.admin` role (or pertinent permissions). A request with an empty key project field will clear the configuration. |
| `↳ state` | `int` Output only. The state for the AutokeyConfig. |
| `↳ etag` | `string` Optional. A checksum computed by the server based on the value of other fields. This may be sent on update requests to ensure that the client has an up-to-date value before proceeding. The request will be rejected with an ABORTED error on a mismatched etag. |
| `↳ key_project_resolution_mode` | `int` Optional. KeyProjectResolutionMode for the AutokeyConfig. Valid values are `DEDICATED_KEY_PROJECT`, `RESOURCE_PROJECT`, or `DISABLED`. |

### getName

Identifier. Name of the [AutokeyConfig](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig)
resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or
`projects/{PROJECT_NUMBER}/autokeyConfig`.

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

### setName

Identifier. Name of the [AutokeyConfig](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig)
resource, e.g. `folders/{FOLDER_NUMBER}/autokeyConfig` or
`projects/{PROJECT_NUMBER}/autokeyConfig`.

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

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

### getKeyProject

Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or
`projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) when a
[KeyHandle](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.KeyHandle) is created. On
[UpdateAutokeyConfig](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.AutokeyAdminClient#_Google_Cloud_Kms_V1_Client_AutokeyAdminClient__updateAutokeyConfig__),
the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on
this key project. Once configured, for Cloud KMS Autokey to function
properly, this key project must have the Cloud KMS API activated and the
Cloud KMS Service Agent for this key project must be granted the
`cloudkms.admin` role (or pertinent permissions). A request with an empty
key project field will clear the configuration.

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

### setKeyProject

Optional. Name of the key project, e.g. `projects/{PROJECT_ID}` or
`projects/{PROJECT_NUMBER}`, where Cloud KMS Autokey will provision a new
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey) when a
[KeyHandle](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.KeyHandle) is created. On
[UpdateAutokeyConfig](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.Client.AutokeyAdminClient#_Google_Cloud_Kms_V1_Client_AutokeyAdminClient__updateAutokeyConfig__),
the caller will require `cloudkms.cryptoKeys.setIamPolicy` permission on
this key project. Once configured, for Cloud KMS Autokey to function
properly, this key project must have the Cloud KMS API activated and the
Cloud KMS Service Agent for this key project must be granted the
`cloudkms.admin` role (or pertinent permissions). A request with an empty
key project field will clear the configuration.

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

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

### getState

Output only. The state for the AutokeyConfig.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig.State). |

### setState

Output only. The state for the AutokeyConfig.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig.State). |

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

### getEtag

Optional. A checksum computed by the server based on the value of other
fields. This may be sent on update requests to ensure that the client has
an up-to-date value before proceeding. The request will be rejected with an
ABORTED error on a mismatched etag.

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

### setEtag

Optional. A checksum computed by the server based on the value of other
fields. This may be sent on update requests to ensure that the client has
an up-to-date value before proceeding. The request will be rejected with an
ABORTED error on a mismatched etag.

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

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

### getKeyProjectResolutionMode

Optional. KeyProjectResolutionMode for the AutokeyConfig.

Valid values are `DEDICATED_KEY_PROJECT`, `RESOURCE_PROJECT`, or
`DISABLED`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [KeyProjectResolutionMode](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig.KeyProjectResolutionMode). |

### setKeyProjectResolutionMode

Optional. KeyProjectResolutionMode for the AutokeyConfig.

Valid values are `DEDICATED_KEY_PROJECT`, `RESOURCE_PROJECT`, or
`DISABLED`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [KeyProjectResolutionMode](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.AutokeyConfig.KeyProjectResolutionMode). |

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