All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.elasticbeanstalk.model.EnvironmentResourceDescription Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Elastic Beanstalk module holds the client classes that are used for communicating with AWS Elastic Beanstalk Service

There is a newer version: 2.29.39
Show newest version
/*
 * 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.elasticbeanstalk.model;

import java.io.Serializable;
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.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;

/**
 * 

* Describes the AWS resources in use by this environment. This data is live. *

*/ @Generated("software.amazon.awssdk:codegen") public final class EnvironmentResourceDescription implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ENVIRONMENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("EnvironmentName").getter(getter(EnvironmentResourceDescription::environmentName)) .setter(setter(Builder::environmentName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnvironmentName").build()).build(); private static final SdkField> AUTO_SCALING_GROUPS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("AutoScalingGroups") .getter(getter(EnvironmentResourceDescription::autoScalingGroups)) .setter(setter(Builder::autoScalingGroups)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoScalingGroups").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(AutoScalingGroup::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> INSTANCES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Instances") .getter(getter(EnvironmentResourceDescription::instances)) .setter(setter(Builder::instances)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Instances").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Instance::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> LAUNCH_CONFIGURATIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("LaunchConfigurations") .getter(getter(EnvironmentResourceDescription::launchConfigurations)) .setter(setter(Builder::launchConfigurations)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LaunchConfigurations").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(LaunchConfiguration::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> LAUNCH_TEMPLATES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("LaunchTemplates") .getter(getter(EnvironmentResourceDescription::launchTemplates)) .setter(setter(Builder::launchTemplates)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LaunchTemplates").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(LaunchTemplate::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> LOAD_BALANCERS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("LoadBalancers") .getter(getter(EnvironmentResourceDescription::loadBalancers)) .setter(setter(Builder::loadBalancers)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LoadBalancers").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(LoadBalancer::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> TRIGGERS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Triggers") .getter(getter(EnvironmentResourceDescription::triggers)) .setter(setter(Builder::triggers)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Triggers").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Trigger::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> QUEUES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Queues") .getter(getter(EnvironmentResourceDescription::queues)) .setter(setter(Builder::queues)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Queues").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Queue::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENVIRONMENT_NAME_FIELD, AUTO_SCALING_GROUPS_FIELD, INSTANCES_FIELD, LAUNCH_CONFIGURATIONS_FIELD, LAUNCH_TEMPLATES_FIELD, LOAD_BALANCERS_FIELD, TRIGGERS_FIELD, QUEUES_FIELD)); private static final long serialVersionUID = 1L; private final String environmentName; private final List autoScalingGroups; private final List instances; private final List launchConfigurations; private final List launchTemplates; private final List loadBalancers; private final List triggers; private final List queues; private EnvironmentResourceDescription(BuilderImpl builder) { this.environmentName = builder.environmentName; this.autoScalingGroups = builder.autoScalingGroups; this.instances = builder.instances; this.launchConfigurations = builder.launchConfigurations; this.launchTemplates = builder.launchTemplates; this.loadBalancers = builder.loadBalancers; this.triggers = builder.triggers; this.queues = builder.queues; } /** *

* The name of the environment. *

* * @return The name of the environment. */ public final String environmentName() { return environmentName; } /** * Returns true if the AutoScalingGroups 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 hasAutoScalingGroups() { return autoScalingGroups != null && !(autoScalingGroups instanceof SdkAutoConstructList); } /** *

* The AutoScalingGroups used by this environment. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasAutoScalingGroups()} to see if a value was sent in this field. *

* * @return The AutoScalingGroups used by this environment. */ public final List autoScalingGroups() { return autoScalingGroups; } /** * Returns true if the Instances 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 hasInstances() { return instances != null && !(instances instanceof SdkAutoConstructList); } /** *

* The Amazon EC2 instances used by this environment. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasInstances()} to see if a value was sent in this field. *

* * @return The Amazon EC2 instances used by this environment. */ public final List instances() { return instances; } /** * Returns true if the LaunchConfigurations 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 hasLaunchConfigurations() { return launchConfigurations != null && !(launchConfigurations instanceof SdkAutoConstructList); } /** *

* The Auto Scaling launch configurations in use by this environment. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasLaunchConfigurations()} to see if a value was sent in this field. *

* * @return The Auto Scaling launch configurations in use by this environment. */ public final List launchConfigurations() { return launchConfigurations; } /** * Returns true if the LaunchTemplates 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 hasLaunchTemplates() { return launchTemplates != null && !(launchTemplates instanceof SdkAutoConstructList); } /** *

* The Amazon EC2 launch templates in use by this environment. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasLaunchTemplates()} to see if a value was sent in this field. *

* * @return The Amazon EC2 launch templates in use by this environment. */ public final List launchTemplates() { return launchTemplates; } /** * Returns true if the LoadBalancers 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 hasLoadBalancers() { return loadBalancers != null && !(loadBalancers instanceof SdkAutoConstructList); } /** *

* The LoadBalancers in use by this environment. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasLoadBalancers()} to see if a value was sent in this field. *

* * @return The LoadBalancers in use by this environment. */ public final List loadBalancers() { return loadBalancers; } /** * Returns true if the Triggers 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 hasTriggers() { return triggers != null && !(triggers instanceof SdkAutoConstructList); } /** *

* The AutoScaling triggers in use by this environment. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasTriggers()} to see if a value was sent in this field. *

* * @return The AutoScaling triggers in use by this environment. */ public final List triggers() { return triggers; } /** * Returns true if the Queues 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 hasQueues() { return queues != null && !(queues instanceof SdkAutoConstructList); } /** *

* The queues used by this environment. *

*

* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

*

* You can use {@link #hasQueues()} to see if a value was sent in this field. *

* * @return The queues used by this environment. */ public final List queues() { return queues; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(environmentName()); hashCode = 31 * hashCode + Objects.hashCode(hasAutoScalingGroups() ? autoScalingGroups() : null); hashCode = 31 * hashCode + Objects.hashCode(hasInstances() ? instances() : null); hashCode = 31 * hashCode + Objects.hashCode(hasLaunchConfigurations() ? launchConfigurations() : null); hashCode = 31 * hashCode + Objects.hashCode(hasLaunchTemplates() ? launchTemplates() : null); hashCode = 31 * hashCode + Objects.hashCode(hasLoadBalancers() ? loadBalancers() : null); hashCode = 31 * hashCode + Objects.hashCode(hasTriggers() ? triggers() : null); hashCode = 31 * hashCode + Objects.hashCode(hasQueues() ? queues() : 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 EnvironmentResourceDescription)) { return false; } EnvironmentResourceDescription other = (EnvironmentResourceDescription) obj; return Objects.equals(environmentName(), other.environmentName()) && hasAutoScalingGroups() == other.hasAutoScalingGroups() && Objects.equals(autoScalingGroups(), other.autoScalingGroups()) && hasInstances() == other.hasInstances() && Objects.equals(instances(), other.instances()) && hasLaunchConfigurations() == other.hasLaunchConfigurations() && Objects.equals(launchConfigurations(), other.launchConfigurations()) && hasLaunchTemplates() == other.hasLaunchTemplates() && Objects.equals(launchTemplates(), other.launchTemplates()) && hasLoadBalancers() == other.hasLoadBalancers() && Objects.equals(loadBalancers(), other.loadBalancers()) && hasTriggers() == other.hasTriggers() && Objects.equals(triggers(), other.triggers()) && hasQueues() == other.hasQueues() && Objects.equals(queues(), other.queues()); } /** * 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("EnvironmentResourceDescription").add("EnvironmentName", environmentName()) .add("AutoScalingGroups", hasAutoScalingGroups() ? autoScalingGroups() : null) .add("Instances", hasInstances() ? instances() : null) .add("LaunchConfigurations", hasLaunchConfigurations() ? launchConfigurations() : null) .add("LaunchTemplates", hasLaunchTemplates() ? launchTemplates() : null) .add("LoadBalancers", hasLoadBalancers() ? loadBalancers() : null) .add("Triggers", hasTriggers() ? triggers() : null).add("Queues", hasQueues() ? queues() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "EnvironmentName": return Optional.ofNullable(clazz.cast(environmentName())); case "AutoScalingGroups": return Optional.ofNullable(clazz.cast(autoScalingGroups())); case "Instances": return Optional.ofNullable(clazz.cast(instances())); case "LaunchConfigurations": return Optional.ofNullable(clazz.cast(launchConfigurations())); case "LaunchTemplates": return Optional.ofNullable(clazz.cast(launchTemplates())); case "LoadBalancers": return Optional.ofNullable(clazz.cast(loadBalancers())); case "Triggers": return Optional.ofNullable(clazz.cast(triggers())); case "Queues": return Optional.ofNullable(clazz.cast(queues())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((EnvironmentResourceDescription) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The name of the environment. *

* * @param environmentName * The name of the environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder environmentName(String environmentName); /** *

* The AutoScalingGroups used by this environment. *

* * @param autoScalingGroups * The AutoScalingGroups used by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoScalingGroups(Collection autoScalingGroups); /** *

* The AutoScalingGroups used by this environment. *

* * @param autoScalingGroups * The AutoScalingGroups used by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder autoScalingGroups(AutoScalingGroup... autoScalingGroups); /** *

* The AutoScalingGroups used by this environment. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and * its result is passed to {@link #autoScalingGroups(List)}. * * @param autoScalingGroups * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #autoScalingGroups(List) */ Builder autoScalingGroups(Consumer... autoScalingGroups); /** *

* The Amazon EC2 instances used by this environment. *

* * @param instances * The Amazon EC2 instances used by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instances(Collection instances); /** *

* The Amazon EC2 instances used by this environment. *

* * @param instances * The Amazon EC2 instances used by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder instances(Instance... instances); /** *

* The Amazon EC2 instances used by this environment. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #instances(List)}. * * @param instances * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #instances(List) */ Builder instances(Consumer... instances); /** *

* The Auto Scaling launch configurations in use by this environment. *

* * @param launchConfigurations * The Auto Scaling launch configurations in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder launchConfigurations(Collection launchConfigurations); /** *

* The Auto Scaling launch configurations in use by this environment. *

* * @param launchConfigurations * The Auto Scaling launch configurations in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder launchConfigurations(LaunchConfiguration... launchConfigurations); /** *

* The Auto Scaling launch configurations in use by this environment. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the * need to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately * and its result is passed to {@link #launchConfigurations(List)}. * * @param launchConfigurations * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #launchConfigurations(List) */ Builder launchConfigurations(Consumer... launchConfigurations); /** *

* The Amazon EC2 launch templates in use by this environment. *

* * @param launchTemplates * The Amazon EC2 launch templates in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder launchTemplates(Collection launchTemplates); /** *

* The Amazon EC2 launch templates in use by this environment. *

* * @param launchTemplates * The Amazon EC2 launch templates in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder launchTemplates(LaunchTemplate... launchTemplates); /** *

* The Amazon EC2 launch templates in use by this environment. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need * to create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and * its result is passed to {@link #launchTemplates(List)}. * * @param launchTemplates * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #launchTemplates(List) */ Builder launchTemplates(Consumer... launchTemplates); /** *

* The LoadBalancers in use by this environment. *

* * @param loadBalancers * The LoadBalancers in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder loadBalancers(Collection loadBalancers); /** *

* The LoadBalancers in use by this environment. *

* * @param loadBalancers * The LoadBalancers in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder loadBalancers(LoadBalancer... loadBalancers); /** *

* The LoadBalancers in use by this environment. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #loadBalancers(List)}. * * @param loadBalancers * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #loadBalancers(List) */ Builder loadBalancers(Consumer... loadBalancers); /** *

* The AutoScaling triggers in use by this environment. *

* * @param triggers * The AutoScaling triggers in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder triggers(Collection triggers); /** *

* The AutoScaling triggers in use by this environment. *

* * @param triggers * The AutoScaling triggers in use by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder triggers(Trigger... triggers); /** *

* The AutoScaling triggers in use by this environment. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #triggers(List)}. * * @param triggers * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #triggers(List) */ Builder triggers(Consumer... triggers); /** *

* The queues used by this environment. *

* * @param queues * The queues used by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder queues(Collection queues); /** *

* The queues used by this environment. *

* * @param queues * The queues used by this environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder queues(Queue... queues); /** *

* The queues used by this environment. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to create * one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its result * is passed to {@link #queues(List)}. * * @param queues * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #queues(List) */ Builder queues(Consumer... queues); } static final class BuilderImpl implements Builder { private String environmentName; private List autoScalingGroups = DefaultSdkAutoConstructList.getInstance(); private List instances = DefaultSdkAutoConstructList.getInstance(); private List launchConfigurations = DefaultSdkAutoConstructList.getInstance(); private List launchTemplates = DefaultSdkAutoConstructList.getInstance(); private List loadBalancers = DefaultSdkAutoConstructList.getInstance(); private List triggers = DefaultSdkAutoConstructList.getInstance(); private List queues = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(EnvironmentResourceDescription model) { environmentName(model.environmentName); autoScalingGroups(model.autoScalingGroups); instances(model.instances); launchConfigurations(model.launchConfigurations); launchTemplates(model.launchTemplates); loadBalancers(model.loadBalancers); triggers(model.triggers); queues(model.queues); } public final String getEnvironmentName() { return environmentName; } @Override public final Builder environmentName(String environmentName) { this.environmentName = environmentName; return this; } public final void setEnvironmentName(String environmentName) { this.environmentName = environmentName; } public final Collection getAutoScalingGroups() { if (autoScalingGroups instanceof SdkAutoConstructList) { return null; } return autoScalingGroups != null ? autoScalingGroups.stream().map(AutoScalingGroup::toBuilder) .collect(Collectors.toList()) : null; } @Override public final Builder autoScalingGroups(Collection autoScalingGroups) { this.autoScalingGroups = AutoScalingGroupListCopier.copy(autoScalingGroups); return this; } @Override @SafeVarargs public final Builder autoScalingGroups(AutoScalingGroup... autoScalingGroups) { autoScalingGroups(Arrays.asList(autoScalingGroups)); return this; } @Override @SafeVarargs public final Builder autoScalingGroups(Consumer... autoScalingGroups) { autoScalingGroups(Stream.of(autoScalingGroups).map(c -> AutoScalingGroup.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setAutoScalingGroups(Collection autoScalingGroups) { this.autoScalingGroups = AutoScalingGroupListCopier.copyFromBuilder(autoScalingGroups); } public final Collection getInstances() { if (instances instanceof SdkAutoConstructList) { return null; } return instances != null ? instances.stream().map(Instance::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder instances(Collection instances) { this.instances = InstanceListCopier.copy(instances); return this; } @Override @SafeVarargs public final Builder instances(Instance... instances) { instances(Arrays.asList(instances)); return this; } @Override @SafeVarargs public final Builder instances(Consumer... instances) { instances(Stream.of(instances).map(c -> Instance.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setInstances(Collection instances) { this.instances = InstanceListCopier.copyFromBuilder(instances); } public final Collection getLaunchConfigurations() { if (launchConfigurations instanceof SdkAutoConstructList) { return null; } return launchConfigurations != null ? launchConfigurations.stream().map(LaunchConfiguration::toBuilder) .collect(Collectors.toList()) : null; } @Override public final Builder launchConfigurations(Collection launchConfigurations) { this.launchConfigurations = LaunchConfigurationListCopier.copy(launchConfigurations); return this; } @Override @SafeVarargs public final Builder launchConfigurations(LaunchConfiguration... launchConfigurations) { launchConfigurations(Arrays.asList(launchConfigurations)); return this; } @Override @SafeVarargs public final Builder launchConfigurations(Consumer... launchConfigurations) { launchConfigurations(Stream.of(launchConfigurations).map(c -> LaunchConfiguration.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setLaunchConfigurations(Collection launchConfigurations) { this.launchConfigurations = LaunchConfigurationListCopier.copyFromBuilder(launchConfigurations); } public final Collection getLaunchTemplates() { if (launchTemplates instanceof SdkAutoConstructList) { return null; } return launchTemplates != null ? launchTemplates.stream().map(LaunchTemplate::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder launchTemplates(Collection launchTemplates) { this.launchTemplates = LaunchTemplateListCopier.copy(launchTemplates); return this; } @Override @SafeVarargs public final Builder launchTemplates(LaunchTemplate... launchTemplates) { launchTemplates(Arrays.asList(launchTemplates)); return this; } @Override @SafeVarargs public final Builder launchTemplates(Consumer... launchTemplates) { launchTemplates(Stream.of(launchTemplates).map(c -> LaunchTemplate.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setLaunchTemplates(Collection launchTemplates) { this.launchTemplates = LaunchTemplateListCopier.copyFromBuilder(launchTemplates); } public final Collection getLoadBalancers() { if (loadBalancers instanceof SdkAutoConstructList) { return null; } return loadBalancers != null ? loadBalancers.stream().map(LoadBalancer::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder loadBalancers(Collection loadBalancers) { this.loadBalancers = LoadBalancerListCopier.copy(loadBalancers); return this; } @Override @SafeVarargs public final Builder loadBalancers(LoadBalancer... loadBalancers) { loadBalancers(Arrays.asList(loadBalancers)); return this; } @Override @SafeVarargs public final Builder loadBalancers(Consumer... loadBalancers) { loadBalancers(Stream.of(loadBalancers).map(c -> LoadBalancer.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setLoadBalancers(Collection loadBalancers) { this.loadBalancers = LoadBalancerListCopier.copyFromBuilder(loadBalancers); } public final Collection getTriggers() { if (triggers instanceof SdkAutoConstructList) { return null; } return triggers != null ? triggers.stream().map(Trigger::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder triggers(Collection triggers) { this.triggers = TriggerListCopier.copy(triggers); return this; } @Override @SafeVarargs public final Builder triggers(Trigger... triggers) { triggers(Arrays.asList(triggers)); return this; } @Override @SafeVarargs public final Builder triggers(Consumer... triggers) { triggers(Stream.of(triggers).map(c -> Trigger.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setTriggers(Collection triggers) { this.triggers = TriggerListCopier.copyFromBuilder(triggers); } public final Collection getQueues() { if (queues instanceof SdkAutoConstructList) { return null; } return queues != null ? queues.stream().map(Queue::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder queues(Collection queues) { this.queues = QueueListCopier.copy(queues); return this; } @Override @SafeVarargs public final Builder queues(Queue... queues) { queues(Arrays.asList(queues)); return this; } @Override @SafeVarargs public final Builder queues(Consumer... queues) { queues(Stream.of(queues).map(c -> Queue.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setQueues(Collection queues) { this.queues = QueueListCopier.copyFromBuilder(queues); } @Override public EnvironmentResourceDescription build() { return new EnvironmentResourceDescription(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy