
software.amazon.awssdk.services.medialive.model.RtmpOutputSettings Maven / Gradle / Ivy
/*
* 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.medialive.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;
/**
* Rtmp Output Settings
*/
@Generated("software.amazon.awssdk:codegen")
public final class RtmpOutputSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField CERTIFICATE_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CertificateMode").getter(getter(RtmpOutputSettings::certificateModeAsString))
.setter(setter(Builder::certificateMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("certificateMode").build()).build();
private static final SdkField CONNECTION_RETRY_INTERVAL_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ConnectionRetryInterval").getter(getter(RtmpOutputSettings::connectionRetryInterval))
.setter(setter(Builder::connectionRetryInterval))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectionRetryInterval").build())
.build();
private static final SdkField DESTINATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Destination")
.getter(getter(RtmpOutputSettings::destination)).setter(setter(Builder::destination))
.constructor(OutputLocationRef::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("destination").build()).build();
private static final SdkField NUM_RETRIES_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("NumRetries").getter(getter(RtmpOutputSettings::numRetries)).setter(setter(Builder::numRetries))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("numRetries").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CERTIFICATE_MODE_FIELD,
CONNECTION_RETRY_INTERVAL_FIELD, DESTINATION_FIELD, NUM_RETRIES_FIELD));
private static final long serialVersionUID = 1L;
private final String certificateMode;
private final Integer connectionRetryInterval;
private final OutputLocationRef destination;
private final Integer numRetries;
private RtmpOutputSettings(BuilderImpl builder) {
this.certificateMode = builder.certificateMode;
this.connectionRetryInterval = builder.connectionRetryInterval;
this.destination = builder.destination;
this.numRetries = builder.numRetries;
}
/**
* If set to verifyAuthenticity, verify the tls certificate chain to a trusted Certificate Authority (CA). This will
* cause rtmps outputs with self-signed certificates to fail.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #certificateMode}
* will return {@link RtmpOutputCertificateMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #certificateModeAsString}.
*
*
* @return If set to verifyAuthenticity, verify the tls certificate chain to a trusted Certificate Authority (CA).
* This will cause rtmps outputs with self-signed certificates to fail.
* @see RtmpOutputCertificateMode
*/
public final RtmpOutputCertificateMode certificateMode() {
return RtmpOutputCertificateMode.fromValue(certificateMode);
}
/**
* If set to verifyAuthenticity, verify the tls certificate chain to a trusted Certificate Authority (CA). This will
* cause rtmps outputs with self-signed certificates to fail.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #certificateMode}
* will return {@link RtmpOutputCertificateMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #certificateModeAsString}.
*
*
* @return If set to verifyAuthenticity, verify the tls certificate chain to a trusted Certificate Authority (CA).
* This will cause rtmps outputs with self-signed certificates to fail.
* @see RtmpOutputCertificateMode
*/
public final String certificateModeAsString() {
return certificateMode;
}
/**
* Number of seconds to wait before retrying a connection to the Flash Media server if the connection is lost.
*
* @return Number of seconds to wait before retrying a connection to the Flash Media server if the connection is
* lost.
*/
public final Integer connectionRetryInterval() {
return connectionRetryInterval;
}
/**
* The RTMP endpoint excluding the stream name (eg. rtmp://host/appname). For connection to Akamai, a username and
* password must be supplied. URI fields accept format identifiers.
*
* @return The RTMP endpoint excluding the stream name (eg. rtmp://host/appname). For connection to Akamai, a
* username and password must be supplied. URI fields accept format identifiers.
*/
public final OutputLocationRef destination() {
return destination;
}
/**
* Number of retry attempts.
*
* @return Number of retry attempts.
*/
public final Integer numRetries() {
return numRetries;
}
@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(certificateModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(connectionRetryInterval());
hashCode = 31 * hashCode + Objects.hashCode(destination());
hashCode = 31 * hashCode + Objects.hashCode(numRetries());
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 RtmpOutputSettings)) {
return false;
}
RtmpOutputSettings other = (RtmpOutputSettings) obj;
return Objects.equals(certificateModeAsString(), other.certificateModeAsString())
&& Objects.equals(connectionRetryInterval(), other.connectionRetryInterval())
&& Objects.equals(destination(), other.destination()) && Objects.equals(numRetries(), other.numRetries());
}
/**
* 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("RtmpOutputSettings").add("CertificateMode", certificateModeAsString())
.add("ConnectionRetryInterval", connectionRetryInterval()).add("Destination", destination())
.add("NumRetries", numRetries()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CertificateMode":
return Optional.ofNullable(clazz.cast(certificateModeAsString()));
case "ConnectionRetryInterval":
return Optional.ofNullable(clazz.cast(connectionRetryInterval()));
case "Destination":
return Optional.ofNullable(clazz.cast(destination()));
case "NumRetries":
return Optional.ofNullable(clazz.cast(numRetries()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy