Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.ivs.model.Channel Maven / Gradle / Ivy
Go to download
The AWS Java SDK for Ivs module holds the client classes that are used for
communicating with Ivs.
/*
* 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.ivs.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Object specifying a channel.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class Channel implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ARN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("arn")
.getter(getter(Channel::arn)).setter(setter(Builder::arn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("arn").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
.getter(getter(Channel::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField LATENCY_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("latencyMode").getter(getter(Channel::latencyModeAsString)).setter(setter(Builder::latencyMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("latencyMode").build()).build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type")
.getter(getter(Channel::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build();
private static final SdkField INGEST_ENDPOINT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ingestEndpoint").getter(getter(Channel::ingestEndpoint)).setter(setter(Builder::ingestEndpoint))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ingestEndpoint").build()).build();
private static final SdkField PLAYBACK_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("playbackUrl").getter(getter(Channel::playbackUrl)).setter(setter(Builder::playbackUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("playbackUrl").build()).build();
private static final SdkField AUTHORIZED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("authorized").getter(getter(Channel::authorized)).setter(setter(Builder::authorized))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("authorized").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("tags")
.getter(getter(Channel::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ARN_FIELD, NAME_FIELD,
LATENCY_MODE_FIELD, TYPE_FIELD, INGEST_ENDPOINT_FIELD, PLAYBACK_URL_FIELD, AUTHORIZED_FIELD, TAGS_FIELD));
private static final long serialVersionUID = 1L;
private final String arn;
private final String name;
private final String latencyMode;
private final String type;
private final String ingestEndpoint;
private final String playbackUrl;
private final Boolean authorized;
private final Map tags;
private Channel(BuilderImpl builder) {
this.arn = builder.arn;
this.name = builder.name;
this.latencyMode = builder.latencyMode;
this.type = builder.type;
this.ingestEndpoint = builder.ingestEndpoint;
this.playbackUrl = builder.playbackUrl;
this.authorized = builder.authorized;
this.tags = builder.tags;
}
/**
*
* Channel ARN.
*
*
* @return Channel ARN.
*/
public final String arn() {
return arn;
}
/**
*
* Channel name.
*
*
* @return Channel name.
*/
public final String name() {
return name;
}
/**
*
* Channel latency mode. Default: LOW
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #latencyMode} will
* return {@link ChannelLatencyMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #latencyModeAsString}.
*
*
* @return Channel latency mode. Default: LOW
.
* @see ChannelLatencyMode
*/
public final ChannelLatencyMode latencyMode() {
return ChannelLatencyMode.fromValue(latencyMode);
}
/**
*
* Channel latency mode. Default: LOW
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #latencyMode} will
* return {@link ChannelLatencyMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #latencyModeAsString}.
*
*
* @return Channel latency mode. Default: LOW
.
* @see ChannelLatencyMode
*/
public final String latencyModeAsString() {
return latencyMode;
}
/**
*
* Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable resolution or
* bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give viewers
* the best experience for their devices and network conditions. Vertical resolution can be up to 1080 and bitrate
* can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice is
* limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link ChannelType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable
* resolution or bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give
* viewers the best experience for their devices and network conditions. Vertical resolution can be up to
* 1080 and bitrate can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice
* is limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
* @see ChannelType
*/
public final ChannelType type() {
return ChannelType.fromValue(type);
}
/**
*
* Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable resolution or
* bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give viewers
* the best experience for their devices and network conditions. Vertical resolution can be up to 1080 and bitrate
* can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice is
* limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link ChannelType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable
* resolution or bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give
* viewers the best experience for their devices and network conditions. Vertical resolution can be up to
* 1080 and bitrate can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice
* is limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
* @see ChannelType
*/
public final String typeAsString() {
return type;
}
/**
*
* Channel ingest endpoint, part of the definition of an ingest server, used when you set up streaming software.
*
*
* @return Channel ingest endpoint, part of the definition of an ingest server, used when you set up streaming
* software.
*/
public final String ingestEndpoint() {
return ingestEndpoint;
}
/**
*
* Channel playback URL.
*
*
* @return Channel playback URL.
*/
public final String playbackUrl() {
return playbackUrl;
}
/**
*
* Whether the channel is authorized.
*
*
* @return Whether the channel is authorized.
*/
public final Boolean authorized() {
return authorized;
}
/**
* Returns true if the Tags property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
*
* Array of 1-50 maps, each of the form string:string (key:value)
.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasTags()} to see if a value was sent in this field.
*
*
* @return Array of 1-50 maps, each of the form string:string (key:value)
.
*/
public final Map tags() {
return tags;
}
@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(arn());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(latencyModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(ingestEndpoint());
hashCode = 31 * hashCode + Objects.hashCode(playbackUrl());
hashCode = 31 * hashCode + Objects.hashCode(authorized());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
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 Channel)) {
return false;
}
Channel other = (Channel) obj;
return Objects.equals(arn(), other.arn()) && Objects.equals(name(), other.name())
&& Objects.equals(latencyModeAsString(), other.latencyModeAsString())
&& Objects.equals(typeAsString(), other.typeAsString())
&& Objects.equals(ingestEndpoint(), other.ingestEndpoint()) && Objects.equals(playbackUrl(), other.playbackUrl())
&& Objects.equals(authorized(), other.authorized()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("Channel").add("Arn", arn()).add("Name", name()).add("LatencyMode", latencyModeAsString())
.add("Type", typeAsString()).add("IngestEndpoint", ingestEndpoint()).add("PlaybackUrl", playbackUrl())
.add("Authorized", authorized()).add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "arn":
return Optional.ofNullable(clazz.cast(arn()));
case "name":
return Optional.ofNullable(clazz.cast(name()));
case "latencyMode":
return Optional.ofNullable(clazz.cast(latencyModeAsString()));
case "type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "ingestEndpoint":
return Optional.ofNullable(clazz.cast(ingestEndpoint()));
case "playbackUrl":
return Optional.ofNullable(clazz.cast(playbackUrl()));
case "authorized":
return Optional.ofNullable(clazz.cast(authorized()));
case "tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((Channel) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* Channel ARN.
*
*
* @param arn
* Channel ARN.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder arn(String arn);
/**
*
* Channel name.
*
*
* @param name
* Channel name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
*
* Channel latency mode. Default: LOW
.
*
*
* @param latencyMode
* Channel latency mode. Default: LOW
.
* @see ChannelLatencyMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelLatencyMode
*/
Builder latencyMode(String latencyMode);
/**
*
* Channel latency mode. Default: LOW
.
*
*
* @param latencyMode
* Channel latency mode. Default: LOW
.
* @see ChannelLatencyMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelLatencyMode
*/
Builder latencyMode(ChannelLatencyMode latencyMode);
/**
*
* Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable
* resolution or bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give
* viewers the best experience for their devices and network conditions. Vertical resolution can be up to 1080
* and bitrate can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice is
* limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
*
*
* @param type
* Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable
* resolution or bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give
* viewers the best experience for their devices and network conditions. Vertical resolution can be up to
* 1080 and bitrate can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality
* choice is limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to
* 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
* @see ChannelType
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelType
*/
Builder type(String type);
/**
*
* Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable
* resolution or bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give
* viewers the best experience for their devices and network conditions. Vertical resolution can be up to 1080
* and bitrate can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality choice is
* limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
*
*
* @param type
* Channel type, which determines the allowable resolution and bitrate. If you exceed the allowable
* resolution or bitrate, the stream probably will disconnect immediately. Valid values:
*
*
*
* STANDARD
: Multiple qualities are generated from the original input, to automatically give
* viewers the best experience for their devices and network conditions. Vertical resolution can be up to
* 1080 and bitrate can be up to 8.5 Mbps.
*
*
*
*
* BASIC
: Amazon IVS delivers the original input to viewers. The viewer’s video-quality
* choice is limited to the original input. Vertical resolution can be up to 480 and bitrate can be up to
* 1.5 Mbps.
*
*
*
*
* Default: STANDARD
.
* @see ChannelType
* @return Returns a reference to this object so that method calls can be chained together.
* @see ChannelType
*/
Builder type(ChannelType type);
/**
*
* Channel ingest endpoint, part of the definition of an ingest server, used when you set up streaming software.
*
*
* @param ingestEndpoint
* Channel ingest endpoint, part of the definition of an ingest server, used when you set up streaming
* software.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder ingestEndpoint(String ingestEndpoint);
/**
*
* Channel playback URL.
*
*
* @param playbackUrl
* Channel playback URL.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder playbackUrl(String playbackUrl);
/**
*
* Whether the channel is authorized.
*
*
* @param authorized
* Whether the channel is authorized.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder authorized(Boolean authorized);
/**
*
* Array of 1-50 maps, each of the form string:string (key:value)
.
*
*
* @param tags
* Array of 1-50 maps, each of the form string:string (key:value)
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
}
static final class BuilderImpl implements Builder {
private String arn;
private String name;
private String latencyMode;
private String type;
private String ingestEndpoint;
private String playbackUrl;
private Boolean authorized;
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(Channel model) {
arn(model.arn);
name(model.name);
latencyMode(model.latencyMode);
type(model.type);
ingestEndpoint(model.ingestEndpoint);
playbackUrl(model.playbackUrl);
authorized(model.authorized);
tags(model.tags);
}
public final String getArn() {
return arn;
}
@Override
public final Builder arn(String arn) {
this.arn = arn;
return this;
}
public final void setArn(String arn) {
this.arn = arn;
}
public final String getName() {
return name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final void setName(String name) {
this.name = name;
}
public final String getLatencyMode() {
return latencyMode;
}
@Override
public final Builder latencyMode(String latencyMode) {
this.latencyMode = latencyMode;
return this;
}
@Override
public final Builder latencyMode(ChannelLatencyMode latencyMode) {
this.latencyMode(latencyMode == null ? null : latencyMode.toString());
return this;
}
public final void setLatencyMode(String latencyMode) {
this.latencyMode = latencyMode;
}
public final String getType() {
return type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(ChannelType type) {
this.type(type == null ? null : type.toString());
return this;
}
public final void setType(String type) {
this.type = type;
}
public final String getIngestEndpoint() {
return ingestEndpoint;
}
@Override
public final Builder ingestEndpoint(String ingestEndpoint) {
this.ingestEndpoint = ingestEndpoint;
return this;
}
public final void setIngestEndpoint(String ingestEndpoint) {
this.ingestEndpoint = ingestEndpoint;
}
public final String getPlaybackUrl() {
return playbackUrl;
}
@Override
public final Builder playbackUrl(String playbackUrl) {
this.playbackUrl = playbackUrl;
return this;
}
public final void setPlaybackUrl(String playbackUrl) {
this.playbackUrl = playbackUrl;
}
public final Boolean getAuthorized() {
return authorized;
}
@Override
public final Builder authorized(Boolean authorized) {
this.authorized = authorized;
return this;
}
public final void setAuthorized(Boolean authorized) {
this.authorized = authorized;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
@Override
public final Builder tags(Map tags) {
this.tags = TagsCopier.copy(tags);
return this;
}
public final void setTags(Map tags) {
this.tags = TagsCopier.copy(tags);
}
@Override
public Channel build() {
return new Channel(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}