Class WebhookResponse (4.3.1)

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.v2.WebhookResponse

Fields

FOLLOWUP_EVENT_INPUT_FIELD_NUMBER

public static final int FOLLOWUP_EVENT_INPUT_FIELD_NUMBER
Field Value
TypeDescription
int

FULFILLMENT_MESSAGES_FIELD_NUMBER

public static final int FULFILLMENT_MESSAGES_FIELD_NUMBER
Field Value
TypeDescription
int

FULFILLMENT_TEXT_FIELD_NUMBER

public static final int FULFILLMENT_TEXT_FIELD_NUMBER
Field Value
TypeDescription
int

OUTPUT_CONTEXTS_FIELD_NUMBER

public static final int OUTPUT_CONTEXTS_FIELD_NUMBER
Field Value
TypeDescription
int

PAYLOAD_FIELD_NUMBER

public static final int PAYLOAD_FIELD_NUMBER
Field Value
TypeDescription
int

SESSION_ENTITY_TYPES_FIELD_NUMBER

public static final int SESSION_ENTITY_TYPES_FIELD_NUMBER
Field Value
TypeDescription
int

SOURCE_FIELD_NUMBER

public static final int SOURCE_FIELD_NUMBER
Field Value
TypeDescription
int

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstance()

public static WebhookResponse getDefaultInstance()
Returns
TypeDescription
WebhookResponse

getDefaultInstanceForType()

public WebhookResponse getDefaultInstanceForType()
Returns
TypeDescription
WebhookResponse

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

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.v2.EventInput followup_event_input = 6;

Returns
TypeDescription
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.v2.EventInput followup_event_input = 6;

Returns
TypeDescription
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.v2.Intent.Message fulfillment_messages = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.Intent.Message fulfillment_messages = 2;

Returns
TypeDescription
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.v2.Intent.Message fulfillment_messages = 2;

Returns
TypeDescription
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.v2.Intent.Message fulfillment_messages = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.Intent.Message fulfillment_messages = 2;

Returns
TypeDescription
List<? extends com.google.cloud.dialogflow.v2.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
TypeDescription
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
TypeDescription
ByteString

The bytes for fulfillmentText.

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.v2.Context output_contexts = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.Context output_contexts = 5;

Returns
TypeDescription
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.v2.Context output_contexts = 5;

Returns
TypeDescription
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.v2.Context output_contexts = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.Context output_contexts = 5;

Returns
TypeDescription
List<? extends com.google.cloud.dialogflow.v2.ContextOrBuilder>

getParserForType()

public Parser<WebhookResponse> getParserForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
StructOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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.v2.SessionEntityType session_entity_types = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.SessionEntityType session_entity_types = 10;

Returns
TypeDescription
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.v2.SessionEntityType session_entity_types = 10;

Returns
TypeDescription
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.v2.SessionEntityType session_entity_types = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.v2.SessionEntityType session_entity_types = 10;

Returns
TypeDescription
List<? extends com.google.cloud.dialogflow.v2.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
TypeDescription
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
TypeDescription
ByteString

The bytes for source.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

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.v2.EventInput followup_event_input = 6;

Returns
TypeDescription
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
TypeDescription
boolean

Whether the payload field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilder()

public static WebhookResponse.Builder newBuilder()
Returns
TypeDescription
WebhookResponse.Builder

newBuilder(WebhookResponse prototype)

public static WebhookResponse.Builder newBuilder(WebhookResponse prototype)
Parameter
NameDescription
prototypeWebhookResponse
Returns
TypeDescription
WebhookResponse.Builder

newBuilderForType()

public WebhookResponse.Builder newBuilderForType()
Returns
TypeDescription
WebhookResponse.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected WebhookResponse.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
WebhookResponse.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

parseDelimitedFrom(InputStream input)

public static WebhookResponse parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static WebhookResponse parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static WebhookResponse parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static WebhookResponse parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static WebhookResponse parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static WebhookResponse parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static WebhookResponse parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
WebhookResponse
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<WebhookResponse> parser()
Returns
TypeDescription
Parser<WebhookResponse>

toBuilder()

public WebhookResponse.Builder toBuilder()
Returns
TypeDescription
WebhookResponse.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException