Google Cloud Dialogflow Cx V3 Client - Class EventHandler (0.4.1)

Reference documentation and code samples for the Google Cloud Dialogflow Cx V3 Client class EventHandler.

An event handler specifies an event 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 associated with the event, it will be called.

  • If there is a target_page associated with the event, the session will transition into the specified page.

  • If there is a target_flow 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 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.

↳ target_page string

The target page to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

↳ target_flow string

The target flow to transition to. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

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
Google\Cloud\Dialogflow\Cx\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 Google\Cloud\Dialogflow\Cx\V3\Fulfillment
Returns
Type Description
$this

getTargetPage

The target page to transition to.

Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

Returns
Type Description
string

hasTargetPage

setTargetPage

The target page to transition to.

Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>.

Parameter
Name Description
var string
Returns
Type Description
$this

getTargetFlow

The target flow to transition to.

Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

Returns
Type Description
string

hasTargetFlow

setTargetFlow

The target flow to transition to.

Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>.

Parameter
Name Description
var string
Returns
Type Description
$this

getTarget

Returns
Type Description
string