# Google Cloud Ces V1 Client - Class ApiKeyConfig (0.2.0)

0.2.0 (latest) 0.1.1 Reference documentation and code samples for the Google Cloud Ces V1 Client class ApiKeyConfig.

Configurations for authentication with API key.

Generated from protobuf message `google.cloud.ces.v1.ApiKeyConfig`

## Namespace

Google \\ Cloud \\ Ces \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ key_name` | `string` Required. The parameter name or the header name of the API key. E.g., If the API request is "<https://example.com/act?X-Api-Key> |
| `↳ api_key_secret_version` | `string` Required. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secret}/versions/{version}` Note: You should grant `roles/secretmanager.secretAccessor` role to the CES service agent `service-<PROJECT-NUMBER>\@gcp-sa-ces.iam.gserviceaccount.com`. |
| `↳ request_location` | `int` Required. Key location in the request. |

### getKeyName

Required. The parameter name or the header name of the API key.

E.g., If the API request is "<https://example.com/act?X-Api-Key>


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

### setKeyName

Required. The parameter name or the header name of the API key.

E.g., If the API request is "<https://example.com/act?X-Api-Key>


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

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

### getApiKeySecretVersion

Required. The name of the SecretManager secret version resource storing the
API key. Format: `projects/{project}/secrets/{secret}/versions/{version}`
Note: You should grant `roles/secretmanager.secretAccessor` role to the CES
service agent
`service-<PROJECT-NUMBER>\@gcp-sa-ces.iam.gserviceaccount.com`.

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

### setApiKeySecretVersion

Required. The name of the SecretManager secret version resource storing the
API key. Format: `projects/{project}/secrets/{secret}/versions/{version}`
Note: You should grant `roles/secretmanager.secretAccessor` role to the CES
service agent
`service-<PROJECT-NUMBER>\@gcp-sa-ces.iam.gserviceaccount.com`.

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

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

### getRequestLocation

Required. Key location in the request.

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

### setRequestLocation

Required. Key location in the request.

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

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