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

software.amazon.awssdk.services.dax.model.CreateClusterRequest Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.dax.model;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class CreateClusterRequest extends DaxRequest implements
        ToCopyableBuilder {
    private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(CreateClusterRequest::clusterName)).setter(setter(Builder::clusterName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterName").build()).build();

    private static final SdkField NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(CreateClusterRequest::nodeType)).setter(setter(Builder::nodeType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NodeType").build()).build();

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

    private static final SdkField REPLICATION_FACTOR_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .getter(getter(CreateClusterRequest::replicationFactor)).setter(setter(Builder::replicationFactor))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationFactor").build()).build();

    private static final SdkField> AVAILABILITY_ZONES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .getter(getter(CreateClusterRequest::availabilityZones))
            .setter(setter(Builder::availabilityZones))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AvailabilityZones").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 SUBNET_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(CreateClusterRequest::subnetGroupName)).setter(setter(Builder::subnetGroupName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetGroupName").build()).build();

    private static final SdkField> SECURITY_GROUP_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .getter(getter(CreateClusterRequest::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 PREFERRED_MAINTENANCE_WINDOW_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .getter(getter(CreateClusterRequest::preferredMaintenanceWindow))
            .setter(setter(Builder::preferredMaintenanceWindow))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PreferredMaintenanceWindow").build())
            .build();

    private static final SdkField NOTIFICATION_TOPIC_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(CreateClusterRequest::notificationTopicArn)).setter(setter(Builder::notificationTopicArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotificationTopicArn").build())
            .build();

    private static final SdkField IAM_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(CreateClusterRequest::iamRoleArn)).setter(setter(Builder::iamRoleArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IamRoleArn").build()).build();

    private static final SdkField PARAMETER_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .getter(getter(CreateClusterRequest::parameterGroupName)).setter(setter(Builder::parameterGroupName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParameterGroupName").build())
            .build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .getter(getter(CreateClusterRequest::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 SSE_SPECIFICATION_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).getter(getter(CreateClusterRequest::sseSpecification))
            .setter(setter(Builder::sseSpecification)).constructor(SSESpecification::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SSESpecification").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_NAME_FIELD,
            NODE_TYPE_FIELD, DESCRIPTION_FIELD, REPLICATION_FACTOR_FIELD, AVAILABILITY_ZONES_FIELD, SUBNET_GROUP_NAME_FIELD,
            SECURITY_GROUP_IDS_FIELD, PREFERRED_MAINTENANCE_WINDOW_FIELD, NOTIFICATION_TOPIC_ARN_FIELD, IAM_ROLE_ARN_FIELD,
            PARAMETER_GROUP_NAME_FIELD, TAGS_FIELD, SSE_SPECIFICATION_FIELD));

    private final String clusterName;

    private final String nodeType;

    private final String description;

    private final Integer replicationFactor;

    private final List availabilityZones;

    private final String subnetGroupName;

    private final List securityGroupIds;

    private final String preferredMaintenanceWindow;

    private final String notificationTopicArn;

    private final String iamRoleArn;

    private final String parameterGroupName;

    private final List tags;

    private final SSESpecification sseSpecification;

    private CreateClusterRequest(BuilderImpl builder) {
        super(builder);
        this.clusterName = builder.clusterName;
        this.nodeType = builder.nodeType;
        this.description = builder.description;
        this.replicationFactor = builder.replicationFactor;
        this.availabilityZones = builder.availabilityZones;
        this.subnetGroupName = builder.subnetGroupName;
        this.securityGroupIds = builder.securityGroupIds;
        this.preferredMaintenanceWindow = builder.preferredMaintenanceWindow;
        this.notificationTopicArn = builder.notificationTopicArn;
        this.iamRoleArn = builder.iamRoleArn;
        this.parameterGroupName = builder.parameterGroupName;
        this.tags = builder.tags;
        this.sseSpecification = builder.sseSpecification;
    }

    /**
     * 

* The cluster identifier. This parameter is stored as a lowercase string. *

*

* Constraints: *

*
    *
  • *

    * A name must contain from 1 to 20 alphanumeric characters or hyphens. *

    *
  • *
  • *

    * The first character must be a letter. *

    *
  • *
  • *

    * A name cannot end with a hyphen or contain two consecutive hyphens. *

    *
  • *
* * @return The cluster identifier. This parameter is stored as a lowercase string.

*

* Constraints: *

*
    *
  • *

    * A name must contain from 1 to 20 alphanumeric characters or hyphens. *

    *
  • *
  • *

    * The first character must be a letter. *

    *
  • *
  • *

    * A name cannot end with a hyphen or contain two consecutive hyphens. *

    *
  • */ public String clusterName() { return clusterName; } /** *

    * The compute and memory capacity of the nodes in the cluster. *

    * * @return The compute and memory capacity of the nodes in the cluster. */ public String nodeType() { return nodeType; } /** *

    * A description of the cluster. *

    * * @return A description of the cluster. */ public String description() { return description; } /** *

    * The number of nodes in the DAX cluster. A replication factor of 1 will create a single-node cluster, without any * read replicas. For additional fault tolerance, you can create a multiple node cluster with one or more read * replicas. To do this, set ReplicationFactor to a number between 3 (one primary and two read * replicas) and 10 (one primary and nine read replicas). If the AvailabilityZones parameter is * provided, its length must equal the ReplicationFactor. *

    * *

    * AWS recommends that you have at least two read replicas per cluster. *

    *
    * * @return The number of nodes in the DAX cluster. A replication factor of 1 will create a single-node cluster, * without any read replicas. For additional fault tolerance, you can create a multiple node cluster with * one or more read replicas. To do this, set ReplicationFactor to a number between 3 (one * primary and two read replicas) and 10 (one primary and nine read replicas). * If the AvailabilityZones parameter is provided, its length must equal the * ReplicationFactor.

    *

    * AWS recommends that you have at least two read replicas per cluster. *

    */ public Integer replicationFactor() { return replicationFactor; } /** * Returns true if the AvailabilityZones 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 boolean hasAvailabilityZones() { return availabilityZones != null && !(availabilityZones instanceof SdkAutoConstructList); } /** *

    * The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created or * updated. If provided, the length of this list must equal the ReplicationFactor parameter. If you * omit this parameter, DAX will spread the nodes across Availability Zones for the highest availability. *

    *

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

    *

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

    * * @return The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created or * updated. If provided, the length of this list must equal the ReplicationFactor parameter. If * you omit this parameter, DAX will spread the nodes across Availability Zones for the highest * availability. */ public List availabilityZones() { return availabilityZones; } /** *

    * The name of the subnet group to be used for the replication group. *

    * *

    * DAX clusters can only run in an Amazon VPC environment. All of the subnets that you specify in a subnet group * must exist in the same VPC. *

    *
    * * @return The name of the subnet group to be used for the replication group.

    *

    * DAX clusters can only run in an Amazon VPC environment. All of the subnets that you specify in a subnet * group must exist in the same VPC. *

    */ public String subnetGroupName() { return subnetGroupName; } /** * Returns true if the SecurityGroupIds 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 boolean hasSecurityGroupIds() { return securityGroupIds != null && !(securityGroupIds instanceof SdkAutoConstructList); } /** *

    * A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security group ID is * system-generated.) *

    *

    * If this parameter is not specified, DAX assigns the default VPC security group to each node. *

    *

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

    *

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

    * * @return A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security group * ID is system-generated.)

    *

    * If this parameter is not specified, DAX assigns the default VPC security group to each node. */ public List securityGroupIds() { return securityGroupIds; } /** *

    * Specifies the weekly time range during which maintenance on the DAX cluster is performed. It is specified as a * range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute * period. Valid values for ddd are: *

    *
      *
    • *

      * sun *

      *
    • *
    • *

      * mon *

      *
    • *
    • *

      * tue *

      *
    • *
    • *

      * wed *

      *
    • *
    • *

      * thu *

      *
    • *
    • *

      * fri *

      *
    • *
    • *

      * sat *

      *
    • *
    *

    * Example: sun:05:00-sun:09:00 *

    * *

    * If you don't specify a preferred maintenance window when you create or modify a cache cluster, DAX assigns a * 60-minute maintenance window on a randomly selected day of the week. *

    *
    * * @return Specifies the weekly time range during which maintenance on the DAX cluster is performed. It is specified * as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 * minute period. Valid values for ddd are:

    *
      *
    • *

      * sun *

      *
    • *
    • *

      * mon *

      *
    • *
    • *

      * tue *

      *
    • *
    • *

      * wed *

      *
    • *
    • *

      * thu *

      *
    • *
    • *

      * fri *

      *
    • *
    • *

      * sat *

      *
    • *
    *

    * Example: sun:05:00-sun:09:00 *

    * *

    * If you don't specify a preferred maintenance window when you create or modify a cache cluster, DAX * assigns a 60-minute maintenance window on a randomly selected day of the week. *

    */ public String preferredMaintenanceWindow() { return preferredMaintenanceWindow; } /** *

    * The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications will be sent. *

    * *

    * The Amazon SNS topic owner must be same as the DAX cluster owner. *

    *
    * * @return The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications will be sent.

    *

    * The Amazon SNS topic owner must be same as the DAX cluster owner. *

    */ public String notificationTopicArn() { return notificationTopicArn; } /** *

    * A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, DAX will assume this role and use the * role's permissions to access DynamoDB on your behalf. *

    * * @return A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, DAX will assume this role and * use the role's permissions to access DynamoDB on your behalf. */ public String iamRoleArn() { return iamRoleArn; } /** *

    * The parameter group to be associated with the DAX cluster. *

    * * @return The parameter group to be associated with the DAX cluster. */ public String parameterGroupName() { return parameterGroupName; } /** * Returns true if the Tags 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 boolean hasTags() { return tags != null && !(tags instanceof SdkAutoConstructList); } /** *

    * A set of tags to associate with the DAX cluster. *

    *

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

    *

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

    * * @return A set of tags to associate with the DAX cluster. */ public List tags() { return tags; } /** *

    * Represents the settings used to enable server-side encryption on the cluster. *

    * * @return Represents the settings used to enable server-side encryption on the cluster. */ public SSESpecification sseSpecification() { return sseSpecification; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(clusterName()); hashCode = 31 * hashCode + Objects.hashCode(nodeType()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(replicationFactor()); hashCode = 31 * hashCode + Objects.hashCode(availabilityZones()); hashCode = 31 * hashCode + Objects.hashCode(subnetGroupName()); hashCode = 31 * hashCode + Objects.hashCode(securityGroupIds()); hashCode = 31 * hashCode + Objects.hashCode(preferredMaintenanceWindow()); hashCode = 31 * hashCode + Objects.hashCode(notificationTopicArn()); hashCode = 31 * hashCode + Objects.hashCode(iamRoleArn()); hashCode = 31 * hashCode + Objects.hashCode(parameterGroupName()); hashCode = 31 * hashCode + Objects.hashCode(tags()); hashCode = 31 * hashCode + Objects.hashCode(sseSpecification()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateClusterRequest)) { return false; } CreateClusterRequest other = (CreateClusterRequest) obj; return Objects.equals(clusterName(), other.clusterName()) && Objects.equals(nodeType(), other.nodeType()) && Objects.equals(description(), other.description()) && Objects.equals(replicationFactor(), other.replicationFactor()) && Objects.equals(availabilityZones(), other.availabilityZones()) && Objects.equals(subnetGroupName(), other.subnetGroupName()) && Objects.equals(securityGroupIds(), other.securityGroupIds()) && Objects.equals(preferredMaintenanceWindow(), other.preferredMaintenanceWindow()) && Objects.equals(notificationTopicArn(), other.notificationTopicArn()) && Objects.equals(iamRoleArn(), other.iamRoleArn()) && Objects.equals(parameterGroupName(), other.parameterGroupName()) && Objects.equals(tags(), other.tags()) && Objects.equals(sseSpecification(), other.sseSpecification()); } /** * 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 String toString() { return ToString.builder("CreateClusterRequest").add("ClusterName", clusterName()).add("NodeType", nodeType()) .add("Description", description()).add("ReplicationFactor", replicationFactor()) .add("AvailabilityZones", availabilityZones()).add("SubnetGroupName", subnetGroupName()) .add("SecurityGroupIds", securityGroupIds()).add("PreferredMaintenanceWindow", preferredMaintenanceWindow()) .add("NotificationTopicArn", notificationTopicArn()).add("IamRoleArn", iamRoleArn()) .add("ParameterGroupName", parameterGroupName()).add("Tags", tags()).add("SSESpecification", sseSpecification()) .build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ClusterName": return Optional.ofNullable(clazz.cast(clusterName())); case "NodeType": return Optional.ofNullable(clazz.cast(nodeType())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "ReplicationFactor": return Optional.ofNullable(clazz.cast(replicationFactor())); case "AvailabilityZones": return Optional.ofNullable(clazz.cast(availabilityZones())); case "SubnetGroupName": return Optional.ofNullable(clazz.cast(subnetGroupName())); case "SecurityGroupIds": return Optional.ofNullable(clazz.cast(securityGroupIds())); case "PreferredMaintenanceWindow": return Optional.ofNullable(clazz.cast(preferredMaintenanceWindow())); case "NotificationTopicArn": return Optional.ofNullable(clazz.cast(notificationTopicArn())); case "IamRoleArn": return Optional.ofNullable(clazz.cast(iamRoleArn())); case "ParameterGroupName": return Optional.ofNullable(clazz.cast(parameterGroupName())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "SSESpecification": return Optional.ofNullable(clazz.cast(sseSpecification())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateClusterRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends DaxRequest.Builder, SdkPojo, CopyableBuilder { /** *

    * The cluster identifier. This parameter is stored as a lowercase string. *

    *

    * Constraints: *

    *
      *
    • *

      * A name must contain from 1 to 20 alphanumeric characters or hyphens. *

      *
    • *
    • *

      * The first character must be a letter. *

      *
    • *
    • *

      * A name cannot end with a hyphen or contain two consecutive hyphens. *

      *
    • *
    * * @param clusterName * The cluster identifier. This parameter is stored as a lowercase string.

    *

    * Constraints: *

    *
      *
    • *

      * A name must contain from 1 to 20 alphanumeric characters or hyphens. *

      *
    • *
    • *

      * The first character must be a letter. *

      *
    • *
    • *

      * A name cannot end with a hyphen or contain two consecutive hyphens. *

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

      * The compute and memory capacity of the nodes in the cluster. *

      * * @param nodeType * The compute and memory capacity of the nodes in the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nodeType(String nodeType); /** *

      * A description of the cluster. *

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

      * The number of nodes in the DAX cluster. A replication factor of 1 will create a single-node cluster, without * any read replicas. For additional fault tolerance, you can create a multiple node cluster with one or more * read replicas. To do this, set ReplicationFactor to a number between 3 (one primary and two read * replicas) and 10 (one primary and nine read replicas). If the AvailabilityZones parameter is * provided, its length must equal the ReplicationFactor. *

      * *

      * AWS recommends that you have at least two read replicas per cluster. *

      *
      * * @param replicationFactor * The number of nodes in the DAX cluster. A replication factor of 1 will create a single-node cluster, * without any read replicas. For additional fault tolerance, you can create a multiple node cluster with * one or more read replicas. To do this, set ReplicationFactor to a number between 3 (one * primary and two read replicas) and 10 (one primary and nine read replicas). * If the AvailabilityZones parameter is provided, its length must equal the * ReplicationFactor.

      *

      * AWS recommends that you have at least two read replicas per cluster. *

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

      * The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created or * updated. If provided, the length of this list must equal the ReplicationFactor parameter. If you * omit this parameter, DAX will spread the nodes across Availability Zones for the highest availability. *

      * * @param availabilityZones * The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created * or updated. If provided, the length of this list must equal the ReplicationFactor * parameter. If you omit this parameter, DAX will spread the nodes across Availability Zones for the * highest availability. * @return Returns a reference to this object so that method calls can be chained together. */ Builder availabilityZones(Collection availabilityZones); /** *

      * The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created or * updated. If provided, the length of this list must equal the ReplicationFactor parameter. If you * omit this parameter, DAX will spread the nodes across Availability Zones for the highest availability. *

      * * @param availabilityZones * The Availability Zones (AZs) in which the cluster nodes will reside after the cluster has been created * or updated. If provided, the length of this list must equal the ReplicationFactor * parameter. If you omit this parameter, DAX will spread the nodes across Availability Zones for the * highest availability. * @return Returns a reference to this object so that method calls can be chained together. */ Builder availabilityZones(String... availabilityZones); /** *

      * The name of the subnet group to be used for the replication group. *

      * *

      * DAX clusters can only run in an Amazon VPC environment. All of the subnets that you specify in a subnet group * must exist in the same VPC. *

      *
      * * @param subnetGroupName * The name of the subnet group to be used for the replication group.

      *

      * DAX clusters can only run in an Amazon VPC environment. All of the subnets that you specify in a * subnet group must exist in the same VPC. *

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

      * A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security group ID * is system-generated.) *

      *

      * If this parameter is not specified, DAX assigns the default VPC security group to each node. *

      * * @param securityGroupIds * A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security * group ID is system-generated.)

      *

      * If this parameter is not specified, DAX assigns the default VPC security group to each node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(Collection securityGroupIds); /** *

      * A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security group ID * is system-generated.) *

      *

      * If this parameter is not specified, DAX assigns the default VPC security group to each node. *

      * * @param securityGroupIds * A list of security group IDs to be assigned to each node in the DAX cluster. (Each of the security * group ID is system-generated.)

      *

      * If this parameter is not specified, DAX assigns the default VPC security group to each node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(String... securityGroupIds); /** *

      * Specifies the weekly time range during which maintenance on the DAX cluster is performed. It is specified as * a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance window is a 60 minute * period. Valid values for ddd are: *

      *
        *
      • *

        * sun *

        *
      • *
      • *

        * mon *

        *
      • *
      • *

        * tue *

        *
      • *
      • *

        * wed *

        *
      • *
      • *

        * thu *

        *
      • *
      • *

        * fri *

        *
      • *
      • *

        * sat *

        *
      • *
      *

      * Example: sun:05:00-sun:09:00 *

      * *

      * If you don't specify a preferred maintenance window when you create or modify a cache cluster, DAX assigns a * 60-minute maintenance window on a randomly selected day of the week. *

      *
      * * @param preferredMaintenanceWindow * Specifies the weekly time range during which maintenance on the DAX cluster is performed. It is * specified as a range in the format ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). The minimum maintenance * window is a 60 minute period. Valid values for ddd are:

      *
        *
      • *

        * sun *

        *
      • *
      • *

        * mon *

        *
      • *
      • *

        * tue *

        *
      • *
      • *

        * wed *

        *
      • *
      • *

        * thu *

        *
      • *
      • *

        * fri *

        *
      • *
      • *

        * sat *

        *
      • *
      *

      * Example: sun:05:00-sun:09:00 *

      * *

      * If you don't specify a preferred maintenance window when you create or modify a cache cluster, DAX * assigns a 60-minute maintenance window on a randomly selected day of the week. *

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

      * The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications will be sent. *

      * *

      * The Amazon SNS topic owner must be same as the DAX cluster owner. *

      *
      * * @param notificationTopicArn * The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications will be sent.

      *

      * The Amazon SNS topic owner must be same as the DAX cluster owner. *

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

      * A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, DAX will assume this role and use * the role's permissions to access DynamoDB on your behalf. *

      * * @param iamRoleArn * A valid Amazon Resource Name (ARN) that identifies an IAM role. At runtime, DAX will assume this role * and use the role's permissions to access DynamoDB on your behalf. * @return Returns a reference to this object so that method calls can be chained together. */ Builder iamRoleArn(String iamRoleArn); /** *

      * The parameter group to be associated with the DAX cluster. *

      * * @param parameterGroupName * The parameter group to be associated with the DAX cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameterGroupName(String parameterGroupName); /** *

      * A set of tags to associate with the DAX cluster. *

      * * @param tags * A set of tags to associate with the DAX cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

      * A set of tags to associate with the DAX cluster. *

      * * @param tags * A set of tags to associate with the DAX cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

      * A set of tags to associate with the DAX cluster. *

      * 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); /** *

      * Represents the settings used to enable server-side encryption on the cluster. *

      * * @param sseSpecification * Represents the settings used to enable server-side encryption on the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sseSpecification(SSESpecification sseSpecification); /** *

      * Represents the settings used to enable server-side encryption on the cluster. *

      * This is a convenience that creates an instance of the {@link SSESpecification.Builder} avoiding the need to * create one manually via {@link SSESpecification#builder()}. * * When the {@link Consumer} completes, {@link SSESpecification.Builder#build()} is called immediately and its * result is passed to {@link #sseSpecification(SSESpecification)}. * * @param sseSpecification * a consumer that will call methods on {@link SSESpecification.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sseSpecification(SSESpecification) */ default Builder sseSpecification(Consumer sseSpecification) { return sseSpecification(SSESpecification.builder().applyMutation(sseSpecification).build()); } @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends DaxRequest.BuilderImpl implements Builder { private String clusterName; private String nodeType; private String description; private Integer replicationFactor; private List availabilityZones = DefaultSdkAutoConstructList.getInstance(); private String subnetGroupName; private List securityGroupIds = DefaultSdkAutoConstructList.getInstance(); private String preferredMaintenanceWindow; private String notificationTopicArn; private String iamRoleArn; private String parameterGroupName; private List tags = DefaultSdkAutoConstructList.getInstance(); private SSESpecification sseSpecification; private BuilderImpl() { } private BuilderImpl(CreateClusterRequest model) { super(model); clusterName(model.clusterName); nodeType(model.nodeType); description(model.description); replicationFactor(model.replicationFactor); availabilityZones(model.availabilityZones); subnetGroupName(model.subnetGroupName); securityGroupIds(model.securityGroupIds); preferredMaintenanceWindow(model.preferredMaintenanceWindow); notificationTopicArn(model.notificationTopicArn); iamRoleArn(model.iamRoleArn); parameterGroupName(model.parameterGroupName); tags(model.tags); sseSpecification(model.sseSpecification); } public final String getClusterName() { return clusterName; } @Override public final Builder clusterName(String clusterName) { this.clusterName = clusterName; return this; } public final void setClusterName(String clusterName) { this.clusterName = clusterName; } public final String getNodeType() { return nodeType; } @Override public final Builder nodeType(String nodeType) { this.nodeType = nodeType; return this; } public final void setNodeType(String nodeType) { this.nodeType = nodeType; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final Integer getReplicationFactor() { return replicationFactor; } @Override public final Builder replicationFactor(Integer replicationFactor) { this.replicationFactor = replicationFactor; return this; } public final void setReplicationFactor(Integer replicationFactor) { this.replicationFactor = replicationFactor; } public final Collection getAvailabilityZones() { return availabilityZones; } @Override public final Builder availabilityZones(Collection availabilityZones) { this.availabilityZones = AvailabilityZoneListCopier.copy(availabilityZones); return this; } @Override @SafeVarargs public final Builder availabilityZones(String... availabilityZones) { availabilityZones(Arrays.asList(availabilityZones)); return this; } public final void setAvailabilityZones(Collection availabilityZones) { this.availabilityZones = AvailabilityZoneListCopier.copy(availabilityZones); } public final String getSubnetGroupName() { return subnetGroupName; } @Override public final Builder subnetGroupName(String subnetGroupName) { this.subnetGroupName = subnetGroupName; return this; } public final void setSubnetGroupName(String subnetGroupName) { this.subnetGroupName = subnetGroupName; } public final Collection getSecurityGroupIds() { return securityGroupIds; } @Override public final Builder securityGroupIds(Collection securityGroupIds) { this.securityGroupIds = SecurityGroupIdentifierListCopier.copy(securityGroupIds); return this; } @Override @SafeVarargs public final Builder securityGroupIds(String... securityGroupIds) { securityGroupIds(Arrays.asList(securityGroupIds)); return this; } public final void setSecurityGroupIds(Collection securityGroupIds) { this.securityGroupIds = SecurityGroupIdentifierListCopier.copy(securityGroupIds); } public final String getPreferredMaintenanceWindow() { return preferredMaintenanceWindow; } @Override public final Builder preferredMaintenanceWindow(String preferredMaintenanceWindow) { this.preferredMaintenanceWindow = preferredMaintenanceWindow; return this; } public final void setPreferredMaintenanceWindow(String preferredMaintenanceWindow) { this.preferredMaintenanceWindow = preferredMaintenanceWindow; } public final String getNotificationTopicArn() { return notificationTopicArn; } @Override public final Builder notificationTopicArn(String notificationTopicArn) { this.notificationTopicArn = notificationTopicArn; return this; } public final void setNotificationTopicArn(String notificationTopicArn) { this.notificationTopicArn = notificationTopicArn; } public final String getIamRoleArn() { return iamRoleArn; } @Override public final Builder iamRoleArn(String iamRoleArn) { this.iamRoleArn = iamRoleArn; return this; } public final void setIamRoleArn(String iamRoleArn) { this.iamRoleArn = iamRoleArn; } public final String getParameterGroupName() { return parameterGroupName; } @Override public final Builder parameterGroupName(String parameterGroupName) { this.parameterGroupName = parameterGroupName; return this; } public final void setParameterGroupName(String parameterGroupName) { this.parameterGroupName = parameterGroupName; } public final Collection getTags() { return tags != null ? tags.stream().map(Tag::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @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 void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } public final SSESpecification.Builder getSseSpecification() { return sseSpecification != null ? sseSpecification.toBuilder() : null; } @Override public final Builder sseSpecification(SSESpecification sseSpecification) { this.sseSpecification = sseSpecification; return this; } public final void setSseSpecification(SSESpecification.BuilderImpl sseSpecification) { this.sseSpecification = sseSpecification != null ? sseSpecification.build() : null; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateClusterRequest build() { return new CreateClusterRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy