# Dialogflow CX V3 API - Class Google::Cloud::Dialogflow::CX::V3::EventHandler (v1.12.1)

1.12.1 (latest) 1.12.0 1.11.0 1.10.1 1.9.0 1.8.0 1.7.0 1.6.1 1.5.0 1.4.0 1.3.0 1.2.0 1.1.1 1.0.0 0.26.0 0.25.0 0.24.2 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0 0.16.0 0.15.1 0.14.0 0.13.0 0.12.0 0.11.0 0.10.2 0.9.0 0.8.1 0.7.1 0.6.0 0.5.0 0.4.0 Reference documentation and code samples for the Dialogflow CX V3 API class Google::Cloud::Dialogflow::CX::V3::EventHandler.

An event handler specifies an
[event](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest/Google-Cloud-Dialogflow-CX-V3-EventHandler#Google__Cloud__Dialogflow__CX__V3__EventHandler_event_instance_ "Google::Cloud::Dialogflow::CX::V3::EventHandler#event (method)") 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/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest/Google-Cloud-Dialogflow-CX-V3-EventHandler#Google__Cloud__Dialogflow__CX__V3__EventHandler_trigger_fulfillment_instance_ "Google::Cloud::Dialogflow::CX::V3::EventHandler#trigger_fulfillment (method)") associated with the event, it will be called.
- If there is a [`target_page`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest/Google-Cloud-Dialogflow-CX-V3-EventHandler#Google__Cloud__Dialogflow__CX__V3__EventHandler_target_page_instance_ "Google::Cloud::Dialogflow::CX::V3::EventHandler#target_page (method)") associated with the event, the session will transition into the specified page.
- If there is a [`target_flow`](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest/Google-Cloud-Dialogflow-CX-V3-EventHandler#Google__Cloud__Dialogflow__CX__V3__EventHandler_target_flow_instance_ "Google::Cloud::Dialogflow::CX::V3::EventHandler#target_flow (method)") associated with the event, the session will transition into the specified flow.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #event

    def event() -> ::String

**Returns**

- (::String) --- Required. The name of the event to handle.

### #event=

    def event=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. The name of the event to handle.
**Returns**

- (::String) --- Required. The name of the event to handle.

### #name

    def name() -> ::String

**Returns**

- (::String) --- Output only. The unique identifier of this event handler.

### #target_flow

    def target_flow() -> ::String

**Returns**

- (::String) --- The target flow to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.


  Note: The following fields are mutually exclusive: `target_flow`, `target_page`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #target_flow=

    def target_flow=(value) -> ::String

**Parameter**

- **value** (::String) --- The target flow to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.


  Note: The following fields are mutually exclusive: `target_flow`, `target_page`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- The target flow to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>`.


  Note: The following fields are mutually exclusive: `target_flow`, `target_page`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #target_page

    def target_page() -> ::String

**Returns**

- (::String) --- The target page to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>`.


  Note: The following fields are mutually exclusive: `target_page`, `target_flow`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #target_page=

    def target_page=(value) -> ::String

**Parameter**

- **value** (::String) --- The target page to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>`.


  Note: The following fields are mutually exclusive: `target_page`, `target_flow`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- The target page to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/flows/<FlowID>/pages/<PageID>`.


  Note: The following fields are mutually exclusive: `target_page`, `target_flow`, `target_playbook`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #target_playbook

    def target_playbook() -> ::String

**Returns**

- (::String) --- The target playbook to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.


  Note: The following fields are mutually exclusive: `target_playbook`, `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #target_playbook=

    def target_playbook=(value) -> ::String

**Parameter**

- **value** (::String) --- The target playbook to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.


  Note: The following fields are mutually exclusive: `target_playbook`, `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared.
**Returns**

- (::String) --- The target playbook to transition to. Format: `projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.


  Note: The following fields are mutually exclusive: `target_playbook`, `target_page`, `target_flow`. If a field in that set is populated, all other fields in the set will automatically be cleared.

### #trigger_fulfillment

    def trigger_fulfillment() -> ::Google::Cloud::Dialogflow::CX::V3::Fulfillment

**Returns**

- ([::Google::Cloud::Dialogflow::CX::V3::Fulfillment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest/Google-Cloud-Dialogflow-CX-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.

### #trigger_fulfillment=

    def trigger_fulfillment=(value) -> ::Google::Cloud::Dialogflow::CX::V3::Fulfillment

**Parameter**

- **value** ([::Google::Cloud::Dialogflow::CX::V3::Fulfillment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest/Google-Cloud-Dialogflow-CX-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.
**Returns**

- ([::Google::Cloud::Dialogflow::CX::V3::Fulfillment](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-dialogflow-cx-v3/latest/Google-Cloud-Dialogflow-CX-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.