Class WebhookResponse (4.61.0)

public final class WebhookResponse extends GeneratedMessageV3 implements WebhookResponseOrBuilder

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:

Protobuf type google.cloud.dialogflow.v2beta1.WebhookResponse

Static Fields

END_INTERACTION_FIELD_NUMBER

public static final int END_INTERACTION_FIELD_NUMBER
Field Value
Type Description
int

FOLLOWUP_EVENT_INPUT_FIELD_NUMBER

public static final int FOLLOWUP_EVENT_INPUT_FIELD_NUMBER
Field Value
Type Description
int

FULFILLMENT_MESSAGES_FIELD_NUMBER

public static final int FULFILLMENT_MESSAGES_FIELD_NUMBER
Field Value
Type Description
int

FULFILLMENT_TEXT_FIELD_NUMBER

public static final int FULFILLMENT_TEXT_FIELD_NUMBER
Field Value
Type Description
int

LIVE_AGENT_HANDOFF_FIELD_NUMBER

public static final int LIVE_AGENT_HANDOFF_FIELD_NUMBER
Field Value
Type Description
int

OUTPUT_CONTEXTS_FIELD_NUMBER

public static final int OUTPUT_CONTEXTS_FIELD_NUMBER
Field Value
Type Description
int

PAYLOAD_FIELD_NUMBER

public static final int PAYLOAD_FIELD_NUMBER
Field Value
Type Description
int

SESSION_ENTITY_TYPES_FIELD_NUMBER

public static final int SESSION_ENTITY_TYPES_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_FIELD_NUMBER

public static final int SOURCE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static WebhookResponse getDefaultInstance()
Returns
Type Description
WebhookResponse

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static WebhookResponse.Builder newBuilder()
Returns
Type Description
WebhookResponse.Builder

newBuilder(WebhookResponse prototype)

public static WebhookResponse.Builder newBuilder(WebhookResponse prototype)
Parameter
Name Description
prototype WebhookResponse
Returns
Type Description
WebhookResponse.Builder

parseDelimitedFrom(InputStream input)

public static WebhookResponse parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
WebhookResponse
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WebhookResponse
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static WebhookResponse parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
WebhookResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WebhookResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static WebhookResponse parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
WebhookResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WebhookResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static WebhookResponse parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
WebhookResponse
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WebhookResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static WebhookResponse parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
WebhookResponse
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WebhookResponse
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static WebhookResponse parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
WebhookResponse
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
WebhookResponse
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<WebhookResponse> parser()
Returns
Type Description
Parser<WebhookResponse>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public WebhookResponse getDefaultInstanceForType()
Returns
Type Description
WebhookResponse

getEndInteraction()

public boolean getEndInteraction()

Optional. Indicates that this intent ends an interaction. Some integrations (e.g., Actions on Google or Dialogflow phone gateway) use this information to close interaction with an end user. Default is false.

bool end_interaction = 8;

Returns
Type Description
boolean

The endInteraction.

getFollowupEventInput()

public EventInput getFollowupEventInput()

Optional. Invokes the supplied events. When this field is set, Dialogflow ignores the fulfillment_text, fulfillment_messages, and payload fields.

.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;

Returns
Type Description
EventInput

The followupEventInput.

getFollowupEventInputOrBuilder()

public EventInputOrBuilder getFollowupEventInputOrBuilder()

Optional. Invokes the supplied events. When this field is set, Dialogflow ignores the fulfillment_text, fulfillment_messages, and payload fields.

.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;

Returns
Type Description
EventInputOrBuilder

getFulfillmentMessages(int index)

public Intent.Message getFulfillmentMessages(int index)

Optional. The rich response messages intended for the end-user. When provided, Dialogflow uses this field to populate QueryResult.fulfillment_messages sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;

Parameter
Name Description
index int
Returns
Type Description
Intent.Message

getFulfillmentMessagesCount()

public int getFulfillmentMessagesCount()

Optional. The rich response messages intended for the end-user. When provided, Dialogflow uses this field to populate QueryResult.fulfillment_messages sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;

Returns
Type Description
int

getFulfillmentMessagesList()

public List<Intent.Message> getFulfillmentMessagesList()

Optional. The rich response messages intended for the end-user. When provided, Dialogflow uses this field to populate QueryResult.fulfillment_messages sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;

Returns
Type Description
List<Message>

getFulfillmentMessagesOrBuilder(int index)

public Intent.MessageOrBuilder getFulfillmentMessagesOrBuilder(int index)

Optional. The rich response messages intended for the end-user. When provided, Dialogflow uses this field to populate QueryResult.fulfillment_messages sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;

Parameter
Name Description
index int
Returns
Type Description
Intent.MessageOrBuilder

getFulfillmentMessagesOrBuilderList()

public List<? extends Intent.MessageOrBuilder> getFulfillmentMessagesOrBuilderList()

Optional. The rich response messages intended for the end-user. When provided, Dialogflow uses this field to populate QueryResult.fulfillment_messages sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;

Returns
Type Description
List<? extends com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder>

getFulfillmentText()

public String getFulfillmentText()

Optional. 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 sent to the integration or API caller.

string fulfillment_text = 1;

Returns
Type Description
String

The fulfillmentText.

getFulfillmentTextBytes()

public ByteString getFulfillmentTextBytes()

Optional. 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 sent to the integration or API caller.

string fulfillment_text = 1;

Returns
Type Description
ByteString

The bytes for fulfillmentText.

getLiveAgentHandoff()

public boolean getLiveAgentHandoff()

Indicates that a live agent should be brought in to handle the interaction with the user. In most cases, when you set this flag to true, you would also want to set end_interaction to true as well. Default is false.

bool live_agent_handoff = 7;

Returns
Type Description
boolean

The liveAgentHandoff.

getOutputContexts(int index)

public Context getOutputContexts(int index)

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 sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;

Parameter
Name Description
index int
Returns
Type Description
Context

getOutputContextsCount()

public int getOutputContextsCount()

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 sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;

Returns
Type Description
int

getOutputContextsList()

public List<Context> getOutputContextsList()

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 sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;

Returns
Type Description
List<Context>

getOutputContextsOrBuilder(int index)

public ContextOrBuilder getOutputContextsOrBuilder(int index)

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 sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;

Parameter
Name Description
index int
Returns
Type Description
ContextOrBuilder

getOutputContextsOrBuilderList()

public List<? extends ContextOrBuilder> getOutputContextsOrBuilderList()

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 sent to the integration or API caller.

repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;

Returns
Type Description
List<? extends com.google.cloud.dialogflow.v2beta1.ContextOrBuilder>

getParserForType()

public Parser<WebhookResponse> getParserForType()
Returns
Type Description
Parser<WebhookResponse>
Overrides

getPayload()

public Struct getPayload()

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 sent to the integration or API caller. This field is also used by the Google Assistant integration for rich response messages. See the format definition at Google Assistant Dialogflow webhook format

.google.protobuf.Struct payload = 4;

Returns
Type Description
Struct

The payload.

getPayloadOrBuilder()

public StructOrBuilder getPayloadOrBuilder()

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 sent to the integration or API caller. This field is also used by the Google Assistant integration for rich response messages. See the format definition at Google Assistant Dialogflow webhook format

.google.protobuf.Struct payload = 4;

Returns
Type Description
StructOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getSessionEntityTypes(int index)

public SessionEntityType getSessionEntityTypes(int index)

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 management methods.

repeated .google.cloud.dialogflow.v2beta1.SessionEntityType session_entity_types = 10;

Parameter
Name Description
index int
Returns
Type Description
SessionEntityType

getSessionEntityTypesCount()

public int getSessionEntityTypesCount()

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 management methods.

repeated .google.cloud.dialogflow.v2beta1.SessionEntityType session_entity_types = 10;

Returns
Type Description
int

getSessionEntityTypesList()

public List<SessionEntityType> getSessionEntityTypesList()

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 management methods.

repeated .google.cloud.dialogflow.v2beta1.SessionEntityType session_entity_types = 10;

Returns
Type Description
List<SessionEntityType>

getSessionEntityTypesOrBuilder(int index)

public SessionEntityTypeOrBuilder getSessionEntityTypesOrBuilder(int index)

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 management methods.

repeated .google.cloud.dialogflow.v2beta1.SessionEntityType session_entity_types = 10;

Parameter
Name Description
index int
Returns
Type Description
SessionEntityTypeOrBuilder

getSessionEntityTypesOrBuilderList()

public List<? extends SessionEntityTypeOrBuilder> getSessionEntityTypesOrBuilderList()

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 management methods.

repeated .google.cloud.dialogflow.v2beta1.SessionEntityType session_entity_types = 10;

Returns
Type Description
List<? extends com.google.cloud.dialogflow.v2beta1.SessionEntityTypeOrBuilder>

getSource()

public String getSource()

Optional. A custom field used to identify the webhook source. Arbitrary strings are supported. When provided, Dialogflow uses this field to populate QueryResult.webhook_source sent to the integration or API caller.

string source = 3;

Returns
Type Description
String

The source.

getSourceBytes()

public ByteString getSourceBytes()

Optional. A custom field used to identify the webhook source. Arbitrary strings are supported. When provided, Dialogflow uses this field to populate QueryResult.webhook_source sent to the integration or API caller.

string source = 3;

Returns
Type Description
ByteString

The bytes for source.

hasFollowupEventInput()

public boolean hasFollowupEventInput()

Optional. Invokes the supplied events. When this field is set, Dialogflow ignores the fulfillment_text, fulfillment_messages, and payload fields.

.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;

Returns
Type Description
boolean

Whether the followupEventInput field is set.

hasPayload()

public boolean hasPayload()

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 sent to the integration or API caller. This field is also used by the Google Assistant integration for rich response messages. See the format definition at Google Assistant Dialogflow webhook format

.google.protobuf.Struct payload = 4;

Returns
Type Description
boolean

Whether the payload field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public WebhookResponse.Builder newBuilderForType()
Returns
Type Description
WebhookResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected WebhookResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
WebhookResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public WebhookResponse.Builder toBuilder()
Returns
Type Description
WebhookResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException