software.amazon.awssdk.services.transcribe.model.UpdateMedicalVocabularyRequest Maven / Gradle / Ivy
Show all versions of transcribe Show documentation
/*
* 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.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.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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 UpdateMedicalVocabularyRequest extends TranscribeRequest implements
ToCopyableBuilder {
private static final SdkField VOCABULARY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VocabularyName").getter(getter(UpdateMedicalVocabularyRequest::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(UpdateMedicalVocabularyRequest::languageCodeAsString))
.setter(setter(Builder::languageCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LanguageCode").build()).build();
private static final SdkField VOCABULARY_FILE_URI_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VocabularyFileUri").getter(getter(UpdateMedicalVocabularyRequest::vocabularyFileUri))
.setter(setter(Builder::vocabularyFileUri))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VocabularyFileUri").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOCABULARY_NAME_FIELD,
LANGUAGE_CODE_FIELD, VOCABULARY_FILE_URI_FIELD));
private final String vocabularyName;
private final String languageCode;
private final String vocabularyFileUri;
private UpdateMedicalVocabularyRequest(BuilderImpl builder) {
super(builder);
this.vocabularyName = builder.vocabularyName;
this.languageCode = builder.languageCode;
this.vocabularyFileUri = builder.vocabularyFileUri;
}
/**
*
* The name of the vocabulary to update. The name is case sensitive. If you try to update a vocabulary with the same
* name as a vocabulary you've already made, you get a ConflictException
error.
*
*
* @return The name of the vocabulary to update. The name is case sensitive. If you try to update a vocabulary with
* the same name as a vocabulary you've already made, you get a ConflictException
error.
*/
public String vocabularyName() {
return vocabularyName;
}
/**
*
* The language code of the language used for the entries in the updated vocabulary. US English (en-US) is the only
* valid language code in Amazon Transcribe Medical.
*
*
* 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 language used for the entries in the updated vocabulary. US English (en-US) is
* the only valid language code in Amazon Transcribe Medical.
* @see LanguageCode
*/
public LanguageCode languageCode() {
return LanguageCode.fromValue(languageCode);
}
/**
*
* The language code of the language used for the entries in the updated vocabulary. US English (en-US) is the only
* valid language code in Amazon Transcribe Medical.
*
*
* 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 language used for the entries in the updated vocabulary. US English (en-US) is
* the only valid language code in Amazon Transcribe Medical.
* @see LanguageCode
*/
public String languageCodeAsString() {
return languageCode;
}
/**
*
* The location in Amazon S3 of the text file that contains the you use for your custom vocabulary. The URI must be
* in the same AWS Region as the resource that you are calling. The following is the format for a URI:
*
*
* https://s3.<aws-region>.amazonaws.com/<bucket-name>/<keyprefix>/<objectkey>
*
*
* For example:
*
*
* https://s3.us-east-1.amazonaws.com/AWSDOC-EXAMPLE-BUCKET/vocab.txt
*
*
* For more information about Amazon S3 object names, see Object Keys in the
* Amazon S3 Developer Guide.
*
*
* For more information about custom vocabularies in Amazon Transcribe Medical, see Medical Custom
* Vocabularies.
*
*
* @return The location in Amazon S3 of the text file that contains the you use for your custom vocabulary. The URI
* must be in the same AWS Region as the resource that you are calling. The following is the format for a
* URI:
*
* https://s3.<aws-region>.amazonaws.com/<bucket-name>/<keyprefix>/<objectkey>
*
*
* For example:
*
*
* https://s3.us-east-1.amazonaws.com/AWSDOC-EXAMPLE-BUCKET/vocab.txt
*
*
* For more information about Amazon S3 object names, see Object Keys in
* the Amazon S3 Developer Guide.
*
*
* For more information about custom vocabularies in Amazon Transcribe Medical, see Medical Custom
* Vocabularies.
*/
public String vocabularyFileUri() {
return vocabularyFileUri;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> 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(vocabularyFileUri());
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 UpdateMedicalVocabularyRequest)) {
return false;
}
UpdateMedicalVocabularyRequest other = (UpdateMedicalVocabularyRequest) obj;
return Objects.equals(vocabularyName(), other.vocabularyName())
&& Objects.equals(languageCodeAsString(), other.languageCodeAsString())
&& Objects.equals(vocabularyFileUri(), other.vocabularyFileUri());
}
/**
* 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("UpdateMedicalVocabularyRequest").add("VocabularyName", vocabularyName())
.add("LanguageCode", languageCodeAsString()).add("VocabularyFileUri", vocabularyFileUri()).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 "VocabularyFileUri":
return Optional.ofNullable(clazz.cast(vocabularyFileUri()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* https://s3.<aws-region>.amazonaws.com/<bucket-name>/<keyprefix>/<objectkey>
*
*
* For example:
*
*
* https://s3.us-east-1.amazonaws.com/AWSDOC-EXAMPLE-BUCKET/vocab.txt
*
*
* For more information about Amazon S3 object names, see Object Keys
* in the Amazon S3 Developer Guide.
*
*
* For more information about custom vocabularies in Amazon Transcribe Medical, see Medical Custom
* Vocabularies.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vocabularyFileUri(String vocabularyFileUri);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends TranscribeRequest.BuilderImpl implements Builder {
private String vocabularyName;
private String languageCode;
private String vocabularyFileUri;
private BuilderImpl() {
}
private BuilderImpl(UpdateMedicalVocabularyRequest model) {
super(model);
vocabularyName(model.vocabularyName);
languageCode(model.languageCode);
vocabularyFileUri(model.vocabularyFileUri);
}
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 getVocabularyFileUri() {
return vocabularyFileUri;
}
@Override
public final Builder vocabularyFileUri(String vocabularyFileUri) {
this.vocabularyFileUri = vocabularyFileUri;
return this;
}
public final void setVocabularyFileUri(String vocabularyFileUri) {
this.vocabularyFileUri = vocabularyFileUri;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public UpdateMedicalVocabularyRequest build() {
return new UpdateMedicalVocabularyRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}