# Google Cloud Dialogflow V2 Client - Class Authentication (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 Authentication.

Authentication information required for API calls

Generated from protobuf message `google.cloud.dialogflow.v2.Tool.Authentication`

## Namespace

Google \\ Cloud \\ Dialogflow \\ V2 \\ Tool

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ api_key_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.ApiKeyConfig` Config for API key auth. |
| `↳ oauth_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.OAuthConfig` Config for OAuth. |
| `↳ service_agent_auth_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.ServiceAgentAuthConfig` Config for [Diglogflow service agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent) auth. |
| `↳ bearer_token_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.BearerTokenConfig` Config for bearer token auth. |

### getApiKeyConfig

Config for API key auth.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.ApiKeyConfig|null` |   |

### hasApiKeyConfig

### setApiKeyConfig

Config for API key auth.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.ApiKeyConfig` |

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

### getOauthConfig

Config for OAuth.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.OAuthConfig|null` |   |

### hasOauthConfig

### setOauthConfig

Config for OAuth.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.OAuthConfig` |

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

### getServiceAgentAuthConfig

Config for [Diglogflow service
agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent)
auth.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.ServiceAgentAuthConfig|null` |   |

### hasServiceAgentAuthConfig

### setServiceAgentAuthConfig

Config for [Diglogflow service
agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent)
auth.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.ServiceAgentAuthConfig` |

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

### getBearerTokenConfig

Config for bearer token auth.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.BearerTokenConfig|null` |   |

### hasBearerTokenConfig

### setBearerTokenConfig

Config for bearer token auth.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow/latest/V2.Tool.Authentication.BearerTokenConfig` |

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

### getAuthConfig

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