Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.lexmodelbuilding.model.GetBotChannelAssociationResponse Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.lexmodelbuilding.model;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
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.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class GetBotChannelAssociationResponse extends LexModelBuildingResponse implements
ToCopyableBuilder {
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetBotChannelAssociationResponse::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetBotChannelAssociationResponse::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField BOT_ALIAS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetBotChannelAssociationResponse::botAlias)).setter(setter(Builder::botAlias))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("botAlias").build()).build();
private static final SdkField BOT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetBotChannelAssociationResponse::botName)).setter(setter(Builder::botName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("botName").build()).build();
private static final SdkField CREATED_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(GetBotChannelAssociationResponse::createdDate)).setter(setter(Builder::createdDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdDate").build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetBotChannelAssociationResponse::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build();
private static final SdkField> BOT_CONFIGURATION_FIELD = SdkField
.> builder(MarshallingType.MAP)
.getter(getter(GetBotChannelAssociationResponse::botConfiguration))
.setter(setter(Builder::botConfiguration))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("botConfiguration").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 STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetBotChannelAssociationResponse::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(GetBotChannelAssociationResponse::failureReason)).setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failureReason").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DESCRIPTION_FIELD,
BOT_ALIAS_FIELD, BOT_NAME_FIELD, CREATED_DATE_FIELD, TYPE_FIELD, BOT_CONFIGURATION_FIELD, STATUS_FIELD,
FAILURE_REASON_FIELD));
private final String name;
private final String description;
private final String botAlias;
private final String botName;
private final Instant createdDate;
private final String type;
private final Map botConfiguration;
private final String status;
private final String failureReason;
private GetBotChannelAssociationResponse(BuilderImpl builder) {
super(builder);
this.name = builder.name;
this.description = builder.description;
this.botAlias = builder.botAlias;
this.botName = builder.botName;
this.createdDate = builder.createdDate;
this.type = builder.type;
this.botConfiguration = builder.botConfiguration;
this.status = builder.status;
this.failureReason = builder.failureReason;
}
/**
*
* The name of the association between the bot and the channel.
*
*
* @return The name of the association between the bot and the channel.
*/
public String name() {
return name;
}
/**
*
* A description of the association between the bot and the channel.
*
*
* @return A description of the association between the bot and the channel.
*/
public String description() {
return description;
}
/**
*
* An alias pointing to the specific version of the Amazon Lex bot to which this association is being made.
*
*
* @return An alias pointing to the specific version of the Amazon Lex bot to which this association is being made.
*/
public String botAlias() {
return botAlias;
}
/**
*
* The name of the Amazon Lex bot.
*
*
* @return The name of the Amazon Lex bot.
*/
public String botName() {
return botName;
}
/**
*
* The date that the association between the bot and the channel was created.
*
*
* @return The date that the association between the bot and the channel was created.
*/
public Instant createdDate() {
return createdDate;
}
/**
*
* The type of the messaging platform.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link ChannelType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The type of the messaging platform.
* @see ChannelType
*/
public ChannelType type() {
return ChannelType.fromValue(type);
}
/**
*
* The type of the messaging platform.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link ChannelType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The type of the messaging platform.
* @see ChannelType
*/
public String typeAsString() {
return type;
}
/**
*
* Provides information that the messaging platform needs to communicate with the Amazon Lex bot.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* @return Provides information that the messaging platform needs to communicate with the Amazon Lex bot.
*/
public Map botConfiguration() {
return botConfiguration;
}
/**
*
* The status of the bot channel.
*
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for the failure,
* see the failureReason
field.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ChannelStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the bot channel.
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for the
* failure, see the failureReason
field.
*
*
* @see ChannelStatus
*/
public ChannelStatus status() {
return ChannelStatus.fromValue(status);
}
/**
*
* The status of the bot channel.
*
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for the failure,
* see the failureReason
field.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ChannelStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the bot channel.
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for the
* failure, see the failureReason
field.
*
*
* @see ChannelStatus
*/
public String statusAsString() {
return status;
}
/**
*
* If status
is FAILED
, Amazon Lex provides the reason that it failed to create the
* association.
*
*
* @return If status
is FAILED
, Amazon Lex provides the reason that it failed to create
* the association.
*/
public String failureReason() {
return failureReason;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(botAlias());
hashCode = 31 * hashCode + Objects.hashCode(botName());
hashCode = 31 * hashCode + Objects.hashCode(createdDate());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(botConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetBotChannelAssociationResponse)) {
return false;
}
GetBotChannelAssociationResponse other = (GetBotChannelAssociationResponse) obj;
return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description())
&& Objects.equals(botAlias(), other.botAlias()) && Objects.equals(botName(), other.botName())
&& Objects.equals(createdDate(), other.createdDate()) && Objects.equals(typeAsString(), other.typeAsString())
&& Objects.equals(botConfiguration(), other.botConfiguration())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(failureReason(), other.failureReason());
}
/**
* 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 String toString() {
return ToString.builder("GetBotChannelAssociationResponse").add("Name", name()).add("Description", description())
.add("BotAlias", botAlias()).add("BotName", botName()).add("CreatedDate", createdDate())
.add("Type", typeAsString())
.add("BotConfiguration", botConfiguration() == null ? null : "*** Sensitive Data Redacted ***")
.add("Status", statusAsString()).add("FailureReason", failureReason()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "botAlias":
return Optional.ofNullable(clazz.cast(botAlias()));
case "botName":
return Optional.ofNullable(clazz.cast(botName()));
case "createdDate":
return Optional.ofNullable(clazz.cast(createdDate()));
case "type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "botConfiguration":
return Optional.ofNullable(clazz.cast(botConfiguration()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "failureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((GetBotChannelAssociationResponse) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends LexModelBuildingResponse.Builder, SdkPojo,
CopyableBuilder {
/**
*
* The name of the association between the bot and the channel.
*
*
* @param name
* The name of the association between the bot and the channel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* A description of the association between the bot and the channel.
*
*
* @param description
* A description of the association between the bot and the channel.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder description(String description);
/**
*
* An alias pointing to the specific version of the Amazon Lex bot to which this association is being made.
*
*
* @param botAlias
* An alias pointing to the specific version of the Amazon Lex bot to which this association is being
* made.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder botAlias(String botAlias);
/**
*
* The name of the Amazon Lex bot.
*
*
* @param botName
* The name of the Amazon Lex bot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder botName(String botName);
/**
*
* The date that the association between the bot and the channel was created.
*
*
* @param createdDate
* The date that the association between the bot and the channel was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder createdDate(Instant createdDate);
/**
*
* The type of the messaging platform.
*
*
* @param type
* The type of the messaging platform.
* @see ChannelType
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelType
*/
Builder type(String type);
/**
*
* The type of the messaging platform.
*
*
* @param type
* The type of the messaging platform.
* @see ChannelType
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelType
*/
Builder type(ChannelType type);
/**
*
* Provides information that the messaging platform needs to communicate with the Amazon Lex bot.
*
*
* @param botConfiguration
* Provides information that the messaging platform needs to communicate with the Amazon Lex bot.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder botConfiguration(Map botConfiguration);
/**
*
* The status of the bot channel.
*
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for the
* failure, see the failureReason
field.
*
*
*
*
* @param status
* The status of the bot channel.
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for
* the failure, see the failureReason
field.
*
*
* @see ChannelStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelStatus
*/
Builder status(String status);
/**
*
* The status of the bot channel.
*
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for the
* failure, see the failureReason
field.
*
*
*
*
* @param status
* The status of the bot channel.
*
*
*
* CREATED
- The channel has been created and is ready for use.
*
*
*
*
* IN_PROGRESS
- Channel creation is in progress.
*
*
*
*
* FAILED
- There was an error creating the channel. For information about the reason for
* the failure, see the failureReason
field.
*
*
* @see ChannelStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelStatus
*/
Builder status(ChannelStatus status);
/**
*
* If status
is FAILED
, Amazon Lex provides the reason that it failed to create the
* association.
*
*
* @param failureReason
* If status
is FAILED
, Amazon Lex provides the reason that it failed to create
* the association.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder failureReason(String failureReason);
}
static final class BuilderImpl extends LexModelBuildingResponse.BuilderImpl implements Builder {
private String name;
private String description;
private String botAlias;
private String botName;
private Instant createdDate;
private String type;
private Map botConfiguration = DefaultSdkAutoConstructMap.getInstance();
private String status;
private String failureReason;
private BuilderImpl() {
}
private BuilderImpl(GetBotChannelAssociationResponse model) {
super(model);
name(model.name);
description(model.description);
botAlias(model.botAlias);
botName(model.botName);
createdDate(model.createdDate);
type(model.type);
botConfiguration(model.botConfiguration);
status(model.status);
failureReason(model.failureReason);
}
public final String getName() {
return name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final void setName(String name) {
this.name = name;
}
public final String getDescription() {
return description;
}
@Override
public final Builder description(String description) {
this.description = description;
return this;
}
public final void setDescription(String description) {
this.description = description;
}
public final String getBotAlias() {
return botAlias;
}
@Override
public final Builder botAlias(String botAlias) {
this.botAlias = botAlias;
return this;
}
public final void setBotAlias(String botAlias) {
this.botAlias = botAlias;
}
public final String getBotName() {
return botName;
}
@Override
public final Builder botName(String botName) {
this.botName = botName;
return this;
}
public final void setBotName(String botName) {
this.botName = botName;
}
public final Instant getCreatedDate() {
return createdDate;
}
@Override
public final Builder createdDate(Instant createdDate) {
this.createdDate = createdDate;
return this;
}
public final void setCreatedDate(Instant createdDate) {
this.createdDate = createdDate;
}
public final String getTypeAsString() {
return type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(ChannelType type) {
this.type(type.toString());
return this;
}
public final void setType(String type) {
this.type = type;
}
public final Map getBotConfiguration() {
return botConfiguration;
}
@Override
public final Builder botConfiguration(Map botConfiguration) {
this.botConfiguration = ChannelConfigurationMapCopier.copy(botConfiguration);
return this;
}
public final void setBotConfiguration(Map botConfiguration) {
this.botConfiguration = ChannelConfigurationMapCopier.copy(botConfiguration);
}
public final String getStatusAsString() {
return status;
}
@Override
public final Builder status(String status) {
this.status = status;
return this;
}
@Override
public final Builder status(ChannelStatus status) {
this.status(status.toString());
return this;
}
public final void setStatus(String status) {
this.status = status;
}
public final String getFailureReason() {
return failureReason;
}
@Override
public final Builder failureReason(String failureReason) {
this.failureReason = failureReason;
return this;
}
public final void setFailureReason(String failureReason) {
this.failureReason = failureReason;
}
@Override
public GetBotChannelAssociationResponse build() {
return new GetBotChannelAssociationResponse(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}