
software.amazon.awssdk.services.lexmodelsv2.model.BotLocaleSummary 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.time.Instant;
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.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;
/**
*
* Summary information about bot locales returned by the ListBotLocales operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class BotLocaleSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField LOCALE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("localeId").getter(getter(BotLocaleSummary::localeId)).setter(setter(Builder::localeId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("localeId").build()).build();
private static final SdkField LOCALE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("localeName").getter(getter(BotLocaleSummary::localeName)).setter(setter(Builder::localeName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("localeName").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("description").getter(getter(BotLocaleSummary::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField BOT_LOCALE_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("botLocaleStatus").getter(getter(BotLocaleSummary::botLocaleStatusAsString))
.setter(setter(Builder::botLocaleStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("botLocaleStatus").build()).build();
private static final SdkField LAST_UPDATED_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("lastUpdatedDateTime").getter(getter(BotLocaleSummary::lastUpdatedDateTime))
.setter(setter(Builder::lastUpdatedDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedDateTime").build())
.build();
private static final SdkField LAST_BUILD_SUBMITTED_DATE_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT)
.memberName("lastBuildSubmittedDateTime")
.getter(getter(BotLocaleSummary::lastBuildSubmittedDateTime))
.setter(setter(Builder::lastBuildSubmittedDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastBuildSubmittedDateTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LOCALE_ID_FIELD,
LOCALE_NAME_FIELD, DESCRIPTION_FIELD, BOT_LOCALE_STATUS_FIELD, LAST_UPDATED_DATE_TIME_FIELD,
LAST_BUILD_SUBMITTED_DATE_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String localeId;
private final String localeName;
private final String description;
private final String botLocaleStatus;
private final Instant lastUpdatedDateTime;
private final Instant lastBuildSubmittedDateTime;
private BotLocaleSummary(BuilderImpl builder) {
this.localeId = builder.localeId;
this.localeName = builder.localeName;
this.description = builder.description;
this.botLocaleStatus = builder.botLocaleStatus;
this.lastUpdatedDateTime = builder.lastUpdatedDateTime;
this.lastBuildSubmittedDateTime = builder.lastBuildSubmittedDateTime;
}
/**
*
* The language and locale of the bot locale.
*
*
* @return The language and locale of the bot locale.
*/
public final String localeId() {
return localeId;
}
/**
*
* The name of the bot locale.
*
*
* @return The name of the bot locale.
*/
public final String localeName() {
return localeName;
}
/**
*
* The description of the bot locale.
*
*
* @return The description of the bot locale.
*/
public final String description() {
return description;
}
/**
*
* The current status of the bot locale. When the status is Built
the locale is ready for use.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #botLocaleStatus}
* will return {@link BotLocaleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #botLocaleStatusAsString}.
*
*
* @return The current status of the bot locale. When the status is Built
the locale is ready for use.
* @see BotLocaleStatus
*/
public final BotLocaleStatus botLocaleStatus() {
return BotLocaleStatus.fromValue(botLocaleStatus);
}
/**
*
* The current status of the bot locale. When the status is Built
the locale is ready for use.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #botLocaleStatus}
* will return {@link BotLocaleStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #botLocaleStatusAsString}.
*
*
* @return The current status of the bot locale. When the status is Built
the locale is ready for use.
* @see BotLocaleStatus
*/
public final String botLocaleStatusAsString() {
return botLocaleStatus;
}
/**
*
* A timestamp of the date and time that the bot locale was last updated.
*
*
* @return A timestamp of the date and time that the bot locale was last updated.
*/
public final Instant lastUpdatedDateTime() {
return lastUpdatedDateTime;
}
/**
*
* A timestamp of the date and time that the bot locale was last built.
*
*
* @return A timestamp of the date and time that the bot locale was last built.
*/
public final Instant lastBuildSubmittedDateTime() {
return lastBuildSubmittedDateTime;
}
@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(localeId());
hashCode = 31 * hashCode + Objects.hashCode(localeName());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(botLocaleStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedDateTime());
hashCode = 31 * hashCode + Objects.hashCode(lastBuildSubmittedDateTime());
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 BotLocaleSummary)) {
return false;
}
BotLocaleSummary other = (BotLocaleSummary) obj;
return Objects.equals(localeId(), other.localeId()) && Objects.equals(localeName(), other.localeName())
&& Objects.equals(description(), other.description())
&& Objects.equals(botLocaleStatusAsString(), other.botLocaleStatusAsString())
&& Objects.equals(lastUpdatedDateTime(), other.lastUpdatedDateTime())
&& Objects.equals(lastBuildSubmittedDateTime(), other.lastBuildSubmittedDateTime());
}
/**
* 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("BotLocaleSummary").add("LocaleId", localeId()).add("LocaleName", localeName())
.add("Description", description()).add("BotLocaleStatus", botLocaleStatusAsString())
.add("LastUpdatedDateTime", lastUpdatedDateTime())
.add("LastBuildSubmittedDateTime", lastBuildSubmittedDateTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "localeId":
return Optional.ofNullable(clazz.cast(localeId()));
case "localeName":
return Optional.ofNullable(clazz.cast(localeName()));
case "description":
return Optional.ofNullable(clazz.cast(description()));
case "botLocaleStatus":
return Optional.ofNullable(clazz.cast(botLocaleStatusAsString()));
case "lastUpdatedDateTime":
return Optional.ofNullable(clazz.cast(lastUpdatedDateTime()));
case "lastBuildSubmittedDateTime":
return Optional.ofNullable(clazz.cast(lastBuildSubmittedDateTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function