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

software.amazon.awssdk.services.m2.model.CreateEnvironmentRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for M2 module holds the client classes that are used for communicating with M2.

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.m2.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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateEnvironmentRequest extends M2Request implements
        ToCopyableBuilder {
    private static final SdkField CLIENT_TOKEN_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("clientToken")
            .getter(getter(CreateEnvironmentRequest::clientToken))
            .setter(setter(Builder::clientToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clientToken").build(),
                    DefaultValueTrait.idempotencyToken()).build();

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

    private static final SdkField ENGINE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("engineType").getter(getter(CreateEnvironmentRequest::engineTypeAsString))
            .setter(setter(Builder::engineType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("engineType").build()).build();

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

    private static final SdkField HIGH_AVAILABILITY_CONFIG_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("highAvailabilityConfig")
            .getter(getter(CreateEnvironmentRequest::highAvailabilityConfig)).setter(setter(Builder::highAvailabilityConfig))
            .constructor(HighAvailabilityConfig::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("highAvailabilityConfig").build())
            .build();

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

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

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

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

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

    private static final SdkField> SECURITY_GROUP_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("securityGroupIds")
            .getter(getter(CreateEnvironmentRequest::securityGroupIds))
            .setter(setter(Builder::securityGroupIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("securityGroupIds").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> STORAGE_CONFIGURATIONS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("storageConfigurations")
            .getter(getter(CreateEnvironmentRequest::storageConfigurations))
            .setter(setter(Builder::storageConfigurations))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("storageConfigurations").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(StorageConfiguration::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField> SUBNET_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("subnetIds")
            .getter(getter(CreateEnvironmentRequest::subnetIds))
            .setter(setter(Builder::subnetIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("subnetIds").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> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("tags")
            .getter(getter(CreateEnvironmentRequest::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLIENT_TOKEN_FIELD,
            DESCRIPTION_FIELD, ENGINE_TYPE_FIELD, ENGINE_VERSION_FIELD, HIGH_AVAILABILITY_CONFIG_FIELD, INSTANCE_TYPE_FIELD,
            KMS_KEY_ID_FIELD, NAME_FIELD, PREFERRED_MAINTENANCE_WINDOW_FIELD, PUBLICLY_ACCESSIBLE_FIELD,
            SECURITY_GROUP_IDS_FIELD, STORAGE_CONFIGURATIONS_FIELD, SUBNET_IDS_FIELD, TAGS_FIELD));

    private final String clientToken;

    private final String description;

    private final String engineType;

    private final String engineVersion;

    private final HighAvailabilityConfig highAvailabilityConfig;

    private final String instanceType;

    private final String kmsKeyId;

    private final String name;

    private final String preferredMaintenanceWindow;

    private final Boolean publiclyAccessible;

    private final List securityGroupIds;

    private final List storageConfigurations;

    private final List subnetIds;

    private final Map tags;

    private CreateEnvironmentRequest(BuilderImpl builder) {
        super(builder);
        this.clientToken = builder.clientToken;
        this.description = builder.description;
        this.engineType = builder.engineType;
        this.engineVersion = builder.engineVersion;
        this.highAvailabilityConfig = builder.highAvailabilityConfig;
        this.instanceType = builder.instanceType;
        this.kmsKeyId = builder.kmsKeyId;
        this.name = builder.name;
        this.preferredMaintenanceWindow = builder.preferredMaintenanceWindow;
        this.publiclyAccessible = builder.publiclyAccessible;
        this.securityGroupIds = builder.securityGroupIds;
        this.storageConfigurations = builder.storageConfigurations;
        this.subnetIds = builder.subnetIds;
        this.tags = builder.tags;
    }

    /**
     * 

* Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. * The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you * retry the API within this timeframe with the same clientToken, you will get the same response. The service also * handles deleting the clientToken after it expires. *

* * @return Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an * environment. The service generates the clientToken when the API call is triggered. The token expires * after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the * same response. The service also handles deleting the clientToken after it expires. */ public final String clientToken() { return clientToken; } /** *

* The description of the runtime environment. *

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

* The engine type for the runtime environment. *

*

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

* * @return The engine type for the runtime environment. * @see EngineType */ public final EngineType engineType() { return EngineType.fromValue(engineType); } /** *

* The engine type for the runtime environment. *

*

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

* * @return The engine type for the runtime environment. * @see EngineType */ public final String engineTypeAsString() { return engineType; } /** *

* The version of the engine type for the runtime environment. *

* * @return The version of the engine type for the runtime environment. */ public final String engineVersion() { return engineVersion; } /** *

* The details of a high availability configuration for this runtime environment. *

* * @return The details of a high availability configuration for this runtime environment. */ public final HighAvailabilityConfig highAvailabilityConfig() { return highAvailabilityConfig; } /** *

* The type of instance for the runtime environment. *

* * @return The type of instance for the runtime environment. */ public final String instanceType() { return instanceType; } /** *

* The identifier of a customer managed key. *

* * @return The identifier of a customer managed key. */ public final String kmsKeyId() { return kmsKeyId; } /** *

* The name of the runtime environment. Must be unique within the account. *

* * @return The name of the runtime environment. Must be unique within the account. */ public final String name() { return name; } /** *

* Configures the maintenance window that you want for the runtime environment. The maintenance window must have the * format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The following two examples are valid * maintenance windows: sun:23:45-mon:00:15 or sat:01:00-sat:03:00. *

*

* If you do not provide a value, a random system-generated value will be assigned. *

* * @return Configures the maintenance window that you want for the runtime environment. The maintenance window must * have the format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The following two * examples are valid maintenance windows: sun:23:45-mon:00:15 or * sat:01:00-sat:03:00.

*

* If you do not provide a value, a random system-generated value will be assigned. */ public final String preferredMaintenanceWindow() { return preferredMaintenanceWindow; } /** *

* Specifies whether the runtime environment is publicly accessible. *

* * @return Specifies whether the runtime environment is publicly accessible. */ public final Boolean publiclyAccessible() { return publiclyAccessible; } /** * For responses, this returns true if the service returned a value for the SecurityGroupIds 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 hasSecurityGroupIds() { return securityGroupIds != null && !(securityGroupIds instanceof SdkAutoConstructList); } /** *

* The list of security groups for the VPC associated with this runtime 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 #hasSecurityGroupIds} method. *

* * @return The list of security groups for the VPC associated with this runtime environment. */ public final List securityGroupIds() { return securityGroupIds; } /** * For responses, this returns true if the service returned a value for the StorageConfigurations 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 hasStorageConfigurations() { return storageConfigurations != null && !(storageConfigurations instanceof SdkAutoConstructList); } /** *

* Optional. The storage configurations for this runtime 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 #hasStorageConfigurations} method. *

* * @return Optional. The storage configurations for this runtime environment. */ public final List storageConfigurations() { return storageConfigurations; } /** * For responses, this returns true if the service returned a value for the SubnetIds 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 hasSubnetIds() { return subnetIds != null && !(subnetIds instanceof SdkAutoConstructList); } /** *

* The list of subnets associated with the VPC for this runtime 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 #hasSubnetIds} method. *

* * @return The list of subnets associated with the VPC for this runtime environment. */ public final List subnetIds() { return subnetIds; } /** * 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); } /** *

* The tags for the runtime 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 The tags for the runtime environment. */ public final Map tags() { return tags; } @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(clientToken()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(engineTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(engineVersion()); hashCode = 31 * hashCode + Objects.hashCode(highAvailabilityConfig()); hashCode = 31 * hashCode + Objects.hashCode(instanceType()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(preferredMaintenanceWindow()); hashCode = 31 * hashCode + Objects.hashCode(publiclyAccessible()); hashCode = 31 * hashCode + Objects.hashCode(hasSecurityGroupIds() ? securityGroupIds() : null); hashCode = 31 * hashCode + Objects.hashCode(hasStorageConfigurations() ? storageConfigurations() : null); hashCode = 31 * hashCode + Objects.hashCode(hasSubnetIds() ? subnetIds() : null); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); 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 CreateEnvironmentRequest)) { return false; } CreateEnvironmentRequest other = (CreateEnvironmentRequest) obj; return Objects.equals(clientToken(), other.clientToken()) && Objects.equals(description(), other.description()) && Objects.equals(engineTypeAsString(), other.engineTypeAsString()) && Objects.equals(engineVersion(), other.engineVersion()) && Objects.equals(highAvailabilityConfig(), other.highAvailabilityConfig()) && Objects.equals(instanceType(), other.instanceType()) && Objects.equals(kmsKeyId(), other.kmsKeyId()) && Objects.equals(name(), other.name()) && Objects.equals(preferredMaintenanceWindow(), other.preferredMaintenanceWindow()) && Objects.equals(publiclyAccessible(), other.publiclyAccessible()) && hasSecurityGroupIds() == other.hasSecurityGroupIds() && Objects.equals(securityGroupIds(), other.securityGroupIds()) && hasStorageConfigurations() == other.hasStorageConfigurations() && Objects.equals(storageConfigurations(), other.storageConfigurations()) && hasSubnetIds() == other.hasSubnetIds() && Objects.equals(subnetIds(), other.subnetIds()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("CreateEnvironmentRequest").add("ClientToken", clientToken()).add("Description", description()) .add("EngineType", engineTypeAsString()).add("EngineVersion", engineVersion()) .add("HighAvailabilityConfig", highAvailabilityConfig()).add("InstanceType", instanceType()) .add("KmsKeyId", kmsKeyId()).add("Name", name()).add("PreferredMaintenanceWindow", preferredMaintenanceWindow()) .add("PubliclyAccessible", publiclyAccessible()) .add("SecurityGroupIds", hasSecurityGroupIds() ? securityGroupIds() : null) .add("StorageConfigurations", hasStorageConfigurations() ? storageConfigurations() : null) .add("SubnetIds", hasSubnetIds() ? subnetIds() : null).add("Tags", hasTags() ? tags() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "clientToken": return Optional.ofNullable(clazz.cast(clientToken())); case "description": return Optional.ofNullable(clazz.cast(description())); case "engineType": return Optional.ofNullable(clazz.cast(engineTypeAsString())); case "engineVersion": return Optional.ofNullable(clazz.cast(engineVersion())); case "highAvailabilityConfig": return Optional.ofNullable(clazz.cast(highAvailabilityConfig())); case "instanceType": return Optional.ofNullable(clazz.cast(instanceType())); case "kmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); case "name": return Optional.ofNullable(clazz.cast(name())); case "preferredMaintenanceWindow": return Optional.ofNullable(clazz.cast(preferredMaintenanceWindow())); case "publiclyAccessible": return Optional.ofNullable(clazz.cast(publiclyAccessible())); case "securityGroupIds": return Optional.ofNullable(clazz.cast(securityGroupIds())); case "storageConfigurations": return Optional.ofNullable(clazz.cast(storageConfigurations())); case "subnetIds": return Optional.ofNullable(clazz.cast(subnetIds())); case "tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateEnvironmentRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends M2Request.Builder, SdkPojo, CopyableBuilder { /** *

* Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an * environment. The service generates the clientToken when the API call is triggered. The token expires after * one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same * response. The service also handles deleting the clientToken after it expires. *

* * @param clientToken * Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an * environment. The service generates the clientToken when the API call is triggered. The token expires * after one hour, so if you retry the API within this timeframe with the same clientToken, you will get * the same response. The service also handles deleting the clientToken after it expires. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clientToken(String clientToken); /** *

* The description of the runtime environment. *

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

* The engine type for the runtime environment. *

* * @param engineType * The engine type for the runtime environment. * @see EngineType * @return Returns a reference to this object so that method calls can be chained together. * @see EngineType */ Builder engineType(String engineType); /** *

* The engine type for the runtime environment. *

* * @param engineType * The engine type for the runtime environment. * @see EngineType * @return Returns a reference to this object so that method calls can be chained together. * @see EngineType */ Builder engineType(EngineType engineType); /** *

* The version of the engine type for the runtime environment. *

* * @param engineVersion * The version of the engine type for the runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engineVersion(String engineVersion); /** *

* The details of a high availability configuration for this runtime environment. *

* * @param highAvailabilityConfig * The details of a high availability configuration for this runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder highAvailabilityConfig(HighAvailabilityConfig highAvailabilityConfig); /** *

* The details of a high availability configuration for this runtime environment. *

* This is a convenience method that creates an instance of the {@link HighAvailabilityConfig.Builder} avoiding * the need to create one manually via {@link HighAvailabilityConfig#builder()}. * *

* When the {@link Consumer} completes, {@link HighAvailabilityConfig.Builder#build()} is called immediately and * its result is passed to {@link #highAvailabilityConfig(HighAvailabilityConfig)}. * * @param highAvailabilityConfig * a consumer that will call methods on {@link HighAvailabilityConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #highAvailabilityConfig(HighAvailabilityConfig) */ default Builder highAvailabilityConfig(Consumer highAvailabilityConfig) { return highAvailabilityConfig(HighAvailabilityConfig.builder().applyMutation(highAvailabilityConfig).build()); } /** *

* The type of instance for the runtime environment. *

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

* The identifier of a customer managed key. *

* * @param kmsKeyId * The identifier of a customer managed key. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); /** *

* The name of the runtime environment. Must be unique within the account. *

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

* Configures the maintenance window that you want for the runtime environment. The maintenance window must have * the format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The following two examples * are valid maintenance windows: sun:23:45-mon:00:15 or sat:01:00-sat:03:00. *

*

* If you do not provide a value, a random system-generated value will be assigned. *

* * @param preferredMaintenanceWindow * Configures the maintenance window that you want for the runtime environment. The maintenance window * must have the format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The * following two examples are valid maintenance windows: sun:23:45-mon:00:15 or * sat:01:00-sat:03:00.

*

* If you do not provide a value, a random system-generated value will be assigned. * @return Returns a reference to this object so that method calls can be chained together. */ Builder preferredMaintenanceWindow(String preferredMaintenanceWindow); /** *

* Specifies whether the runtime environment is publicly accessible. *

* * @param publiclyAccessible * Specifies whether the runtime environment is publicly accessible. * @return Returns a reference to this object so that method calls can be chained together. */ Builder publiclyAccessible(Boolean publiclyAccessible); /** *

* The list of security groups for the VPC associated with this runtime environment. *

* * @param securityGroupIds * The list of security groups for the VPC associated with this runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(Collection securityGroupIds); /** *

* The list of security groups for the VPC associated with this runtime environment. *

* * @param securityGroupIds * The list of security groups for the VPC associated with this runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(String... securityGroupIds); /** *

* Optional. The storage configurations for this runtime environment. *

* * @param storageConfigurations * Optional. The storage configurations for this runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageConfigurations(Collection storageConfigurations); /** *

* Optional. The storage configurations for this runtime environment. *

* * @param storageConfigurations * Optional. The storage configurations for this runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageConfigurations(StorageConfiguration... storageConfigurations); /** *

* Optional. The storage configurations for this runtime environment. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.m2.model.StorageConfiguration.Builder} avoiding the need to create one * manually via {@link software.amazon.awssdk.services.m2.model.StorageConfiguration#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.m2.model.StorageConfiguration.Builder#build()} is called immediately * and its result is passed to {@link #storageConfigurations(List)}. * * @param storageConfigurations * a consumer that will call methods on * {@link software.amazon.awssdk.services.m2.model.StorageConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #storageConfigurations(java.util.Collection) */ Builder storageConfigurations(Consumer... storageConfigurations); /** *

* The list of subnets associated with the VPC for this runtime environment. *

* * @param subnetIds * The list of subnets associated with the VPC for this runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetIds(Collection subnetIds); /** *

* The list of subnets associated with the VPC for this runtime environment. *

* * @param subnetIds * The list of subnets associated with the VPC for this runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetIds(String... subnetIds); /** *

* The tags for the runtime environment. *

* * @param tags * The tags for the runtime environment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends M2Request.BuilderImpl implements Builder { private String clientToken; private String description; private String engineType; private String engineVersion; private HighAvailabilityConfig highAvailabilityConfig; private String instanceType; private String kmsKeyId; private String name; private String preferredMaintenanceWindow; private Boolean publiclyAccessible; private List securityGroupIds = DefaultSdkAutoConstructList.getInstance(); private List storageConfigurations = DefaultSdkAutoConstructList.getInstance(); private List subnetIds = DefaultSdkAutoConstructList.getInstance(); private Map tags = DefaultSdkAutoConstructMap.getInstance(); private BuilderImpl() { } private BuilderImpl(CreateEnvironmentRequest model) { super(model); clientToken(model.clientToken); description(model.description); engineType(model.engineType); engineVersion(model.engineVersion); highAvailabilityConfig(model.highAvailabilityConfig); instanceType(model.instanceType); kmsKeyId(model.kmsKeyId); name(model.name); preferredMaintenanceWindow(model.preferredMaintenanceWindow); publiclyAccessible(model.publiclyAccessible); securityGroupIds(model.securityGroupIds); storageConfigurations(model.storageConfigurations); subnetIds(model.subnetIds); tags(model.tags); } public final String getClientToken() { return clientToken; } public final void setClientToken(String clientToken) { this.clientToken = clientToken; } @Override public final Builder clientToken(String clientToken) { this.clientToken = clientToken; return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } public final String getEngineType() { return engineType; } public final void setEngineType(String engineType) { this.engineType = engineType; } @Override public final Builder engineType(String engineType) { this.engineType = engineType; return this; } @Override public final Builder engineType(EngineType engineType) { this.engineType(engineType == null ? null : engineType.toString()); return this; } public final String getEngineVersion() { return engineVersion; } public final void setEngineVersion(String engineVersion) { this.engineVersion = engineVersion; } @Override public final Builder engineVersion(String engineVersion) { this.engineVersion = engineVersion; return this; } public final HighAvailabilityConfig.Builder getHighAvailabilityConfig() { return highAvailabilityConfig != null ? highAvailabilityConfig.toBuilder() : null; } public final void setHighAvailabilityConfig(HighAvailabilityConfig.BuilderImpl highAvailabilityConfig) { this.highAvailabilityConfig = highAvailabilityConfig != null ? highAvailabilityConfig.build() : null; } @Override public final Builder highAvailabilityConfig(HighAvailabilityConfig highAvailabilityConfig) { this.highAvailabilityConfig = highAvailabilityConfig; return this; } public final String getInstanceType() { return instanceType; } public final void setInstanceType(String instanceType) { this.instanceType = instanceType; } @Override public final Builder instanceType(String instanceType) { this.instanceType = instanceType; return this; } public final String getKmsKeyId() { return kmsKeyId; } public final void setKmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; } @Override public final Builder kmsKeyId(String kmsKeyId) { this.kmsKeyId = kmsKeyId; 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 getPreferredMaintenanceWindow() { return preferredMaintenanceWindow; } public final void setPreferredMaintenanceWindow(String preferredMaintenanceWindow) { this.preferredMaintenanceWindow = preferredMaintenanceWindow; } @Override public final Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) { this.preferredMaintenanceWindow = preferredMaintenanceWindow; return this; } public final Boolean getPubliclyAccessible() { return publiclyAccessible; } public final void setPubliclyAccessible(Boolean publiclyAccessible) { this.publiclyAccessible = publiclyAccessible; } @Override public final Builder publiclyAccessible(Boolean publiclyAccessible) { this.publiclyAccessible = publiclyAccessible; return this; } public final Collection getSecurityGroupIds() { if (securityGroupIds instanceof SdkAutoConstructList) { return null; } return securityGroupIds; } public final void setSecurityGroupIds(Collection securityGroupIds) { this.securityGroupIds = String50ListCopier.copy(securityGroupIds); } @Override public final Builder securityGroupIds(Collection securityGroupIds) { this.securityGroupIds = String50ListCopier.copy(securityGroupIds); return this; } @Override @SafeVarargs public final Builder securityGroupIds(String... securityGroupIds) { securityGroupIds(Arrays.asList(securityGroupIds)); return this; } public final List getStorageConfigurations() { List result = StorageConfigurationListCopier.copyToBuilder(this.storageConfigurations); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setStorageConfigurations(Collection storageConfigurations) { this.storageConfigurations = StorageConfigurationListCopier.copyFromBuilder(storageConfigurations); } @Override public final Builder storageConfigurations(Collection storageConfigurations) { this.storageConfigurations = StorageConfigurationListCopier.copy(storageConfigurations); return this; } @Override @SafeVarargs public final Builder storageConfigurations(StorageConfiguration... storageConfigurations) { storageConfigurations(Arrays.asList(storageConfigurations)); return this; } @Override @SafeVarargs public final Builder storageConfigurations(Consumer... storageConfigurations) { storageConfigurations(Stream.of(storageConfigurations) .map(c -> StorageConfiguration.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Collection getSubnetIds() { if (subnetIds instanceof SdkAutoConstructList) { return null; } return subnetIds; } public final void setSubnetIds(Collection subnetIds) { this.subnetIds = String50ListCopier.copy(subnetIds); } @Override public final Builder subnetIds(Collection subnetIds) { this.subnetIds = String50ListCopier.copy(subnetIds); return this; } @Override @SafeVarargs public final Builder subnetIds(String... subnetIds) { subnetIds(Arrays.asList(subnetIds)); return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); 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 CreateEnvironmentRequest build() { return new CreateEnvironmentRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy