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

software.amazon.awssdk.services.elasticache.model.CreateServerlessCacheRequest Maven / Gradle / Ivy

Go to download

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

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

package software.amazon.awssdk.services.elasticache.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 CreateServerlessCacheRequest extends ElastiCacheRequest implements
        ToCopyableBuilder {
    private static final SdkField SERVERLESS_CACHE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ServerlessCacheName").getter(getter(CreateServerlessCacheRequest::serverlessCacheName))
            .setter(setter(Builder::serverlessCacheName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerlessCacheName").build())
            .build();

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

    private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
            .getter(getter(CreateServerlessCacheRequest::engine)).setter(setter(Builder::engine))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();

    private static final SdkField MAJOR_ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("MajorEngineVersion").getter(getter(CreateServerlessCacheRequest::majorEngineVersion))
            .setter(setter(Builder::majorEngineVersion))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MajorEngineVersion").build())
            .build();

    private static final SdkField CACHE_USAGE_LIMITS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("CacheUsageLimits")
            .getter(getter(CreateServerlessCacheRequest::cacheUsageLimits)).setter(setter(Builder::cacheUsageLimits))
            .constructor(CacheUsageLimits::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheUsageLimits").build()).build();

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

    private static final SdkField> SECURITY_GROUP_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("SecurityGroupIds")
            .getter(getter(CreateServerlessCacheRequest::securityGroupIds))
            .setter(setter(Builder::securityGroupIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecurityGroupIds").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("SecurityGroupId")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("SecurityGroupId").build()).build()).build()).build();

    private static final SdkField> SNAPSHOT_ARNS_TO_RESTORE_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("SnapshotArnsToRestore")
            .getter(getter(CreateServerlessCacheRequest::snapshotArnsToRestore))
            .setter(setter(Builder::snapshotArnsToRestore))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotArnsToRestore").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("SnapshotArn")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("SnapshotArn").build()).build()).build()).build();

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

    private static final SdkField USER_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("UserGroupId").getter(getter(CreateServerlessCacheRequest::userGroupId))
            .setter(setter(Builder::userGroupId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UserGroupId").build()).build();

    private static final SdkField> SUBNET_IDS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("SubnetIds")
            .getter(getter(CreateServerlessCacheRequest::subnetIds))
            .setter(setter(Builder::subnetIds))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubnetIds").build(),
                    ListTrait
                            .builder()
                            .memberLocationName("SubnetId")
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.STRING)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("SubnetId").build()).build()).build()).build();

    private static final SdkField SNAPSHOT_RETENTION_LIMIT_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("SnapshotRetentionLimit").getter(getter(CreateServerlessCacheRequest::snapshotRetentionLimit))
            .setter(setter(Builder::snapshotRetentionLimit))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotRetentionLimit").build())
            .build();

    private static final SdkField DAILY_SNAPSHOT_TIME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DailySnapshotTime").getter(getter(CreateServerlessCacheRequest::dailySnapshotTime))
            .setter(setter(Builder::dailySnapshotTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DailySnapshotTime").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SERVERLESS_CACHE_NAME_FIELD,
            DESCRIPTION_FIELD, ENGINE_FIELD, MAJOR_ENGINE_VERSION_FIELD, CACHE_USAGE_LIMITS_FIELD, KMS_KEY_ID_FIELD,
            SECURITY_GROUP_IDS_FIELD, SNAPSHOT_ARNS_TO_RESTORE_FIELD, TAGS_FIELD, USER_GROUP_ID_FIELD, SUBNET_IDS_FIELD,
            SNAPSHOT_RETENTION_LIMIT_FIELD, DAILY_SNAPSHOT_TIME_FIELD));

    private final String serverlessCacheName;

    private final String description;

    private final String engine;

    private final String majorEngineVersion;

    private final CacheUsageLimits cacheUsageLimits;

    private final String kmsKeyId;

    private final List securityGroupIds;

    private final List snapshotArnsToRestore;

    private final List tags;

    private final String userGroupId;

    private final List subnetIds;

    private final Integer snapshotRetentionLimit;

    private final String dailySnapshotTime;

    private CreateServerlessCacheRequest(BuilderImpl builder) {
        super(builder);
        this.serverlessCacheName = builder.serverlessCacheName;
        this.description = builder.description;
        this.engine = builder.engine;
        this.majorEngineVersion = builder.majorEngineVersion;
        this.cacheUsageLimits = builder.cacheUsageLimits;
        this.kmsKeyId = builder.kmsKeyId;
        this.securityGroupIds = builder.securityGroupIds;
        this.snapshotArnsToRestore = builder.snapshotArnsToRestore;
        this.tags = builder.tags;
        this.userGroupId = builder.userGroupId;
        this.subnetIds = builder.subnetIds;
        this.snapshotRetentionLimit = builder.snapshotRetentionLimit;
        this.dailySnapshotTime = builder.dailySnapshotTime;
    }

    /**
     * 

* User-provided identifier for the serverless cache. This parameter is stored as a lowercase string. *

* * @return User-provided identifier for the serverless cache. This parameter is stored as a lowercase string. */ public final String serverlessCacheName() { return serverlessCacheName; } /** *

* User-provided description for the serverless cache. The default is NULL, i.e. if no description is provided then * an empty string will be returned. The maximum length is 255 characters. *

* * @return User-provided description for the serverless cache. The default is NULL, i.e. if no description is * provided then an empty string will be returned. The maximum length is 255 characters. */ public final String description() { return description; } /** *

* The name of the cache engine to be used for creating the serverless cache. *

* * @return The name of the cache engine to be used for creating the serverless cache. */ public final String engine() { return engine; } /** *

* The version of the cache engine that will be used to create the serverless cache. *

* * @return The version of the cache engine that will be used to create the serverless cache. */ public final String majorEngineVersion() { return majorEngineVersion; } /** *

* Sets the cache usage limits for storage and ElastiCache Processing Units for the cache. *

* * @return Sets the cache usage limits for storage and ElastiCache Processing Units for the cache. */ public final CacheUsageLimits cacheUsageLimits() { return cacheUsageLimits; } /** *

* ARN of the customer managed key for encrypting the data at rest. If no KMS key is provided, a default service key * is used. *

* * @return ARN of the customer managed key for encrypting the data at rest. If no KMS key is provided, a default * service key is used. */ public final String kmsKeyId() { return kmsKeyId; } /** * 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); } /** *

* A list of the one or more VPC security groups to be associated with the serverless cache. The security group will * authorize traffic access for the VPC end-point (private-link). If no other information is given this will be the * VPC’s Default Security Group that is associated with the cluster VPC end-point. *

*

* 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 A list of the one or more VPC security groups to be associated with the serverless cache. The security * group will authorize traffic access for the VPC end-point (private-link). If no other information is * given this will be the VPC’s Default Security Group that is associated with the cluster VPC end-point. */ public final List securityGroupIds() { return securityGroupIds; } /** * For responses, this returns true if the service returned a value for the SnapshotArnsToRestore 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 hasSnapshotArnsToRestore() { return snapshotArnsToRestore != null && !(snapshotArnsToRestore instanceof SdkAutoConstructList); } /** *

* The ARN(s) of the snapshot that the new serverless cache will be created from. Available for Redis OSS and * Serverless Memcached only. *

*

* 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 #hasSnapshotArnsToRestore} method. *

* * @return The ARN(s) of the snapshot that the new serverless cache will be created from. Available for Redis OSS * and Serverless Memcached only. */ public final List snapshotArnsToRestore() { return snapshotArnsToRestore; } /** * 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); } /** *

* The list of tags (key, value) pairs to be added to the serverless cache resource. Default is NULL. *

*

* 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 list of tags (key, value) pairs to be added to the serverless cache resource. Default is NULL. */ public final List tags() { return tags; } /** *

* The identifier of the UserGroup to be associated with the serverless cache. Available for Redis OSS only. Default * is NULL. *

* * @return The identifier of the UserGroup to be associated with the serverless cache. Available for Redis OSS only. * Default is NULL. */ public final String userGroupId() { return userGroupId; } /** * 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); } /** *

* A list of the identifiers of the subnets where the VPC endpoint for the serverless cache will be deployed. All * the subnetIds must belong to the same VPC. *

*

* 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 A list of the identifiers of the subnets where the VPC endpoint for the serverless cache will be * deployed. All the subnetIds must belong to the same VPC. */ public final List subnetIds() { return subnetIds; } /** *

* The number of snapshots that will be retained for the serverless cache that is being created. As new snapshots * beyond this limit are added, the oldest snapshots will be deleted on a rolling basis. Available for Redis OSS and * Serverless Memcached only. *

* * @return The number of snapshots that will be retained for the serverless cache that is being created. As new * snapshots beyond this limit are added, the oldest snapshots will be deleted on a rolling basis. Available * for Redis OSS and Serverless Memcached only. */ public final Integer snapshotRetentionLimit() { return snapshotRetentionLimit; } /** *

* The daily time that snapshots will be created from the new serverless cache. By default this number is populated * with 0, i.e. no snapshots will be created on an automatic daily basis. Available for Redis OSS and Serverless * Memcached only. *

* * @return The daily time that snapshots will be created from the new serverless cache. By default this number is * populated with 0, i.e. no snapshots will be created on an automatic daily basis. Available for Redis OSS * and Serverless Memcached only. */ public final String dailySnapshotTime() { return dailySnapshotTime; } @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(serverlessCacheName()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(engine()); hashCode = 31 * hashCode + Objects.hashCode(majorEngineVersion()); hashCode = 31 * hashCode + Objects.hashCode(cacheUsageLimits()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyId()); hashCode = 31 * hashCode + Objects.hashCode(hasSecurityGroupIds() ? securityGroupIds() : null); hashCode = 31 * hashCode + Objects.hashCode(hasSnapshotArnsToRestore() ? snapshotArnsToRestore() : null); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(userGroupId()); hashCode = 31 * hashCode + Objects.hashCode(hasSubnetIds() ? subnetIds() : null); hashCode = 31 * hashCode + Objects.hashCode(snapshotRetentionLimit()); hashCode = 31 * hashCode + Objects.hashCode(dailySnapshotTime()); 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 CreateServerlessCacheRequest)) { return false; } CreateServerlessCacheRequest other = (CreateServerlessCacheRequest) obj; return Objects.equals(serverlessCacheName(), other.serverlessCacheName()) && Objects.equals(description(), other.description()) && Objects.equals(engine(), other.engine()) && Objects.equals(majorEngineVersion(), other.majorEngineVersion()) && Objects.equals(cacheUsageLimits(), other.cacheUsageLimits()) && Objects.equals(kmsKeyId(), other.kmsKeyId()) && hasSecurityGroupIds() == other.hasSecurityGroupIds() && Objects.equals(securityGroupIds(), other.securityGroupIds()) && hasSnapshotArnsToRestore() == other.hasSnapshotArnsToRestore() && Objects.equals(snapshotArnsToRestore(), other.snapshotArnsToRestore()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(userGroupId(), other.userGroupId()) && hasSubnetIds() == other.hasSubnetIds() && Objects.equals(subnetIds(), other.subnetIds()) && Objects.equals(snapshotRetentionLimit(), other.snapshotRetentionLimit()) && Objects.equals(dailySnapshotTime(), other.dailySnapshotTime()); } /** * 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("CreateServerlessCacheRequest").add("ServerlessCacheName", serverlessCacheName()) .add("Description", description()).add("Engine", engine()).add("MajorEngineVersion", majorEngineVersion()) .add("CacheUsageLimits", cacheUsageLimits()).add("KmsKeyId", kmsKeyId()) .add("SecurityGroupIds", hasSecurityGroupIds() ? securityGroupIds() : null) .add("SnapshotArnsToRestore", hasSnapshotArnsToRestore() ? snapshotArnsToRestore() : null) .add("Tags", hasTags() ? tags() : null).add("UserGroupId", userGroupId()) .add("SubnetIds", hasSubnetIds() ? subnetIds() : null).add("SnapshotRetentionLimit", snapshotRetentionLimit()) .add("DailySnapshotTime", dailySnapshotTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ServerlessCacheName": return Optional.ofNullable(clazz.cast(serverlessCacheName())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "Engine": return Optional.ofNullable(clazz.cast(engine())); case "MajorEngineVersion": return Optional.ofNullable(clazz.cast(majorEngineVersion())); case "CacheUsageLimits": return Optional.ofNullable(clazz.cast(cacheUsageLimits())); case "KmsKeyId": return Optional.ofNullable(clazz.cast(kmsKeyId())); case "SecurityGroupIds": return Optional.ofNullable(clazz.cast(securityGroupIds())); case "SnapshotArnsToRestore": return Optional.ofNullable(clazz.cast(snapshotArnsToRestore())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); case "UserGroupId": return Optional.ofNullable(clazz.cast(userGroupId())); case "SubnetIds": return Optional.ofNullable(clazz.cast(subnetIds())); case "SnapshotRetentionLimit": return Optional.ofNullable(clazz.cast(snapshotRetentionLimit())); case "DailySnapshotTime": return Optional.ofNullable(clazz.cast(dailySnapshotTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateServerlessCacheRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends ElastiCacheRequest.Builder, SdkPojo, CopyableBuilder { /** *

* User-provided identifier for the serverless cache. This parameter is stored as a lowercase string. *

* * @param serverlessCacheName * User-provided identifier for the serverless cache. This parameter is stored as a lowercase string. * @return Returns a reference to this object so that method calls can be chained together. */ Builder serverlessCacheName(String serverlessCacheName); /** *

* User-provided description for the serverless cache. The default is NULL, i.e. if no description is provided * then an empty string will be returned. The maximum length is 255 characters. *

* * @param description * User-provided description for the serverless cache. The default is NULL, i.e. if no description is * provided then an empty string will be returned. The maximum length is 255 characters. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The name of the cache engine to be used for creating the serverless cache. *

* * @param engine * The name of the cache engine to be used for creating the serverless cache. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engine(String engine); /** *

* The version of the cache engine that will be used to create the serverless cache. *

* * @param majorEngineVersion * The version of the cache engine that will be used to create the serverless cache. * @return Returns a reference to this object so that method calls can be chained together. */ Builder majorEngineVersion(String majorEngineVersion); /** *

* Sets the cache usage limits for storage and ElastiCache Processing Units for the cache. *

* * @param cacheUsageLimits * Sets the cache usage limits for storage and ElastiCache Processing Units for the cache. * @return Returns a reference to this object so that method calls can be chained together. */ Builder cacheUsageLimits(CacheUsageLimits cacheUsageLimits); /** *

* Sets the cache usage limits for storage and ElastiCache Processing Units for the cache. *

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

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

* ARN of the customer managed key for encrypting the data at rest. If no KMS key is provided, a default service * key is used. *

* * @param kmsKeyId * ARN of the customer managed key for encrypting the data at rest. If no KMS key is provided, a default * service key is used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyId(String kmsKeyId); /** *

* A list of the one or more VPC security groups to be associated with the serverless cache. The security group * will authorize traffic access for the VPC end-point (private-link). If no other information is given this * will be the VPC’s Default Security Group that is associated with the cluster VPC end-point. *

* * @param securityGroupIds * A list of the one or more VPC security groups to be associated with the serverless cache. The security * group will authorize traffic access for the VPC end-point (private-link). If no other information is * given this will be the VPC’s Default Security Group that is associated with the cluster VPC end-point. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(Collection securityGroupIds); /** *

* A list of the one or more VPC security groups to be associated with the serverless cache. The security group * will authorize traffic access for the VPC end-point (private-link). If no other information is given this * will be the VPC’s Default Security Group that is associated with the cluster VPC end-point. *

* * @param securityGroupIds * A list of the one or more VPC security groups to be associated with the serverless cache. The security * group will authorize traffic access for the VPC end-point (private-link). If no other information is * given this will be the VPC’s Default Security Group that is associated with the cluster VPC end-point. * @return Returns a reference to this object so that method calls can be chained together. */ Builder securityGroupIds(String... securityGroupIds); /** *

* The ARN(s) of the snapshot that the new serverless cache will be created from. Available for Redis OSS and * Serverless Memcached only. *

* * @param snapshotArnsToRestore * The ARN(s) of the snapshot that the new serverless cache will be created from. Available for Redis OSS * and Serverless Memcached only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotArnsToRestore(Collection snapshotArnsToRestore); /** *

* The ARN(s) of the snapshot that the new serverless cache will be created from. Available for Redis OSS and * Serverless Memcached only. *

* * @param snapshotArnsToRestore * The ARN(s) of the snapshot that the new serverless cache will be created from. Available for Redis OSS * and Serverless Memcached only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotArnsToRestore(String... snapshotArnsToRestore); /** *

* The list of tags (key, value) pairs to be added to the serverless cache resource. Default is NULL. *

* * @param tags * The list of tags (key, value) pairs to be added to the serverless cache resource. Default is NULL. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

* The list of tags (key, value) pairs to be added to the serverless cache resource. Default is NULL. *

* * @param tags * The list of tags (key, value) pairs to be added to the serverless cache resource. Default is NULL. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

* The list of tags (key, value) pairs to be added to the serverless cache resource. Default is NULL. *

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

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

* The identifier of the UserGroup to be associated with the serverless cache. Available for Redis OSS only. * Default is NULL. *

* * @param userGroupId * The identifier of the UserGroup to be associated with the serverless cache. Available for Redis OSS * only. Default is NULL. * @return Returns a reference to this object so that method calls can be chained together. */ Builder userGroupId(String userGroupId); /** *

* A list of the identifiers of the subnets where the VPC endpoint for the serverless cache will be deployed. * All the subnetIds must belong to the same VPC. *

* * @param subnetIds * A list of the identifiers of the subnets where the VPC endpoint for the serverless cache will be * deployed. All the subnetIds must belong to the same VPC. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetIds(Collection subnetIds); /** *

* A list of the identifiers of the subnets where the VPC endpoint for the serverless cache will be deployed. * All the subnetIds must belong to the same VPC. *

* * @param subnetIds * A list of the identifiers of the subnets where the VPC endpoint for the serverless cache will be * deployed. All the subnetIds must belong to the same VPC. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subnetIds(String... subnetIds); /** *

* The number of snapshots that will be retained for the serverless cache that is being created. As new * snapshots beyond this limit are added, the oldest snapshots will be deleted on a rolling basis. Available for * Redis OSS and Serverless Memcached only. *

* * @param snapshotRetentionLimit * The number of snapshots that will be retained for the serverless cache that is being created. As new * snapshots beyond this limit are added, the oldest snapshots will be deleted on a rolling basis. * Available for Redis OSS and Serverless Memcached only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotRetentionLimit(Integer snapshotRetentionLimit); /** *

* The daily time that snapshots will be created from the new serverless cache. By default this number is * populated with 0, i.e. no snapshots will be created on an automatic daily basis. Available for Redis OSS and * Serverless Memcached only. *

* * @param dailySnapshotTime * The daily time that snapshots will be created from the new serverless cache. By default this number is * populated with 0, i.e. no snapshots will be created on an automatic daily basis. Available for Redis * OSS and Serverless Memcached only. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dailySnapshotTime(String dailySnapshotTime); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends ElastiCacheRequest.BuilderImpl implements Builder { private String serverlessCacheName; private String description; private String engine; private String majorEngineVersion; private CacheUsageLimits cacheUsageLimits; private String kmsKeyId; private List securityGroupIds = DefaultSdkAutoConstructList.getInstance(); private List snapshotArnsToRestore = DefaultSdkAutoConstructList.getInstance(); private List tags = DefaultSdkAutoConstructList.getInstance(); private String userGroupId; private List subnetIds = DefaultSdkAutoConstructList.getInstance(); private Integer snapshotRetentionLimit; private String dailySnapshotTime; private BuilderImpl() { } private BuilderImpl(CreateServerlessCacheRequest model) { super(model); serverlessCacheName(model.serverlessCacheName); description(model.description); engine(model.engine); majorEngineVersion(model.majorEngineVersion); cacheUsageLimits(model.cacheUsageLimits); kmsKeyId(model.kmsKeyId); securityGroupIds(model.securityGroupIds); snapshotArnsToRestore(model.snapshotArnsToRestore); tags(model.tags); userGroupId(model.userGroupId); subnetIds(model.subnetIds); snapshotRetentionLimit(model.snapshotRetentionLimit); dailySnapshotTime(model.dailySnapshotTime); } public final String getServerlessCacheName() { return serverlessCacheName; } public final void setServerlessCacheName(String serverlessCacheName) { this.serverlessCacheName = serverlessCacheName; } @Override public final Builder serverlessCacheName(String serverlessCacheName) { this.serverlessCacheName = serverlessCacheName; 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 getEngine() { return engine; } public final void setEngine(String engine) { this.engine = engine; } @Override public final Builder engine(String engine) { this.engine = engine; return this; } public final String getMajorEngineVersion() { return majorEngineVersion; } public final void setMajorEngineVersion(String majorEngineVersion) { this.majorEngineVersion = majorEngineVersion; } @Override public final Builder majorEngineVersion(String majorEngineVersion) { this.majorEngineVersion = majorEngineVersion; return this; } public final CacheUsageLimits.Builder getCacheUsageLimits() { return cacheUsageLimits != null ? cacheUsageLimits.toBuilder() : null; } public final void setCacheUsageLimits(CacheUsageLimits.BuilderImpl cacheUsageLimits) { this.cacheUsageLimits = cacheUsageLimits != null ? cacheUsageLimits.build() : null; } @Override public final Builder cacheUsageLimits(CacheUsageLimits cacheUsageLimits) { this.cacheUsageLimits = cacheUsageLimits; 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 Collection getSecurityGroupIds() { if (securityGroupIds instanceof SdkAutoConstructList) { return null; } return securityGroupIds; } public final void setSecurityGroupIds(Collection securityGroupIds) { this.securityGroupIds = SecurityGroupIdsListCopier.copy(securityGroupIds); } @Override public final Builder securityGroupIds(Collection securityGroupIds) { this.securityGroupIds = SecurityGroupIdsListCopier.copy(securityGroupIds); return this; } @Override @SafeVarargs public final Builder securityGroupIds(String... securityGroupIds) { securityGroupIds(Arrays.asList(securityGroupIds)); return this; } public final Collection getSnapshotArnsToRestore() { if (snapshotArnsToRestore instanceof SdkAutoConstructList) { return null; } return snapshotArnsToRestore; } public final void setSnapshotArnsToRestore(Collection snapshotArnsToRestore) { this.snapshotArnsToRestore = SnapshotArnsListCopier.copy(snapshotArnsToRestore); } @Override public final Builder snapshotArnsToRestore(Collection snapshotArnsToRestore) { this.snapshotArnsToRestore = SnapshotArnsListCopier.copy(snapshotArnsToRestore); return this; } @Override @SafeVarargs public final Builder snapshotArnsToRestore(String... snapshotArnsToRestore) { snapshotArnsToRestore(Arrays.asList(snapshotArnsToRestore)); 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 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 String getUserGroupId() { return userGroupId; } public final void setUserGroupId(String userGroupId) { this.userGroupId = userGroupId; } @Override public final Builder userGroupId(String userGroupId) { this.userGroupId = userGroupId; return this; } public final Collection getSubnetIds() { if (subnetIds instanceof SdkAutoConstructList) { return null; } return subnetIds; } public final void setSubnetIds(Collection subnetIds) { this.subnetIds = SubnetIdsListCopier.copy(subnetIds); } @Override public final Builder subnetIds(Collection subnetIds) { this.subnetIds = SubnetIdsListCopier.copy(subnetIds); return this; } @Override @SafeVarargs public final Builder subnetIds(String... subnetIds) { subnetIds(Arrays.asList(subnetIds)); return this; } public final Integer getSnapshotRetentionLimit() { return snapshotRetentionLimit; } public final void setSnapshotRetentionLimit(Integer snapshotRetentionLimit) { this.snapshotRetentionLimit = snapshotRetentionLimit; } @Override public final Builder snapshotRetentionLimit(Integer snapshotRetentionLimit) { this.snapshotRetentionLimit = snapshotRetentionLimit; return this; } public final String getDailySnapshotTime() { return dailySnapshotTime; } public final void setDailySnapshotTime(String dailySnapshotTime) { this.dailySnapshotTime = dailySnapshotTime; } @Override public final Builder dailySnapshotTime(String dailySnapshotTime) { this.dailySnapshotTime = dailySnapshotTime; 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 CreateServerlessCacheRequest build() { return new CreateServerlessCacheRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy