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

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 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 getter(Function g) { return obj -> g.apply((BotLocaleSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The language and locale of the bot locale. *

* * @param localeId * The language and locale of the bot locale. * @return Returns a reference to this object so that method calls can be chained together. */ Builder localeId(String localeId); /** *

* The name of the bot locale. *

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

* The description of the bot locale. *

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

* The current status of the bot locale. When the status is Built the locale is ready for use. *

* * @param botLocaleStatus * The current status of the bot locale. When the status is Built the locale is ready for * use. * @see BotLocaleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see BotLocaleStatus */ Builder botLocaleStatus(String botLocaleStatus); /** *

* The current status of the bot locale. When the status is Built the locale is ready for use. *

* * @param botLocaleStatus * The current status of the bot locale. When the status is Built the locale is ready for * use. * @see BotLocaleStatus * @return Returns a reference to this object so that method calls can be chained together. * @see BotLocaleStatus */ Builder botLocaleStatus(BotLocaleStatus botLocaleStatus); /** *

* A timestamp of the date and time that the bot locale was last updated. *

* * @param lastUpdatedDateTime * A timestamp of the date and time that the bot locale was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedDateTime(Instant lastUpdatedDateTime); /** *

* A timestamp of the date and time that the bot locale was last built. *

* * @param lastBuildSubmittedDateTime * A timestamp of the date and time that the bot locale was last built. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastBuildSubmittedDateTime(Instant lastBuildSubmittedDateTime); } static final class BuilderImpl implements Builder { private String localeId; private String localeName; private String description; private String botLocaleStatus; private Instant lastUpdatedDateTime; private Instant lastBuildSubmittedDateTime; private BuilderImpl() { } private BuilderImpl(BotLocaleSummary model) { localeId(model.localeId); localeName(model.localeName); description(model.description); botLocaleStatus(model.botLocaleStatus); lastUpdatedDateTime(model.lastUpdatedDateTime); lastBuildSubmittedDateTime(model.lastBuildSubmittedDateTime); } 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 String getLocaleName() { return localeName; } public final void setLocaleName(String localeName) { this.localeName = localeName; } @Override public final Builder localeName(String localeName) { this.localeName = localeName; 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 getBotLocaleStatus() { return botLocaleStatus; } public final void setBotLocaleStatus(String botLocaleStatus) { this.botLocaleStatus = botLocaleStatus; } @Override public final Builder botLocaleStatus(String botLocaleStatus) { this.botLocaleStatus = botLocaleStatus; return this; } @Override public final Builder botLocaleStatus(BotLocaleStatus botLocaleStatus) { this.botLocaleStatus(botLocaleStatus == null ? null : botLocaleStatus.toString()); return this; } public final Instant getLastUpdatedDateTime() { return lastUpdatedDateTime; } public final void setLastUpdatedDateTime(Instant lastUpdatedDateTime) { this.lastUpdatedDateTime = lastUpdatedDateTime; } @Override public final Builder lastUpdatedDateTime(Instant lastUpdatedDateTime) { this.lastUpdatedDateTime = lastUpdatedDateTime; return this; } public final Instant getLastBuildSubmittedDateTime() { return lastBuildSubmittedDateTime; } public final void setLastBuildSubmittedDateTime(Instant lastBuildSubmittedDateTime) { this.lastBuildSubmittedDateTime = lastBuildSubmittedDateTime; } @Override public final Builder lastBuildSubmittedDateTime(Instant lastBuildSubmittedDateTime) { this.lastBuildSubmittedDateTime = lastBuildSubmittedDateTime; return this; } @Override public BotLocaleSummary build() { return new BotLocaleSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy