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

software.amazon.awssdk.services.lexmodelsv2.model.UpdateIntentRequest 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.lexmodelsv2.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateIntentRequest extends LexModelsV2Request implements
        ToCopyableBuilder {
    private static final SdkField INTENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("intentId").getter(getter(UpdateIntentRequest::intentId)).setter(setter(Builder::intentId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("intentId").build()).build();

    private static final SdkField INTENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("intentName").getter(getter(UpdateIntentRequest::intentName)).setter(setter(Builder::intentName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("intentName").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("description").getter(getter(UpdateIntentRequest::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField PARENT_INTENT_SIGNATURE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("parentIntentSignature").getter(getter(UpdateIntentRequest::parentIntentSignature))
            .setter(setter(Builder::parentIntentSignature))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("parentIntentSignature").build())
            .build();

    private static final SdkField> SAMPLE_UTTERANCES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("sampleUtterances")
            .getter(getter(UpdateIntentRequest::sampleUtterances))
            .setter(setter(Builder::sampleUtterances))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sampleUtterances").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(SampleUtterance::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField DIALOG_CODE_HOOK_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("dialogCodeHook")
            .getter(getter(UpdateIntentRequest::dialogCodeHook)).setter(setter(Builder::dialogCodeHook))
            .constructor(DialogCodeHookSettings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dialogCodeHook").build()).build();

    private static final SdkField FULFILLMENT_CODE_HOOK_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("fulfillmentCodeHook")
            .getter(getter(UpdateIntentRequest::fulfillmentCodeHook)).setter(setter(Builder::fulfillmentCodeHook))
            .constructor(FulfillmentCodeHookSettings::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fulfillmentCodeHook").build())
            .build();

    private static final SdkField> SLOT_PRIORITIES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("slotPriorities")
            .getter(getter(UpdateIntentRequest::slotPriorities))
            .setter(setter(Builder::slotPriorities))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("slotPriorities").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(SlotPriority::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField INTENT_CONFIRMATION_SETTING_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("intentConfirmationSetting")
            .getter(getter(UpdateIntentRequest::intentConfirmationSetting)).setter(setter(Builder::intentConfirmationSetting))
            .constructor(IntentConfirmationSetting::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("intentConfirmationSetting").build())
            .build();

    private static final SdkField INTENT_CLOSING_SETTING_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("intentClosingSetting")
            .getter(getter(UpdateIntentRequest::intentClosingSetting)).setter(setter(Builder::intentClosingSetting))
            .constructor(IntentClosingSetting::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("intentClosingSetting").build())
            .build();

    private static final SdkField> INPUT_CONTEXTS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("inputContexts")
            .getter(getter(UpdateIntentRequest::inputContexts))
            .setter(setter(Builder::inputContexts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inputContexts").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(InputContext::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> OUTPUT_CONTEXTS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("outputContexts")
            .getter(getter(UpdateIntentRequest::outputContexts))
            .setter(setter(Builder::outputContexts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("outputContexts").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(OutputContext::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField KENDRA_CONFIGURATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("kendraConfiguration")
            .getter(getter(UpdateIntentRequest::kendraConfiguration)).setter(setter(Builder::kendraConfiguration))
            .constructor(KendraConfiguration::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kendraConfiguration").build())
            .build();

    private static final SdkField BOT_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("botId")
            .getter(getter(UpdateIntentRequest::botId)).setter(setter(Builder::botId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("botId").build()).build();

    private static final SdkField BOT_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("botVersion").getter(getter(UpdateIntentRequest::botVersion)).setter(setter(Builder::botVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("botVersion").build()).build();

    private static final SdkField LOCALE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("localeId").getter(getter(UpdateIntentRequest::localeId)).setter(setter(Builder::localeId))
            .traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("localeId").build()).build();

    private static final SdkField INITIAL_RESPONSE_SETTING_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("initialResponseSetting")
            .getter(getter(UpdateIntentRequest::initialResponseSetting)).setter(setter(Builder::initialResponseSetting))
            .constructor(InitialResponseSetting::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("initialResponseSetting").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(INTENT_ID_FIELD,
            INTENT_NAME_FIELD, DESCRIPTION_FIELD, PARENT_INTENT_SIGNATURE_FIELD, SAMPLE_UTTERANCES_FIELD, DIALOG_CODE_HOOK_FIELD,
            FULFILLMENT_CODE_HOOK_FIELD, SLOT_PRIORITIES_FIELD, INTENT_CONFIRMATION_SETTING_FIELD, INTENT_CLOSING_SETTING_FIELD,
            INPUT_CONTEXTS_FIELD, OUTPUT_CONTEXTS_FIELD, KENDRA_CONFIGURATION_FIELD, BOT_ID_FIELD, BOT_VERSION_FIELD,
            LOCALE_ID_FIELD, INITIAL_RESPONSE_SETTING_FIELD));

    private final String intentId;

    private final String intentName;

    private final String description;

    private final String parentIntentSignature;

    private final List sampleUtterances;

    private final DialogCodeHookSettings dialogCodeHook;

    private final FulfillmentCodeHookSettings fulfillmentCodeHook;

    private final List slotPriorities;

    private final IntentConfirmationSetting intentConfirmationSetting;

    private final IntentClosingSetting intentClosingSetting;

    private final List inputContexts;

    private final List outputContexts;

    private final KendraConfiguration kendraConfiguration;

    private final String botId;

    private final String botVersion;

    private final String localeId;

    private final InitialResponseSetting initialResponseSetting;

    private UpdateIntentRequest(BuilderImpl builder) {
        super(builder);
        this.intentId = builder.intentId;
        this.intentName = builder.intentName;
        this.description = builder.description;
        this.parentIntentSignature = builder.parentIntentSignature;
        this.sampleUtterances = builder.sampleUtterances;
        this.dialogCodeHook = builder.dialogCodeHook;
        this.fulfillmentCodeHook = builder.fulfillmentCodeHook;
        this.slotPriorities = builder.slotPriorities;
        this.intentConfirmationSetting = builder.intentConfirmationSetting;
        this.intentClosingSetting = builder.intentClosingSetting;
        this.inputContexts = builder.inputContexts;
        this.outputContexts = builder.outputContexts;
        this.kendraConfiguration = builder.kendraConfiguration;
        this.botId = builder.botId;
        this.botVersion = builder.botVersion;
        this.localeId = builder.localeId;
        this.initialResponseSetting = builder.initialResponseSetting;
    }

    /**
     * 

* The unique identifier of the intent to update. *

* * @return The unique identifier of the intent to update. */ public final String intentId() { return intentId; } /** *

* The new name for the intent. *

* * @return The new name for the intent. */ public final String intentName() { return intentName; } /** *

* The new description of the intent. *

* * @return The new description of the intent. */ public final String description() { return description; } /** *

* The signature of the new built-in intent to use as the parent of this intent. *

* * @return The signature of the new built-in intent to use as the parent of this intent. */ public final String parentIntentSignature() { return parentIntentSignature; } /** * For responses, this returns true if the service returned a value for the SampleUtterances 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 hasSampleUtterances() { return sampleUtterances != null && !(sampleUtterances instanceof SdkAutoConstructList); } /** *

* New utterances used to invoke the intent. *

*

* 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 #hasSampleUtterances} method. *

* * @return New utterances used to invoke the intent. */ public final List sampleUtterances() { return sampleUtterances; } /** *

* The new Lambda function to use between each turn of the conversation with the bot. *

* * @return The new Lambda function to use between each turn of the conversation with the bot. */ public final DialogCodeHookSettings dialogCodeHook() { return dialogCodeHook; } /** *

* The new Lambda function to call when all of the intents required slots are provided and the intent is ready for * fulfillment. *

* * @return The new Lambda function to call when all of the intents required slots are provided and the intent is * ready for fulfillment. */ public final FulfillmentCodeHookSettings fulfillmentCodeHook() { return fulfillmentCodeHook; } /** * For responses, this returns true if the service returned a value for the SlotPriorities 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 hasSlotPriorities() { return slotPriorities != null && !(slotPriorities instanceof SdkAutoConstructList); } /** *

* A new list of slots and their priorities that are contained by the intent. *

*

* 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 #hasSlotPriorities} method. *

* * @return A new list of slots and their priorities that are contained by the intent. */ public final List slotPriorities() { return slotPriorities; } /** *

* New prompts that Amazon Lex sends to the user to confirm the completion of an intent. *

* * @return New prompts that Amazon Lex sends to the user to confirm the completion of an intent. */ public final IntentConfirmationSetting intentConfirmationSetting() { return intentConfirmationSetting; } /** *

* The new response that Amazon Lex sends the user when the intent is closed. *

* * @return The new response that Amazon Lex sends the user when the intent is closed. */ public final IntentClosingSetting intentClosingSetting() { return intentClosingSetting; } /** * For responses, this returns true if the service returned a value for the InputContexts 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 hasInputContexts() { return inputContexts != null && !(inputContexts instanceof SdkAutoConstructList); } /** *

* A new list of contexts that must be active in order for Amazon Lex to consider the intent. *

*

* 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 #hasInputContexts} method. *

* * @return A new list of contexts that must be active in order for Amazon Lex to consider the intent. */ public final List inputContexts() { return inputContexts; } /** * For responses, this returns true if the service returned a value for the OutputContexts 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 hasOutputContexts() { return outputContexts != null && !(outputContexts instanceof SdkAutoConstructList); } /** *

* A new list of contexts that Amazon Lex activates when the intent is fulfilled. *

*

* 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 #hasOutputContexts} method. *

* * @return A new list of contexts that Amazon Lex activates when the intent is fulfilled. */ public final List outputContexts() { return outputContexts; } /** *

* New configuration settings for connecting to an Amazon Kendra index. *

* * @return New configuration settings for connecting to an Amazon Kendra index. */ public final KendraConfiguration kendraConfiguration() { return kendraConfiguration; } /** *

* The identifier of the bot that contains the intent. *

* * @return The identifier of the bot that contains the intent. */ public final String botId() { return botId; } /** *

* The version of the bot that contains the intent. Must be DRAFT. *

* * @return The version of the bot that contains the intent. Must be DRAFT. */ public final String botVersion() { return botVersion; } /** *

* The identifier of the language and locale where this intent is used. The string must match one of the supported * locales. For more information, see Supported languages. *

* * @return The identifier of the language and locale where this intent is used. The string must match one of the * supported locales. For more information, see Supported languages. */ public final String localeId() { return localeId; } /** *

* * @return */ public final InitialResponseSetting initialResponseSetting() { return initialResponseSetting; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(intentId()); hashCode = 31 * hashCode + Objects.hashCode(intentName()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(parentIntentSignature()); hashCode = 31 * hashCode + Objects.hashCode(hasSampleUtterances() ? sampleUtterances() : null); hashCode = 31 * hashCode + Objects.hashCode(dialogCodeHook()); hashCode = 31 * hashCode + Objects.hashCode(fulfillmentCodeHook()); hashCode = 31 * hashCode + Objects.hashCode(hasSlotPriorities() ? slotPriorities() : null); hashCode = 31 * hashCode + Objects.hashCode(intentConfirmationSetting()); hashCode = 31 * hashCode + Objects.hashCode(intentClosingSetting()); hashCode = 31 * hashCode + Objects.hashCode(hasInputContexts() ? inputContexts() : null); hashCode = 31 * hashCode + Objects.hashCode(hasOutputContexts() ? outputContexts() : null); hashCode = 31 * hashCode + Objects.hashCode(kendraConfiguration()); hashCode = 31 * hashCode + Objects.hashCode(botId()); hashCode = 31 * hashCode + Objects.hashCode(botVersion()); hashCode = 31 * hashCode + Objects.hashCode(localeId()); hashCode = 31 * hashCode + Objects.hashCode(initialResponseSetting()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof UpdateIntentRequest)) { return false; } UpdateIntentRequest other = (UpdateIntentRequest) obj; return Objects.equals(intentId(), other.intentId()) && Objects.equals(intentName(), other.intentName()) && Objects.equals(description(), other.description()) && Objects.equals(parentIntentSignature(), other.parentIntentSignature()) && hasSampleUtterances() == other.hasSampleUtterances() && Objects.equals(sampleUtterances(), other.sampleUtterances()) && Objects.equals(dialogCodeHook(), other.dialogCodeHook()) && Objects.equals(fulfillmentCodeHook(), other.fulfillmentCodeHook()) && hasSlotPriorities() == other.hasSlotPriorities() && Objects.equals(slotPriorities(), other.slotPriorities()) && Objects.equals(intentConfirmationSetting(), other.intentConfirmationSetting()) && Objects.equals(intentClosingSetting(), other.intentClosingSetting()) && hasInputContexts() == other.hasInputContexts() && Objects.equals(inputContexts(), other.inputContexts()) && hasOutputContexts() == other.hasOutputContexts() && Objects.equals(outputContexts(), other.outputContexts()) && Objects.equals(kendraConfiguration(), other.kendraConfiguration()) && Objects.equals(botId(), other.botId()) && Objects.equals(botVersion(), other.botVersion()) && Objects.equals(localeId(), other.localeId()) && Objects.equals(initialResponseSetting(), other.initialResponseSetting()); } /** * 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("UpdateIntentRequest").add("IntentId", intentId()).add("IntentName", intentName()) .add("Description", description()).add("ParentIntentSignature", parentIntentSignature()) .add("SampleUtterances", hasSampleUtterances() ? sampleUtterances() : null) .add("DialogCodeHook", dialogCodeHook()).add("FulfillmentCodeHook", fulfillmentCodeHook()) .add("SlotPriorities", hasSlotPriorities() ? slotPriorities() : null) .add("IntentConfirmationSetting", intentConfirmationSetting()) .add("IntentClosingSetting", intentClosingSetting()) .add("InputContexts", hasInputContexts() ? inputContexts() : null) .add("OutputContexts", hasOutputContexts() ? outputContexts() : null) .add("KendraConfiguration", kendraConfiguration()).add("BotId", botId()).add("BotVersion", botVersion()) .add("LocaleId", localeId()).add("InitialResponseSetting", initialResponseSetting()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "intentId": return Optional.ofNullable(clazz.cast(intentId())); case "intentName": return Optional.ofNullable(clazz.cast(intentName())); case "description": return Optional.ofNullable(clazz.cast(description())); case "parentIntentSignature": return Optional.ofNullable(clazz.cast(parentIntentSignature())); case "sampleUtterances": return Optional.ofNullable(clazz.cast(sampleUtterances())); case "dialogCodeHook": return Optional.ofNullable(clazz.cast(dialogCodeHook())); case "fulfillmentCodeHook": return Optional.ofNullable(clazz.cast(fulfillmentCodeHook())); case "slotPriorities": return Optional.ofNullable(clazz.cast(slotPriorities())); case "intentConfirmationSetting": return Optional.ofNullable(clazz.cast(intentConfirmationSetting())); case "intentClosingSetting": return Optional.ofNullable(clazz.cast(intentClosingSetting())); case "inputContexts": return Optional.ofNullable(clazz.cast(inputContexts())); case "outputContexts": return Optional.ofNullable(clazz.cast(outputContexts())); case "kendraConfiguration": return Optional.ofNullable(clazz.cast(kendraConfiguration())); case "botId": return Optional.ofNullable(clazz.cast(botId())); case "botVersion": return Optional.ofNullable(clazz.cast(botVersion())); case "localeId": return Optional.ofNullable(clazz.cast(localeId())); case "initialResponseSetting": return Optional.ofNullable(clazz.cast(initialResponseSetting())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateIntentRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends LexModelsV2Request.Builder, SdkPojo, CopyableBuilder { /** *

* The unique identifier of the intent to update. *

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

* The new name for the intent. *

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

* The new description of the intent. *

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

* The signature of the new built-in intent to use as the parent of this intent. *

* * @param parentIntentSignature * The signature of the new built-in intent to use as the parent of this intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parentIntentSignature(String parentIntentSignature); /** *

* New utterances used to invoke the intent. *

* * @param sampleUtterances * New utterances used to invoke the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sampleUtterances(Collection sampleUtterances); /** *

* New utterances used to invoke the intent. *

* * @param sampleUtterances * New utterances used to invoke the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sampleUtterances(SampleUtterance... sampleUtterances); /** *

* New utterances used to invoke the intent. *

* This is a convenience method that creates an instance of the {@link List.Builder} avoiding * the need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and * its result is passed to {@link #sampleUtterances(List)}. * * @param sampleUtterances * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sampleUtterances(List) */ Builder sampleUtterances(Consumer... sampleUtterances); /** *

* The new Lambda function to use between each turn of the conversation with the bot. *

* * @param dialogCodeHook * The new Lambda function to use between each turn of the conversation with the bot. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dialogCodeHook(DialogCodeHookSettings dialogCodeHook); /** *

* The new Lambda function to use between each turn of the conversation with the bot. *

* This is a convenience method that creates an instance of the {@link DialogCodeHookSettings.Builder} avoiding * the need to create one manually via {@link DialogCodeHookSettings#builder()}. * * When the {@link Consumer} completes, {@link DialogCodeHookSettings.Builder#build()} is called immediately and * its result is passed to {@link #dialogCodeHook(DialogCodeHookSettings)}. * * @param dialogCodeHook * a consumer that will call methods on {@link DialogCodeHookSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #dialogCodeHook(DialogCodeHookSettings) */ default Builder dialogCodeHook(Consumer dialogCodeHook) { return dialogCodeHook(DialogCodeHookSettings.builder().applyMutation(dialogCodeHook).build()); } /** *

* The new Lambda function to call when all of the intents required slots are provided and the intent is ready * for fulfillment. *

* * @param fulfillmentCodeHook * The new Lambda function to call when all of the intents required slots are provided and the intent is * ready for fulfillment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder fulfillmentCodeHook(FulfillmentCodeHookSettings fulfillmentCodeHook); /** *

* The new Lambda function to call when all of the intents required slots are provided and the intent is ready * for fulfillment. *

* This is a convenience method that creates an instance of the {@link FulfillmentCodeHookSettings.Builder} * avoiding the need to create one manually via {@link FulfillmentCodeHookSettings#builder()}. * * When the {@link Consumer} completes, {@link FulfillmentCodeHookSettings.Builder#build()} is called * immediately and its result is passed to {@link #fulfillmentCodeHook(FulfillmentCodeHookSettings)}. * * @param fulfillmentCodeHook * a consumer that will call methods on {@link FulfillmentCodeHookSettings.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #fulfillmentCodeHook(FulfillmentCodeHookSettings) */ default Builder fulfillmentCodeHook(Consumer fulfillmentCodeHook) { return fulfillmentCodeHook(FulfillmentCodeHookSettings.builder().applyMutation(fulfillmentCodeHook).build()); } /** *

* A new list of slots and their priorities that are contained by the intent. *

* * @param slotPriorities * A new list of slots and their priorities that are contained by the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder slotPriorities(Collection slotPriorities); /** *

* A new list of slots and their priorities that are contained by the intent. *

* * @param slotPriorities * A new list of slots and their priorities that are contained by the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder slotPriorities(SlotPriority... slotPriorities); /** *

* A new list of slots and their priorities that are contained by the intent. *

* This is a convenience method that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #slotPriorities(List)}. * * @param slotPriorities * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #slotPriorities(List) */ Builder slotPriorities(Consumer... slotPriorities); /** *

* New prompts that Amazon Lex sends to the user to confirm the completion of an intent. *

* * @param intentConfirmationSetting * New prompts that Amazon Lex sends to the user to confirm the completion of an intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder intentConfirmationSetting(IntentConfirmationSetting intentConfirmationSetting); /** *

* New prompts that Amazon Lex sends to the user to confirm the completion of an intent. *

* This is a convenience method that creates an instance of the {@link IntentConfirmationSetting.Builder} * avoiding the need to create one manually via {@link IntentConfirmationSetting#builder()}. * * When the {@link Consumer} completes, {@link IntentConfirmationSetting.Builder#build()} is called immediately * and its result is passed to {@link #intentConfirmationSetting(IntentConfirmationSetting)}. * * @param intentConfirmationSetting * a consumer that will call methods on {@link IntentConfirmationSetting.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #intentConfirmationSetting(IntentConfirmationSetting) */ default Builder intentConfirmationSetting(Consumer intentConfirmationSetting) { return intentConfirmationSetting(IntentConfirmationSetting.builder().applyMutation(intentConfirmationSetting).build()); } /** *

* The new response that Amazon Lex sends the user when the intent is closed. *

* * @param intentClosingSetting * The new response that Amazon Lex sends the user when the intent is closed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder intentClosingSetting(IntentClosingSetting intentClosingSetting); /** *

* The new response that Amazon Lex sends the user when the intent is closed. *

* This is a convenience method that creates an instance of the {@link IntentClosingSetting.Builder} avoiding * the need to create one manually via {@link IntentClosingSetting#builder()}. * * When the {@link Consumer} completes, {@link IntentClosingSetting.Builder#build()} is called immediately and * its result is passed to {@link #intentClosingSetting(IntentClosingSetting)}. * * @param intentClosingSetting * a consumer that will call methods on {@link IntentClosingSetting.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #intentClosingSetting(IntentClosingSetting) */ default Builder intentClosingSetting(Consumer intentClosingSetting) { return intentClosingSetting(IntentClosingSetting.builder().applyMutation(intentClosingSetting).build()); } /** *

* A new list of contexts that must be active in order for Amazon Lex to consider the intent. *

* * @param inputContexts * A new list of contexts that must be active in order for Amazon Lex to consider the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputContexts(Collection inputContexts); /** *

* A new list of contexts that must be active in order for Amazon Lex to consider the intent. *

* * @param inputContexts * A new list of contexts that must be active in order for Amazon Lex to consider the intent. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputContexts(InputContext... inputContexts); /** *

* A new list of contexts that must be active in order for Amazon Lex to consider the intent. *

* This is a convenience method that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #inputContexts(List)}. * * @param inputContexts * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #inputContexts(List) */ Builder inputContexts(Consumer... inputContexts); /** *

* A new list of contexts that Amazon Lex activates when the intent is fulfilled. *

* * @param outputContexts * A new list of contexts that Amazon Lex activates when the intent is fulfilled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputContexts(Collection outputContexts); /** *

* A new list of contexts that Amazon Lex activates when the intent is fulfilled. *

* * @param outputContexts * A new list of contexts that Amazon Lex activates when the intent is fulfilled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputContexts(OutputContext... outputContexts); /** *

* A new list of contexts that Amazon Lex activates when the intent is fulfilled. *

* This is a convenience method that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and * its result is passed to {@link #outputContexts(List)}. * * @param outputContexts * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputContexts(List) */ Builder outputContexts(Consumer... outputContexts); /** *

* New configuration settings for connecting to an Amazon Kendra index. *

* * @param kendraConfiguration * New configuration settings for connecting to an Amazon Kendra index. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kendraConfiguration(KendraConfiguration kendraConfiguration); /** *

* New configuration settings for connecting to an Amazon Kendra index. *

* This is a convenience method that creates an instance of the {@link KendraConfiguration.Builder} avoiding the * need to create one manually via {@link KendraConfiguration#builder()}. * * When the {@link Consumer} completes, {@link KendraConfiguration.Builder#build()} is called immediately and * its result is passed to {@link #kendraConfiguration(KendraConfiguration)}. * * @param kendraConfiguration * a consumer that will call methods on {@link KendraConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #kendraConfiguration(KendraConfiguration) */ default Builder kendraConfiguration(Consumer kendraConfiguration) { return kendraConfiguration(KendraConfiguration.builder().applyMutation(kendraConfiguration).build()); } /** *

* The identifier of the bot that contains the intent. *

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

* The version of the bot that contains the intent. Must be DRAFT. *

* * @param botVersion * The version of the bot that contains the intent. Must be DRAFT. * @return Returns a reference to this object so that method calls can be chained together. */ Builder botVersion(String botVersion); /** *

* The identifier of the language and locale where this intent is used. The string must match one of the * supported locales. For more information, see Supported languages. *

* * @param localeId * The identifier of the language and locale where this intent is used. The string must match one of the * supported locales. For more information, see Supported languages. * @return Returns a reference to this object so that method calls can be chained together. */ Builder localeId(String localeId); /** *

* * @param initialResponseSetting * @return Returns a reference to this object so that method calls can be chained together. */ Builder initialResponseSetting(InitialResponseSetting initialResponseSetting); /** *

* This is a convenience method that creates an instance of the {@link InitialResponseSetting.Builder} avoiding * the need to create one manually via {@link InitialResponseSetting#builder()}. * * When the {@link Consumer} completes, {@link InitialResponseSetting.Builder#build()} is called immediately and * its result is passed to {@link #initialResponseSetting(InitialResponseSetting)}. * * @param initialResponseSetting * a consumer that will call methods on {@link InitialResponseSetting.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #initialResponseSetting(InitialResponseSetting) */ default Builder initialResponseSetting(Consumer initialResponseSetting) { return initialResponseSetting(InitialResponseSetting.builder().applyMutation(initialResponseSetting).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends LexModelsV2Request.BuilderImpl implements Builder { private String intentId; private String intentName; private String description; private String parentIntentSignature; private List sampleUtterances = DefaultSdkAutoConstructList.getInstance(); private DialogCodeHookSettings dialogCodeHook; private FulfillmentCodeHookSettings fulfillmentCodeHook; private List slotPriorities = DefaultSdkAutoConstructList.getInstance(); private IntentConfirmationSetting intentConfirmationSetting; private IntentClosingSetting intentClosingSetting; private List inputContexts = DefaultSdkAutoConstructList.getInstance(); private List outputContexts = DefaultSdkAutoConstructList.getInstance(); private KendraConfiguration kendraConfiguration; private String botId; private String botVersion; private String localeId; private InitialResponseSetting initialResponseSetting; private BuilderImpl() { } private BuilderImpl(UpdateIntentRequest model) { super(model); intentId(model.intentId); intentName(model.intentName); description(model.description); parentIntentSignature(model.parentIntentSignature); sampleUtterances(model.sampleUtterances); dialogCodeHook(model.dialogCodeHook); fulfillmentCodeHook(model.fulfillmentCodeHook); slotPriorities(model.slotPriorities); intentConfirmationSetting(model.intentConfirmationSetting); intentClosingSetting(model.intentClosingSetting); inputContexts(model.inputContexts); outputContexts(model.outputContexts); kendraConfiguration(model.kendraConfiguration); botId(model.botId); botVersion(model.botVersion); localeId(model.localeId); initialResponseSetting(model.initialResponseSetting); } public final String getIntentId() { return intentId; } public final void setIntentId(String intentId) { this.intentId = intentId; } @Override public final Builder intentId(String intentId) { this.intentId = intentId; 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 String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getParentIntentSignature() { return parentIntentSignature; } public final void setParentIntentSignature(String parentIntentSignature) { this.parentIntentSignature = parentIntentSignature; } @Override public final Builder parentIntentSignature(String parentIntentSignature) { this.parentIntentSignature = parentIntentSignature; return this; } public final List getSampleUtterances() { List result = SampleUtterancesListCopier.copyToBuilder(this.sampleUtterances); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSampleUtterances(Collection sampleUtterances) { this.sampleUtterances = SampleUtterancesListCopier.copyFromBuilder(sampleUtterances); } @Override public final Builder sampleUtterances(Collection sampleUtterances) { this.sampleUtterances = SampleUtterancesListCopier.copy(sampleUtterances); return this; } @Override @SafeVarargs public final Builder sampleUtterances(SampleUtterance... sampleUtterances) { sampleUtterances(Arrays.asList(sampleUtterances)); return this; } @Override @SafeVarargs public final Builder sampleUtterances(Consumer... sampleUtterances) { sampleUtterances(Stream.of(sampleUtterances).map(c -> SampleUtterance.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final DialogCodeHookSettings.Builder getDialogCodeHook() { return dialogCodeHook != null ? dialogCodeHook.toBuilder() : null; } public final void setDialogCodeHook(DialogCodeHookSettings.BuilderImpl dialogCodeHook) { this.dialogCodeHook = dialogCodeHook != null ? dialogCodeHook.build() : null; } @Override public final Builder dialogCodeHook(DialogCodeHookSettings dialogCodeHook) { this.dialogCodeHook = dialogCodeHook; return this; } public final FulfillmentCodeHookSettings.Builder getFulfillmentCodeHook() { return fulfillmentCodeHook != null ? fulfillmentCodeHook.toBuilder() : null; } public final void setFulfillmentCodeHook(FulfillmentCodeHookSettings.BuilderImpl fulfillmentCodeHook) { this.fulfillmentCodeHook = fulfillmentCodeHook != null ? fulfillmentCodeHook.build() : null; } @Override public final Builder fulfillmentCodeHook(FulfillmentCodeHookSettings fulfillmentCodeHook) { this.fulfillmentCodeHook = fulfillmentCodeHook; return this; } public final List getSlotPriorities() { List result = SlotPrioritiesListCopier.copyToBuilder(this.slotPriorities); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSlotPriorities(Collection slotPriorities) { this.slotPriorities = SlotPrioritiesListCopier.copyFromBuilder(slotPriorities); } @Override public final Builder slotPriorities(Collection slotPriorities) { this.slotPriorities = SlotPrioritiesListCopier.copy(slotPriorities); return this; } @Override @SafeVarargs public final Builder slotPriorities(SlotPriority... slotPriorities) { slotPriorities(Arrays.asList(slotPriorities)); return this; } @Override @SafeVarargs public final Builder slotPriorities(Consumer... slotPriorities) { slotPriorities(Stream.of(slotPriorities).map(c -> SlotPriority.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final IntentConfirmationSetting.Builder getIntentConfirmationSetting() { return intentConfirmationSetting != null ? intentConfirmationSetting.toBuilder() : null; } public final void setIntentConfirmationSetting(IntentConfirmationSetting.BuilderImpl intentConfirmationSetting) { this.intentConfirmationSetting = intentConfirmationSetting != null ? intentConfirmationSetting.build() : null; } @Override public final Builder intentConfirmationSetting(IntentConfirmationSetting intentConfirmationSetting) { this.intentConfirmationSetting = intentConfirmationSetting; return this; } public final IntentClosingSetting.Builder getIntentClosingSetting() { return intentClosingSetting != null ? intentClosingSetting.toBuilder() : null; } public final void setIntentClosingSetting(IntentClosingSetting.BuilderImpl intentClosingSetting) { this.intentClosingSetting = intentClosingSetting != null ? intentClosingSetting.build() : null; } @Override public final Builder intentClosingSetting(IntentClosingSetting intentClosingSetting) { this.intentClosingSetting = intentClosingSetting; return this; } public final List getInputContexts() { List result = InputContextsListCopier.copyToBuilder(this.inputContexts); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setInputContexts(Collection inputContexts) { this.inputContexts = InputContextsListCopier.copyFromBuilder(inputContexts); } @Override public final Builder inputContexts(Collection inputContexts) { this.inputContexts = InputContextsListCopier.copy(inputContexts); return this; } @Override @SafeVarargs public final Builder inputContexts(InputContext... inputContexts) { inputContexts(Arrays.asList(inputContexts)); return this; } @Override @SafeVarargs public final Builder inputContexts(Consumer... inputContexts) { inputContexts(Stream.of(inputContexts).map(c -> InputContext.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final List getOutputContexts() { List result = OutputContextsListCopier.copyToBuilder(this.outputContexts); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setOutputContexts(Collection outputContexts) { this.outputContexts = OutputContextsListCopier.copyFromBuilder(outputContexts); } @Override public final Builder outputContexts(Collection outputContexts) { this.outputContexts = OutputContextsListCopier.copy(outputContexts); return this; } @Override @SafeVarargs public final Builder outputContexts(OutputContext... outputContexts) { outputContexts(Arrays.asList(outputContexts)); return this; } @Override @SafeVarargs public final Builder outputContexts(Consumer... outputContexts) { outputContexts(Stream.of(outputContexts).map(c -> OutputContext.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final KendraConfiguration.Builder getKendraConfiguration() { return kendraConfiguration != null ? kendraConfiguration.toBuilder() : null; } public final void setKendraConfiguration(KendraConfiguration.BuilderImpl kendraConfiguration) { this.kendraConfiguration = kendraConfiguration != null ? kendraConfiguration.build() : null; } @Override public final Builder kendraConfiguration(KendraConfiguration kendraConfiguration) { this.kendraConfiguration = kendraConfiguration; return this; } public final String getBotId() { return botId; } public final void setBotId(String botId) { this.botId = botId; } @Override public final Builder botId(String botId) { this.botId = botId; return this; } public final String getBotVersion() { return botVersion; } public final void setBotVersion(String botVersion) { this.botVersion = botVersion; } @Override public final Builder botVersion(String botVersion) { this.botVersion = botVersion; return this; } public final String getLocaleId() { return localeId; } public final void setLocaleId(String localeId) { this.localeId = localeId; } @Override public final Builder localeId(String localeId) { this.localeId = localeId; return this; } public final InitialResponseSetting.Builder getInitialResponseSetting() { return initialResponseSetting != null ? initialResponseSetting.toBuilder() : null; } public final void setInitialResponseSetting(InitialResponseSetting.BuilderImpl initialResponseSetting) { this.initialResponseSetting = initialResponseSetting != null ? initialResponseSetting.build() : null; } @Override public final Builder initialResponseSetting(InitialResponseSetting initialResponseSetting) { this.initialResponseSetting = initialResponseSetting; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public UpdateIntentRequest build() { return new UpdateIntentRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy