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.medialive.model.CreateInputRequest 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.util.Arrays;
import java.util.Collection;
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.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.DefaultValueTrait;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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;
/**
* The name of the input
*/
@Generated("software.amazon.awssdk:codegen")
public final class CreateInputRequest extends MediaLiveRequest implements
ToCopyableBuilder {
private static final SdkField> DESTINATIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Destinations")
.getter(getter(CreateInputRequest::destinations))
.setter(setter(Builder::destinations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("destinations").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(InputDestinationRequest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> INPUT_DEVICES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("InputDevices")
.getter(getter(CreateInputRequest::inputDevices))
.setter(setter(Builder::inputDevices))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inputDevices").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(InputDeviceSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> INPUT_SECURITY_GROUPS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("InputSecurityGroups")
.getter(getter(CreateInputRequest::inputSecurityGroups))
.setter(setter(Builder::inputSecurityGroups))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("inputSecurityGroups").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> MEDIA_CONNECT_FLOWS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("MediaConnectFlows")
.getter(getter(CreateInputRequest::mediaConnectFlows))
.setter(setter(Builder::mediaConnectFlows))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("mediaConnectFlows").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(MediaConnectFlowRequest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Name")
.getter(getter(CreateInputRequest::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();
private static final SdkField REQUEST_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("RequestId")
.getter(getter(CreateInputRequest::requestId))
.setter(setter(Builder::requestId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("requestId").build(),
DefaultValueTrait.idempotencyToken()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleArn").getter(getter(CreateInputRequest::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build();
private static final SdkField> SOURCES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Sources")
.getter(getter(CreateInputRequest::sources))
.setter(setter(Builder::sources))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("sources").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(InputSourceRequest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Tags")
.getter(getter(CreateInputRequest::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 SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Type")
.getter(getter(CreateInputRequest::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build();
private static final SdkField VPC_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Vpc").getter(getter(CreateInputRequest::vpc)).setter(setter(Builder::vpc))
.constructor(InputVpcRequest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("vpc").build()).build();
private static final SdkField SRT_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("SrtSettings")
.getter(getter(CreateInputRequest::srtSettings)).setter(setter(Builder::srtSettings))
.constructor(SrtSettingsRequest::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("srtSettings").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DESTINATIONS_FIELD,
INPUT_DEVICES_FIELD, INPUT_SECURITY_GROUPS_FIELD, MEDIA_CONNECT_FLOWS_FIELD, NAME_FIELD, REQUEST_ID_FIELD,
ROLE_ARN_FIELD, SOURCES_FIELD, TAGS_FIELD, TYPE_FIELD, VPC_FIELD, SRT_SETTINGS_FIELD));
private final List destinations;
private final List inputDevices;
private final List inputSecurityGroups;
private final List mediaConnectFlows;
private final String name;
private final String requestId;
private final String roleArn;
private final List sources;
private final Map tags;
private final String type;
private final InputVpcRequest vpc;
private final SrtSettingsRequest srtSettings;
private CreateInputRequest(BuilderImpl builder) {
super(builder);
this.destinations = builder.destinations;
this.inputDevices = builder.inputDevices;
this.inputSecurityGroups = builder.inputSecurityGroups;
this.mediaConnectFlows = builder.mediaConnectFlows;
this.name = builder.name;
this.requestId = builder.requestId;
this.roleArn = builder.roleArn;
this.sources = builder.sources;
this.tags = builder.tags;
this.type = builder.type;
this.vpc = builder.vpc;
this.srtSettings = builder.srtSettings;
}
/**
* For responses, this returns true if the service returned a value for the Destinations property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasDestinations() {
return destinations != null && !(destinations instanceof SdkAutoConstructList);
}
/**
* Destination settings for PUSH type inputs.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasDestinations} method.
*
*
* @return Destination settings for PUSH type inputs.
*/
public final List destinations() {
return destinations;
}
/**
* For responses, this returns true if the service returned a value for the InputDevices property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasInputDevices() {
return inputDevices != null && !(inputDevices instanceof SdkAutoConstructList);
}
/**
* Settings for the devices.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasInputDevices} method.
*
*
* @return Settings for the devices.
*/
public final List inputDevices() {
return inputDevices;
}
/**
* For responses, this returns true if the service returned a value for the InputSecurityGroups property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasInputSecurityGroups() {
return inputSecurityGroups != null && !(inputSecurityGroups instanceof SdkAutoConstructList);
}
/**
* A list of security groups referenced by IDs to attach to the input.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasInputSecurityGroups} method.
*
*
* @return A list of security groups referenced by IDs to attach to the input.
*/
public final List inputSecurityGroups() {
return inputSecurityGroups;
}
/**
* For responses, this returns true if the service returned a value for the MediaConnectFlows property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMediaConnectFlows() {
return mediaConnectFlows != null && !(mediaConnectFlows instanceof SdkAutoConstructList);
}
/**
* A list of the MediaConnect Flows that you want to use in this input. You can specify as few as one Flow and
* presently, as many as two. The only requirement is when you have more than one is that each Flow is in a separate
* Availability Zone as this ensures your EML input is redundant to AZ issues.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMediaConnectFlows} method.
*
*
* @return A list of the MediaConnect Flows that you want to use in this input. You can specify as few as one Flow
* and presently, as many as two. The only requirement is when you have more than one is that each Flow is
* in a separate Availability Zone as this ensures your EML input is redundant to AZ issues.
*/
public final List mediaConnectFlows() {
return mediaConnectFlows;
}
/**
* Name of the input.
*
* @return Name of the input.
*/
public final String name() {
return name;
}
/**
* Unique identifier of the request to ensure the request is handled exactly once in case of retries.
*
* @return Unique identifier of the request to ensure the request is handled exactly once in case of retries.
*/
public final String requestId() {
return requestId;
}
/**
* The Amazon Resource Name (ARN) of the role this input assumes during and after creation.
*
* @return The Amazon Resource Name (ARN) of the role this input assumes during and after creation.
*/
public final String roleArn() {
return roleArn;
}
/**
* For responses, this returns true if the service returned a value for the Sources property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSources() {
return sources != null && !(sources instanceof SdkAutoConstructList);
}
/**
* The source URLs for a PULL-type input. Every PULL type input needs exactly two source URLs for redundancy. Only
* specify sources for PULL type Inputs. Leave Destinations empty.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSources} method.
*
*
* @return The source URLs for a PULL-type input. Every PULL type input needs exactly two source URLs for
* redundancy. Only specify sources for PULL type Inputs. Leave Destinations empty.
*/
public final List sources() {
return sources;
}
/**
* For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasTags() {
return tags != null && !(tags instanceof SdkAutoConstructMap);
}
/**
* A collection of key-value pairs.
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasTags} method.
*
*
* @return A collection of key-value pairs.
*/
public final Map tags() {
return tags;
}
/**
* Returns the value of the Type property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link InputType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The value of the Type property for this object.
* @see InputType
*/
public final InputType type() {
return InputType.fromValue(type);
}
/**
* Returns the value of the Type property for this object.
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link InputType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The value of the Type property for this object.
* @see InputType
*/
public final String typeAsString() {
return type;
}
/**
* Returns the value of the Vpc property for this object.
*
* @return The value of the Vpc property for this object.
*/
public final InputVpcRequest vpc() {
return vpc;
}
/**
* The settings associated with an SRT input.
*
* @return The settings associated with an SRT input.
*/
public final SrtSettingsRequest srtSettings() {
return srtSettings;
}
@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(hasDestinations() ? destinations() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasInputDevices() ? inputDevices() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasInputSecurityGroups() ? inputSecurityGroups() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMediaConnectFlows() ? mediaConnectFlows() : null);
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(requestId());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(hasSources() ? sources() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null);
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(vpc());
hashCode = 31 * hashCode + Objects.hashCode(srtSettings());
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 CreateInputRequest)) {
return false;
}
CreateInputRequest other = (CreateInputRequest) obj;
return hasDestinations() == other.hasDestinations() && Objects.equals(destinations(), other.destinations())
&& hasInputDevices() == other.hasInputDevices() && Objects.equals(inputDevices(), other.inputDevices())
&& hasInputSecurityGroups() == other.hasInputSecurityGroups()
&& Objects.equals(inputSecurityGroups(), other.inputSecurityGroups())
&& hasMediaConnectFlows() == other.hasMediaConnectFlows()
&& Objects.equals(mediaConnectFlows(), other.mediaConnectFlows()) && Objects.equals(name(), other.name())
&& Objects.equals(requestId(), other.requestId()) && Objects.equals(roleArn(), other.roleArn())
&& hasSources() == other.hasSources() && Objects.equals(sources(), other.sources())
&& hasTags() == other.hasTags() && Objects.equals(tags(), other.tags())
&& Objects.equals(typeAsString(), other.typeAsString()) && Objects.equals(vpc(), other.vpc())
&& Objects.equals(srtSettings(), other.srtSettings());
}
/**
* 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("CreateInputRequest").add("Destinations", hasDestinations() ? destinations() : null)
.add("InputDevices", hasInputDevices() ? inputDevices() : null)
.add("InputSecurityGroups", hasInputSecurityGroups() ? inputSecurityGroups() : null)
.add("MediaConnectFlows", hasMediaConnectFlows() ? mediaConnectFlows() : null).add("Name", name())
.add("RequestId", requestId()).add("RoleArn", roleArn()).add("Sources", hasSources() ? sources() : null)
.add("Tags", hasTags() ? tags() : null).add("Type", typeAsString()).add("Vpc", vpc())
.add("SrtSettings", srtSettings()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Destinations":
return Optional.ofNullable(clazz.cast(destinations()));
case "InputDevices":
return Optional.ofNullable(clazz.cast(inputDevices()));
case "InputSecurityGroups":
return Optional.ofNullable(clazz.cast(inputSecurityGroups()));
case "MediaConnectFlows":
return Optional.ofNullable(clazz.cast(mediaConnectFlows()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "RequestId":
return Optional.ofNullable(clazz.cast(requestId()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "Sources":
return Optional.ofNullable(clazz.cast(sources()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
case "Type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "Vpc":
return Optional.ofNullable(clazz.cast(vpc()));
case "SrtSettings":
return Optional.ofNullable(clazz.cast(srtSettings()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((CreateInputRequest) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends MediaLiveRequest.Builder, SdkPojo, CopyableBuilder {
/**
* Destination settings for PUSH type inputs.
*
* @param destinations
* Destination settings for PUSH type inputs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder destinations(Collection destinations);
/**
* Destination settings for PUSH type inputs.
*
* @param destinations
* Destination settings for PUSH type inputs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder destinations(InputDestinationRequest... destinations);
/**
* Destination settings for PUSH type inputs. This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.medialive.model.InputDestinationRequest.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.medialive.model.InputDestinationRequest#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.medialive.model.InputDestinationRequest.Builder#build()} is called
* immediately and its result is passed to {@link #destinations(List)}.
*
* @param destinations
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.medialive.model.InputDestinationRequest.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #destinations(java.util.Collection)
*/
Builder destinations(Consumer... destinations);
/**
* Settings for the devices.
*
* @param inputDevices
* Settings for the devices.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inputDevices(Collection inputDevices);
/**
* Settings for the devices.
*
* @param inputDevices
* Settings for the devices.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inputDevices(InputDeviceSettings... inputDevices);
/**
* Settings for the devices. This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.medialive.model.InputDeviceSettings.Builder} avoiding the need to
* create one manually via {@link software.amazon.awssdk.services.medialive.model.InputDeviceSettings#builder()}
* .
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.medialive.model.InputDeviceSettings.Builder#build()} is called
* immediately and its result is passed to {@link #inputDevices(List)}.
*
* @param inputDevices
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.medialive.model.InputDeviceSettings.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #inputDevices(java.util.Collection)
*/
Builder inputDevices(Consumer... inputDevices);
/**
* A list of security groups referenced by IDs to attach to the input.
*
* @param inputSecurityGroups
* A list of security groups referenced by IDs to attach to the input.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inputSecurityGroups(Collection inputSecurityGroups);
/**
* A list of security groups referenced by IDs to attach to the input.
*
* @param inputSecurityGroups
* A list of security groups referenced by IDs to attach to the input.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder inputSecurityGroups(String... inputSecurityGroups);
/**
* A list of the MediaConnect Flows that you want to use in this input. You can specify as few as one Flow and
* presently, as many as two. The only requirement is when you have more than one is that each Flow is in a
* separate Availability Zone as this ensures your EML input is redundant to AZ issues.
*
* @param mediaConnectFlows
* A list of the MediaConnect Flows that you want to use in this input. You can specify as few as one
* Flow and presently, as many as two. The only requirement is when you have more than one is that each
* Flow is in a separate Availability Zone as this ensures your EML input is redundant to AZ issues.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mediaConnectFlows(Collection mediaConnectFlows);
/**
* A list of the MediaConnect Flows that you want to use in this input. You can specify as few as one Flow and
* presently, as many as two. The only requirement is when you have more than one is that each Flow is in a
* separate Availability Zone as this ensures your EML input is redundant to AZ issues.
*
* @param mediaConnectFlows
* A list of the MediaConnect Flows that you want to use in this input. You can specify as few as one
* Flow and presently, as many as two. The only requirement is when you have more than one is that each
* Flow is in a separate Availability Zone as this ensures your EML input is redundant to AZ issues.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mediaConnectFlows(MediaConnectFlowRequest... mediaConnectFlows);
/**
* A list of the MediaConnect Flows that you want to use in this input. You can specify as few as one Flow and
* presently, as many as two. The only requirement is when you have more than one is that each Flow is in a
* separate Availability Zone as this ensures your EML input is redundant to AZ issues. This is a convenience
* method that creates an instance of the
* {@link software.amazon.awssdk.services.medialive.model.MediaConnectFlowRequest.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.medialive.model.MediaConnectFlowRequest#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.medialive.model.MediaConnectFlowRequest.Builder#build()} is called
* immediately and its result is passed to {@link #mediaConnectFlows(List)}.
*
* @param mediaConnectFlows
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.medialive.model.MediaConnectFlowRequest.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #mediaConnectFlows(java.util.Collection)
*/
Builder mediaConnectFlows(Consumer... mediaConnectFlows);
/**
* Name of the input.
*
* @param name
* Name of the input.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder name(String name);
/**
* Unique identifier of the request to ensure the request is handled exactly once in case of retries.
*
* @param requestId
* Unique identifier of the request to ensure the request is handled exactly once in case of retries.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requestId(String requestId);
/**
* The Amazon Resource Name (ARN) of the role this input assumes during and after creation.
*
* @param roleArn
* The Amazon Resource Name (ARN) of the role this input assumes during and after creation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder roleArn(String roleArn);
/**
* The source URLs for a PULL-type input. Every PULL type input needs exactly two source URLs for redundancy.
* Only specify sources for PULL type Inputs. Leave Destinations empty.
*
* @param sources
* The source URLs for a PULL-type input. Every PULL type input needs exactly two source URLs for
* redundancy. Only specify sources for PULL type Inputs. Leave Destinations empty.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sources(Collection sources);
/**
* The source URLs for a PULL-type input. Every PULL type input needs exactly two source URLs for redundancy.
* Only specify sources for PULL type Inputs. Leave Destinations empty.
*
* @param sources
* The source URLs for a PULL-type input. Every PULL type input needs exactly two source URLs for
* redundancy. Only specify sources for PULL type Inputs. Leave Destinations empty.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder sources(InputSourceRequest... sources);
/**
* The source URLs for a PULL-type input. Every PULL type input needs exactly two source URLs for redundancy.
* Only specify sources for PULL type Inputs. Leave Destinations empty. This is a convenience method that
* creates an instance of the {@link software.amazon.awssdk.services.medialive.model.InputSourceRequest.Builder}
* avoiding the need to create one manually via
* {@link software.amazon.awssdk.services.medialive.model.InputSourceRequest#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.medialive.model.InputSourceRequest.Builder#build()} is called
* immediately and its result is passed to {@link #sources(List)}.
*
* @param sources
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.medialive.model.InputSourceRequest.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #sources(java.util.Collection)
*/
Builder sources(Consumer... sources);
/**
* A collection of key-value pairs.
*
* @param tags
* A collection of key-value pairs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Map tags);
/**
* Sets the value of the Type property for this object.
*
* @param type
* The new value for the Type property for this object.
* @see InputType
* @return Returns a reference to this object so that method calls can be chained together.
* @see InputType
*/
Builder type(String type);
/**
* Sets the value of the Type property for this object.
*
* @param type
* The new value for the Type property for this object.
* @see InputType
* @return Returns a reference to this object so that method calls can be chained together.
* @see InputType
*/
Builder type(InputType type);
/**
* Sets the value of the Vpc property for this object.
*
* @param vpc
* The new value for the Vpc property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder vpc(InputVpcRequest vpc);
/**
* Sets the value of the Vpc property for this object.
*
* This is a convenience method that creates an instance of the {@link InputVpcRequest.Builder} avoiding the
* need to create one manually via {@link InputVpcRequest#builder()}.
*
*
* When the {@link Consumer} completes, {@link InputVpcRequest.Builder#build()} is called immediately and its
* result is passed to {@link #vpc(InputVpcRequest)}.
*
* @param vpc
* a consumer that will call methods on {@link InputVpcRequest.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #vpc(InputVpcRequest)
*/
default Builder vpc(Consumer vpc) {
return vpc(InputVpcRequest.builder().applyMutation(vpc).build());
}
/**
* The settings associated with an SRT input.
*
* @param srtSettings
* The settings associated with an SRT input.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder srtSettings(SrtSettingsRequest srtSettings);
/**
* The settings associated with an SRT input. This is a convenience method that creates an instance of the
* {@link SrtSettingsRequest.Builder} avoiding the need to create one manually via
* {@link SrtSettingsRequest#builder()}.
*
*
* When the {@link Consumer} completes, {@link SrtSettingsRequest.Builder#build()} is called immediately and its
* result is passed to {@link #srtSettings(SrtSettingsRequest)}.
*
* @param srtSettings
* a consumer that will call methods on {@link SrtSettingsRequest.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #srtSettings(SrtSettingsRequest)
*/
default Builder srtSettings(Consumer srtSettings) {
return srtSettings(SrtSettingsRequest.builder().applyMutation(srtSettings).build());
}
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends MediaLiveRequest.BuilderImpl implements Builder {
private List destinations = DefaultSdkAutoConstructList.getInstance();
private List inputDevices = DefaultSdkAutoConstructList.getInstance();
private List inputSecurityGroups = DefaultSdkAutoConstructList.getInstance();
private List mediaConnectFlows = DefaultSdkAutoConstructList.getInstance();
private String name;
private String requestId;
private String roleArn;
private List sources = DefaultSdkAutoConstructList.getInstance();
private Map tags = DefaultSdkAutoConstructMap.getInstance();
private String type;
private InputVpcRequest vpc;
private SrtSettingsRequest srtSettings;
private BuilderImpl() {
}
private BuilderImpl(CreateInputRequest model) {
super(model);
destinations(model.destinations);
inputDevices(model.inputDevices);
inputSecurityGroups(model.inputSecurityGroups);
mediaConnectFlows(model.mediaConnectFlows);
name(model.name);
requestId(model.requestId);
roleArn(model.roleArn);
sources(model.sources);
tags(model.tags);
type(model.type);
vpc(model.vpc);
srtSettings(model.srtSettings);
}
public final List getDestinations() {
List result = ___listOfInputDestinationRequestCopier
.copyToBuilder(this.destinations);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setDestinations(Collection destinations) {
this.destinations = ___listOfInputDestinationRequestCopier.copyFromBuilder(destinations);
}
@Override
public final Builder destinations(Collection destinations) {
this.destinations = ___listOfInputDestinationRequestCopier.copy(destinations);
return this;
}
@Override
@SafeVarargs
public final Builder destinations(InputDestinationRequest... destinations) {
destinations(Arrays.asList(destinations));
return this;
}
@Override
@SafeVarargs
public final Builder destinations(Consumer... destinations) {
destinations(Stream.of(destinations).map(c -> InputDestinationRequest.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final List getInputDevices() {
List result = ___listOfInputDeviceSettingsCopier.copyToBuilder(this.inputDevices);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setInputDevices(Collection inputDevices) {
this.inputDevices = ___listOfInputDeviceSettingsCopier.copyFromBuilder(inputDevices);
}
@Override
public final Builder inputDevices(Collection inputDevices) {
this.inputDevices = ___listOfInputDeviceSettingsCopier.copy(inputDevices);
return this;
}
@Override
@SafeVarargs
public final Builder inputDevices(InputDeviceSettings... inputDevices) {
inputDevices(Arrays.asList(inputDevices));
return this;
}
@Override
@SafeVarargs
public final Builder inputDevices(Consumer... inputDevices) {
inputDevices(Stream.of(inputDevices).map(c -> InputDeviceSettings.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection getInputSecurityGroups() {
if (inputSecurityGroups instanceof SdkAutoConstructList) {
return null;
}
return inputSecurityGroups;
}
public final void setInputSecurityGroups(Collection inputSecurityGroups) {
this.inputSecurityGroups = ___listOf__stringCopier.copy(inputSecurityGroups);
}
@Override
public final Builder inputSecurityGroups(Collection inputSecurityGroups) {
this.inputSecurityGroups = ___listOf__stringCopier.copy(inputSecurityGroups);
return this;
}
@Override
@SafeVarargs
public final Builder inputSecurityGroups(String... inputSecurityGroups) {
inputSecurityGroups(Arrays.asList(inputSecurityGroups));
return this;
}
public final List getMediaConnectFlows() {
List result = ___listOfMediaConnectFlowRequestCopier
.copyToBuilder(this.mediaConnectFlows);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setMediaConnectFlows(Collection mediaConnectFlows) {
this.mediaConnectFlows = ___listOfMediaConnectFlowRequestCopier.copyFromBuilder(mediaConnectFlows);
}
@Override
public final Builder mediaConnectFlows(Collection mediaConnectFlows) {
this.mediaConnectFlows = ___listOfMediaConnectFlowRequestCopier.copy(mediaConnectFlows);
return this;
}
@Override
@SafeVarargs
public final Builder mediaConnectFlows(MediaConnectFlowRequest... mediaConnectFlows) {
mediaConnectFlows(Arrays.asList(mediaConnectFlows));
return this;
}
@Override
@SafeVarargs
public final Builder mediaConnectFlows(Consumer... mediaConnectFlows) {
mediaConnectFlows(Stream.of(mediaConnectFlows).map(c -> MediaConnectFlowRequest.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final String getName() {
return name;
}
public final void setName(String name) {
this.name = name;
}
@Override
public final Builder name(String name) {
this.name = name;
return this;
}
public final String getRequestId() {
return requestId;
}
public final void setRequestId(String requestId) {
this.requestId = requestId;
}
@Override
public final Builder requestId(String requestId) {
this.requestId = requestId;
return this;
}
public final String getRoleArn() {
return roleArn;
}
public final void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
@Override
public final Builder roleArn(String roleArn) {
this.roleArn = roleArn;
return this;
}
public final List getSources() {
List result = ___listOfInputSourceRequestCopier.copyToBuilder(this.sources);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setSources(Collection sources) {
this.sources = ___listOfInputSourceRequestCopier.copyFromBuilder(sources);
}
@Override
public final Builder sources(Collection sources) {
this.sources = ___listOfInputSourceRequestCopier.copy(sources);
return this;
}
@Override
@SafeVarargs
public final Builder sources(InputSourceRequest... sources) {
sources(Arrays.asList(sources));
return this;
}
@Override
@SafeVarargs
public final Builder sources(Consumer... sources) {
sources(Stream.of(sources).map(c -> InputSourceRequest.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Map getTags() {
if (tags instanceof SdkAutoConstructMap) {
return null;
}
return tags;
}
public final void setTags(Map tags) {
this.tags = TagsCopier.copy(tags);
}
@Override
public final Builder tags(Map tags) {
this.tags = TagsCopier.copy(tags);
return this;
}
public final String getType() {
return type;
}
public final void setType(String type) {
this.type = type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(InputType type) {
this.type(type == null ? null : type.toString());
return this;
}
public final InputVpcRequest.Builder getVpc() {
return vpc != null ? vpc.toBuilder() : null;
}
public final void setVpc(InputVpcRequest.BuilderImpl vpc) {
this.vpc = vpc != null ? vpc.build() : null;
}
@Override
public final Builder vpc(InputVpcRequest vpc) {
this.vpc = vpc;
return this;
}
public final SrtSettingsRequest.Builder getSrtSettings() {
return srtSettings != null ? srtSettings.toBuilder() : null;
}
public final void setSrtSettings(SrtSettingsRequest.BuilderImpl srtSettings) {
this.srtSettings = srtSettings != null ? srtSettings.build() : null;
}
@Override
public final Builder srtSettings(SrtSettingsRequest srtSettings) {
this.srtSettings = srtSettings;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateInputRequest build() {
return new CreateInputRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}