software.amazon.awssdk.services.mediaconnect.model.UpdateFlowOutputRequest 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.mediaconnect.model;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* The fields that you want to update in the output.
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpdateFlowOutputRequest extends MediaConnectRequest implements
ToCopyableBuilder {
private static final SdkField> CIDR_ALLOW_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("CidrAllowList")
.getter(getter(UpdateFlowOutputRequest::cidrAllowList))
.setter(setter(Builder::cidrAllowList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("cidrAllowList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(UpdateFlowOutputRequest::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();
private static final SdkField DESTINATION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Destination").getter(getter(UpdateFlowOutputRequest::destination)).setter(setter(Builder::destination))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("destination").build()).build();
private static final SdkField ENCRYPTION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Encryption")
.getter(getter(UpdateFlowOutputRequest::encryption)).setter(setter(Builder::encryption))
.constructor(UpdateEncryption::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("encryption").build()).build();
private static final SdkField FLOW_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FlowArn").getter(getter(UpdateFlowOutputRequest::flowArn)).setter(setter(Builder::flowArn))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("flowArn").build()).build();
private static final SdkField MAX_LATENCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxLatency").getter(getter(UpdateFlowOutputRequest::maxLatency)).setter(setter(Builder::maxLatency))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("maxLatency").build()).build();
private static final SdkField> MEDIA_STREAM_OUTPUT_CONFIGURATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("MediaStreamOutputConfigurations")
.getter(getter(UpdateFlowOutputRequest::mediaStreamOutputConfigurations))
.setter(setter(Builder::mediaStreamOutputConfigurations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mediaStreamOutputConfigurations")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(MediaStreamOutputConfigurationRequest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField MIN_LATENCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MinLatency").getter(getter(UpdateFlowOutputRequest::minLatency)).setter(setter(Builder::minLatency))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("minLatency").build()).build();
private static final SdkField OUTPUT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("OutputArn").getter(getter(UpdateFlowOutputRequest::outputArn)).setter(setter(Builder::outputArn))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("outputArn").build()).build();
private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Port")
.getter(getter(UpdateFlowOutputRequest::port)).setter(setter(Builder::port))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("port").build()).build();
private static final SdkField PROTOCOL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Protocol").getter(getter(UpdateFlowOutputRequest::protocolAsString)).setter(setter(Builder::protocol))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("protocol").build()).build();
private static final SdkField REMOTE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RemoteId").getter(getter(UpdateFlowOutputRequest::remoteId)).setter(setter(Builder::remoteId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("remoteId").build()).build();
private static final SdkField SMOOTHING_LATENCY_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("SmoothingLatency").getter(getter(UpdateFlowOutputRequest::smoothingLatency))
.setter(setter(Builder::smoothingLatency))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("smoothingLatency").build()).build();
private static final SdkField STREAM_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StreamId").getter(getter(UpdateFlowOutputRequest::streamId)).setter(setter(Builder::streamId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("streamId").build()).build();
private static final SdkField VPC_INTERFACE_ATTACHMENT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("VpcInterfaceAttachment")
.getter(getter(UpdateFlowOutputRequest::vpcInterfaceAttachment)).setter(setter(Builder::vpcInterfaceAttachment))
.constructor(VpcInterfaceAttachment::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vpcInterfaceAttachment").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CIDR_ALLOW_LIST_FIELD,
DESCRIPTION_FIELD, DESTINATION_FIELD, ENCRYPTION_FIELD, FLOW_ARN_FIELD, MAX_LATENCY_FIELD,
MEDIA_STREAM_OUTPUT_CONFIGURATIONS_FIELD, MIN_LATENCY_FIELD, OUTPUT_ARN_FIELD, PORT_FIELD, PROTOCOL_FIELD,
REMOTE_ID_FIELD, SMOOTHING_LATENCY_FIELD, STREAM_ID_FIELD, VPC_INTERFACE_ATTACHMENT_FIELD));
private final List cidrAllowList;
private final String description;
private final String destination;
private final UpdateEncryption encryption;
private final String flowArn;
private final Integer maxLatency;
private final List mediaStreamOutputConfigurations;
private final Integer minLatency;
private final String outputArn;
private final Integer port;
private final String protocol;
private final String remoteId;
private final Integer smoothingLatency;
private final String streamId;
private final VpcInterfaceAttachment vpcInterfaceAttachment;
private UpdateFlowOutputRequest(BuilderImpl builder) {
super(builder);
this.cidrAllowList = builder.cidrAllowList;
this.description = builder.description;
this.destination = builder.destination;
this.encryption = builder.encryption;
this.flowArn = builder.flowArn;
this.maxLatency = builder.maxLatency;
this.mediaStreamOutputConfigurations = builder.mediaStreamOutputConfigurations;
this.minLatency = builder.minLatency;
this.outputArn = builder.outputArn;
this.port = builder.port;
this.protocol = builder.protocol;
this.remoteId = builder.remoteId;
this.smoothingLatency = builder.smoothingLatency;
this.streamId = builder.streamId;
this.vpcInterfaceAttachment = builder.vpcInterfaceAttachment;
}
/**
* Returns true if the CidrAllowList 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 hasCidrAllowList() {
return cidrAllowList != null && !(cidrAllowList instanceof SdkAutoConstructList);
}
/**
* The range of IP addresses that should be allowed to initiate output requests to this flow. These IP addresses
* should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasCidrAllowList()} to see if a value was sent in this field.
*
*
* @return The range of IP addresses that should be allowed to initiate output requests to this flow. These IP
* addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example,
* 10.0.0.0/16.
*/
public final List cidrAllowList() {
return cidrAllowList;
}
/**
* A description of the output. This description appears only on the AWS Elemental MediaConnect console and will not
* be seen by the end user.
*
* @return A description of the output. This description appears only on the AWS Elemental MediaConnect console and
* will not be seen by the end user.
*/
public final String description() {
return description;
}
/**
* The IP address where you want to send the output.
*
* @return The IP address where you want to send the output.
*/
public final String destination() {
return destination;
}
/**
* The type of key used for the encryption. If no keyType is provided, the service will use the default setting
* (static-key).
*
* @return The type of key used for the encryption. If no keyType is provided, the service will use the default
* setting (static-key).
*/
public final UpdateEncryption encryption() {
return encryption;
}
/**
* The flow that is associated with the output that you want to update.
*
* @return The flow that is associated with the output that you want to update.
*/
public final String flowArn() {
return flowArn;
}
/**
* The maximum latency in milliseconds for Zixi-based streams.
*
* @return The maximum latency in milliseconds for Zixi-based streams.
*/
public final Integer maxLatency() {
return maxLatency;
}
/**
* Returns true if the MediaStreamOutputConfigurations 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 hasMediaStreamOutputConfigurations() {
return mediaStreamOutputConfigurations != null && !(mediaStreamOutputConfigurations instanceof SdkAutoConstructList);
}
/**
* The media streams that are associated with the output, and the parameters for those associations.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasMediaStreamOutputConfigurations()} to see if a value was sent in this field.
*
*
* @return The media streams that are associated with the output, and the parameters for those associations.
*/
public final List mediaStreamOutputConfigurations() {
return mediaStreamOutputConfigurations;
}
/**
* The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this value that
* you set on your MediaConnect source or output represents the minimal potential latency of that connection. The
* latency of the stream is set to the highest number between the sender’s minimum latency and the receiver’s
* minimum latency.
*
* @return The minimum latency in milliseconds for SRT-based streams. In streams that use the SRT protocol, this
* value that you set on your MediaConnect source or output represents the minimal potential latency of that
* connection. The latency of the stream is set to the highest number between the sender’s minimum latency
* and the receiver’s minimum latency.
*/
public final Integer minLatency() {
return minLatency;
}
/**
* The ARN of the output that you want to update.
*
* @return The ARN of the output that you want to update.
*/
public final String outputArn() {
return outputArn;
}
/**
* The port to use when content is distributed to this output.
*
* @return The port to use when content is distributed to this output.
*/
public final Integer port() {
return port;
}
/**
* The protocol to use for the output.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #protocol} will
* return {@link Protocol#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #protocolAsString}.
*
*
* @return The protocol to use for the output.
* @see Protocol
*/
public final Protocol protocol() {
return Protocol.fromValue(protocol);
}
/**
* The protocol to use for the output.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #protocol} will
* return {@link Protocol#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #protocolAsString}.
*
*
* @return The protocol to use for the output.
* @see Protocol
*/
public final String protocolAsString() {
return protocol;
}
/**
* The remote ID for the Zixi-pull stream.
*
* @return The remote ID for the Zixi-pull stream.
*/
public final String remoteId() {
return remoteId;
}
/**
* The smoothing latency in milliseconds for RIST, RTP, and RTP-FEC streams.
*
* @return The smoothing latency in milliseconds for RIST, RTP, and RTP-FEC streams.
*/
public final Integer smoothingLatency() {
return smoothingLatency;
}
/**
* The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams.
*
* @return The stream ID that you want to use for this transport. This parameter applies only to Zixi-based streams.
*/
public final String streamId() {
return streamId;
}
/**
* The name of the VPC interface attachment to use for this output.
*
* @return The name of the VPC interface attachment to use for this output.
*/
public final VpcInterfaceAttachment vpcInterfaceAttachment() {
return vpcInterfaceAttachment;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasCidrAllowList() ? cidrAllowList() : null);
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(destination());
hashCode = 31 * hashCode + Objects.hashCode(encryption());
hashCode = 31 * hashCode + Objects.hashCode(flowArn());
hashCode = 31 * hashCode + Objects.hashCode(maxLatency());
hashCode = 31 * hashCode
+ Objects.hashCode(hasMediaStreamOutputConfigurations() ? mediaStreamOutputConfigurations() : null);
hashCode = 31 * hashCode + Objects.hashCode(minLatency());
hashCode = 31 * hashCode + Objects.hashCode(outputArn());
hashCode = 31 * hashCode + Objects.hashCode(port());
hashCode = 31 * hashCode + Objects.hashCode(protocolAsString());
hashCode = 31 * hashCode + Objects.hashCode(remoteId());
hashCode = 31 * hashCode + Objects.hashCode(smoothingLatency());
hashCode = 31 * hashCode + Objects.hashCode(streamId());
hashCode = 31 * hashCode + Objects.hashCode(vpcInterfaceAttachment());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof UpdateFlowOutputRequest)) {
return false;
}
UpdateFlowOutputRequest other = (UpdateFlowOutputRequest) obj;
return hasCidrAllowList() == other.hasCidrAllowList() && Objects.equals(cidrAllowList(), other.cidrAllowList())
&& Objects.equals(description(), other.description()) && Objects.equals(destination(), other.destination())
&& Objects.equals(encryption(), other.encryption()) && Objects.equals(flowArn(), other.flowArn())
&& Objects.equals(maxLatency(), other.maxLatency())
&& hasMediaStreamOutputConfigurations() == other.hasMediaStreamOutputConfigurations()
&& Objects.equals(mediaStreamOutputConfigurations(), other.mediaStreamOutputConfigurations())
&& Objects.equals(minLatency(), other.minLatency()) && Objects.equals(outputArn(), other.outputArn())
&& Objects.equals(port(), other.port()) && Objects.equals(protocolAsString(), other.protocolAsString())
&& Objects.equals(remoteId(), other.remoteId()) && Objects.equals(smoothingLatency(), other.smoothingLatency())
&& Objects.equals(streamId(), other.streamId())
&& Objects.equals(vpcInterfaceAttachment(), other.vpcInterfaceAttachment());
}
/**
* 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("UpdateFlowOutputRequest")
.add("CidrAllowList", hasCidrAllowList() ? cidrAllowList() : null)
.add("Description", description())
.add("Destination", destination())
.add("Encryption", encryption())
.add("FlowArn", flowArn())
.add("MaxLatency", maxLatency())
.add("MediaStreamOutputConfigurations",
hasMediaStreamOutputConfigurations() ? mediaStreamOutputConfigurations() : null)
.add("MinLatency", minLatency()).add("OutputArn", outputArn()).add("Port", port())
.add("Protocol", protocolAsString()).add("RemoteId", remoteId()).add("SmoothingLatency", smoothingLatency())
.add("StreamId", streamId()).add("VpcInterfaceAttachment", vpcInterfaceAttachment()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CidrAllowList":
return Optional.ofNullable(clazz.cast(cidrAllowList()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "Destination":
return Optional.ofNullable(clazz.cast(destination()));
case "Encryption":
return Optional.ofNullable(clazz.cast(encryption()));
case "FlowArn":
return Optional.ofNullable(clazz.cast(flowArn()));
case "MaxLatency":
return Optional.ofNullable(clazz.cast(maxLatency()));
case "MediaStreamOutputConfigurations":
return Optional.ofNullable(clazz.cast(mediaStreamOutputConfigurations()));
case "MinLatency":
return Optional.ofNullable(clazz.cast(minLatency()));
case "OutputArn":
return Optional.ofNullable(clazz.cast(outputArn()));
case "Port":
return Optional.ofNullable(clazz.cast(port()));
case "Protocol":
return Optional.ofNullable(clazz.cast(protocolAsString()));
case "RemoteId":
return Optional.ofNullable(clazz.cast(remoteId()));
case "SmoothingLatency":
return Optional.ofNullable(clazz.cast(smoothingLatency()));
case "StreamId":
return Optional.ofNullable(clazz.cast(streamId()));
case "VpcInterfaceAttachment":
return Optional.ofNullable(clazz.cast(vpcInterfaceAttachment()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function