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

software.amazon.awssdk.services.lexmodelbuilding.model.GetExportResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Lex Model Building module holds the client classes that are used for communicating with Amazon Lex Model Building Service

There is a newer version: 2.29.39
Show newest version
/*
 * 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.lexmodelbuilding.model;

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;

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

    private static final SdkField VERSION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("version")
            .getter(getter(GetExportResponse::version)).setter(setter(Builder::version))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("version").build()).build();

    private static final SdkField RESOURCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("resourceType").getter(getter(GetExportResponse::resourceTypeAsString))
            .setter(setter(Builder::resourceType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("resourceType").build()).build();

    private static final SdkField EXPORT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("exportType").getter(getter(GetExportResponse::exportTypeAsString)).setter(setter(Builder::exportType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("exportType").build()).build();

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

    private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("failureReason").getter(getter(GetExportResponse::failureReason)).setter(setter(Builder::failureReason))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failureReason").build()).build();

    private static final SdkField URL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("url")
            .getter(getter(GetExportResponse::url)).setter(setter(Builder::url))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("url").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, VERSION_FIELD,
            RESOURCE_TYPE_FIELD, EXPORT_TYPE_FIELD, EXPORT_STATUS_FIELD, FAILURE_REASON_FIELD, URL_FIELD));

    private final String name;

    private final String version;

    private final String resourceType;

    private final String exportType;

    private final String exportStatus;

    private final String failureReason;

    private final String url;

    private GetExportResponse(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.version = builder.version;
        this.resourceType = builder.resourceType;
        this.exportType = builder.exportType;
        this.exportStatus = builder.exportStatus;
        this.failureReason = builder.failureReason;
        this.url = builder.url;
    }

    /**
     * 

* The name of the bot being exported. *

* * @return The name of the bot being exported. */ public final String name() { return name; } /** *

* The version of the bot being exported. *

* * @return The version of the bot being exported. */ public final String version() { return version; } /** *

* The type of the exported resource. *

*

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

* * @return The type of the exported resource. * @see ResourceType */ public final ResourceType resourceType() { return ResourceType.fromValue(resourceType); } /** *

* The type of the exported resource. *

*

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

* * @return The type of the exported resource. * @see ResourceType */ public final String resourceTypeAsString() { return resourceType; } /** *

* The format of the exported data. *

*

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

* * @return The format of the exported data. * @see ExportType */ public final ExportType exportType() { return ExportType.fromValue(exportType); } /** *

* The format of the exported data. *

*

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

* * @return The format of the exported data. * @see ExportType */ public final String exportTypeAsString() { return exportType; } /** *

* The status of the export. *

*
    *
  • *

    * IN_PROGRESS - The export is in progress. *

    *
  • *
  • *

    * READY - The export is complete. *

    *
  • *
  • *

    * FAILED - The export could not be completed. *

    *
  • *
*

* 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.

*
    *
  • *

    * IN_PROGRESS - The export is in progress. *

    *
  • *
  • *

    * READY - The export is complete. *

    *
  • *
  • *

    * FAILED - The export could not be completed. *

    *
  • * @see ExportStatus */ public final ExportStatus exportStatus() { return ExportStatus.fromValue(exportStatus); } /** *

    * The status of the export. *

    *
      *
    • *

      * IN_PROGRESS - The export is in progress. *

      *
    • *
    • *

      * READY - The export is complete. *

      *
    • *
    • *

      * FAILED - The export could not be completed. *

      *
    • *
    *

    * 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.

    *
      *
    • *

      * IN_PROGRESS - The export is in progress. *

      *
    • *
    • *

      * READY - The export is complete. *

      *
    • *
    • *

      * FAILED - The export could not be completed. *

      *
    • * @see ExportStatus */ public final String exportStatusAsString() { return exportStatus; } /** *

      * If status is FAILED, Amazon Lex provides the reason that it failed to export the * resource. *

      * * @return If status is FAILED, Amazon Lex provides the reason that it failed to export * the resource. */ public final String failureReason() { return failureReason; } /** *

      * An S3 pre-signed URL that provides the location of the exported resource. The exported resource is a ZIP archive * that contains the exported resource in JSON format. The structure of the archive may change. Your code should not * rely on the archive structure. *

      * * @return An S3 pre-signed URL that provides the location of the exported resource. The exported resource is a ZIP * archive that contains the exported resource in JSON format. The structure of the archive may change. Your * code should not rely on the archive structure. */ public final String url() { return url; } @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(name()); hashCode = 31 * hashCode + Objects.hashCode(version()); hashCode = 31 * hashCode + Objects.hashCode(resourceTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(exportTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(exportStatusAsString()); hashCode = 31 * hashCode + Objects.hashCode(failureReason()); hashCode = 31 * hashCode + Objects.hashCode(url()); 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 GetExportResponse)) { return false; } GetExportResponse other = (GetExportResponse) obj; return Objects.equals(name(), other.name()) && Objects.equals(version(), other.version()) && Objects.equals(resourceTypeAsString(), other.resourceTypeAsString()) && Objects.equals(exportTypeAsString(), other.exportTypeAsString()) && Objects.equals(exportStatusAsString(), other.exportStatusAsString()) && Objects.equals(failureReason(), other.failureReason()) && Objects.equals(url(), other.url()); } /** * 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("GetExportResponse").add("Name", name()).add("Version", version()) .add("ResourceType", resourceTypeAsString()).add("ExportType", exportTypeAsString()) .add("ExportStatus", exportStatusAsString()).add("FailureReason", failureReason()).add("Url", url()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "version": return Optional.ofNullable(clazz.cast(version())); case "resourceType": return Optional.ofNullable(clazz.cast(resourceTypeAsString())); case "exportType": return Optional.ofNullable(clazz.cast(exportTypeAsString())); case "exportStatus": return Optional.ofNullable(clazz.cast(exportStatusAsString())); case "failureReason": return Optional.ofNullable(clazz.cast(failureReason())); case "url": return Optional.ofNullable(clazz.cast(url())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetExportResponse) 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 bot being exported. *

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

      * The version of the bot being exported. *

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

      * The type of the exported resource. *

      * * @param resourceType * The type of the exported resource. * @see ResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ Builder resourceType(String resourceType); /** *

      * The type of the exported resource. *

      * * @param resourceType * The type of the exported resource. * @see ResourceType * @return Returns a reference to this object so that method calls can be chained together. * @see ResourceType */ Builder resourceType(ResourceType resourceType); /** *

      * The format of the exported data. *

      * * @param exportType * The format of the exported data. * @see ExportType * @return Returns a reference to this object so that method calls can be chained together. * @see ExportType */ Builder exportType(String exportType); /** *

      * The format of the exported data. *

      * * @param exportType * The format of the exported data. * @see ExportType * @return Returns a reference to this object so that method calls can be chained together. * @see ExportType */ Builder exportType(ExportType exportType); /** *

      * The status of the export. *

      *
        *
      • *

        * IN_PROGRESS - The export is in progress. *

        *
      • *
      • *

        * READY - The export is complete. *

        *
      • *
      • *

        * FAILED - The export could not be completed. *

        *
      • *
      * * @param exportStatus * The status of the export.

      *
        *
      • *

        * IN_PROGRESS - The export is in progress. *

        *
      • *
      • *

        * READY - The export is complete. *

        *
      • *
      • *

        * FAILED - The export could not be completed. *

        *
      • * @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. *

        *
          *
        • *

          * IN_PROGRESS - The export is in progress. *

          *
        • *
        • *

          * READY - The export is complete. *

          *
        • *
        • *

          * FAILED - The export could not be completed. *

          *
        • *
        * * @param exportStatus * The status of the export.

        *
          *
        • *

          * IN_PROGRESS - The export is in progress. *

          *
        • *
        • *

          * READY - The export is complete. *

          *
        • *
        • *

          * FAILED - The export could not be completed. *

          *
        • * @see ExportStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ExportStatus */ Builder exportStatus(ExportStatus exportStatus); /** *

          * If status is FAILED, Amazon Lex provides the reason that it failed to export the * resource. *

          * * @param failureReason * If status is FAILED, Amazon Lex provides the reason that it failed to export * the resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureReason(String failureReason); /** *

          * An S3 pre-signed URL that provides the location of the exported resource. The exported resource is a ZIP * archive that contains the exported resource in JSON format. The structure of the archive may change. Your * code should not rely on the archive structure. *

          * * @param url * An S3 pre-signed URL that provides the location of the exported resource. The exported resource is a * ZIP archive that contains the exported resource in JSON format. The structure of the archive may * change. Your code should not rely on the archive structure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder url(String url); } static final class BuilderImpl extends LexModelBuildingResponse.BuilderImpl implements Builder { private String name; private String version; private String resourceType; private String exportType; private String exportStatus; private String failureReason; private String url; private BuilderImpl() { } private BuilderImpl(GetExportResponse model) { super(model); name(model.name); version(model.version); resourceType(model.resourceType); exportType(model.exportType); exportStatus(model.exportStatus); failureReason(model.failureReason); url(model.url); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getVersion() { return version; } public final void setVersion(String version) { this.version = version; } @Override public final Builder version(String version) { this.version = version; return this; } public final String getResourceType() { return resourceType; } public final void setResourceType(String resourceType) { this.resourceType = resourceType; } @Override public final Builder resourceType(String resourceType) { this.resourceType = resourceType; return this; } @Override public final Builder resourceType(ResourceType resourceType) { this.resourceType(resourceType == null ? null : resourceType.toString()); return this; } public final String getExportType() { return exportType; } public final void setExportType(String exportType) { this.exportType = exportType; } @Override public final Builder exportType(String exportType) { this.exportType = exportType; return this; } @Override public final Builder exportType(ExportType exportType) { this.exportType(exportType == null ? null : exportType.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 String getFailureReason() { return failureReason; } public final void setFailureReason(String failureReason) { this.failureReason = failureReason; } @Override public final Builder failureReason(String failureReason) { this.failureReason = failureReason; return this; } public final String getUrl() { return url; } public final void setUrl(String url) { this.url = url; } @Override public final Builder url(String url) { this.url = url; return this; } @Override public GetExportResponse build() { return new GetExportResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy