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

software.amazon.awssdk.services.transcribe.model.CreateVocabularyResponse 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 CreateVocabularyResponse extends TranscribeResponse implements
        ToCopyableBuilder {
    private static final SdkField VOCABULARY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("VocabularyName").getter(getter(CreateVocabularyResponse::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(CreateVocabularyResponse::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(CreateVocabularyResponse::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(CreateVocabularyResponse::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(CreateVocabularyResponse::failureReason))
            .setter(setter(Builder::failureReason))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").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));

    private final String vocabularyName;

    private final String languageCode;

    private final String vocabularyState;

    private final Instant lastModifiedTime;

    private final String failureReason;

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

    /**
     * 

* The name you chose for your custom vocabulary. *

* * @return The name you chose for your custom vocabulary. */ public final String vocabularyName() { return vocabularyName; } /** *

* The language code you selected for your custom vocabulary. *

*

* 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 you selected for your custom vocabulary. * @see LanguageCode */ public final LanguageCode languageCode() { return LanguageCode.fromValue(languageCode); } /** *

* The language code you selected for your custom vocabulary. *

*

* 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 you selected for your custom vocabulary. * @see LanguageCode */ public final String languageCodeAsString() { return languageCode; } /** *

* The processing state of your custom vocabulary. If the state is READY, you can use the custom * vocabulary in a StartTranscriptionJob request. *

*

* 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 your custom vocabulary. If the state is READY, you can use the * custom vocabulary in a StartTranscriptionJob request. * @see VocabularyState */ public final VocabularyState vocabularyState() { return VocabularyState.fromValue(vocabularyState); } /** *

* The processing state of your custom vocabulary. If the state is READY, you can use the custom * vocabulary in a StartTranscriptionJob request. *

*

* 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 your custom vocabulary. If the state is READY, you can use the * custom vocabulary in a StartTranscriptionJob request. * @see VocabularyState */ public final String vocabularyStateAsString() { return vocabularyState; } /** *

* The date and time you created your custom vocabulary. *

*

* Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC. For example, * 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022. *

* * @return The date and time you created your custom vocabulary.

*

* Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC. For example, * 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022. */ public final Instant lastModifiedTime() { return lastModifiedTime; } /** *

* If VocabularyState is FAILED, FailureReason contains information about why * the custom vocabulary request failed. See also: Common Errors. *

* * @return If VocabularyState is FAILED, FailureReason contains information * about why the custom vocabulary request failed. See also: Common Errors. */ public final String failureReason() { return failureReason; } @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()); 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 CreateVocabularyResponse)) { return false; } CreateVocabularyResponse other = (CreateVocabularyResponse) 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()); } /** * 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("CreateVocabularyResponse").add("VocabularyName", vocabularyName()) .add("LanguageCode", languageCodeAsString()).add("VocabularyState", vocabularyStateAsString()) .add("LastModifiedTime", lastModifiedTime()).add("FailureReason", failureReason()).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())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateVocabularyResponse) 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 you chose for your custom vocabulary. *

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

* The language code you selected for your custom vocabulary. *

* * @param languageCode * The language code you selected for your custom vocabulary. * @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 you selected for your custom vocabulary. *

* * @param languageCode * The language code you selected for your custom vocabulary. * @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 your custom vocabulary. If the state is READY, you can use the custom * vocabulary in a StartTranscriptionJob request. *

* * @param vocabularyState * The processing state of your custom vocabulary. If the state is READY, you can use the * custom vocabulary in a StartTranscriptionJob request. * @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 your custom vocabulary. If the state is READY, you can use the custom * vocabulary in a StartTranscriptionJob request. *

* * @param vocabularyState * The processing state of your custom vocabulary. If the state is READY, you can use the * custom vocabulary in a StartTranscriptionJob request. * @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 you created your custom vocabulary. *

*

* Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC. For example, * 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022. *

* * @param lastModifiedTime * The date and time you created your custom vocabulary.

*

* Timestamps are in the format YYYY-MM-DD'T'HH:MM:SS.SSSSSS-UTC. For example, * 2022-05-04T12:32:58.761000-07:00 represents 12:32 PM UTC-7 on May 4, 2022. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedTime(Instant lastModifiedTime); /** *

* If VocabularyState is FAILED, FailureReason contains information about * why the custom vocabulary request failed. See also: Common Errors. *

* * @param failureReason * If VocabularyState is FAILED, FailureReason contains * information about why the custom vocabulary request failed. See also: Common Errors. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureReason(String failureReason); } 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 BuilderImpl() { } private BuilderImpl(CreateVocabularyResponse model) { super(model); vocabularyName(model.vocabularyName); languageCode(model.languageCode); vocabularyState(model.vocabularyState); lastModifiedTime(model.lastModifiedTime); failureReason(model.failureReason); } public final String getVocabularyName() { return vocabularyName; } public final void setVocabularyName(String vocabularyName) { this.vocabularyName = vocabularyName; } @Override public final Builder vocabularyName(String vocabularyName) { this.vocabularyName = vocabularyName; return this; } public final String getLanguageCode() { return languageCode; } public final void setLanguageCode(String languageCode) { this.languageCode = 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 String getVocabularyState() { return vocabularyState; } public final void setVocabularyState(String vocabularyState) { this.vocabularyState = 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 Instant getLastModifiedTime() { return lastModifiedTime; } public final void setLastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } @Override public final Builder lastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; 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; } @Override public CreateVocabularyResponse build() { return new CreateVocabularyResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy