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

software.amazon.awssdk.services.transcribe.model.GetMedicalVocabularyResponse 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 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 GetMedicalVocabularyResponse extends TranscribeResponse implements
        ToCopyableBuilder {
    private static final SdkField VOCABULARY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("VocabularyName").getter(getter(GetMedicalVocabularyResponse::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)
            .memberName("LanguageCode").getter(getter(GetMedicalVocabularyResponse::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)
            .memberName("VocabularyState").getter(getter(GetMedicalVocabularyResponse::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)
            .memberName("LastModifiedTime").getter(getter(GetMedicalVocabularyResponse::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)
            .memberName("FailureReason").getter(getter(GetMedicalVocabularyResponse::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)
            .memberName("DownloadUri").getter(getter(GetMedicalVocabularyResponse::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 GetMedicalVocabularyResponse(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 returned by Amazon Transcribe Medical. *

* * @return The name of the vocabulary returned by Amazon Transcribe Medical. */ public final String vocabularyName() { return vocabularyName; } /** *

* The valid language code for your 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 valid language code for your vocabulary entries. * @see LanguageCode */ public final LanguageCode languageCode() { return LanguageCode.fromValue(languageCode); } /** *

* The valid language code for your 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 valid language code for your vocabulary entries. * @see LanguageCode */ public final String languageCodeAsString() { return languageCode; } /** *

* The processing state of the vocabulary. If the VocabularyState is READY then you can * use it in the StartMedicalTranscriptionJob operation. *

*

* 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. If the VocabularyState is READY then * you can use it in the StartMedicalTranscriptionJob operation. * @see VocabularyState */ public final VocabularyState vocabularyState() { return VocabularyState.fromValue(vocabularyState); } /** *

* The processing state of the vocabulary. If the VocabularyState is READY then you can * use it in the StartMedicalTranscriptionJob operation. *

*

* 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. If the VocabularyState is READY then * you can use it in the StartMedicalTranscriptionJob operation. * @see VocabularyState */ public final String vocabularyStateAsString() { return vocabularyState; } /** *

* The date and time that the vocabulary was last modified with a text file different from the one that was * previously used. *

* * @return The date and time that the vocabulary was last modified with a text file different from the one that was * previously used. */ public final Instant lastModifiedTime() { return lastModifiedTime; } /** *

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

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

* The location in Amazon S3 where the vocabulary is stored. Use this URI to get the contents of the vocabulary. You * can download your vocabulary from the URI for a limited time. *

* * @return The location in Amazon S3 where the vocabulary is stored. Use this URI to get the contents of the * vocabulary. You can download your vocabulary from the URI for a limited time. */ public final 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 final 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 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 GetMedicalVocabularyResponse)) { return false; } GetMedicalVocabularyResponse other = (GetMedicalVocabularyResponse) 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 final String toString() { return ToString.builder("GetMedicalVocabularyResponse").add("VocabularyName", vocabularyName()) .add("LanguageCode", languageCodeAsString()).add("VocabularyState", vocabularyStateAsString()) .add("LastModifiedTime", lastModifiedTime()).add("FailureReason", failureReason()) .add("DownloadUri", downloadUri()).build(); } public final 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 final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetMedicalVocabularyResponse) 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 returned by Amazon Transcribe Medical. *

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

* The valid language code for your vocabulary entries. *

* * @param languageCode * The valid language code for your 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 valid language code for your vocabulary entries. *

* * @param languageCode * The valid language code for your 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. If the VocabularyState is READY then you * can use it in the StartMedicalTranscriptionJob operation. *

* * @param vocabularyState * The processing state of the vocabulary. If the VocabularyState is READY then * you can use it in the StartMedicalTranscriptionJob operation. * @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. If the VocabularyState is READY then you * can use it in the StartMedicalTranscriptionJob operation. *

* * @param vocabularyState * The processing state of the vocabulary. If the VocabularyState is READY then * you can use it in the StartMedicalTranscriptionJob operation. * @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 with a text file different from the one that was * previously used. *

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

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

* * @param failureReason * If the VocabularyState 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 location in Amazon S3 where the vocabulary is stored. Use this URI to get the contents of the vocabulary. * You can download your vocabulary from the URI for a limited time. *

* * @param downloadUri * The location in Amazon S3 where the vocabulary is stored. Use this URI to get the contents of the * vocabulary. You can download your vocabulary from the URI 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(GetMedicalVocabularyResponse 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 getLanguageCode() { 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 getVocabularyState() { 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 GetMedicalVocabularyResponse build() { return new GetMedicalVocabularyResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy