
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 extends Builder> 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