
software.amazon.awssdk.services.lexmodelsv2.model.WaitAndContinueSpecification 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.io.Serializable;
import java.util.Arrays;
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 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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Specifies the prompts that Amazon Lex uses while a bot is waiting for customer input.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class WaitAndContinueSpecification implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField WAITING_RESPONSE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("waitingResponse")
.getter(getter(WaitAndContinueSpecification::waitingResponse)).setter(setter(Builder::waitingResponse))
.constructor(ResponseSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("waitingResponse").build()).build();
private static final SdkField CONTINUE_RESPONSE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("continueResponse")
.getter(getter(WaitAndContinueSpecification::continueResponse)).setter(setter(Builder::continueResponse))
.constructor(ResponseSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("continueResponse").build()).build();
private static final SdkField STILL_WAITING_RESPONSE_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("stillWaitingResponse")
.getter(getter(WaitAndContinueSpecification::stillWaitingResponse)).setter(setter(Builder::stillWaitingResponse))
.constructor(StillWaitingResponseSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stillWaitingResponse").build())
.build();
private static final SdkField ACTIVE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("active").getter(getter(WaitAndContinueSpecification::active)).setter(setter(Builder::active))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("active").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(WAITING_RESPONSE_FIELD,
CONTINUE_RESPONSE_FIELD, STILL_WAITING_RESPONSE_FIELD, ACTIVE_FIELD));
private static final long serialVersionUID = 1L;
private final ResponseSpecification waitingResponse;
private final ResponseSpecification continueResponse;
private final StillWaitingResponseSpecification stillWaitingResponse;
private final Boolean active;
private WaitAndContinueSpecification(BuilderImpl builder) {
this.waitingResponse = builder.waitingResponse;
this.continueResponse = builder.continueResponse;
this.stillWaitingResponse = builder.stillWaitingResponse;
this.active = builder.active;
}
/**
*
* The response that Amazon Lex sends to indicate that the bot is waiting for the conversation to continue.
*
*
* @return The response that Amazon Lex sends to indicate that the bot is waiting for the conversation to continue.
*/
public final ResponseSpecification waitingResponse() {
return waitingResponse;
}
/**
*
* The response that Amazon Lex sends to indicate that the bot is ready to continue the conversation.
*
*
* @return The response that Amazon Lex sends to indicate that the bot is ready to continue the conversation.
*/
public final ResponseSpecification continueResponse() {
return continueResponse;
}
/**
*
* A response that Amazon Lex sends periodically to the user to indicate that the bot is still waiting for input
* from the user.
*
*
* @return A response that Amazon Lex sends periodically to the user to indicate that the bot is still waiting for
* input from the user.
*/
public final StillWaitingResponseSpecification stillWaitingResponse() {
return stillWaitingResponse;
}
/**
*
* Specifies whether the bot will wait for a user to respond. When this field is false, wait and continue responses
* for a slot aren't used. If the active
field isn't specified, the default is true.
*
*
* @return Specifies whether the bot will wait for a user to respond. When this field is false, wait and continue
* responses for a slot aren't used. If the active
field isn't specified, the default is true.
*/
public final Boolean active() {
return active;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(waitingResponse());
hashCode = 31 * hashCode + Objects.hashCode(continueResponse());
hashCode = 31 * hashCode + Objects.hashCode(stillWaitingResponse());
hashCode = 31 * hashCode + Objects.hashCode(active());
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 WaitAndContinueSpecification)) {
return false;
}
WaitAndContinueSpecification other = (WaitAndContinueSpecification) obj;
return Objects.equals(waitingResponse(), other.waitingResponse())
&& Objects.equals(continueResponse(), other.continueResponse())
&& Objects.equals(stillWaitingResponse(), other.stillWaitingResponse())
&& Objects.equals(active(), other.active());
}
/**
* 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("WaitAndContinueSpecification").add("WaitingResponse", waitingResponse())
.add("ContinueResponse", continueResponse()).add("StillWaitingResponse", stillWaitingResponse())
.add("Active", active()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "waitingResponse":
return Optional.ofNullable(clazz.cast(waitingResponse()));
case "continueResponse":
return Optional.ofNullable(clazz.cast(continueResponse()));
case "stillWaitingResponse":
return Optional.ofNullable(clazz.cast(stillWaitingResponse()));
case "active":
return Optional.ofNullable(clazz.cast(active()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy