Class Fulfillment

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

    public final class Fulfillment
    extends com.google.protobuf.GeneratedMessageV3
    implements FulfillmentOrBuilder
     A fulfillment can do one or more of the following actions at the same time:
    
       * Generate rich message responses.
       * Set parameter values.
       * Call the webhook.
    
     Fulfillments can be called at various stages in the
     [Page][google.cloud.dialogflow.cx.v3beta1.Page] or
     [Form][google.cloud.dialogflow.cx.v3beta1.Form] lifecycle. For example, when
     a
     [DetectIntentRequest][google.cloud.dialogflow.cx.v3beta1.DetectIntentRequest]
     drives a session to enter a new page, the page's entry fulfillment can add a
     static response to the
     [QueryResult][google.cloud.dialogflow.cx.v3beta1.QueryResult] in the
     returning
     [DetectIntentResponse][google.cloud.dialogflow.cx.v3beta1.DetectIntentResponse],
     call the webhook (for example, to load user data from a database), or both.
     
    Protobuf type google.cloud.dialogflow.cx.v3beta1.Fulfillment
    See Also:
    Serialized Form
    • Field Detail

      • RETURN_PARTIAL_RESPONSES_FIELD_NUMBER

        public static final int RETURN_PARTIAL_RESPONSES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SET_PARAMETER_ACTIONS_FIELD_NUMBER

        public static final int SET_PARAMETER_ACTIONS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • CONDITIONAL_CASES_FIELD_NUMBER

        public static final int CONDITIONAL_CASES_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
      • getMessagesCount

        public int getMessagesCount()
         The list of rich message responses to present to the user.
         
        repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;
        Specified by:
        getMessagesCount in interface FulfillmentOrBuilder
      • getMessages

        public ResponseMessage getMessages​(int index)
         The list of rich message responses to present to the user.
         
        repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;
        Specified by:
        getMessages in interface FulfillmentOrBuilder
      • getWebhook

        public String getWebhook()
         The webhook to call.
         Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
         ID>/webhooks/<Webhook ID>`.
         
        string webhook = 2 [(.google.api.resource_reference) = { ... }
        Specified by:
        getWebhook in interface FulfillmentOrBuilder
        Returns:
        The webhook.
      • getWebhookBytes

        public com.google.protobuf.ByteString getWebhookBytes()
         The webhook to call.
         Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
         ID>/webhooks/<Webhook ID>`.
         
        string webhook = 2 [(.google.api.resource_reference) = { ... }
        Specified by:
        getWebhookBytes in interface FulfillmentOrBuilder
        Returns:
        The bytes for webhook.
      • getReturnPartialResponses

        public boolean getReturnPartialResponses()
         Whether Dialogflow should return currently queued fulfillment response
         messages in streaming APIs. If a webhook is specified, it happens before
         Dialogflow invokes webhook.
         Warning:
         1) This flag only affects streaming API. Responses are still queued
         and returned once in non-streaming API.
         2) The flag can be enabled in any fulfillment but only the first 3 partial
         responses will be returned. You may only want to apply it to fulfillments
         that have slow webhooks.
         
        bool return_partial_responses = 8;
        Specified by:
        getReturnPartialResponses in interface FulfillmentOrBuilder
        Returns:
        The returnPartialResponses.
      • getTag

        public String getTag()
         The value of this field will be populated in the
         [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]
         `fulfillmentInfo.tag` field by Dialogflow when the associated webhook is
         called.
         The tag is typically used by the webhook service to identify which
         fulfillment is being called, but it could be used for other purposes.
         This field is required if `webhook` is specified.
         
        string tag = 3;
        Specified by:
        getTag in interface FulfillmentOrBuilder
        Returns:
        The tag.
      • getTagBytes

        public com.google.protobuf.ByteString getTagBytes()
         The value of this field will be populated in the
         [WebhookRequest][google.cloud.dialogflow.cx.v3beta1.WebhookRequest]
         `fulfillmentInfo.tag` field by Dialogflow when the associated webhook is
         called.
         The tag is typically used by the webhook service to identify which
         fulfillment is being called, but it could be used for other purposes.
         This field is required if `webhook` is specified.
         
        string tag = 3;
        Specified by:
        getTagBytes in interface FulfillmentOrBuilder
        Returns:
        The bytes for tag.
      • getSetParameterActionsCount

        public int getSetParameterActionsCount()
         Set parameter values before executing the webhook.
         
        repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.SetParameterAction set_parameter_actions = 4;
        Specified by:
        getSetParameterActionsCount in interface FulfillmentOrBuilder
      • getConditionalCasesCount

        public int getConditionalCasesCount()
         Conditional cases for this fulfillment.
         
        repeated .google.cloud.dialogflow.cx.v3beta1.Fulfillment.ConditionalCases conditional_cases = 5;
        Specified by:
        getConditionalCasesCount in interface FulfillmentOrBuilder
      • 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 Fulfillment parseFrom​(ByteBuffer data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

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

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

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

        public static Fulfillment getDefaultInstance()
      • parser

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

        public com.google.protobuf.Parser<Fulfillment> 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 Fulfillment getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder