NAME
Google::Cloud::Dialogflow::V2::Webhook - Compiled Protocol Buffers messages for google/cloud/dialogflow/v2/webhook.proto
SYNOPSIS
use Google::Cloud::Dialogflow::V2::Webhook;
my $msg = Google::Cloud::Dialogflow::V2::Webhook::WebhookRequest->new({
session => $session,
response_id => $response_id,
query_result => $query_result,
original_detect_intent_request => $original_detect_intent_request,
});
# Read or update a field
my $val = $msg->session();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Cloud::Dialogflow::V2::Webhook::WebhookRequest->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/dialogflow/v2/webhook.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Cloud::Dialogflow::V2::Webhook::WebhookRequest
The request message for a webhook call.
Inherits from Protobuf::Message.
Accessors
$msg->session()/$msg->session($value)Type:
StringThe unique identifier of detectIntent request session. Can be used to identify end-user inside webhook implementation. Format: `projects/<Project ID>/agent/sessions/<Session ID>`, or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>`.
$msg->response_id()/$msg->response_id($value)Type:
StringThe unique identifier of the response. Contains the same value as `[Streaming]DetectIntentResponse.response_id`.
$msg->query_result()/$msg->query_result($value)Type:
Message(Google::Cloud::Dialogflow::V2::Session::QueryResult)The result of the conversational query or event processing. Contains the same value as `[Streaming]DetectIntentResponse.query_result`.
$msg->original_detect_intent_request()/$msg->original_detect_intent_request($value)Type:
Message(Google::Cloud::Dialogflow::V2::Webhook::OriginalDetectIntentRequest)Optional. The contents of the original request that was passed to `[Streaming]DetectIntent` call.
Google::Cloud::Dialogflow::V2::Webhook::WebhookResponse
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][google.cloud.dialogflow.v2.QueryResult.diagnostic_info] field. Setting JSON fields to an empty value with the wrong type is a common error. To avoid this error:
- Use `""` for empty strings - Use `{}` or `null` for empty objects - Use `[]` or `null` for empty arrays
For more information, see the [Protocol Buffers Language Guide](https://developers.google.com/protocol-buffers/docs/proto3#json).
Inherits from Protobuf::Message.
Accessors
$msg->fulfillment_text()/$msg->fulfillment_text($value)Type:
StringOptional. The text response message intended for the end-user. It is recommended to use `fulfillment_messages.text.text[0]` instead. When provided, Dialogflow uses this field to populate [QueryResult.fulfillment_text][google.cloud.dialogflow.v2.QueryResult.fulfillment_text] sent to the integration or API caller.
$msg->fulfillment_messages()/$msg->fulfillment_messages($value)Type:
Message(Google::Cloud::Dialogflow::V2::Intent::Intent::Message)Optional. The rich response messages intended for the end-user. When provided, Dialogflow uses this field to populate [QueryResult.fulfillment_messages][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages] sent to the integration or API caller.
$msg->source()/$msg->source($value)Type:
StringOptional. A custom field used to identify the webhook source. Arbitrary strings are supported. When provided, Dialogflow uses this field to populate [QueryResult.webhook_source][google.cloud.dialogflow.v2.QueryResult.webhook_source] sent to the integration or API caller.
$msg->payload()/$msg->payload($value)Type:
Message(Google::Protobuf::Struct::Struct)Optional. This field can be used to pass custom data from your webhook to the integration or API caller. Arbitrary JSON objects are supported. When provided, Dialogflow uses this field to populate [QueryResult.webhook_payload][google.cloud.dialogflow.v2.QueryResult.webhook_payload] sent to the integration or API caller. This field is also used by the [Google Assistant integration](https://cloud.google.com/dialogflow/docs/integrations/aog) for rich response messages. See the format definition at [Google Assistant Dialogflow webhook format](https://developers.google.com/assistant/actions/build/json/dialogflow-webhook-json)
$msg->output_contexts()/$msg->output_contexts($value)Type:
Message(Google::Cloud::Dialogflow::V2::Context::Context)Optional. The collection of output contexts that will overwrite currently active contexts for the session and reset their lifespans. When provided, Dialogflow uses this field to populate [QueryResult.output_contexts][google.cloud.dialogflow.v2.QueryResult.output_contexts] sent to the integration or API caller.
$msg->followup_event_input()/$msg->followup_event_input($value)Type:
Message(Google::Cloud::Dialogflow::V2::Session::EventInput)Optional. Invokes the supplied events. When this field is set, Dialogflow ignores the `fulfillment_text`, `fulfillment_messages`, and `payload` fields.
$msg->session_entity_types()/$msg->session_entity_types($value)Type:
Message(Google::Cloud::Dialogflow::V2::SessionEntityType::SessionEntityType)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. Setting this data from a webhook overwrites the session entity types that have been set using `detectIntent`, `streamingDetectIntent` or [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] management methods.
Google::Cloud::Dialogflow::V2::Webhook::OriginalDetectIntentRequest
Represents the contents of the original request that was passed to the `[Streaming]DetectIntent` call.
Inherits from Protobuf::Message.
Accessors
$msg->source()/$msg->source($value)Type:
StringThe source of this request, e.g., `google`, `facebook`, `slack`. It is set by Dialogflow-owned servers.
$msg->version()/$msg->version($value)Type:
StringOptional. The version of the protocol used for this request. This field is AoG-specific.
$msg->payload()/$msg->payload($value)Type:
Message(Google::Protobuf::Struct::Struct)Optional. This field is set to the value of the `QueryParameters.payload` field passed in the request. Some integrations that query a Dialogflow agent may provide additional information in the payload.
In particular, for the Dialogflow Phone Gateway integration, this field has the form: <pre>{ "telephony": { "caller_id": "+18558363987" } }</pre> Note: The caller ID field (`caller_id`) will be redacted for Trial Edition agents and populated with the caller ID in [E.164 format](https://en.wikipedia.org/wiki/E.164) for Essentials Edition agents.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Dialogflow::V2::Webhook::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.