0.5.3 (latest) 0.4.4 0.3.0 0.2.1 0.1.4 Reference documentation and code samples for the Google Cloud Api Hub V1 Client class ApiKeyConfig.

Config for authentication with API key.

Generated from protobuf message `google.cloud.apihub.v1.AuthConfig.ApiKeyConfig`

## Namespace

Google \\ Cloud \\ ApiHub \\ V1 \\ AuthConfig

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Required. The parameter name of the API key. E.g. If the API request is "<https://example.com/act?api_key> |
| `↳ api_key` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Secret` Required. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}`. The `secretmanager.versions.access` permission should be granted to the service account accessing the secret. |
| `↳ http_element_location` | `int` Required. The location of the API key. The default value is QUERY. |

### getName

Required. The parameter name of the API key.

E.g. If the API request is "<https://example.com/act?api_key>


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

### setName

Required. The parameter name of the API key.

E.g. If the API request is "<https://example.com/act?api_key>


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

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

### getApiKey

Required. The name of the SecretManager secret version resource storing
the API key. Format:
`projects/{project}/secrets/{secrete}/versions/{version}`. The
`secretmanager.versions.access` permission should be granted to the
service account accessing the secret.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Secret|null` |   |

### hasApiKey

### clearApiKey

### setApiKey

Required. The name of the SecretManager secret version resource storing
the API key. Format:
`projects/{project}/secrets/{secrete}/versions/{version}`. The
`secretmanager.versions.access` permission should be granted to the
service account accessing the secret.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-apihub/latest/V1.Secret` |

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

### getHttpElementLocation

Required. The location of the API key.

The default value is QUERY.

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

### setHttpElementLocation

Required. The location of the API key.

The default value is QUERY.

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

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