Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowCxV3EventHandler

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/dialogflow_v2/classes.rb,
generated/google/apis/dialogflow_v2/representations.rb,
generated/google/apis/dialogflow_v2/representations.rb

Overview

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowCxV3EventHandler

Returns a new instance of GoogleCloudDialogflowCxV3EventHandler.



358
359
360
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 358

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#eventString

Required. The name of the event to handle. Corresponds to the JSON property event

Returns:

  • (String)


328
329
330
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 328

def event
  @event
end

#nameString

Output only. The unique identifier of this event handler. Corresponds to the JSON property name

Returns:

  • (String)


333
334
335
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 333

def name
  @name
end

#target_flowString

The target flow to transition to. Format: projects//locations//agents//flows/ . Corresponds to the JSON property targetFlow

Returns:

  • (String)


339
340
341
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 339

def target_flow
  @target_flow
end

#target_pageString

The target page to transition to. Format: projects//locations//agents//flows// pages/. Corresponds to the JSON property targetPage

Returns:

  • (String)


345
346
347
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 345

def target_page
  @target_page
end

#trigger_fulfillmentGoogle::Apis::DialogflowV2::GoogleCloudDialogflowCxV3Fulfillment

A fulfillment can do one or more of the following actions at the same time: * Generate rich message responses. * Set parameter values. * Call the webhook. Fulfillments can be called at various stages in the Page or Form lifecycle. For example, when a DetectIntentRequest drives a session to enter a new page, the page's entry fulfillment can add a static response to the QueryResult in the returning DetectIntentResponse, call the webhook (for example, to load user data from a database), or both. Corresponds to the JSON property triggerFulfillment



356
357
358
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 356

def trigger_fulfillment
  @trigger_fulfillment
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



363
364
365
366
367
368
369
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 363

def update!(**args)
  @event = args[:event] if args.key?(:event)
  @name = args[:name] if args.key?(:name)
  @target_flow = args[:target_flow] if args.key?(:target_flow)
  @target_page = args[:target_page] if args.key?(:target_page)
  @trigger_fulfillment = args[:trigger_fulfillment] if args.key?(:trigger_fulfillment)
end