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

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

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class UpdateExportResponse extends LexModelsV2Response implements
        ToCopyableBuilder {
    private static final SdkField EXPORT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("exportId").getter(getter(UpdateExportResponse::exportId)).setter(setter(Builder::exportId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportId").build()).build();

    private static final SdkField RESOURCE_SPECIFICATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("resourceSpecification")
            .getter(getter(UpdateExportResponse::resourceSpecification)).setter(setter(Builder::resourceSpecification))
            .constructor(ExportResourceSpecification::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceSpecification").build())
            .build();

    private static final SdkField FILE_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("fileFormat").getter(getter(UpdateExportResponse::fileFormatAsString))
            .setter(setter(Builder::fileFormat))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("fileFormat").build()).build();

    private static final SdkField EXPORT_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("exportStatus").getter(getter(UpdateExportResponse::exportStatusAsString))
            .setter(setter(Builder::exportStatus))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportStatus").build()).build();

    private static final SdkField CREATION_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("creationDateTime").getter(getter(UpdateExportResponse::creationDateTime))
            .setter(setter(Builder::creationDateTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationDateTime").build()).build();

    private static final SdkField LAST_UPDATED_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("lastUpdatedDateTime").getter(getter(UpdateExportResponse::lastUpdatedDateTime))
            .setter(setter(Builder::lastUpdatedDateTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedDateTime").build())
            .build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EXPORT_ID_FIELD,
            RESOURCE_SPECIFICATION_FIELD, FILE_FORMAT_FIELD, EXPORT_STATUS_FIELD, CREATION_DATE_TIME_FIELD,
            LAST_UPDATED_DATE_TIME_FIELD));

    private final String exportId;

    private final ExportResourceSpecification resourceSpecification;

    private final String fileFormat;

    private final String exportStatus;

    private final Instant creationDateTime;

    private final Instant lastUpdatedDateTime;

    private UpdateExportResponse(BuilderImpl builder) {
        super(builder);
        this.exportId = builder.exportId;
        this.resourceSpecification = builder.resourceSpecification;
        this.fileFormat = builder.fileFormat;
        this.exportStatus = builder.exportStatus;
        this.creationDateTime = builder.creationDateTime;
        this.lastUpdatedDateTime = builder.lastUpdatedDateTime;
    }

    /**
     * 

* The unique identifier Amazon Lex assigned to the export. *

* * @return The unique identifier Amazon Lex assigned to the export. */ public final String exportId() { return exportId; } /** *

* A description of the type of resource that was exported, either a bot or a bot locale. *

* * @return A description of the type of resource that was exported, either a bot or a bot locale. */ public final ExportResourceSpecification resourceSpecification() { return resourceSpecification; } /** *

* The file format used for the files that define the resource. The TSV format is required to export a * custom vocabulary only; otherwise use LexJson format. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #fileFormat} will * return {@link ImportExportFileFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #fileFormatAsString}. *

* * @return The file format used for the files that define the resource. The TSV format is required to * export a custom vocabulary only; otherwise use LexJson format. * @see ImportExportFileFormat */ public final ImportExportFileFormat fileFormat() { return ImportExportFileFormat.fromValue(fileFormat); } /** *

* The file format used for the files that define the resource. The TSV format is required to export a * custom vocabulary only; otherwise use LexJson format. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #fileFormat} will * return {@link ImportExportFileFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #fileFormatAsString}. *

* * @return The file format used for the files that define the resource. The TSV format is required to * export a custom vocabulary only; otherwise use LexJson format. * @see ImportExportFileFormat */ public final String fileFormatAsString() { return fileFormat; } /** *

* The status of the export. When the status is Completed the export archive is available for download. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #exportStatus} will * return {@link ExportStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #exportStatusAsString}. *

* * @return The status of the export. When the status is Completed the export archive is available for * download. * @see ExportStatus */ public final ExportStatus exportStatus() { return ExportStatus.fromValue(exportStatus); } /** *

* The status of the export. When the status is Completed the export archive is available for download. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #exportStatus} will * return {@link ExportStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from * {@link #exportStatusAsString}. *

* * @return The status of the export. When the status is Completed the export archive is available for * download. * @see ExportStatus */ public final String exportStatusAsString() { return exportStatus; } /** *

* The date and time that the export was created. *

* * @return The date and time that the export was created. */ public final Instant creationDateTime() { return creationDateTime; } /** *

* The date and time that the export was last updated. *

* * @return The date and time that the export was last updated. */ public final Instant lastUpdatedDateTime() { return lastUpdatedDateTime; } @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(exportId()); hashCode = 31 * hashCode + Objects.hashCode(resourceSpecification()); hashCode = 31 * hashCode + Objects.hashCode(fileFormatAsString()); hashCode = 31 * hashCode + Objects.hashCode(exportStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(creationDateTime()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedDateTime()); 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 UpdateExportResponse)) { return false; } UpdateExportResponse other = (UpdateExportResponse) obj; return Objects.equals(exportId(), other.exportId()) && Objects.equals(resourceSpecification(), other.resourceSpecification()) && Objects.equals(fileFormatAsString(), other.fileFormatAsString()) && Objects.equals(exportStatusAsString(), other.exportStatusAsString()) && Objects.equals(creationDateTime(), other.creationDateTime()) && Objects.equals(lastUpdatedDateTime(), other.lastUpdatedDateTime()); } /** * 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("UpdateExportResponse").add("ExportId", exportId()) .add("ResourceSpecification", resourceSpecification()).add("FileFormat", fileFormatAsString()) .add("ExportStatus", exportStatusAsString()).add("CreationDateTime", creationDateTime()) .add("LastUpdatedDateTime", lastUpdatedDateTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "exportId": return Optional.ofNullable(clazz.cast(exportId())); case "resourceSpecification": return Optional.ofNullable(clazz.cast(resourceSpecification())); case "fileFormat": return Optional.ofNullable(clazz.cast(fileFormatAsString())); case "exportStatus": return Optional.ofNullable(clazz.cast(exportStatusAsString())); case "creationDateTime": return Optional.ofNullable(clazz.cast(creationDateTime())); case "lastUpdatedDateTime": return Optional.ofNullable(clazz.cast(lastUpdatedDateTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((UpdateExportResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends LexModelsV2Response.Builder, SdkPojo, CopyableBuilder { /** *

* The unique identifier Amazon Lex assigned to the export. *

* * @param exportId * The unique identifier Amazon Lex assigned to the export. * @return Returns a reference to this object so that method calls can be chained together. */ Builder exportId(String exportId); /** *

* A description of the type of resource that was exported, either a bot or a bot locale. *

* * @param resourceSpecification * A description of the type of resource that was exported, either a bot or a bot locale. * @return Returns a reference to this object so that method calls can be chained together. */ Builder resourceSpecification(ExportResourceSpecification resourceSpecification); /** *

* A description of the type of resource that was exported, either a bot or a bot locale. *

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

* The file format used for the files that define the resource. The TSV format is required to * export a custom vocabulary only; otherwise use LexJson format. *

* * @param fileFormat * The file format used for the files that define the resource. The TSV format is required * to export a custom vocabulary only; otherwise use LexJson format. * @see ImportExportFileFormat * @return Returns a reference to this object so that method calls can be chained together. * @see ImportExportFileFormat */ Builder fileFormat(String fileFormat); /** *

* The file format used for the files that define the resource. The TSV format is required to * export a custom vocabulary only; otherwise use LexJson format. *

* * @param fileFormat * The file format used for the files that define the resource. The TSV format is required * to export a custom vocabulary only; otherwise use LexJson format. * @see ImportExportFileFormat * @return Returns a reference to this object so that method calls can be chained together. * @see ImportExportFileFormat */ Builder fileFormat(ImportExportFileFormat fileFormat); /** *

* The status of the export. When the status is Completed the export archive is available for * download. *

* * @param exportStatus * The status of the export. When the status is Completed the export archive is available * for download. * @see ExportStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ExportStatus */ Builder exportStatus(String exportStatus); /** *

* The status of the export. When the status is Completed the export archive is available for * download. *

* * @param exportStatus * The status of the export. When the status is Completed the export archive is available * for download. * @see ExportStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ExportStatus */ Builder exportStatus(ExportStatus exportStatus); /** *

* The date and time that the export was created. *

* * @param creationDateTime * The date and time that the export was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDateTime(Instant creationDateTime); /** *

* The date and time that the export was last updated. *

* * @param lastUpdatedDateTime * The date and time that the export was last updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedDateTime(Instant lastUpdatedDateTime); } static final class BuilderImpl extends LexModelsV2Response.BuilderImpl implements Builder { private String exportId; private ExportResourceSpecification resourceSpecification; private String fileFormat; private String exportStatus; private Instant creationDateTime; private Instant lastUpdatedDateTime; private BuilderImpl() { } private BuilderImpl(UpdateExportResponse model) { super(model); exportId(model.exportId); resourceSpecification(model.resourceSpecification); fileFormat(model.fileFormat); exportStatus(model.exportStatus); creationDateTime(model.creationDateTime); lastUpdatedDateTime(model.lastUpdatedDateTime); } public final String getExportId() { return exportId; } public final void setExportId(String exportId) { this.exportId = exportId; } @Override public final Builder exportId(String exportId) { this.exportId = exportId; return this; } public final ExportResourceSpecification.Builder getResourceSpecification() { return resourceSpecification != null ? resourceSpecification.toBuilder() : null; } public final void setResourceSpecification(ExportResourceSpecification.BuilderImpl resourceSpecification) { this.resourceSpecification = resourceSpecification != null ? resourceSpecification.build() : null; } @Override public final Builder resourceSpecification(ExportResourceSpecification resourceSpecification) { this.resourceSpecification = resourceSpecification; return this; } public final String getFileFormat() { return fileFormat; } public final void setFileFormat(String fileFormat) { this.fileFormat = fileFormat; } @Override public final Builder fileFormat(String fileFormat) { this.fileFormat = fileFormat; return this; } @Override public final Builder fileFormat(ImportExportFileFormat fileFormat) { this.fileFormat(fileFormat == null ? null : fileFormat.toString()); return this; } public final String getExportStatus() { return exportStatus; } public final void setExportStatus(String exportStatus) { this.exportStatus = exportStatus; } @Override public final Builder exportStatus(String exportStatus) { this.exportStatus = exportStatus; return this; } @Override public final Builder exportStatus(ExportStatus exportStatus) { this.exportStatus(exportStatus == null ? null : exportStatus.toString()); return this; } public final Instant getCreationDateTime() { return creationDateTime; } public final void setCreationDateTime(Instant creationDateTime) { this.creationDateTime = creationDateTime; } @Override public final Builder creationDateTime(Instant creationDateTime) { this.creationDateTime = creationDateTime; 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; } @Override public UpdateExportResponse build() { return new UpdateExportResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy