Class WebhookResponse

  • All Implemented Interfaces:
    WebhookResponseOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class WebhookResponse
    extends com.google.protobuf.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][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).
     
    Protobuf type google.cloud.dialogflow.v2.WebhookResponse
    See Also:
    Serialized Form
    • Field Detail

      • FULFILLMENT_TEXT_FIELD_NUMBER

        public static final int FULFILLMENT_TEXT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • FULFILLMENT_MESSAGES_FIELD_NUMBER

        public static final int FULFILLMENT_MESSAGES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • OUTPUT_CONTEXTS_FIELD_NUMBER

        public static final int OUTPUT_CONTEXTS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • FOLLOWUP_EVENT_INPUT_FIELD_NUMBER

        public static final int FOLLOWUP_EVENT_INPUT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SESSION_ENTITY_TYPES_FIELD_NUMBER

        public static final int SESSION_ENTITY_TYPES_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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][google.cloud.dialogflow.v2.QueryResult.fulfillment_text]
         sent to the integration or API caller.
         
        string fulfillment_text = 1;
        Specified by:
        getFulfillmentText in interface WebhookResponseOrBuilder
        Returns:
        The fulfillmentText.
      • getFulfillmentTextBytes

        public com.google.protobuf.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][google.cloud.dialogflow.v2.QueryResult.fulfillment_text]
         sent to the integration or API caller.
         
        string fulfillment_text = 1;
        Specified by:
        getFulfillmentTextBytes in interface WebhookResponseOrBuilder
        Returns:
        The bytes for fulfillmentText.
      • 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][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
        Specified by:
        getFulfillmentMessagesList in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
        Specified by:
        getFulfillmentMessagesOrBuilderList in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
        Specified by:
        getFulfillmentMessagesCount in interface WebhookResponseOrBuilder
      • getFulfillmentMessages

        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][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
        Specified by:
        getFulfillmentMessages in interface WebhookResponseOrBuilder
      • getFulfillmentMessagesOrBuilder

        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][google.cloud.dialogflow.v2.QueryResult.fulfillment_messages]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
        Specified by:
        getFulfillmentMessagesOrBuilder in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.QueryResult.webhook_source]
         sent to the integration or API caller.
         
        string source = 3;
        Specified by:
        getSource in interface WebhookResponseOrBuilder
        Returns:
        The source.
      • getSourceBytes

        public com.google.protobuf.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][google.cloud.dialogflow.v2.QueryResult.webhook_source]
         sent to the integration or API caller.
         
        string source = 3;
        Specified by:
        getSourceBytes in interface WebhookResponseOrBuilder
        Returns:
        The bytes for source.
      • 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][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)
         
        .google.protobuf.Struct payload = 4;
        Specified by:
        hasPayload in interface WebhookResponseOrBuilder
        Returns:
        Whether the payload field is set.
      • getPayload

        public com.google.protobuf.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][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)
         
        .google.protobuf.Struct payload = 4;
        Specified by:
        getPayload in interface WebhookResponseOrBuilder
        Returns:
        The payload.
      • getPayloadOrBuilder

        public com.google.protobuf.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][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)
         
        .google.protobuf.Struct payload = 4;
        Specified by:
        getPayloadOrBuilder in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.QueryResult.output_contexts]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
        Specified by:
        getOutputContextsList in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.QueryResult.output_contexts]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
        Specified by:
        getOutputContextsOrBuilderList in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.QueryResult.output_contexts]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
        Specified by:
        getOutputContextsCount in interface WebhookResponseOrBuilder
      • getOutputContexts

        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][google.cloud.dialogflow.v2.QueryResult.output_contexts]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
        Specified by:
        getOutputContexts in interface WebhookResponseOrBuilder
      • getOutputContextsOrBuilder

        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][google.cloud.dialogflow.v2.QueryResult.output_contexts]
         sent to the integration or API caller.
         
        repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
        Specified by:
        getOutputContextsOrBuilder in interface WebhookResponseOrBuilder
      • 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;
        Specified by:
        hasFollowupEventInput in interface WebhookResponseOrBuilder
        Returns:
        Whether the followupEventInput field is set.
      • 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;
        Specified by:
        getFollowupEventInput in interface WebhookResponseOrBuilder
        Returns:
        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;
        Specified by:
        getFollowupEventInputOrBuilder in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.SessionEntityType]
         management methods.
         
        repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10;
        Specified by:
        getSessionEntityTypesList in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.SessionEntityType]
         management methods.
         
        repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10;
        Specified by:
        getSessionEntityTypesOrBuilderList in interface WebhookResponseOrBuilder
      • 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][google.cloud.dialogflow.v2.SessionEntityType]
         management methods.
         
        repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10;
        Specified by:
        getSessionEntityTypesCount in interface WebhookResponseOrBuilder
      • getSessionEntityTypes

        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][google.cloud.dialogflow.v2.SessionEntityType]
         management methods.
         
        repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10;
        Specified by:
        getSessionEntityTypes in interface WebhookResponseOrBuilder
      • getSessionEntityTypesOrBuilder

        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][google.cloud.dialogflow.v2.SessionEntityType]
         management methods.
         
        repeated .google.cloud.dialogflow.v2.SessionEntityType session_entity_types = 10;
        Specified by:
        getSessionEntityTypesOrBuilder in interface WebhookResponseOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static WebhookResponse parseFrom​(ByteBuffer data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static WebhookResponse parseFrom​(ByteBuffer data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static WebhookResponse parseFrom​(com.google.protobuf.ByteString data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static WebhookResponse parseFrom​(com.google.protobuf.ByteString data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static WebhookResponse parseFrom​(byte[] data)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static WebhookResponse parseFrom​(byte[] data,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static WebhookResponse parseFrom​(com.google.protobuf.CodedInputStream input,
                                                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                         throws IOException
        Throws:
        IOException
      • newBuilderForType

        public WebhookResponse.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public WebhookResponse.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected WebhookResponse.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • parser

        public static com.google.protobuf.Parser<WebhookResponse> parser()
      • getParserForType

        public com.google.protobuf.Parser<WebhookResponse> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public WebhookResponse getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder