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

software.amazon.awssdk.services.transcribe.model.VocabularyInfo 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.io.Serializable;
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;

/**
 * 

* Provides information about a custom vocabulary, including the language of the custom vocabulary, when it was last * modified, its name, and the processing state. *

*/ @Generated("software.amazon.awssdk:codegen") public final class VocabularyInfo implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField VOCABULARY_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VocabularyName").getter(getter(VocabularyInfo::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(VocabularyInfo::languageCodeAsString)) .setter(setter(Builder::languageCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LanguageCode").build()).build(); private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("LastModifiedTime").getter(getter(VocabularyInfo::lastModifiedTime)) .setter(setter(Builder::lastModifiedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build(); private static final SdkField VOCABULARY_STATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VocabularyState").getter(getter(VocabularyInfo::vocabularyStateAsString)) .setter(setter(Builder::vocabularyState)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VocabularyState").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOCABULARY_NAME_FIELD, LANGUAGE_CODE_FIELD, LAST_MODIFIED_TIME_FIELD, VOCABULARY_STATE_FIELD)); private static final long serialVersionUID = 1L; private final String vocabularyName; private final String languageCode; private final Instant lastModifiedTime; private final String vocabularyState; private VocabularyInfo(BuilderImpl builder) { this.vocabularyName = builder.vocabularyName; this.languageCode = builder.languageCode; this.lastModifiedTime = builder.lastModifiedTime; this.vocabularyState = builder.vocabularyState; } /** *

* A unique name, chosen by you, for your custom vocabulary. This name is case sensitive, cannot contain spaces, and * must be unique within an Amazon Web Services account. *

* * @return A unique name, chosen by you, for your custom vocabulary. This name is case sensitive, cannot contain * spaces, and must be unique within an Amazon Web Services account. */ public final String vocabularyName() { return vocabularyName; } /** *

* The language code used to create your custom vocabulary. Each custom vocabulary must contain terms in only one * language. *

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For * example, if you create a custom vocabulary using US English (en-US), you can only apply this custom * vocabulary to files that contain English audio. *

*

* 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 used to create your custom vocabulary. Each custom vocabulary must contain terms in * only one language.

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. * For example, if you create a custom vocabulary using US English (en-US), you can only apply * this custom vocabulary to files that contain English audio. * @see LanguageCode */ public final LanguageCode languageCode() { return LanguageCode.fromValue(languageCode); } /** *

* The language code used to create your custom vocabulary. Each custom vocabulary must contain terms in only one * language. *

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For * example, if you create a custom vocabulary using US English (en-US), you can only apply this custom * vocabulary to files that contain English audio. *

*

* 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 used to create your custom vocabulary. Each custom vocabulary must contain terms in * only one language.

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. * For example, if you create a custom vocabulary using US English (en-US), you can only apply * this custom vocabulary to files that contain English audio. * @see LanguageCode */ public final String languageCodeAsString() { return languageCode; } /** *

* The date and time the specified custom vocabulary was last modified. *

*

* 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 the specified custom vocabulary was last modified.

*

* 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; } /** *

* 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; } @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 + Objects.hashCode(vocabularyName()); hashCode = 31 * hashCode + Objects.hashCode(languageCodeAsString()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime()); hashCode = 31 * hashCode + Objects.hashCode(vocabularyStateAsString()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof VocabularyInfo)) { return false; } VocabularyInfo other = (VocabularyInfo) obj; return Objects.equals(vocabularyName(), other.vocabularyName()) && Objects.equals(languageCodeAsString(), other.languageCodeAsString()) && Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(vocabularyStateAsString(), other.vocabularyStateAsString()); } /** * 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("VocabularyInfo").add("VocabularyName", vocabularyName()) .add("LanguageCode", languageCodeAsString()).add("LastModifiedTime", lastModifiedTime()) .add("VocabularyState", vocabularyStateAsString()).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 "LastModifiedTime": return Optional.ofNullable(clazz.cast(lastModifiedTime())); case "VocabularyState": return Optional.ofNullable(clazz.cast(vocabularyStateAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((VocabularyInfo) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A unique name, chosen by you, for your custom vocabulary. This name is case sensitive, cannot contain spaces, * and must be unique within an Amazon Web Services account. *

* * @param vocabularyName * A unique name, chosen by you, for your custom vocabulary. This name is case sensitive, cannot contain * spaces, and must be unique within an Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vocabularyName(String vocabularyName); /** *

* The language code used to create your custom vocabulary. Each custom vocabulary must contain terms in only * one language. *

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For * example, if you create a custom vocabulary using US English (en-US), you can only apply this * custom vocabulary to files that contain English audio. *

* * @param languageCode * The language code used to create your custom vocabulary. Each custom vocabulary must contain terms in * only one language.

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom * vocabulary. For example, if you create a custom vocabulary using US English (en-US), you * can only apply this custom vocabulary to files that contain English audio. * @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 used to create your custom vocabulary. Each custom vocabulary must contain terms in only * one language. *

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom vocabulary. For * example, if you create a custom vocabulary using US English (en-US), you can only apply this * custom vocabulary to files that contain English audio. *

* * @param languageCode * The language code used to create your custom vocabulary. Each custom vocabulary must contain terms in * only one language.

*

* A custom vocabulary can only be used to transcribe files in the same language as the custom * vocabulary. For example, if you create a custom vocabulary using US English (en-US), you * can only apply this custom vocabulary to files that contain English audio. * @see LanguageCode * @return Returns a reference to this object so that method calls can be chained together. * @see LanguageCode */ Builder languageCode(LanguageCode languageCode); /** *

* The date and time the specified custom vocabulary was last modified. *

*

* 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 the specified custom vocabulary was last modified.

*

* 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); /** *

* 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); } static final class BuilderImpl implements Builder { private String vocabularyName; private String languageCode; private Instant lastModifiedTime; private String vocabularyState; private BuilderImpl() { } private BuilderImpl(VocabularyInfo model) { vocabularyName(model.vocabularyName); languageCode(model.languageCode); lastModifiedTime(model.lastModifiedTime); vocabularyState(model.vocabularyState); } 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 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 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; } @Override public VocabularyInfo build() { return new VocabularyInfo(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy