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

software.amazon.awssdk.services.transcribe.model.GetVocabularyResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Transcribe module holds the client classes that are used for communicating with Transcribe.

There is a newer version: 2.29.39
Show newest version
/*
 * Copyright 2014-2019 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.transcribe.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.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 GetVocabularyResponse extends TranscribeResponse implements
        ToCopyableBuilder {
    private static final SdkField VOCABULARY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(GetVocabularyResponse::vocabularyName)).setter(setter(Builder::vocabularyName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VocabularyName").build()).build();

    private static final SdkField LANGUAGE_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(GetVocabularyResponse::languageCodeAsString)).setter(setter(Builder::languageCode))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LanguageCode").build()).build();

    private static final SdkField VOCABULARY_STATE_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(GetVocabularyResponse::vocabularyStateAsString)).setter(setter(Builder::vocabularyState))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VocabularyState").build()).build();

    private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .getter(getter(GetVocabularyResponse::lastModifiedTime)).setter(setter(Builder::lastModifiedTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();

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

    private static final SdkField DOWNLOAD_URI_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(GetVocabularyResponse::downloadUri)).setter(setter(Builder::downloadUri))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DownloadUri").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOCABULARY_NAME_FIELD,
            LANGUAGE_CODE_FIELD, VOCABULARY_STATE_FIELD, LAST_MODIFIED_TIME_FIELD, FAILURE_REASON_FIELD, DOWNLOAD_URI_FIELD));

    private final String vocabularyName;

    private final String languageCode;

    private final String vocabularyState;

    private final Instant lastModifiedTime;

    private final String failureReason;

    private final String downloadUri;

    private GetVocabularyResponse(BuilderImpl builder) {
        super(builder);
        this.vocabularyName = builder.vocabularyName;
        this.languageCode = builder.languageCode;
        this.vocabularyState = builder.vocabularyState;
        this.lastModifiedTime = builder.lastModifiedTime;
        this.failureReason = builder.failureReason;
        this.downloadUri = builder.downloadUri;
    }

    /**
     * 

* The name of the vocabulary to return. *

* * @return The name of the vocabulary to return. */ public String vocabularyName() { return vocabularyName; } /** *

* The language code of the vocabulary entries. *

*

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

* * @return The language code of the vocabulary entries. * @see LanguageCode */ public LanguageCode languageCode() { return LanguageCode.fromValue(languageCode); } /** *

* The language code of the vocabulary entries. *

*

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

* * @return The language code of the vocabulary entries. * @see LanguageCode */ public String languageCodeAsString() { return languageCode; } /** *

* The processing state of the vocabulary. *

*

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

* * @return The processing state of the vocabulary. * @see VocabularyState */ public VocabularyState vocabularyState() { return VocabularyState.fromValue(vocabularyState); } /** *

* The processing state of the vocabulary. *

*

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

* * @return The processing state of the vocabulary. * @see VocabularyState */ public String vocabularyStateAsString() { return vocabularyState; } /** *

* The date and time that the vocabulary was last modified. *

* * @return The date and time that the vocabulary was last modified. */ public Instant lastModifiedTime() { return lastModifiedTime; } /** *

* If the VocabularyState field is FAILED, this field contains information about why the * job failed. *

* * @return If the VocabularyState field is FAILED, this field contains information about * why the job failed. */ public String failureReason() { return failureReason; } /** *

* The S3 location where the vocabulary is stored. Use this URI to get the contents of the vocabulary. The URI is * available for a limited time. *

* * @return The S3 location where the vocabulary is stored. Use this URI to get the contents of the vocabulary. The * URI is available for a limited time. */ public String downloadUri() { return downloadUri; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(vocabularyName()); hashCode = 31 * hashCode + Objects.hashCode(languageCodeAsString()); hashCode = 31 * hashCode + Objects.hashCode(vocabularyStateAsString()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime()); hashCode = 31 * hashCode + Objects.hashCode(failureReason()); hashCode = 31 * hashCode + Objects.hashCode(downloadUri()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof GetVocabularyResponse)) { return false; } GetVocabularyResponse other = (GetVocabularyResponse) obj; return Objects.equals(vocabularyName(), other.vocabularyName()) && Objects.equals(languageCodeAsString(), other.languageCodeAsString()) && Objects.equals(vocabularyStateAsString(), other.vocabularyStateAsString()) && Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(failureReason(), other.failureReason()) && Objects.equals(downloadUri(), other.downloadUri()); } /** * 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 String toString() { return ToString.builder("GetVocabularyResponse").add("VocabularyName", vocabularyName()) .add("LanguageCode", languageCodeAsString()).add("VocabularyState", vocabularyStateAsString()) .add("LastModifiedTime", lastModifiedTime()).add("FailureReason", failureReason()) .add("DownloadUri", downloadUri()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "VocabularyName": return Optional.ofNullable(clazz.cast(vocabularyName())); case "LanguageCode": return Optional.ofNullable(clazz.cast(languageCodeAsString())); case "VocabularyState": return Optional.ofNullable(clazz.cast(vocabularyStateAsString())); case "LastModifiedTime": return Optional.ofNullable(clazz.cast(lastModifiedTime())); case "FailureReason": return Optional.ofNullable(clazz.cast(failureReason())); case "DownloadUri": return Optional.ofNullable(clazz.cast(downloadUri())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetVocabularyResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends TranscribeResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the vocabulary to return. *

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

* The language code of the vocabulary entries. *

* * @param languageCode * The language code of the vocabulary entries. * @see LanguageCode * @return Returns a reference to this object so that method calls can be chained together. * @see LanguageCode */ Builder languageCode(String languageCode); /** *

* The language code of the vocabulary entries. *

* * @param languageCode * The language code of the vocabulary entries. * @see LanguageCode * @return Returns a reference to this object so that method calls can be chained together. * @see LanguageCode */ Builder languageCode(LanguageCode languageCode); /** *

* The processing state of the vocabulary. *

* * @param vocabularyState * The processing state of the vocabulary. * @see VocabularyState * @return Returns a reference to this object so that method calls can be chained together. * @see VocabularyState */ Builder vocabularyState(String vocabularyState); /** *

* The processing state of the vocabulary. *

* * @param vocabularyState * The processing state of the vocabulary. * @see VocabularyState * @return Returns a reference to this object so that method calls can be chained together. * @see VocabularyState */ Builder vocabularyState(VocabularyState vocabularyState); /** *

* The date and time that the vocabulary was last modified. *

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

* If the VocabularyState field is FAILED, this field contains information about why * the job failed. *

* * @param failureReason * If the VocabularyState field is FAILED, this field contains information * about why the job failed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureReason(String failureReason); /** *

* The S3 location where the vocabulary is stored. Use this URI to get the contents of the vocabulary. The URI * is available for a limited time. *

* * @param downloadUri * The S3 location where the vocabulary is stored. Use this URI to get the contents of the vocabulary. * The URI is available for a limited time. * @return Returns a reference to this object so that method calls can be chained together. */ Builder downloadUri(String downloadUri); } static final class BuilderImpl extends TranscribeResponse.BuilderImpl implements Builder { private String vocabularyName; private String languageCode; private String vocabularyState; private Instant lastModifiedTime; private String failureReason; private String downloadUri; private BuilderImpl() { } private BuilderImpl(GetVocabularyResponse model) { super(model); vocabularyName(model.vocabularyName); languageCode(model.languageCode); vocabularyState(model.vocabularyState); lastModifiedTime(model.lastModifiedTime); failureReason(model.failureReason); downloadUri(model.downloadUri); } public final String getVocabularyName() { return vocabularyName; } @Override public final Builder vocabularyName(String vocabularyName) { this.vocabularyName = vocabularyName; return this; } public final void setVocabularyName(String vocabularyName) { this.vocabularyName = vocabularyName; } public final String getLanguageCodeAsString() { return languageCode; } @Override public final Builder languageCode(String languageCode) { this.languageCode = languageCode; return this; } @Override public final Builder languageCode(LanguageCode languageCode) { this.languageCode(languageCode == null ? null : languageCode.toString()); return this; } public final void setLanguageCode(String languageCode) { this.languageCode = languageCode; } public final String getVocabularyStateAsString() { return vocabularyState; } @Override public final Builder vocabularyState(String vocabularyState) { this.vocabularyState = vocabularyState; return this; } @Override public final Builder vocabularyState(VocabularyState vocabularyState) { this.vocabularyState(vocabularyState == null ? null : vocabularyState.toString()); return this; } public final void setVocabularyState(String vocabularyState) { this.vocabularyState = vocabularyState; } public final Instant getLastModifiedTime() { return lastModifiedTime; } @Override public final Builder lastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; return this; } public final void setLastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } public final String getFailureReason() { return failureReason; } @Override public final Builder failureReason(String failureReason) { this.failureReason = failureReason; return this; } public final void setFailureReason(String failureReason) { this.failureReason = failureReason; } public final String getDownloadUri() { return downloadUri; } @Override public final Builder downloadUri(String downloadUri) { this.downloadUri = downloadUri; return this; } public final void setDownloadUri(String downloadUri) { this.downloadUri = downloadUri; } @Override public GetVocabularyResponse build() { return new GetVocabularyResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy