com.mux.sdk.models.Track Maven / Gradle / Ivy
The newest version!
/*
* Mux API
* Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before.
*
* The version of the OpenAPI document: v1
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.mux.sdk.models;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* Track
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class Track {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
/**
* The type of track
*/
@JsonAdapter(TypeEnum.Adapter.class)
public enum TypeEnum {
VIDEO("video"),
AUDIO("audio"),
TEXT("text");
private String value;
TypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TYPE = "type";
@SerializedName(SERIALIZED_NAME_TYPE)
private TypeEnum type;
public static final String SERIALIZED_NAME_DURATION = "duration";
@SerializedName(SERIALIZED_NAME_DURATION)
private Double duration;
public static final String SERIALIZED_NAME_MAX_WIDTH = "max_width";
@SerializedName(SERIALIZED_NAME_MAX_WIDTH)
private Long maxWidth;
public static final String SERIALIZED_NAME_MAX_HEIGHT = "max_height";
@SerializedName(SERIALIZED_NAME_MAX_HEIGHT)
private Long maxHeight;
public static final String SERIALIZED_NAME_MAX_FRAME_RATE = "max_frame_rate";
@SerializedName(SERIALIZED_NAME_MAX_FRAME_RATE)
private Double maxFrameRate;
public static final String SERIALIZED_NAME_MAX_CHANNELS = "max_channels";
@SerializedName(SERIALIZED_NAME_MAX_CHANNELS)
private Long maxChannels;
public static final String SERIALIZED_NAME_MAX_CHANNEL_LAYOUT = "max_channel_layout";
@SerializedName(SERIALIZED_NAME_MAX_CHANNEL_LAYOUT)
private String maxChannelLayout;
/**
* This parameter is only set for `text` type tracks.
*/
@JsonAdapter(TextTypeEnum.Adapter.class)
public enum TextTypeEnum {
SUBTITLES("subtitles");
private String value;
TextTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TextTypeEnum fromValue(String value) {
for (TextTypeEnum b : TextTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TextTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TextTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TextTypeEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TEXT_TYPE = "text_type";
@SerializedName(SERIALIZED_NAME_TEXT_TYPE)
private TextTypeEnum textType;
/**
* The source of the text contained in a Track of type `text`. Valid `text_source` values are listed below. * `uploaded`: Tracks uploaded to Mux as caption or subtitle files using the Create Asset Track API. * `embedded`: Tracks extracted from an embedded stream of CEA-608 closed captions. * `generated_vod`: Tracks generated by automatic speech recognition on an on-demand asset. * `generated_live`: Tracks generated by automatic speech recognition on a live stream configured with `generated_subtitles`. If an Asset has both `generated_live` and `generated_live_final` tracks that are `ready`, then only the `generated_live_final` track will be included during playback. * `generated_live_final`: Tracks generated by automatic speech recognition on a live stream using `generated_subtitles`. The accuracy, timing, and formatting of these subtitles is improved compared to the corresponding `generated_live` tracks. However, `generated_live_final` tracks will not be available in `ready` status until the live stream ends. If an Asset has both `generated_live` and `generated_live_final` tracks that are `ready`, then only the `generated_live_final` track will be included during playback.
*/
@JsonAdapter(TextSourceEnum.Adapter.class)
public enum TextSourceEnum {
UPLOADED("uploaded"),
EMBEDDED("embedded"),
GENERATED_LIVE("generated_live"),
GENERATED_LIVE_FINAL("generated_live_final"),
GENERATED_VOD("generated_vod");
private String value;
TextSourceEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TextSourceEnum fromValue(String value) {
for (TextSourceEnum b : TextSourceEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TextSourceEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TextSourceEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TextSourceEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_TEXT_SOURCE = "text_source";
@SerializedName(SERIALIZED_NAME_TEXT_SOURCE)
private TextSourceEnum textSource;
public static final String SERIALIZED_NAME_LANGUAGE_CODE = "language_code";
@SerializedName(SERIALIZED_NAME_LANGUAGE_CODE)
private String languageCode;
public static final String SERIALIZED_NAME_NAME = "name";
@SerializedName(SERIALIZED_NAME_NAME)
private String name;
public static final String SERIALIZED_NAME_CLOSED_CAPTIONS = "closed_captions";
@SerializedName(SERIALIZED_NAME_CLOSED_CAPTIONS)
private Boolean closedCaptions;
public static final String SERIALIZED_NAME_PASSTHROUGH = "passthrough";
@SerializedName(SERIALIZED_NAME_PASSTHROUGH)
private String passthrough;
/**
* The status of the track. This parameter is only set for `text` type tracks.
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
PREPARING("preparing"),
READY("ready"),
ERRORED("errored"),
DELETED("deleted");
private String value;
StatusEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static StatusEnum fromValue(String value) {
for (StatusEnum b : StatusEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public StatusEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return StatusEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_STATUS = "status";
@SerializedName(SERIALIZED_NAME_STATUS)
private StatusEnum status;
public static final String SERIALIZED_NAME_PRIMARY = "primary";
@SerializedName(SERIALIZED_NAME_PRIMARY)
private Boolean primary;
public Track id(String id) {
this.id = id;
return this;
}
/**
* Unique identifier for the Track
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Unique identifier for the Track")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Track type(TypeEnum type) {
this.type = type;
return this;
}
/**
* The type of track
* @return type
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The type of track")
public TypeEnum getType() {
return type;
}
public void setType(TypeEnum type) {
this.type = type;
}
public Track duration(Double duration) {
this.duration = duration;
return this;
}
/**
* The duration in seconds of the track media. This parameter is not set for `text` type tracks. This field is optional and may not be set. The top level `duration` field of an asset will always be set.
* @return duration
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The duration in seconds of the track media. This parameter is not set for `text` type tracks. This field is optional and may not be set. The top level `duration` field of an asset will always be set.")
public Double getDuration() {
return duration;
}
public void setDuration(Double duration) {
this.duration = duration;
}
public Track maxWidth(Long maxWidth) {
this.maxWidth = maxWidth;
return this;
}
/**
* The maximum width in pixels available for the track. Only set for the `video` type track.
* @return maxWidth
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The maximum width in pixels available for the track. Only set for the `video` type track.")
public Long getMaxWidth() {
return maxWidth;
}
public void setMaxWidth(Long maxWidth) {
this.maxWidth = maxWidth;
}
public Track maxHeight(Long maxHeight) {
this.maxHeight = maxHeight;
return this;
}
/**
* The maximum height in pixels available for the track. Only set for the `video` type track.
* @return maxHeight
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The maximum height in pixels available for the track. Only set for the `video` type track.")
public Long getMaxHeight() {
return maxHeight;
}
public void setMaxHeight(Long maxHeight) {
this.maxHeight = maxHeight;
}
public Track maxFrameRate(Double maxFrameRate) {
this.maxFrameRate = maxFrameRate;
return this;
}
/**
* The maximum frame rate available for the track. Only set for the `video` type track. This field may return `-1` if the frame rate of the input cannot be reliably determined.
* @return maxFrameRate
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The maximum frame rate available for the track. Only set for the `video` type track. This field may return `-1` if the frame rate of the input cannot be reliably determined.")
public Double getMaxFrameRate() {
return maxFrameRate;
}
public void setMaxFrameRate(Double maxFrameRate) {
this.maxFrameRate = maxFrameRate;
}
public Track maxChannels(Long maxChannels) {
this.maxChannels = maxChannels;
return this;
}
/**
* The maximum number of audio channels the track supports. Only set for the `audio` type track.
* @return maxChannels
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The maximum number of audio channels the track supports. Only set for the `audio` type track.")
public Long getMaxChannels() {
return maxChannels;
}
public void setMaxChannels(Long maxChannels) {
this.maxChannels = maxChannels;
}
public Track maxChannelLayout(String maxChannelLayout) {
this.maxChannelLayout = maxChannelLayout;
return this;
}
/**
* Only set for the `audio` type track.
* @return maxChannelLayout
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Only set for the `audio` type track.")
public String getMaxChannelLayout() {
return maxChannelLayout;
}
public void setMaxChannelLayout(String maxChannelLayout) {
this.maxChannelLayout = maxChannelLayout;
}
public Track textType(TextTypeEnum textType) {
this.textType = textType;
return this;
}
/**
* This parameter is only set for `text` type tracks.
* @return textType
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "This parameter is only set for `text` type tracks.")
public TextTypeEnum getTextType() {
return textType;
}
public void setTextType(TextTypeEnum textType) {
this.textType = textType;
}
public Track textSource(TextSourceEnum textSource) {
this.textSource = textSource;
return this;
}
/**
* The source of the text contained in a Track of type `text`. Valid `text_source` values are listed below. * `uploaded`: Tracks uploaded to Mux as caption or subtitle files using the Create Asset Track API. * `embedded`: Tracks extracted from an embedded stream of CEA-608 closed captions. * `generated_vod`: Tracks generated by automatic speech recognition on an on-demand asset. * `generated_live`: Tracks generated by automatic speech recognition on a live stream configured with `generated_subtitles`. If an Asset has both `generated_live` and `generated_live_final` tracks that are `ready`, then only the `generated_live_final` track will be included during playback. * `generated_live_final`: Tracks generated by automatic speech recognition on a live stream using `generated_subtitles`. The accuracy, timing, and formatting of these subtitles is improved compared to the corresponding `generated_live` tracks. However, `generated_live_final` tracks will not be available in `ready` status until the live stream ends. If an Asset has both `generated_live` and `generated_live_final` tracks that are `ready`, then only the `generated_live_final` track will be included during playback.
* @return textSource
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The source of the text contained in a Track of type `text`. Valid `text_source` values are listed below. * `uploaded`: Tracks uploaded to Mux as caption or subtitle files using the Create Asset Track API. * `embedded`: Tracks extracted from an embedded stream of CEA-608 closed captions. * `generated_vod`: Tracks generated by automatic speech recognition on an on-demand asset. * `generated_live`: Tracks generated by automatic speech recognition on a live stream configured with `generated_subtitles`. If an Asset has both `generated_live` and `generated_live_final` tracks that are `ready`, then only the `generated_live_final` track will be included during playback. * `generated_live_final`: Tracks generated by automatic speech recognition on a live stream using `generated_subtitles`. The accuracy, timing, and formatting of these subtitles is improved compared to the corresponding `generated_live` tracks. However, `generated_live_final` tracks will not be available in `ready` status until the live stream ends. If an Asset has both `generated_live` and `generated_live_final` tracks that are `ready`, then only the `generated_live_final` track will be included during playback. ")
public TextSourceEnum getTextSource() {
return textSource;
}
public void setTextSource(TextSourceEnum textSource) {
this.textSource = textSource;
}
public Track languageCode(String languageCode) {
this.languageCode = languageCode;
return this;
}
/**
* The language code value represents [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, `en` for English or `en-US` for the US version of English. This parameter is only set for `text` and `audio` track types.
* @return languageCode
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The language code value represents [BCP 47](https://tools.ietf.org/html/bcp47) specification compliant value. For example, `en` for English or `en-US` for the US version of English. This parameter is only set for `text` and `audio` track types.")
public String getLanguageCode() {
return languageCode;
}
public void setLanguageCode(String languageCode) {
this.languageCode = languageCode;
}
public Track name(String name) {
this.name = name;
return this;
}
/**
* The name of the track containing a human-readable description. The HLS manifest will associate a subtitle `text` or `audio` track with this value. For example, the value should be \"English\" for a subtitle text track for the `language_code` value of `en-US`. This parameter is only set for `text` and `audio` track types.
* @return name
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The name of the track containing a human-readable description. The HLS manifest will associate a subtitle `text` or `audio` track with this value. For example, the value should be \"English\" for a subtitle text track for the `language_code` value of `en-US`. This parameter is only set for `text` and `audio` track types.")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Track closedCaptions(Boolean closedCaptions) {
this.closedCaptions = closedCaptions;
return this;
}
/**
* Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is only set tracks where `type` is `text` and `text_type` is `subtitles`.
* @return closedCaptions
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Indicates the track provides Subtitles for the Deaf or Hard-of-hearing (SDH). This parameter is only set tracks where `type` is `text` and `text_type` is `subtitles`.")
public Boolean getClosedCaptions() {
return closedCaptions;
}
public void setClosedCaptions(Boolean closedCaptions) {
this.closedCaptions = closedCaptions;
}
public Track passthrough(String passthrough) {
this.passthrough = passthrough;
return this;
}
/**
* Arbitrary user-supplied metadata set for the track either when creating the asset or track. This parameter is only set for `text` type tracks. Max 255 characters.
* @return passthrough
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Arbitrary user-supplied metadata set for the track either when creating the asset or track. This parameter is only set for `text` type tracks. Max 255 characters.")
public String getPassthrough() {
return passthrough;
}
public void setPassthrough(String passthrough) {
this.passthrough = passthrough;
}
public Track status(StatusEnum status) {
this.status = status;
return this;
}
/**
* The status of the track. This parameter is only set for `text` type tracks.
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The status of the track. This parameter is only set for `text` type tracks.")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public Track primary(Boolean primary) {
this.primary = primary;
return this;
}
/**
* For an audio track, indicates that this is the primary audio track, ingested from the main input for this asset. The primary audio track cannot be deleted.
* @return primary
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "For an audio track, indicates that this is the primary audio track, ingested from the main input for this asset. The primary audio track cannot be deleted.")
public Boolean getPrimary() {
return primary;
}
public void setPrimary(Boolean primary) {
this.primary = primary;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Track track = (Track) o;
return Objects.equals(this.id, track.id) &&
Objects.equals(this.type, track.type) &&
Objects.equals(this.duration, track.duration) &&
Objects.equals(this.maxWidth, track.maxWidth) &&
Objects.equals(this.maxHeight, track.maxHeight) &&
Objects.equals(this.maxFrameRate, track.maxFrameRate) &&
Objects.equals(this.maxChannels, track.maxChannels) &&
Objects.equals(this.maxChannelLayout, track.maxChannelLayout) &&
Objects.equals(this.textType, track.textType) &&
Objects.equals(this.textSource, track.textSource) &&
Objects.equals(this.languageCode, track.languageCode) &&
Objects.equals(this.name, track.name) &&
Objects.equals(this.closedCaptions, track.closedCaptions) &&
Objects.equals(this.passthrough, track.passthrough) &&
Objects.equals(this.status, track.status) &&
Objects.equals(this.primary, track.primary);
}
@Override
public int hashCode() {
return Objects.hash(id, type, duration, maxWidth, maxHeight, maxFrameRate, maxChannels, maxChannelLayout, textType, textSource, languageCode, name, closedCaptions, passthrough, status, primary);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Track {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" duration: ").append(toIndentedString(duration)).append("\n");
sb.append(" maxWidth: ").append(toIndentedString(maxWidth)).append("\n");
sb.append(" maxHeight: ").append(toIndentedString(maxHeight)).append("\n");
sb.append(" maxFrameRate: ").append(toIndentedString(maxFrameRate)).append("\n");
sb.append(" maxChannels: ").append(toIndentedString(maxChannels)).append("\n");
sb.append(" maxChannelLayout: ").append(toIndentedString(maxChannelLayout)).append("\n");
sb.append(" textType: ").append(toIndentedString(textType)).append("\n");
sb.append(" textSource: ").append(toIndentedString(textSource)).append("\n");
sb.append(" languageCode: ").append(toIndentedString(languageCode)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" closedCaptions: ").append(toIndentedString(closedCaptions)).append("\n");
sb.append(" passthrough: ").append(toIndentedString(passthrough)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" primary: ").append(toIndentedString(primary)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}