com.mux.sdk.models.SimulcastTarget 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;
/**
* SimulcastTarget
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class SimulcastTarget {
public static final String SERIALIZED_NAME_ID = "id";
@SerializedName(SERIALIZED_NAME_ID)
private String id;
public static final String SERIALIZED_NAME_PASSTHROUGH = "passthrough";
@SerializedName(SERIALIZED_NAME_PASSTHROUGH)
private String passthrough;
/**
* The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. When a simulcast target has this status it will have an `error_severity` field with more details about the error.
*/
@JsonAdapter(StatusEnum.Adapter.class)
public enum StatusEnum {
IDLE("idle"),
STARTING("starting"),
BROADCASTING("broadcasting"),
ERRORED("errored");
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_STREAM_KEY = "stream_key";
@SerializedName(SERIALIZED_NAME_STREAM_KEY)
private String streamKey;
public static final String SERIALIZED_NAME_URL = "url";
@SerializedName(SERIALIZED_NAME_URL)
private String url;
/**
* The severity of the error encountered by the simulcast target. This field is only set when the simulcast target is in the `errored` status. See the values of severities below and their descriptions. * `normal`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. A simulcast may transition back into the broadcasting state if a connection with the service can be re-established. * `fatal`: The simulcast target is incompatible with the current input to the parent live stream. No further attempts to this simulcast target will be made for the current live stream asset.
*/
@JsonAdapter(ErrorSeverityEnum.Adapter.class)
public enum ErrorSeverityEnum {
NORMAL("normal"),
FATAL("fatal");
private String value;
ErrorSeverityEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static ErrorSeverityEnum fromValue(String value) {
for (ErrorSeverityEnum b : ErrorSeverityEnum.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 ErrorSeverityEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public ErrorSeverityEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return ErrorSeverityEnum.fromValue(value);
}
}
}
public static final String SERIALIZED_NAME_ERROR_SEVERITY = "error_severity";
@SerializedName(SERIALIZED_NAME_ERROR_SEVERITY)
private ErrorSeverityEnum errorSeverity;
public SimulcastTarget id(String id) {
this.id = id;
return this;
}
/**
* ID of the Simulcast Target
* @return id
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "ID of the Simulcast Target")
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public SimulcastTarget passthrough(String passthrough) {
this.passthrough = passthrough;
return this;
}
/**
* Arbitrary user-supplied metadata set when creating a simulcast target.
* @return passthrough
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Arbitrary user-supplied metadata set when creating a simulcast target.")
public String getPassthrough() {
return passthrough;
}
public void setPassthrough(String passthrough) {
this.passthrough = passthrough;
}
public SimulcastTarget status(StatusEnum status) {
this.status = status;
return this;
}
/**
* The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. When a simulcast target has this status it will have an `error_severity` field with more details about the error.
* @return status
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The current status of the simulcast target. See Statuses below for detailed description. * `idle`: Default status. When the parent live stream is in disconnected status, simulcast targets will be idle state. * `starting`: The simulcast target transitions into this state when the parent live stream transition into connected state. * `broadcasting`: The simulcast target has successfully connected to the third party live streaming service and is pushing video to that service. * `errored`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. When a simulcast target has this status it will have an `error_severity` field with more details about the error. ")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
public SimulcastTarget streamKey(String streamKey) {
this.streamKey = streamKey;
return this;
}
/**
* Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. Only used for RTMP(s) simulcast destinations.
* @return streamKey
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Stream Key represents a stream identifier on the third party live streaming service to send the parent live stream to. Only used for RTMP(s) simulcast destinations.")
public String getStreamKey() {
return streamKey;
}
public void setStreamKey(String streamKey) {
this.streamKey = streamKey;
}
public SimulcastTarget url(String url) {
this.url = url;
return this;
}
/**
* The RTMP(s) or SRT endpoint for a simulcast destination. * For RTMP(s) destinations, this should include the application name for the third party live streaming service, for example: `rtmp://live.example.com/app`. * For SRT destinations, this should be a fully formed SRT connection string, for example: `srt://srt-live.example.com:1234?streamid={stream_key}&passphrase={srt_passphrase}`. Note: SRT simulcast targets can only be used when an source is connected over SRT.
* @return url
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The RTMP(s) or SRT endpoint for a simulcast destination. * For RTMP(s) destinations, this should include the application name for the third party live streaming service, for example: `rtmp://live.example.com/app`. * For SRT destinations, this should be a fully formed SRT connection string, for example: `srt://srt-live.example.com:1234?streamid={stream_key}&passphrase={srt_passphrase}`. Note: SRT simulcast targets can only be used when an source is connected over SRT. ")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public SimulcastTarget errorSeverity(ErrorSeverityEnum errorSeverity) {
this.errorSeverity = errorSeverity;
return this;
}
/**
* The severity of the error encountered by the simulcast target. This field is only set when the simulcast target is in the `errored` status. See the values of severities below and their descriptions. * `normal`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. A simulcast may transition back into the broadcasting state if a connection with the service can be re-established. * `fatal`: The simulcast target is incompatible with the current input to the parent live stream. No further attempts to this simulcast target will be made for the current live stream asset.
* @return errorSeverity
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "The severity of the error encountered by the simulcast target. This field is only set when the simulcast target is in the `errored` status. See the values of severities below and their descriptions. * `normal`: The simulcast target encountered an error either while attempting to connect to the third party live streaming service, or mid-broadcasting. A simulcast may transition back into the broadcasting state if a connection with the service can be re-established. * `fatal`: The simulcast target is incompatible with the current input to the parent live stream. No further attempts to this simulcast target will be made for the current live stream asset. ")
public ErrorSeverityEnum getErrorSeverity() {
return errorSeverity;
}
public void setErrorSeverity(ErrorSeverityEnum errorSeverity) {
this.errorSeverity = errorSeverity;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SimulcastTarget simulcastTarget = (SimulcastTarget) o;
return Objects.equals(this.id, simulcastTarget.id) &&
Objects.equals(this.passthrough, simulcastTarget.passthrough) &&
Objects.equals(this.status, simulcastTarget.status) &&
Objects.equals(this.streamKey, simulcastTarget.streamKey) &&
Objects.equals(this.url, simulcastTarget.url) &&
Objects.equals(this.errorSeverity, simulcastTarget.errorSeverity);
}
@Override
public int hashCode() {
return Objects.hash(id, passthrough, status, streamKey, url, errorSeverity);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SimulcastTarget {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" passthrough: ").append(toIndentedString(passthrough)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" streamKey: ").append(toIndentedString(streamKey)).append("\n");
sb.append(" url: ").append(toIndentedString(url)).append("\n");
sb.append(" errorSeverity: ").append(toIndentedString(errorSeverity)).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 ");
}
}