Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2WebhookResponse

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

The response message for a webhook call. This response is validated by the Dialogflow server. If validation fails, an error will be returned in the QueryResult.diagnostic_info field. Setting JSON fields to an empty value with the wrong type is a common error. To avoid this error:

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowV2WebhookResponse

Returns a new instance of GoogleCloudDialogflowV2WebhookResponse.



3443
3444
3445
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3443

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

Instance Attribute Details

#followup_event_inputGoogle::Apis::DialogflowV2::GoogleCloudDialogflowV2EventInput

Events allow for matching intents by event name instead of the natural language input. For instance, input <event: name: "welcome_event", parameters: name: "Sam" > can trigger a personalized welcome response. The parameter name may be used by the agent in the response: "Hello #welcome_event.name! What can I do for you today?". Corresponds to the JSON property followupEventInput



3383
3384
3385
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3383

def followup_event_input
  @followup_event_input
end

#fulfillment_messagesArray<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2IntentMessage>

Optional. The collection of rich messages to present to the user. This value is passed directly to QueryResult.fulfillment_messages. Corresponds to the JSON property fulfillmentMessages



3389
3390
3391
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3389

def fulfillment_messages
  @fulfillment_messages
end

#fulfillment_textString

Optional. The text to be shown on the screen. This value is passed directly to QueryResult.fulfillment_text. Corresponds to the JSON property fulfillmentText

Returns:

  • (String)


3395
3396
3397
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3395

def fulfillment_text
  @fulfillment_text
end

#output_contextsArray<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Context>

Optional. The collection of output contexts. This value is passed directly to QueryResult.output_contexts. Corresponds to the JSON property outputContexts



3401
3402
3403
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3401

def output_contexts
  @output_contexts
end

#payloadHash<String,Object>

Optional. This value is passed directly to QueryResult.webhook_payload. See the related fulfillment_messages[i].payload field, which may be used as an alternative to this field. This field can be used for Actions on Google responses. It should have a structure similar to the JSON message shown here. For more information, see Actions on Google Webhook Format

`
"google": `
"expectUserResponse": true,
"richResponse": `
"items": [
`
"simpleResponse": `
"textToSpeech": "this is a simple response"
`
`
]
`
`
`

Corresponds to the JSON property payload

Returns:

  • (Hash<String,Object>)


3427
3428
3429
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3427

def payload
  @payload
end

#session_entity_typesArray<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2SessionEntityType>

Optional. Additional session entity types to replace or extend developer entity types with. The entity synonyms apply to all languages and persist for the session of this query. Setting the session entity types inside webhook overwrites the session entity types that have been set through DetectIntentRequest.query_params.session_entity_types. Corresponds to the JSON property sessionEntityTypes



3436
3437
3438
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3436

def session_entity_types
  @session_entity_types
end

#sourceString

Optional. This value is passed directly to QueryResult.webhook_source. Corresponds to the JSON property source

Returns:

  • (String)


3441
3442
3443
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3441

def source
  @source
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3448
3449
3450
3451
3452
3453
3454
3455
3456
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3448

def update!(**args)
  @followup_event_input = args[:followup_event_input] if args.key?(:followup_event_input)
  @fulfillment_messages = args[:fulfillment_messages] if args.key?(:fulfillment_messages)
  @fulfillment_text = args[:fulfillment_text] if args.key?(:fulfillment_text)
  @output_contexts = args[:output_contexts] if args.key?(:output_contexts)
  @payload = args[:payload] if args.key?(:payload)
  @session_entity_types = args[:session_entity_types] if args.key?(:session_entity_types)
  @source = args[:source] if args.key?(:source)
end