All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.lexruntime.model.DialogAction Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.lexruntime.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Describes the next action that the bot should take in its interaction with the user and provides information about * the context in which the action takes place. Use the DialogAction data type to set the interaction to a * specific state, or to return the interaction to a previous state. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DialogAction implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type") .getter(getter(DialogAction::typeAsString)).setter(setter(Builder::type)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build(); private static final SdkField INTENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("intentName").getter(getter(DialogAction::intentName)).setter(setter(Builder::intentName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("intentName").build()).build(); private static final SdkField> SLOTS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("slots") .getter(getter(DialogAction::slots)) .setter(setter(Builder::slots)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("slots").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField SLOT_TO_ELICIT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("slotToElicit").getter(getter(DialogAction::slotToElicit)).setter(setter(Builder::slotToElicit)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("slotToElicit").build()).build(); private static final SdkField FULFILLMENT_STATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("fulfillmentState").getter(getter(DialogAction::fulfillmentStateAsString)) .setter(setter(Builder::fulfillmentState)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fulfillmentState").build()).build(); private static final SdkField MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("message") .getter(getter(DialogAction::message)).setter(setter(Builder::message)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("message").build()).build(); private static final SdkField MESSAGE_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("messageFormat").getter(getter(DialogAction::messageFormatAsString)) .setter(setter(Builder::messageFormat)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("messageFormat").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TYPE_FIELD, INTENT_NAME_FIELD, SLOTS_FIELD, SLOT_TO_ELICIT_FIELD, FULFILLMENT_STATE_FIELD, MESSAGE_FIELD, MESSAGE_FORMAT_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private static final long serialVersionUID = 1L; private final String type; private final String intentName; private final Map slots; private final String slotToElicit; private final String fulfillmentState; private final String message; private final String messageFormat; private DialogAction(BuilderImpl builder) { this.type = builder.type; this.intentName = builder.intentName; this.slots = builder.slots; this.slotToElicit = builder.slotToElicit; this.fulfillmentState = builder.fulfillmentState; this.message = builder.message; this.messageFormat = builder.messageFormat; } /** *

* The next action that the bot should take in its interaction with the user. The possible values are: *

*
    *
  • *

    * ConfirmIntent - The next action is asking the user if the intent is complete and ready to be * fulfilled. This is a yes/no question such as "Place the order?" *

    *
  • *
  • *

    * Close - Indicates that the there will not be a response from the user. For example, the statement * "Your order has been placed" does not require a response. *

    *
  • *
  • *

    * Delegate - The next action is determined by Amazon Lex. *

    *
  • *
  • *

    * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

    *
  • *
  • *

    * ElicitSlot - The next action is to elicit a slot value from the user. *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link DialogActionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

* * @return The next action that the bot should take in its interaction with the user. The possible values are:

*
    *
  • *

    * ConfirmIntent - The next action is asking the user if the intent is complete and ready to be * fulfilled. This is a yes/no question such as "Place the order?" *

    *
  • *
  • *

    * Close - Indicates that the there will not be a response from the user. For example, the * statement "Your order has been placed" does not require a response. *

    *
  • *
  • *

    * Delegate - The next action is determined by Amazon Lex. *

    *
  • *
  • *

    * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

    *
  • *
  • *

    * ElicitSlot - The next action is to elicit a slot value from the user. *

    *
  • * @see DialogActionType */ public final DialogActionType type() { return DialogActionType.fromValue(type); } /** *

    * The next action that the bot should take in its interaction with the user. The possible values are: *

    *
      *
    • *

      * ConfirmIntent - The next action is asking the user if the intent is complete and ready to be * fulfilled. This is a yes/no question such as "Place the order?" *

      *
    • *
    • *

      * Close - Indicates that the there will not be a response from the user. For example, the statement * "Your order has been placed" does not require a response. *

      *
    • *
    • *

      * Delegate - The next action is determined by Amazon Lex. *

      *
    • *
    • *

      * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

      *
    • *
    • *

      * ElicitSlot - The next action is to elicit a slot value from the user. *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #type} will return * {@link DialogActionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #typeAsString}. *

    * * @return The next action that the bot should take in its interaction with the user. The possible values are:

    *
      *
    • *

      * ConfirmIntent - The next action is asking the user if the intent is complete and ready to be * fulfilled. This is a yes/no question such as "Place the order?" *

      *
    • *
    • *

      * Close - Indicates that the there will not be a response from the user. For example, the * statement "Your order has been placed" does not require a response. *

      *
    • *
    • *

      * Delegate - The next action is determined by Amazon Lex. *

      *
    • *
    • *

      * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

      *
    • *
    • *

      * ElicitSlot - The next action is to elicit a slot value from the user. *

      *
    • * @see DialogActionType */ public final String typeAsString() { return type; } /** *

      * The name of the intent. *

      * * @return The name of the intent. */ public final String intentName() { return intentName; } /** * For responses, this returns true if the service returned a value for the Slots property. This DOES NOT check that * the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful * because the SDK will never return a null collection or map, but you may need to differentiate between the service * returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true * if a value for the property was specified in the request builder, and false if a value was not specified. */ public final boolean hasSlots() { return slots != null && !(slots instanceof SdkAutoConstructMap); } /** *

      * Map of the slots that have been gathered and their values. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasSlots} method. *

      * * @return Map of the slots that have been gathered and their values. */ public final Map slots() { return slots; } /** *

      * The name of the slot that should be elicited from the user. *

      * * @return The name of the slot that should be elicited from the user. */ public final String slotToElicit() { return slotToElicit; } /** *

      * The fulfillment state of the intent. The possible values are: *

      *
        *
      • *

        * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

        *
      • *
      • *

        * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

        *
      • *
      • *

        * ReadyForFulfillment - All of the information necessary for the intent is present and the intent * ready to be fulfilled by the client application. *

        *
      • *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #fulfillmentState} * will return {@link FulfillmentState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #fulfillmentStateAsString}. *

      * * @return The fulfillment state of the intent. The possible values are:

      *
        *
      • *

        * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

        *
      • *
      • *

        * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

        *
      • *
      • *

        * ReadyForFulfillment - All of the information necessary for the intent is present and the * intent ready to be fulfilled by the client application. *

        *
      • * @see FulfillmentState */ public final FulfillmentState fulfillmentState() { return FulfillmentState.fromValue(fulfillmentState); } /** *

        * The fulfillment state of the intent. The possible values are: *

        *
          *
        • *

          * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

          *
        • *
        • *

          * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

          *
        • *
        • *

          * ReadyForFulfillment - All of the information necessary for the intent is present and the intent * ready to be fulfilled by the client application. *

          *
        • *
        *

        * If the service returns an enum value that is not available in the current SDK version, {@link #fulfillmentState} * will return {@link FulfillmentState#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #fulfillmentStateAsString}. *

        * * @return The fulfillment state of the intent. The possible values are:

        *
          *
        • *

          * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

          *
        • *
        • *

          * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

          *
        • *
        • *

          * ReadyForFulfillment - All of the information necessary for the intent is present and the * intent ready to be fulfilled by the client application. *

          *
        • * @see FulfillmentState */ public final String fulfillmentStateAsString() { return fulfillmentState; } /** *

          * The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the message * configured for the intent. *

          * * @return The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the * message configured for the intent. */ public final String message() { return message; } /** *
            *
          • *

            * PlainText - The message contains plain UTF-8 text. *

            *
          • *
          • *

            * CustomPayload - The message is a custom format for the client. *

            *
          • *
          • *

            * SSML - The message contains text formatted for voice output. *

            *
          • *
          • *

            * Composite - The message contains an escaped JSON object containing one or more messages. For more * information, see Message * Groups. *

            *
          • *
          *

          * If the service returns an enum value that is not available in the current SDK version, {@link #messageFormat} * will return {@link MessageFormatType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #messageFormatAsString}. *

          * * @return
        • *

          * PlainText - The message contains plain UTF-8 text. *

          *
        • *

          * CustomPayload - The message is a custom format for the client. *

          *
        • *

          * SSML - The message contains text formatted for voice output. *

          *
        • *

          * Composite - The message contains an escaped JSON object containing one or more messages. For * more information, see Message Groups. *

          *
        • * @see MessageFormatType */ public final MessageFormatType messageFormat() { return MessageFormatType.fromValue(messageFormat); } /** *
            *
          • *

            * PlainText - The message contains plain UTF-8 text. *

            *
          • *
          • *

            * CustomPayload - The message is a custom format for the client. *

            *
          • *
          • *

            * SSML - The message contains text formatted for voice output. *

            *
          • *
          • *

            * Composite - The message contains an escaped JSON object containing one or more messages. For more * information, see Message * Groups. *

            *
          • *
          *

          * If the service returns an enum value that is not available in the current SDK version, {@link #messageFormat} * will return {@link MessageFormatType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #messageFormatAsString}. *

          * * @return
        • *

          * PlainText - The message contains plain UTF-8 text. *

          *
        • *

          * CustomPayload - The message is a custom format for the client. *

          *
        • *

          * SSML - The message contains text formatted for voice output. *

          *
        • *

          * Composite - The message contains an escaped JSON object containing one or more messages. For * more information, see Message Groups. *

          *
        • * @see MessageFormatType */ public final String messageFormatAsString() { return messageFormat; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(typeAsString()); hashCode = 31 * hashCode + Objects.hashCode(intentName()); hashCode = 31 * hashCode + Objects.hashCode(hasSlots() ? slots() : null); hashCode = 31 * hashCode + Objects.hashCode(slotToElicit()); hashCode = 31 * hashCode + Objects.hashCode(fulfillmentStateAsString()); hashCode = 31 * hashCode + Objects.hashCode(message()); hashCode = 31 * hashCode + Objects.hashCode(messageFormatAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DialogAction)) { return false; } DialogAction other = (DialogAction) obj; return Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(intentName(), other.intentName()) && hasSlots() == other.hasSlots() && Objects.equals(slots(), other.slots()) && Objects.equals(slotToElicit(), other.slotToElicit()) && Objects.equals(fulfillmentStateAsString(), other.fulfillmentStateAsString()) && Objects.equals(message(), other.message()) && Objects.equals(messageFormatAsString(), other.messageFormatAsString()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("DialogAction").add("Type", typeAsString()).add("IntentName", intentName()) .add("Slots", slots() == null ? null : "*** Sensitive Data Redacted ***").add("SlotToElicit", slotToElicit()) .add("FulfillmentState", fulfillmentStateAsString()) .add("Message", message() == null ? null : "*** Sensitive Data Redacted ***") .add("MessageFormat", messageFormatAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "type": return Optional.ofNullable(clazz.cast(typeAsString())); case "intentName": return Optional.ofNullable(clazz.cast(intentName())); case "slots": return Optional.ofNullable(clazz.cast(slots())); case "slotToElicit": return Optional.ofNullable(clazz.cast(slotToElicit())); case "fulfillmentState": return Optional.ofNullable(clazz.cast(fulfillmentStateAsString())); case "message": return Optional.ofNullable(clazz.cast(message())); case "messageFormat": return Optional.ofNullable(clazz.cast(messageFormatAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("type", TYPE_FIELD); map.put("intentName", INTENT_NAME_FIELD); map.put("slots", SLOTS_FIELD); map.put("slotToElicit", SLOT_TO_ELICIT_FIELD); map.put("fulfillmentState", FULFILLMENT_STATE_FIELD); map.put("message", MESSAGE_FIELD); map.put("messageFormat", MESSAGE_FORMAT_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((DialogAction) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

          * The next action that the bot should take in its interaction with the user. The possible values are: *

          *
            *
          • *

            * ConfirmIntent - The next action is asking the user if the intent is complete and ready to be * fulfilled. This is a yes/no question such as "Place the order?" *

            *
          • *
          • *

            * Close - Indicates that the there will not be a response from the user. For example, the * statement "Your order has been placed" does not require a response. *

            *
          • *
          • *

            * Delegate - The next action is determined by Amazon Lex. *

            *
          • *
          • *

            * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

            *
          • *
          • *

            * ElicitSlot - The next action is to elicit a slot value from the user. *

            *
          • *
          * * @param type * The next action that the bot should take in its interaction with the user. The possible values * are:

          *
            *
          • *

            * ConfirmIntent - The next action is asking the user if the intent is complete and ready to * be fulfilled. This is a yes/no question such as "Place the order?" *

            *
          • *
          • *

            * Close - Indicates that the there will not be a response from the user. For example, the * statement "Your order has been placed" does not require a response. *

            *
          • *
          • *

            * Delegate - The next action is determined by Amazon Lex. *

            *
          • *
          • *

            * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

            *
          • *
          • *

            * ElicitSlot - The next action is to elicit a slot value from the user. *

            *
          • * @see DialogActionType * @return Returns a reference to this object so that method calls can be chained together. * @see DialogActionType */ Builder type(String type); /** *

            * The next action that the bot should take in its interaction with the user. The possible values are: *

            *
              *
            • *

              * ConfirmIntent - The next action is asking the user if the intent is complete and ready to be * fulfilled. This is a yes/no question such as "Place the order?" *

              *
            • *
            • *

              * Close - Indicates that the there will not be a response from the user. For example, the * statement "Your order has been placed" does not require a response. *

              *
            • *
            • *

              * Delegate - The next action is determined by Amazon Lex. *

              *
            • *
            • *

              * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

              *
            • *
            • *

              * ElicitSlot - The next action is to elicit a slot value from the user. *

              *
            • *
            * * @param type * The next action that the bot should take in its interaction with the user. The possible values * are:

            *
              *
            • *

              * ConfirmIntent - The next action is asking the user if the intent is complete and ready to * be fulfilled. This is a yes/no question such as "Place the order?" *

              *
            • *
            • *

              * Close - Indicates that the there will not be a response from the user. For example, the * statement "Your order has been placed" does not require a response. *

              *
            • *
            • *

              * Delegate - The next action is determined by Amazon Lex. *

              *
            • *
            • *

              * ElicitIntent - The next action is to determine the intent that the user wants to fulfill. *

              *
            • *
            • *

              * ElicitSlot - The next action is to elicit a slot value from the user. *

              *
            • * @see DialogActionType * @return Returns a reference to this object so that method calls can be chained together. * @see DialogActionType */ Builder type(DialogActionType type); /** *

              * The name of the intent. *

              * * @param intentName * The name of the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder intentName(String intentName); /** *

              * Map of the slots that have been gathered and their values. *

              * * @param slots * Map of the slots that have been gathered and their values. * @return Returns a reference to this object so that method calls can be chained together. */ Builder slots(Map slots); /** *

              * The name of the slot that should be elicited from the user. *

              * * @param slotToElicit * The name of the slot that should be elicited from the user. * @return Returns a reference to this object so that method calls can be chained together. */ Builder slotToElicit(String slotToElicit); /** *

              * The fulfillment state of the intent. The possible values are: *

              *
                *
              • *

                * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

                *
              • *
              • *

                * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

                *
              • *
              • *

                * ReadyForFulfillment - All of the information necessary for the intent is present and the intent * ready to be fulfilled by the client application. *

                *
              • *
              * * @param fulfillmentState * The fulfillment state of the intent. The possible values are:

              *
                *
              • *

                * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

                *
              • *
              • *

                * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

                *
              • *
              • *

                * ReadyForFulfillment - All of the information necessary for the intent is present and the * intent ready to be fulfilled by the client application. *

                *
              • * @see FulfillmentState * @return Returns a reference to this object so that method calls can be chained together. * @see FulfillmentState */ Builder fulfillmentState(String fulfillmentState); /** *

                * The fulfillment state of the intent. The possible values are: *

                *
                  *
                • *

                  * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

                  *
                • *
                • *

                  * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

                  *
                • *
                • *

                  * ReadyForFulfillment - All of the information necessary for the intent is present and the intent * ready to be fulfilled by the client application. *

                  *
                • *
                * * @param fulfillmentState * The fulfillment state of the intent. The possible values are:

                *
                  *
                • *

                  * Failed - The Lambda function associated with the intent failed to fulfill the intent. *

                  *
                • *
                • *

                  * Fulfilled - The intent has fulfilled by the Lambda function associated with the intent. *

                  *
                • *
                • *

                  * ReadyForFulfillment - All of the information necessary for the intent is present and the * intent ready to be fulfilled by the client application. *

                  *
                • * @see FulfillmentState * @return Returns a reference to this object so that method calls can be chained together. * @see FulfillmentState */ Builder fulfillmentState(FulfillmentState fulfillmentState); /** *

                  * The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the message * configured for the intent. *

                  * * @param message * The message that should be shown to the user. If you don't specify a message, Amazon Lex will use the * message configured for the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder message(String message); /** *
                    *
                  • *

                    * PlainText - The message contains plain UTF-8 text. *

                    *
                  • *
                  • *

                    * CustomPayload - The message is a custom format for the client. *

                    *
                  • *
                  • *

                    * SSML - The message contains text formatted for voice output. *

                    *
                  • *
                  • *

                    * Composite - The message contains an escaped JSON object containing one or more messages. For * more information, see Message Groups. *

                    *
                  • *
                  * * @param messageFormat *
                • *

                  * PlainText - The message contains plain UTF-8 text. *

                  *
                • *

                  * CustomPayload - The message is a custom format for the client. *

                  *
                • *

                  * SSML - The message contains text formatted for voice output. *

                  *
                • *

                  * Composite - The message contains an escaped JSON object containing one or more messages. * For more information, see Message Groups. *

                  *
                • * @see MessageFormatType * @return Returns a reference to this object so that method calls can be chained together. * @see MessageFormatType */ Builder messageFormat(String messageFormat); /** *
                    *
                  • *

                    * PlainText - The message contains plain UTF-8 text. *

                    *
                  • *
                  • *

                    * CustomPayload - The message is a custom format for the client. *

                    *
                  • *
                  • *

                    * SSML - The message contains text formatted for voice output. *

                    *
                  • *
                  • *

                    * Composite - The message contains an escaped JSON object containing one or more messages. For * more information, see Message Groups. *

                    *
                  • *
                  * * @param messageFormat *
                • *

                  * PlainText - The message contains plain UTF-8 text. *

                  *
                • *

                  * CustomPayload - The message is a custom format for the client. *

                  *
                • *

                  * SSML - The message contains text formatted for voice output. *

                  *
                • *

                  * Composite - The message contains an escaped JSON object containing one or more messages. * For more information, see Message Groups. *

                  *
                • * @see MessageFormatType * @return Returns a reference to this object so that method calls can be chained together. * @see MessageFormatType */ Builder messageFormat(MessageFormatType messageFormat); } static final class BuilderImpl implements Builder { private String type; private String intentName; private Map slots = DefaultSdkAutoConstructMap.getInstance(); private String slotToElicit; private String fulfillmentState; private String message; private String messageFormat; private BuilderImpl() { } private BuilderImpl(DialogAction model) { type(model.type); intentName(model.intentName); slots(model.slots); slotToElicit(model.slotToElicit); fulfillmentState(model.fulfillmentState); message(model.message); messageFormat(model.messageFormat); } public final String getType() { return type; } public final void setType(String type) { this.type = type; } @Override public final Builder type(String type) { this.type = type; return this; } @Override public final Builder type(DialogActionType type) { this.type(type == null ? null : type.toString()); return this; } public final String getIntentName() { return intentName; } public final void setIntentName(String intentName) { this.intentName = intentName; } @Override public final Builder intentName(String intentName) { this.intentName = intentName; return this; } public final Map getSlots() { if (slots instanceof SdkAutoConstructMap) { return null; } return slots; } public final void setSlots(Map slots) { this.slots = StringMapCopier.copy(slots); } @Override public final Builder slots(Map slots) { this.slots = StringMapCopier.copy(slots); return this; } public final String getSlotToElicit() { return slotToElicit; } public final void setSlotToElicit(String slotToElicit) { this.slotToElicit = slotToElicit; } @Override public final Builder slotToElicit(String slotToElicit) { this.slotToElicit = slotToElicit; return this; } public final String getFulfillmentState() { return fulfillmentState; } public final void setFulfillmentState(String fulfillmentState) { this.fulfillmentState = fulfillmentState; } @Override public final Builder fulfillmentState(String fulfillmentState) { this.fulfillmentState = fulfillmentState; return this; } @Override public final Builder fulfillmentState(FulfillmentState fulfillmentState) { this.fulfillmentState(fulfillmentState == null ? null : fulfillmentState.toString()); return this; } public final String getMessage() { return message; } public final void setMessage(String message) { this.message = message; } @Override public final Builder message(String message) { this.message = message; return this; } public final String getMessageFormat() { return messageFormat; } public final void setMessageFormat(String messageFormat) { this.messageFormat = messageFormat; } @Override public final Builder messageFormat(String messageFormat) { this.messageFormat = messageFormat; return this; } @Override public final Builder messageFormat(MessageFormatType messageFormat) { this.messageFormat(messageFormat == null ? null : messageFormat.toString()); return this; } @Override public DialogAction build() { return new DialogAction(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy