software.amazon.awssdk.services.transcribe.model.MedicalTranscriptionJobSummary 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.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 summary information about a transcription job.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MedicalTranscriptionJobSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField MEDICAL_TRANSCRIPTION_JOB_NAME_FIELD = SdkField
. builder(MarshallingType.STRING)
.getter(getter(MedicalTranscriptionJobSummary::medicalTranscriptionJobName))
.setter(setter(Builder::medicalTranscriptionJobName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MedicalTranscriptionJobName")
.build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(MedicalTranscriptionJobSummary::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(MedicalTranscriptionJobSummary::startTime)).setter(setter(Builder::startTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build();
private static final SdkField COMPLETION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(MedicalTranscriptionJobSummary::completionTime)).setter(setter(Builder::completionTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompletionTime").build()).build();
private static final SdkField LANGUAGE_CODE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MedicalTranscriptionJobSummary::languageCodeAsString)).setter(setter(Builder::languageCode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LanguageCode").build()).build();
private static final SdkField TRANSCRIPTION_JOB_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MedicalTranscriptionJobSummary::transcriptionJobStatusAsString))
.setter(setter(Builder::transcriptionJobStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TranscriptionJobStatus").build())
.build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MedicalTranscriptionJobSummary::failureReason)).setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build();
private static final SdkField OUTPUT_LOCATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MedicalTranscriptionJobSummary::outputLocationTypeAsString))
.setter(setter(Builder::outputLocationType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputLocationType").build())
.build();
private static final SdkField SPECIALTY_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MedicalTranscriptionJobSummary::specialtyAsString)).setter(setter(Builder::specialty))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Specialty").build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MedicalTranscriptionJobSummary::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Type").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
MEDICAL_TRANSCRIPTION_JOB_NAME_FIELD, CREATION_TIME_FIELD, START_TIME_FIELD, COMPLETION_TIME_FIELD,
LANGUAGE_CODE_FIELD, TRANSCRIPTION_JOB_STATUS_FIELD, FAILURE_REASON_FIELD, OUTPUT_LOCATION_TYPE_FIELD,
SPECIALTY_FIELD, TYPE_FIELD));
private static final long serialVersionUID = 1L;
private final String medicalTranscriptionJobName;
private final Instant creationTime;
private final Instant startTime;
private final Instant completionTime;
private final String languageCode;
private final String transcriptionJobStatus;
private final String failureReason;
private final String outputLocationType;
private final String specialty;
private final String type;
private MedicalTranscriptionJobSummary(BuilderImpl builder) {
this.medicalTranscriptionJobName = builder.medicalTranscriptionJobName;
this.creationTime = builder.creationTime;
this.startTime = builder.startTime;
this.completionTime = builder.completionTime;
this.languageCode = builder.languageCode;
this.transcriptionJobStatus = builder.transcriptionJobStatus;
this.failureReason = builder.failureReason;
this.outputLocationType = builder.outputLocationType;
this.specialty = builder.specialty;
this.type = builder.type;
}
/**
*
* The name of a medical transcription job.
*
*
* @return The name of a medical transcription job.
*/
public String medicalTranscriptionJobName() {
return medicalTranscriptionJobName;
}
/**
*
* A timestamp that shows when the medical transcription job was created.
*
*
* @return A timestamp that shows when the medical transcription job was created.
*/
public Instant creationTime() {
return creationTime;
}
/**
*
* A timestamp that shows when the job began processing.
*
*
* @return A timestamp that shows when the job began processing.
*/
public Instant startTime() {
return startTime;
}
/**
*
* A timestamp that shows when the job was completed.
*
*
* @return A timestamp that shows when the job was completed.
*/
public Instant completionTime() {
return completionTime;
}
/**
*
* The language of the transcript in the source audio file.
*
*
* 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 of the transcript in the source audio file.
* @see LanguageCode
*/
public LanguageCode languageCode() {
return LanguageCode.fromValue(languageCode);
}
/**
*
* The language of the transcript in the source audio file.
*
*
* 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 of the transcript in the source audio file.
* @see LanguageCode
*/
public String languageCodeAsString() {
return languageCode;
}
/**
*
* The status of the medical transcription job.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #transcriptionJobStatus} will return {@link TranscriptionJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #transcriptionJobStatusAsString}.
*
*
* @return The status of the medical transcription job.
* @see TranscriptionJobStatus
*/
public TranscriptionJobStatus transcriptionJobStatus() {
return TranscriptionJobStatus.fromValue(transcriptionJobStatus);
}
/**
*
* The status of the medical transcription job.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #transcriptionJobStatus} will return {@link TranscriptionJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #transcriptionJobStatusAsString}.
*
*
* @return The status of the medical transcription job.
* @see TranscriptionJobStatus
*/
public String transcriptionJobStatusAsString() {
return transcriptionJobStatus;
}
/**
*
* If the TranscriptionJobStatus
field is FAILED
, a description of the error.
*
*
* @return If the TranscriptionJobStatus
field is FAILED
, a description of the error.
*/
public String failureReason() {
return failureReason;
}
/**
*
* Indicates the location of the transcription job's output.
*
*
* The CUSTOMER_BUCKET
is the S3 location provided in the OutputBucketName
field when the
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #outputLocationType} will return {@link OutputLocationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #outputLocationTypeAsString}.
*
*
* @return Indicates the location of the transcription job's output.
*
* The CUSTOMER_BUCKET
is the S3 location provided in the OutputBucketName
field
* when the
* @see OutputLocationType
*/
public OutputLocationType outputLocationType() {
return OutputLocationType.fromValue(outputLocationType);
}
/**
*
* Indicates the location of the transcription job's output.
*
*
* The CUSTOMER_BUCKET
is the S3 location provided in the OutputBucketName
field when the
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #outputLocationType} will return {@link OutputLocationType#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #outputLocationTypeAsString}.
*
*
* @return Indicates the location of the transcription job's output.
*
* The CUSTOMER_BUCKET
is the S3 location provided in the OutputBucketName
field
* when the
* @see OutputLocationType
*/
public String outputLocationTypeAsString() {
return outputLocationType;
}
/**
*
* The medical specialty of the transcription job. Primary care
is the only valid value.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #specialty} will
* return {@link Specialty#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #specialtyAsString}.
*
*
* @return The medical specialty of the transcription job. Primary care
is the only valid value.
* @see Specialty
*/
public Specialty specialty() {
return Specialty.fromValue(specialty);
}
/**
*
* The medical specialty of the transcription job. Primary care
is the only valid value.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #specialty} will
* return {@link Specialty#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #specialtyAsString}.
*
*
* @return The medical specialty of the transcription job. Primary care
is the only valid value.
* @see Specialty
*/
public String specialtyAsString() {
return specialty;
}
/**
*
* The speech of the clinician in the input audio.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link Type#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The speech of the clinician in the input audio.
* @see Type
*/
public Type type() {
return Type.fromValue(type);
}
/**
*
* The speech of the clinician in the input audio.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link Type#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The speech of the clinician in the input audio.
* @see Type
*/
public String typeAsString() {
return type;
}
@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 + Objects.hashCode(medicalTranscriptionJobName());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(startTime());
hashCode = 31 * hashCode + Objects.hashCode(completionTime());
hashCode = 31 * hashCode + Objects.hashCode(languageCodeAsString());
hashCode = 31 * hashCode + Objects.hashCode(transcriptionJobStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
hashCode = 31 * hashCode + Objects.hashCode(outputLocationTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(specialtyAsString());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof MedicalTranscriptionJobSummary)) {
return false;
}
MedicalTranscriptionJobSummary other = (MedicalTranscriptionJobSummary) obj;
return Objects.equals(medicalTranscriptionJobName(), other.medicalTranscriptionJobName())
&& Objects.equals(creationTime(), other.creationTime()) && Objects.equals(startTime(), other.startTime())
&& Objects.equals(completionTime(), other.completionTime())
&& Objects.equals(languageCodeAsString(), other.languageCodeAsString())
&& Objects.equals(transcriptionJobStatusAsString(), other.transcriptionJobStatusAsString())
&& Objects.equals(failureReason(), other.failureReason())
&& Objects.equals(outputLocationTypeAsString(), other.outputLocationTypeAsString())
&& Objects.equals(specialtyAsString(), other.specialtyAsString())
&& Objects.equals(typeAsString(), other.typeAsString());
}
/**
* 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("MedicalTranscriptionJobSummary")
.add("MedicalTranscriptionJobName", medicalTranscriptionJobName()).add("CreationTime", creationTime())
.add("StartTime", startTime()).add("CompletionTime", completionTime())
.add("LanguageCode", languageCodeAsString()).add("TranscriptionJobStatus", transcriptionJobStatusAsString())
.add("FailureReason", failureReason()).add("OutputLocationType", outputLocationTypeAsString())
.add("Specialty", specialtyAsString()).add("Type", typeAsString()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "MedicalTranscriptionJobName":
return Optional.ofNullable(clazz.cast(medicalTranscriptionJobName()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "StartTime":
return Optional.ofNullable(clazz.cast(startTime()));
case "CompletionTime":
return Optional.ofNullable(clazz.cast(completionTime()));
case "LanguageCode":
return Optional.ofNullable(clazz.cast(languageCodeAsString()));
case "TranscriptionJobStatus":
return Optional.ofNullable(clazz.cast(transcriptionJobStatusAsString()));
case "FailureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
case "OutputLocationType":
return Optional.ofNullable(clazz.cast(outputLocationTypeAsString()));
case "Specialty":
return Optional.ofNullable(clazz.cast(specialtyAsString()));
case "Type":
return Optional.ofNullable(clazz.cast(typeAsString()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function