# Google Cloud Dialogflow Cx V3 Client - Class GenericWebService (0.11.1)

0.11.1 (latest) 0.11.0 0.10.2 0.9.2 0.8.1 0.7.2 0.6.0 0.5.2 0.4.1 0.3.4 0.2.1 0.1.1 Reference documentation and code samples for the Google Cloud Dialogflow Cx V3 Client class GenericWebService.

Represents configuration for a generic web service.

Generated from protobuf message `google.cloud.dialogflow.cx.v3.Webhook.GenericWebService`

## Namespace

Google \\ Cloud \\ Dialogflow \\ Cx \\ V3 \\ Webhook

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ uri` | `string` Required. The webhook URI for receiving POST requests. It must use https protocol. |
| `↳ username` | `string` The user name for HTTP Basic authentication. |
| `↳ password` | `string` The password for HTTP Basic authentication. |
| `↳ secret_version_for_username_password` | `string` Optional. The SecretManager secret version resource storing the username:password pair for HTTP Basic authentication. Format: `projects/{project}/secrets/{secret}/versions/{version}` |
| `↳ request_headers` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` The HTTP request headers to send together with webhook requests. |
| `↳ secret_versions_for_request_headers` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. The HTTP request headers to send together with webhook requests. Header values are stored in SecretManager secret versions. When the same header name is specified in both `request_headers` and `secret_versions_for_request_headers`, the value in `secret_versions_for_request_headers` will be used. |
| `↳ allowed_ca_certs` | `string[]` Optional. Specifies a list of allowed custom CA certificates (in DER format) for HTTPS verification. This overrides the default SSL trust store. If this is empty or unspecified, Dialogflow will use Google's default trust store to verify certificates. N.B. Make sure the HTTPS server certificates are signed with "subject alt name". For instance a certificate can be self-signed using the following command, `openssl x509 -req -days 200 -in example.com.csr \ -signkey example.com.key \ -out example.com.crt \ -extfile <(printf "\nsubjectAltName='DNS:www.example.com'")` |
| `↳ oauth_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.OAuthConfig` Optional. The OAuth configuration of the webhook. If specified, Dialogflow will initiate the OAuth client credential flow to exchange an access token from the 3rd party platform and put it in the auth header. |
| `↳ service_agent_auth` | `int` Optional. Indicate the auth token type generated from the [Diglogflow service agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent). The generated token is sent in the Authorization header. |
| `↳ service_account_auth_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.ServiceAccountAuthConfig` Optional. Configuration for service account authentication. |
| `↳ webhook_type` | `int` Optional. Type of the webhook. |
| `↳ http_method` | `int` Optional. HTTP method for the flexible webhook calls. Standard webhook always uses POST. |
| `↳ request_body` | `string` Optional. Defines a custom JSON object as request body to send to flexible webhook. |
| `↳ parameter_mapping` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Optional. Maps the values extracted from specific fields of the flexible webhook response into session parameters. - Key: session parameter name - Value: field path in the webhook response |

### getUri

Required. The webhook URI for receiving POST requests. It must use https
protocol.

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

### setUri

Required. The webhook URI for receiving POST requests. It must use https
protocol.

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

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

### getUsername

The user name for HTTP Basic authentication.

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

### setUsername

The user name for HTTP Basic authentication.

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

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

### getPassword

The password for HTTP Basic authentication.

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

### setPassword

The password for HTTP Basic authentication.

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

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

### getSecretVersionForUsernamePassword

Optional. The SecretManager secret version resource storing the
username:password pair for HTTP Basic authentication. Format:
`projects/{project}/secrets/{secret}/versions/{version}`

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

### setSecretVersionForUsernamePassword

Optional. The SecretManager secret version resource storing the
username:password pair for HTTP Basic authentication. Format:
`projects/{project}/secrets/{secret}/versions/{version}`

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

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

### getRequestHeaders

The HTTP request headers to send together with webhook requests.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setRequestHeaders

The HTTP request headers to send together with webhook requests.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getSecretVersionsForRequestHeaders

Optional. The HTTP request headers to send together with webhook
requests. Header values are stored in SecretManager secret versions.

When the same header name is specified in both `request_headers` and
`secret_versions_for_request_headers`, the value in
`secret_versions_for_request_headers` will be used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setSecretVersionsForRequestHeaders

Optional. The HTTP request headers to send together with webhook
requests. Header values are stored in SecretManager secret versions.

When the same header name is specified in both `request_headers` and
`secret_versions_for_request_headers`, the value in
`secret_versions_for_request_headers` will be used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getAllowedCaCerts

Optional. Specifies a list of allowed custom CA certificates (in DER
format) for HTTPS verification. This overrides the default SSL trust
store. If this is empty or unspecified, Dialogflow will use Google's
default trust store to verify certificates. N.B. Make sure the HTTPS
server certificates are signed with "subject alt name". For instance a
certificate can be self-signed using the following command,

       openssl x509 -req -days 200 -in example.com.csr \
         -signkey example.com.key \
         -out example.com.crt \
         -extfile <(printf "\nsubjectAltName='DNS:www.example.com'")

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setAllowedCaCerts

Optional. Specifies a list of allowed custom CA certificates (in DER
format) for HTTPS verification. This overrides the default SSL trust
store. If this is empty or unspecified, Dialogflow will use Google's
default trust store to verify certificates. N.B. Make sure the HTTPS
server certificates are signed with "subject alt name". For instance a
certificate can be self-signed using the following command,

       openssl x509 -req -days 200 -in example.com.csr \
         -signkey example.com.key \
         -out example.com.crt \
         -extfile <(printf "\nsubjectAltName='DNS:www.example.com'")

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

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

### getOauthConfig

Optional. The OAuth configuration of the webhook. If specified,
Dialogflow will initiate the OAuth client credential flow to exchange an
access token from the 3rd party platform and put it in the auth header.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.OAuthConfig|null` |   |

### hasOauthConfig

### clearOauthConfig

### setOauthConfig

Optional. The OAuth configuration of the webhook. If specified,
Dialogflow will initiate the OAuth client credential flow to exchange an
access token from the 3rd party platform and put it in the auth header.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.OAuthConfig` |

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

### getServiceAgentAuth

Optional. Indicate the auth token type generated from the [Diglogflow
service
agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent).

The generated token is sent in the Authorization header.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [ServiceAgentAuth](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.ServiceAgentAuth). |

### setServiceAgentAuth

Optional. Indicate the auth token type generated from the [Diglogflow
service
agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent).

The generated token is sent in the Authorization header.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [ServiceAgentAuth](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.ServiceAgentAuth). |

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

### getServiceAccountAuthConfig

Optional. Configuration for service account authentication.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.ServiceAccountAuthConfig|null` |   |

### hasServiceAccountAuthConfig

### clearServiceAccountAuthConfig

### setServiceAccountAuthConfig

Optional. Configuration for service account authentication.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.ServiceAccountAuthConfig` |

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

### getWebhookType

Optional. Type of the webhook.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [WebhookType](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.WebhookType). |

### setWebhookType

Optional. Type of the webhook.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [WebhookType](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.WebhookType). |

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

### getHttpMethod

Optional. HTTP method for the flexible webhook calls. Standard webhook
always uses POST.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [HttpMethod](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.HttpMethod). |

### setHttpMethod

Optional. HTTP method for the flexible webhook calls. Standard webhook
always uses POST.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [HttpMethod](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Webhook.GenericWebService.HttpMethod). |

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

### getRequestBody

Optional. Defines a custom JSON object as request body to send to
flexible webhook.

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

### setRequestBody

Optional. Defines a custom JSON object as request body to send to
flexible webhook.

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

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

### getParameterMapping

Optional. Maps the values extracted from specific fields of the flexible
webhook response into session parameters.

- Key: session parameter name
- Value: field path in the webhook response

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setParameterMapping

Optional. Maps the values extracted from specific fields of the flexible
webhook response into session parameters.

- Key: session parameter name
- Value: field path in the webhook response

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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