Google Cloud Dialogflow Cx V3 Client - Class EventHandler (0.2.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
NameDescription
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
TypeDescription
string

setName

Output only. The unique identifier of this event handler.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getEvent

Required. The name of the event to handle.

Returns
TypeDescription
string

setEvent

Required. The name of the event to handle.

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Cloud\Dialogflow\Cx\V3\Fulfillment
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getTargetFlow

The target flow to transition to.

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

Returns
TypeDescription
string

hasTargetFlow

setTargetFlow

The target flow to transition to.

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getTarget

Returns
TypeDescription
string