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

software.amazon.awssdk.services.cloud9.model.CreateEnvironmentEc2Request Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.28.4
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.cloud9.model;

import java.beans.Transient;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateEnvironmentEc2Request extends Cloud9Request implements
        ToCopyableBuilder {
    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(CreateEnvironmentEc2Request::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("description").getter(getter(CreateEnvironmentEc2Request::description))
            .setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final SdkField CLIENT_REQUEST_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("clientRequestToken").getter(getter(CreateEnvironmentEc2Request::clientRequestToken))
            .setter(setter(Builder::clientRequestToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientRequestToken").build())
            .build();

    private static final SdkField INSTANCE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("instanceType").getter(getter(CreateEnvironmentEc2Request::instanceType))
            .setter(setter(Builder::instanceType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("instanceType").build()).build();

    private static final SdkField SUBNET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("subnetId").getter(getter(CreateEnvironmentEc2Request::subnetId)).setter(setter(Builder::subnetId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("subnetId").build()).build();

    private static final SdkField IMAGE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("imageId").getter(getter(CreateEnvironmentEc2Request::imageId)).setter(setter(Builder::imageId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("imageId").build()).build();

    private static final SdkField AUTOMATIC_STOP_TIME_MINUTES_FIELD = SdkField
            . builder(MarshallingType.INTEGER).memberName("automaticStopTimeMinutes")
            .getter(getter(CreateEnvironmentEc2Request::automaticStopTimeMinutes))
            .setter(setter(Builder::automaticStopTimeMinutes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("automaticStopTimeMinutes").build())
            .build();

    private static final SdkField OWNER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ownerArn").getter(getter(CreateEnvironmentEc2Request::ownerArn)).setter(setter(Builder::ownerArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerArn").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("tags")
            .getter(getter(CreateEnvironmentEc2Request::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Tag::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField CONNECTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("connectionType").getter(getter(CreateEnvironmentEc2Request::connectionTypeAsString))
            .setter(setter(Builder::connectionType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("connectionType").build()).build();

    private static final SdkField DRY_RUN_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("dryRun").getter(getter(CreateEnvironmentEc2Request::dryRun)).setter(setter(Builder::dryRun))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dryRun").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, DESCRIPTION_FIELD,
            CLIENT_REQUEST_TOKEN_FIELD, INSTANCE_TYPE_FIELD, SUBNET_ID_FIELD, IMAGE_ID_FIELD, AUTOMATIC_STOP_TIME_MINUTES_FIELD,
            OWNER_ARN_FIELD, TAGS_FIELD, CONNECTION_TYPE_FIELD, DRY_RUN_FIELD));

    private final String name;

    private final String description;

    private final String clientRequestToken;

    private final String instanceType;

    private final String subnetId;

    private final String imageId;

    private final Integer automaticStopTimeMinutes;

    private final String ownerArn;

    private final List tags;

    private final String connectionType;

    private final Boolean dryRun;

    private CreateEnvironmentEc2Request(BuilderImpl builder) {
        super(builder);
        this.name = builder.name;
        this.description = builder.description;
        this.clientRequestToken = builder.clientRequestToken;
        this.instanceType = builder.instanceType;
        this.subnetId = builder.subnetId;
        this.imageId = builder.imageId;
        this.automaticStopTimeMinutes = builder.automaticStopTimeMinutes;
        this.ownerArn = builder.ownerArn;
        this.tags = builder.tags;
        this.connectionType = builder.connectionType;
        this.dryRun = builder.dryRun;
    }

    /**
     * 

* The name of the environment to create. *

*

* This name is visible to other IAM users in the same Amazon Web Services account. *

* * @return The name of the environment to create.

*

* This name is visible to other IAM users in the same Amazon Web Services account. */ public final String name() { return name; } /** *

* The description of the environment to create. *

* * @return The description of the environment to create. */ public final String description() { return description; } /** *

* A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one time. *

*

* For more information, see Client Tokens in * the Amazon EC2 API Reference. *

* * @return A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one * time.

*

* For more information, see Client * Tokens in the Amazon EC2 API Reference. */ public final String clientRequestToken() { return clientRequestToken; } /** *

* The type of instance to connect to the environment (for example, t2.micro). *

* * @return The type of instance to connect to the environment (for example, t2.micro). */ public final String instanceType() { return instanceType; } /** *

* The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance. *

* * @return The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance. */ public final String subnetId() { return subnetId; } /** *

* The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an AMI for * the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path. *

*

* The default AMI is used if the parameter isn't explicitly assigned a value in the request. Because Amazon Linux * AMI has ended standard support as of December 31, 2020, we recommend you choose Amazon Linux 2, which includes * long term support through 2023. *

*

* AMI aliases *

*
    *
  • *

    * Amazon Linux (default): amazonlinux-1-x86_64 *

    *
  • *
  • *

    * Amazon Linux 2: amazonlinux-2-x86_64 *

    *
  • *
  • *

    * Ubuntu 18.04: ubuntu-18.04-x86_64 *

    *
  • *
*

* SSM paths *

*
    *
  • *

    * Amazon Linux (default): resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64 *

    *
  • *
  • *

    * Amazon Linux 2: resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64 *

    *
  • *
  • *

    * Ubuntu 18.04: resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64 *

    *
  • *
* * @return The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an * AMI for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) * path.

*

* The default AMI is used if the parameter isn't explicitly assigned a value in the request. Because Amazon * Linux AMI has ended standard support as of December 31, 2020, we recommend you choose Amazon Linux 2, * which includes long term support through 2023. *

*

* AMI aliases *

*
    *
  • *

    * Amazon Linux (default): amazonlinux-1-x86_64 *

    *
  • *
  • *

    * Amazon Linux 2: amazonlinux-2-x86_64 *

    *
  • *
  • *

    * Ubuntu 18.04: ubuntu-18.04-x86_64 *

    *
  • *
*

* SSM paths *

*
    *
  • *

    * Amazon Linux (default): resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64 *

    *
  • *
  • *

    * Amazon Linux 2: resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64 *

    *
  • *
  • *

    * Ubuntu 18.04: resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64 *

    *
  • */ public final String imageId() { return imageId; } /** *

    * The number of minutes until the running instance is shut down after the environment has last been used. *

    * * @return The number of minutes until the running instance is shut down after the environment has last been used. */ public final Integer automaticStopTimeMinutes() { return automaticStopTimeMinutes; } /** *

    * The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If this * value is not specified, the ARN defaults to this environment's creator. *

    * * @return The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If * this value is not specified, the ARN defaults to this environment's creator. */ public final String ownerArn() { return ownerArn; } /** * 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 SdkAutoConstructList); } /** *

    * An array of key-value pairs that will be associated with the new Cloud9 development environment. *

    *

    * 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 An array of key-value pairs that will be associated with the new Cloud9 development environment. */ public final List tags() { return tags; } /** *

    * The connection type used for connecting to an Amazon EC2 environment. Valid values are CONNECT_SSH * (default) and CONNECT_SSM (connected through Amazon EC2 Systems Manager). *

    *

    * For more information, see Accessing * no-ingress EC2 instances with Amazon EC2 Systems Manager in the Cloud9 User Guide. *

    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #connectionType} * will return {@link ConnectionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #connectionTypeAsString}. *

    * * @return The connection type used for connecting to an Amazon EC2 environment. Valid values are * CONNECT_SSH (default) and CONNECT_SSM (connected through Amazon EC2 Systems * Manager).

    *

    * For more information, see Accessing no-ingress EC2 * instances with Amazon EC2 Systems Manager in the Cloud9 User Guide. * @see ConnectionType */ public final ConnectionType connectionType() { return ConnectionType.fromValue(connectionType); } /** *

    * The connection type used for connecting to an Amazon EC2 environment. Valid values are CONNECT_SSH * (default) and CONNECT_SSM (connected through Amazon EC2 Systems Manager). *

    *

    * For more information, see Accessing * no-ingress EC2 instances with Amazon EC2 Systems Manager in the Cloud9 User Guide. *

    *

    * If the service returns an enum value that is not available in the current SDK version, {@link #connectionType} * will return {@link ConnectionType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #connectionTypeAsString}. *

    * * @return The connection type used for connecting to an Amazon EC2 environment. Valid values are * CONNECT_SSH (default) and CONNECT_SSM (connected through Amazon EC2 Systems * Manager).

    *

    * For more information, see Accessing no-ingress EC2 * instances with Amazon EC2 Systems Manager in the Cloud9 User Guide. * @see ConnectionType */ public final String connectionTypeAsString() { return connectionType; } /** *

    * Checks whether you have the required permissions for the action, without actually making the request, and * provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. *

    * * @return Checks whether you have the required permissions for the action, without actually making the request, and * provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. */ public final Boolean dryRun() { return dryRun; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(clientRequestToken()); hashCode = 31 * hashCode + Objects.hashCode(instanceType()); hashCode = 31 * hashCode + Objects.hashCode(subnetId()); hashCode = 31 * hashCode + Objects.hashCode(imageId()); hashCode = 31 * hashCode + Objects.hashCode(automaticStopTimeMinutes()); hashCode = 31 * hashCode + Objects.hashCode(ownerArn()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(connectionTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(dryRun()); 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 CreateEnvironmentEc2Request)) { return false; } CreateEnvironmentEc2Request other = (CreateEnvironmentEc2Request) obj; return Objects.equals(name(), other.name()) && Objects.equals(description(), other.description()) && Objects.equals(clientRequestToken(), other.clientRequestToken()) && Objects.equals(instanceType(), other.instanceType()) && Objects.equals(subnetId(), other.subnetId()) && Objects.equals(imageId(), other.imageId()) && Objects.equals(automaticStopTimeMinutes(), other.automaticStopTimeMinutes()) && Objects.equals(ownerArn(), other.ownerArn()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(connectionTypeAsString(), other.connectionTypeAsString()) && Objects.equals(dryRun(), other.dryRun()); } /** * 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("CreateEnvironmentEc2Request").add("Name", name()) .add("Description", description() == null ? null : "*** Sensitive Data Redacted ***") .add("ClientRequestToken", clientRequestToken()).add("InstanceType", instanceType()).add("SubnetId", subnetId()) .add("ImageId", imageId()).add("AutomaticStopTimeMinutes", automaticStopTimeMinutes()) .add("OwnerArn", ownerArn()).add("Tags", tags() == null ? null : "*** Sensitive Data Redacted ***") .add("ConnectionType", connectionTypeAsString()).add("DryRun", dryRun()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "description": return Optional.ofNullable(clazz.cast(description())); case "clientRequestToken": return Optional.ofNullable(clazz.cast(clientRequestToken())); case "instanceType": return Optional.ofNullable(clazz.cast(instanceType())); case "subnetId": return Optional.ofNullable(clazz.cast(subnetId())); case "imageId": return Optional.ofNullable(clazz.cast(imageId())); case "automaticStopTimeMinutes": return Optional.ofNullable(clazz.cast(automaticStopTimeMinutes())); case "ownerArn": return Optional.ofNullable(clazz.cast(ownerArn())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "connectionType": return Optional.ofNullable(clazz.cast(connectionTypeAsString())); case "dryRun": return Optional.ofNullable(clazz.cast(dryRun())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateEnvironmentEc2Request) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends Cloud9Request.Builder, SdkPojo, CopyableBuilder { /** *

    * The name of the environment to create. *

    *

    * This name is visible to other IAM users in the same Amazon Web Services account. *

    * * @param name * The name of the environment to create.

    *

    * This name is visible to other IAM users in the same Amazon Web Services account. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

    * The description of the environment to create. *

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

    * A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one time. *

    *

    * For more information, see Client Tokens * in the Amazon EC2 API Reference. *

    * * @param clientRequestToken * A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one * time.

    *

    * For more information, see Client * Tokens in the Amazon EC2 API Reference. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientRequestToken(String clientRequestToken); /** *

    * The type of instance to connect to the environment (for example, t2.micro). *

    * * @param instanceType * The type of instance to connect to the environment (for example, t2.micro). * @return Returns a reference to this object so that method calls can be chained together. */ Builder instanceType(String instanceType); /** *

    * The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance. *

    * * @param subnetId * The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetId(String subnetId); /** *

    * The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an AMI * for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path. *

    *

    * The default AMI is used if the parameter isn't explicitly assigned a value in the request. Because Amazon * Linux AMI has ended standard support as of December 31, 2020, we recommend you choose Amazon Linux 2, which * includes long term support through 2023. *

    *

    * AMI aliases *

    *
      *
    • *

      * Amazon Linux (default): amazonlinux-1-x86_64 *

      *
    • *
    • *

      * Amazon Linux 2: amazonlinux-2-x86_64 *

      *
    • *
    • *

      * Ubuntu 18.04: ubuntu-18.04-x86_64 *

      *
    • *
    *

    * SSM paths *

    *
      *
    • *

      * Amazon Linux (default): resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64 *

      *
    • *
    • *

      * Amazon Linux 2: resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64 *

      *
    • *
    • *

      * Ubuntu 18.04: resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64 *

      *
    • *
    * * @param imageId * The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an * AMI for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) * path.

    *

    * The default AMI is used if the parameter isn't explicitly assigned a value in the request. Because * Amazon Linux AMI has ended standard support as of December 31, 2020, we recommend you choose Amazon * Linux 2, which includes long term support through 2023. *

    *

    * AMI aliases *

    *
      *
    • *

      * Amazon Linux (default): amazonlinux-1-x86_64 *

      *
    • *
    • *

      * Amazon Linux 2: amazonlinux-2-x86_64 *

      *
    • *
    • *

      * Ubuntu 18.04: ubuntu-18.04-x86_64 *

      *
    • *
    *

    * SSM paths *

    *
      *
    • *

      * Amazon Linux (default): resolve:ssm:/aws/service/cloud9/amis/amazonlinux-1-x86_64 *

      *
    • *
    • *

      * Amazon Linux 2: resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64 *

      *
    • *
    • *

      * Ubuntu 18.04: resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64 *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder imageId(String imageId); /** *

      * The number of minutes until the running instance is shut down after the environment has last been used. *

      * * @param automaticStopTimeMinutes * The number of minutes until the running instance is shut down after the environment has last been * used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder automaticStopTimeMinutes(Integer automaticStopTimeMinutes); /** *

      * The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If * this value is not specified, the ARN defaults to this environment's creator. *

      * * @param ownerArn * The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. * If this value is not specified, the ARN defaults to this environment's creator. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerArn(String ownerArn); /** *

      * An array of key-value pairs that will be associated with the new Cloud9 development environment. *

      * * @param tags * An array of key-value pairs that will be associated with the new Cloud9 development environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

      * An array of key-value pairs that will be associated with the new Cloud9 development environment. *

      * * @param tags * An array of key-value pairs that will be associated with the new Cloud9 development environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

      * An array of key-value pairs that will be associated with the new Cloud9 development 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 #tags(List)}. * * @param tags * 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 #tags(List) */ Builder tags(Consumer... tags); /** *

      * The connection type used for connecting to an Amazon EC2 environment. Valid values are * CONNECT_SSH (default) and CONNECT_SSM (connected through Amazon EC2 Systems * Manager). *

      *

      * For more information, see Accessing no-ingress EC2 instances * with Amazon EC2 Systems Manager in the Cloud9 User Guide. *

      * * @param connectionType * The connection type used for connecting to an Amazon EC2 environment. Valid values are * CONNECT_SSH (default) and CONNECT_SSM (connected through Amazon EC2 Systems * Manager).

      *

      * For more information, see Accessing no-ingress EC2 * instances with Amazon EC2 Systems Manager in the Cloud9 User Guide. * @see ConnectionType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectionType */ Builder connectionType(String connectionType); /** *

      * The connection type used for connecting to an Amazon EC2 environment. Valid values are * CONNECT_SSH (default) and CONNECT_SSM (connected through Amazon EC2 Systems * Manager). *

      *

      * For more information, see Accessing no-ingress EC2 instances * with Amazon EC2 Systems Manager in the Cloud9 User Guide. *

      * * @param connectionType * The connection type used for connecting to an Amazon EC2 environment. Valid values are * CONNECT_SSH (default) and CONNECT_SSM (connected through Amazon EC2 Systems * Manager).

      *

      * For more information, see Accessing no-ingress EC2 * instances with Amazon EC2 Systems Manager in the Cloud9 User Guide. * @see ConnectionType * @return Returns a reference to this object so that method calls can be chained together. * @see ConnectionType */ Builder connectionType(ConnectionType connectionType); /** *

      * Checks whether you have the required permissions for the action, without actually making the request, and * provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. *

      * * @param dryRun * Checks whether you have the required permissions for the action, without actually making the request, * and provides an error response. If you have the required permissions, the error response is * DryRunOperation. Otherwise, it is UnauthorizedOperation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dryRun(Boolean dryRun); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends Cloud9Request.BuilderImpl implements Builder { private String name; private String description; private String clientRequestToken; private String instanceType; private String subnetId; private String imageId; private Integer automaticStopTimeMinutes; private String ownerArn; private List tags = DefaultSdkAutoConstructList.getInstance(); private String connectionType; private Boolean dryRun; private BuilderImpl() { } private BuilderImpl(CreateEnvironmentEc2Request model) { super(model); name(model.name); description(model.description); clientRequestToken(model.clientRequestToken); instanceType(model.instanceType); subnetId(model.subnetId); imageId(model.imageId); automaticStopTimeMinutes(model.automaticStopTimeMinutes); ownerArn(model.ownerArn); tags(model.tags); connectionType(model.connectionType); dryRun(model.dryRun); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override @Transient public final Builder name(String name) { this.name = name; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override @Transient public final Builder description(String description) { this.description = description; return this; } public final String getClientRequestToken() { return clientRequestToken; } public final void setClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; } @Override @Transient public final Builder clientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; return this; } public final String getInstanceType() { return instanceType; } public final void setInstanceType(String instanceType) { this.instanceType = instanceType; } @Override @Transient public final Builder instanceType(String instanceType) { this.instanceType = instanceType; return this; } public final String getSubnetId() { return subnetId; } public final void setSubnetId(String subnetId) { this.subnetId = subnetId; } @Override @Transient public final Builder subnetId(String subnetId) { this.subnetId = subnetId; return this; } public final String getImageId() { return imageId; } public final void setImageId(String imageId) { this.imageId = imageId; } @Override @Transient public final Builder imageId(String imageId) { this.imageId = imageId; return this; } public final Integer getAutomaticStopTimeMinutes() { return automaticStopTimeMinutes; } public final void setAutomaticStopTimeMinutes(Integer automaticStopTimeMinutes) { this.automaticStopTimeMinutes = automaticStopTimeMinutes; } @Override @Transient public final Builder automaticStopTimeMinutes(Integer automaticStopTimeMinutes) { this.automaticStopTimeMinutes = automaticStopTimeMinutes; return this; } public final String getOwnerArn() { return ownerArn; } public final void setOwnerArn(String ownerArn) { this.ownerArn = ownerArn; } @Override @Transient public final Builder ownerArn(String ownerArn) { this.ownerArn = ownerArn; return this; } public final List getTags() { List result = TagListCopier.copyToBuilder(this.tags); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override @Transient public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @Transient @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @Transient @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final String getConnectionType() { return connectionType; } public final void setConnectionType(String connectionType) { this.connectionType = connectionType; } @Override @Transient public final Builder connectionType(String connectionType) { this.connectionType = connectionType; return this; } @Override @Transient public final Builder connectionType(ConnectionType connectionType) { this.connectionType(connectionType == null ? null : connectionType.toString()); return this; } public final Boolean getDryRun() { return dryRun; } public final void setDryRun(Boolean dryRun) { this.dryRun = dryRun; } @Override @Transient public final Builder dryRun(Boolean dryRun) { this.dryRun = dryRun; 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 CreateEnvironmentEc2Request build() { return new CreateEnvironmentEc2Request(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy