software.amazon.awssdk.services.elastictranscoder.model.CaptionSource Maven / Gradle / Ivy
Show all versions of elastictranscoder 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.elastictranscoder.model;
import java.io.Serializable;
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.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;
/**
*
* A source file for the input sidecar captions used during the transcoding process.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CaptionSource implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField KEY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Key")
.getter(getter(CaptionSource::key)).setter(setter(Builder::key))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Key").build()).build();
private static final SdkField LANGUAGE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Language").getter(getter(CaptionSource::language)).setter(setter(Builder::language))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Language").build()).build();
private static final SdkField TIME_OFFSET_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TimeOffset").getter(getter(CaptionSource::timeOffset)).setter(setter(Builder::timeOffset))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeOffset").build()).build();
private static final SdkField LABEL_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Label")
.getter(getter(CaptionSource::label)).setter(setter(Builder::label))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Label").build()).build();
private static final SdkField ENCRYPTION_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Encryption").getter(getter(CaptionSource::encryption)).setter(setter(Builder::encryption))
.constructor(Encryption::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Encryption").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(KEY_FIELD, LANGUAGE_FIELD,
TIME_OFFSET_FIELD, LABEL_FIELD, ENCRYPTION_FIELD));
private static final long serialVersionUID = 1L;
private final String key;
private final String language;
private final String timeOffset;
private final String label;
private final Encryption encryption;
private CaptionSource(BuilderImpl builder) {
this.key = builder.key;
this.language = builder.language;
this.timeOffset = builder.timeOffset;
this.label = builder.label;
this.encryption = builder.encryption;
}
/**
*
* The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.
*
*
* @return The name of the sidecar caption file that you want Elastic Transcoder to include in the output file.
*/
public final String key() {
return key;
}
/**
*
* A string that specifies the language of the caption. If you specified multiple inputs with captions, the caption
* language must match in order to be included in the output. Specify this as one of:
*
*
* -
*
* 2-character ISO 639-1 code
*
*
* -
*
* 3-character ISO 639-2 code
*
*
*
*
* For more information on ISO language codes and language names, see the List of ISO 639-1 codes.
*
*
* @return A string that specifies the language of the caption. If you specified multiple inputs with captions, the
* caption language must match in order to be included in the output. Specify this as one of:
*
* -
*
* 2-character ISO 639-1 code
*
*
* -
*
* 3-character ISO 639-2 code
*
*
*
*
* For more information on ISO language codes and language names, see the List of ISO 639-1 codes.
*/
public final String language() {
return language;
}
/**
*
* For clip generation or captions that do not start at the same time as the associated video file, the
* TimeOffset
tells Elastic Transcoder how much of the video to encode before including captions.
*
*
* Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.
*
*
* @return For clip generation or captions that do not start at the same time as the associated video file, the
* TimeOffset
tells Elastic Transcoder how much of the video to encode before including
* captions.
*
* Specify the TimeOffset in the form [+-]SS.sss or [+-]HH:mm:SS.ss.
*/
public final String timeOffset() {
return timeOffset;
}
/**
*
* The label of the caption shown in the player when choosing a language. We recommend that you put the caption
* language name here, in the language of the captions.
*
*
* @return The label of the caption shown in the player when choosing a language. We recommend that you put the
* caption language name here, in the language of the captions.
*/
public final String label() {
return label;
}
/**
*
* The encryption settings, if any, that Elastic Transcoder needs to decyrpt your caption sources, or that you want
* Elastic Transcoder to apply to your caption sources.
*
*
* @return The encryption settings, if any, that Elastic Transcoder needs to decyrpt your caption sources, or that
* you want Elastic Transcoder to apply to your caption sources.
*/
public final Encryption encryption() {
return encryption;
}
@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 final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(key());
hashCode = 31 * hashCode + Objects.hashCode(language());
hashCode = 31 * hashCode + Objects.hashCode(timeOffset());
hashCode = 31 * hashCode + Objects.hashCode(label());
hashCode = 31 * hashCode + Objects.hashCode(encryption());
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 CaptionSource)) {
return false;
}
CaptionSource other = (CaptionSource) obj;
return Objects.equals(key(), other.key()) && Objects.equals(language(), other.language())
&& Objects.equals(timeOffset(), other.timeOffset()) && Objects.equals(label(), other.label())
&& Objects.equals(encryption(), other.encryption());
}
/**
* 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("CaptionSource").add("Key", key()).add("Language", language()).add("TimeOffset", timeOffset())
.add("Label", label()).add("Encryption", encryption()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Key":
return Optional.ofNullable(clazz.cast(key()));
case "Language":
return Optional.ofNullable(clazz.cast(language()));
case "TimeOffset":
return Optional.ofNullable(clazz.cast(timeOffset()));
case "Label":
return Optional.ofNullable(clazz.cast(label()));
case "Encryption":
return Optional.ofNullable(clazz.cast(encryption()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function