# Google Cloud Dialogflow Cx V3 Client - Class EventHandler (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 EventHandler.

An event handler specifies an
[event](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.EventHandler#_Google_Cloud_Dialogflow_Cx_V3_EventHandler__getEvent__) that can be handled
during a session. When the specified event happens, the following actions are
taken in order:

- If there is a
  [`trigger_fulfillment`](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.EventHandler#_Google_Cloud_Dialogflow_Cx_V3_EventHandler__getTriggerFulfillment__)
  associated with the event, it will be called.

- If there is a
  [`target_page`](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.EventHandler#_Google_Cloud_Dialogflow_Cx_V3_EventHandler__getTargetPage__)
  associated with the event, the session will transition into the specified
  page.

- If there is a [`target_flow`](https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.EventHandler#_Google_Cloud_Dialogflow_Cx_V3_EventHandler__getTargetFlow__) associated with the event, the session will transition into the specified flow.

Generated from protobuf message `google.cloud.dialogflow.cx.v3.EventHandler`

## Namespace

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

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Output only. The unique identifier of this event handler. |
| `↳ event` | `string` Required. The name of the event to handle. |
| `↳ trigger_fulfillment` | `https://docs.cloud.google.com/php/docs/reference/cloud-dialogflow-cx/latest/V3.Fulfillment` The fulfillment to call when the event occurs. Handling webhook errors with a fulfillment enabled with webhook could cause infinite loop. It is invalid to specify such fulfillment for a handler handling webhooks. |
| `↳ target_page` | `string` The target page to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>`. |
| `↳ target_flow` | `string` The target flow to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`. |
| `↳ target_playbook` | `string` The target playbook to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`. |

### getName

Output only. The unique identifier of this event handler.

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

### setName

Output only. The unique identifier of this event handler.

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

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

### getEvent

Required. The name of the event to handle.

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

### setEvent

Required. The name of the event to handle.

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

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

### getTriggerFulfillment

The fulfillment to call when the event occurs.

Handling webhook errors with a fulfillment enabled with webhook could
cause infinite loop. It is invalid to specify such fulfillment for a
handler handling webhooks.

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

### hasTriggerFulfillment

### clearTriggerFulfillment

### setTriggerFulfillment

The fulfillment to call when the event occurs.

Handling webhook errors with a fulfillment enabled with webhook could
cause infinite loop. It is invalid to specify such fulfillment for a
handler handling webhooks.

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

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

### getTargetPage

The target page to transition to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>`.

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

### hasTargetPage

### setTargetPage

The target page to transition to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>`.

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

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

### getTargetFlow

The target flow to transition to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.

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

### hasTargetFlow

### setTargetFlow

The target flow to transition to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.

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

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

### getTargetPlaybook

The target playbook to transition to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.

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

### hasTargetPlaybook

### setTargetPlaybook

The target playbook to transition to.

Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.

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

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

### getTarget

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