software.amazon.awssdk.services.appsync.model.ApiCache Maven / Gradle / Ivy
Show all versions of appsync Show documentation
/*
* 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.appsync.model;
import java.io.Serializable;
import java.util.Arrays;
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.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The ApiCache
object.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ApiCache implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField TTL_FIELD = SdkField. builder(MarshallingType.LONG).memberName("ttl")
.getter(getter(ApiCache::ttl)).setter(setter(Builder::ttl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ttl").build()).build();
private static final SdkField API_CACHING_BEHAVIOR_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("apiCachingBehavior").getter(getter(ApiCache::apiCachingBehaviorAsString))
.setter(setter(Builder::apiCachingBehavior))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("apiCachingBehavior").build())
.build();
private static final SdkField TRANSIT_ENCRYPTION_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("transitEncryptionEnabled").getter(getter(ApiCache::transitEncryptionEnabled))
.setter(setter(Builder::transitEncryptionEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("transitEncryptionEnabled").build())
.build();
private static final SdkField AT_REST_ENCRYPTION_ENABLED_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("atRestEncryptionEnabled").getter(getter(ApiCache::atRestEncryptionEnabled))
.setter(setter(Builder::atRestEncryptionEnabled))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("atRestEncryptionEnabled").build())
.build();
private static final SdkField TYPE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("type")
.getter(getter(ApiCache::typeAsString)).setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("type").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(ApiCache::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField HEALTH_METRICS_CONFIG_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("healthMetricsConfig").getter(getter(ApiCache::healthMetricsConfigAsString))
.setter(setter(Builder::healthMetricsConfig))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("healthMetricsConfig").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TTL_FIELD,
API_CACHING_BEHAVIOR_FIELD, TRANSIT_ENCRYPTION_ENABLED_FIELD, AT_REST_ENCRYPTION_ENABLED_FIELD, TYPE_FIELD,
STATUS_FIELD, HEALTH_METRICS_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final Long ttl;
private final String apiCachingBehavior;
private final Boolean transitEncryptionEnabled;
private final Boolean atRestEncryptionEnabled;
private final String type;
private final String status;
private final String healthMetricsConfig;
private ApiCache(BuilderImpl builder) {
this.ttl = builder.ttl;
this.apiCachingBehavior = builder.apiCachingBehavior;
this.transitEncryptionEnabled = builder.transitEncryptionEnabled;
this.atRestEncryptionEnabled = builder.atRestEncryptionEnabled;
this.type = builder.type;
this.status = builder.status;
this.healthMetricsConfig = builder.healthMetricsConfig;
}
/**
*
* TTL in seconds for cache entries.
*
*
* Valid values are 1–3,600 seconds.
*
*
* @return TTL in seconds for cache entries.
*
* Valid values are 1–3,600 seconds.
*/
public final Long ttl() {
return ttl;
}
/**
*
* Caching behavior.
*
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #apiCachingBehavior} will return {@link ApiCachingBehavior#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #apiCachingBehaviorAsString}.
*
*
* @return Caching behavior.
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
* @see ApiCachingBehavior
*/
public final ApiCachingBehavior apiCachingBehavior() {
return ApiCachingBehavior.fromValue(apiCachingBehavior);
}
/**
*
* Caching behavior.
*
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #apiCachingBehavior} will return {@link ApiCachingBehavior#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #apiCachingBehaviorAsString}.
*
*
* @return Caching behavior.
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
* @see ApiCachingBehavior
*/
public final String apiCachingBehaviorAsString() {
return apiCachingBehavior;
}
/**
*
* Transit encryption flag when connecting to cache. You cannot update this setting after creation.
*
*
* @return Transit encryption flag when connecting to cache. You cannot update this setting after creation.
*/
public final Boolean transitEncryptionEnabled() {
return transitEncryptionEnabled;
}
/**
*
* At-rest encryption flag for cache. You cannot update this setting after creation.
*
*
* @return At-rest encryption flag for cache. You cannot update this setting after creation.
*/
public final Boolean atRestEncryptionEnabled() {
return atRestEncryptionEnabled;
}
/**
*
* The cache instance type. Valid values are
*
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the
* generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link ApiCacheType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The cache instance type. Valid values are
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated,
* and the generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
* @see ApiCacheType
*/
public final ApiCacheType type() {
return ApiCacheType.fromValue(type);
}
/**
*
* The cache instance type. Valid values are
*
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and the
* generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #type} will return
* {@link ApiCacheType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #typeAsString}.
*
*
* @return The cache instance type. Valid values are
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated,
* and the generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
* @see ApiCacheType
*/
public final String typeAsString() {
return type;
}
/**
*
* The cache instance status.
*
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ApiCacheStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The cache instance status.
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
* @see ApiCacheStatus
*/
public final ApiCacheStatus status() {
return ApiCacheStatus.fromValue(status);
}
/**
*
* The cache instance status.
*
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ApiCacheStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The cache instance status.
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
* @see ApiCacheStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated
* bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for
* diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or DISABLED
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #healthMetricsConfig} will return {@link CacheHealthMetricsConfig#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #healthMetricsConfigAsString}.
*
*
* @return Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the
* aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for
* diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or
* DISABLED
.
* @see CacheHealthMetricsConfig
*/
public final CacheHealthMetricsConfig healthMetricsConfig() {
return CacheHealthMetricsConfig.fromValue(healthMetricsConfig);
}
/**
*
* Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the aggregated
* bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for
* diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or DISABLED
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #healthMetricsConfig} will return {@link CacheHealthMetricsConfig#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #healthMetricsConfigAsString}.
*
*
* @return Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the
* aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for
* diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or
* DISABLED
.
* @see CacheHealthMetricsConfig
*/
public final String healthMetricsConfigAsString() {
return healthMetricsConfig;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(ttl());
hashCode = 31 * hashCode + Objects.hashCode(apiCachingBehaviorAsString());
hashCode = 31 * hashCode + Objects.hashCode(transitEncryptionEnabled());
hashCode = 31 * hashCode + Objects.hashCode(atRestEncryptionEnabled());
hashCode = 31 * hashCode + Objects.hashCode(typeAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(healthMetricsConfigAsString());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ApiCache)) {
return false;
}
ApiCache other = (ApiCache) obj;
return Objects.equals(ttl(), other.ttl())
&& Objects.equals(apiCachingBehaviorAsString(), other.apiCachingBehaviorAsString())
&& Objects.equals(transitEncryptionEnabled(), other.transitEncryptionEnabled())
&& Objects.equals(atRestEncryptionEnabled(), other.atRestEncryptionEnabled())
&& Objects.equals(typeAsString(), other.typeAsString())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(healthMetricsConfigAsString(), other.healthMetricsConfigAsString());
}
/**
* 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("ApiCache").add("Ttl", ttl()).add("ApiCachingBehavior", apiCachingBehaviorAsString())
.add("TransitEncryptionEnabled", transitEncryptionEnabled())
.add("AtRestEncryptionEnabled", atRestEncryptionEnabled()).add("Type", typeAsString())
.add("Status", statusAsString()).add("HealthMetricsConfig", healthMetricsConfigAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ttl":
return Optional.ofNullable(clazz.cast(ttl()));
case "apiCachingBehavior":
return Optional.ofNullable(clazz.cast(apiCachingBehaviorAsString()));
case "transitEncryptionEnabled":
return Optional.ofNullable(clazz.cast(transitEncryptionEnabled()));
case "atRestEncryptionEnabled":
return Optional.ofNullable(clazz.cast(atRestEncryptionEnabled()));
case "type":
return Optional.ofNullable(clazz.cast(typeAsString()));
case "status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "healthMetricsConfig":
return Optional.ofNullable(clazz.cast(healthMetricsConfigAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* Valid values are 1–3,600 seconds.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder ttl(Long ttl);
/**
*
* Caching behavior.
*
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
*
*
* @param apiCachingBehavior
* Caching behavior.
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
* @see ApiCachingBehavior
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiCachingBehavior
*/
Builder apiCachingBehavior(String apiCachingBehavior);
/**
*
* Caching behavior.
*
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
*
*
* @param apiCachingBehavior
* Caching behavior.
*
* -
*
* FULL_REQUEST_CACHING: All requests are fully cached.
*
*
* -
*
* PER_RESOLVER_CACHING: Individual resolvers that you specify are cached.
*
*
* @see ApiCachingBehavior
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiCachingBehavior
*/
Builder apiCachingBehavior(ApiCachingBehavior apiCachingBehavior);
/**
*
* Transit encryption flag when connecting to cache. You cannot update this setting after creation.
*
*
* @param transitEncryptionEnabled
* Transit encryption flag when connecting to cache. You cannot update this setting after creation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder transitEncryptionEnabled(Boolean transitEncryptionEnabled);
/**
*
* At-rest encryption flag for cache. You cannot update this setting after creation.
*
*
* @param atRestEncryptionEnabled
* At-rest encryption flag for cache. You cannot update this setting after creation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder atRestEncryptionEnabled(Boolean atRestEncryptionEnabled);
/**
*
* The cache instance type. Valid values are
*
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and
* the generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
*
*
* @param type
* The cache instance type. Valid values are
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is
* deprecated, and the generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
* @see ApiCacheType
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiCacheType
*/
Builder type(String type);
/**
*
* The cache instance type. Valid values are
*
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is deprecated, and
* the generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
*
*
* @param type
* The cache instance type. Valid values are
*
* -
*
* SMALL
*
*
* -
*
* MEDIUM
*
*
* -
*
* LARGE
*
*
* -
*
* XLARGE
*
*
* -
*
* LARGE_2X
*
*
* -
*
* LARGE_4X
*
*
* -
*
* LARGE_8X
(not available in all regions)
*
*
* -
*
* LARGE_12X
*
*
*
*
* Historically, instance types were identified by an EC2-style value. As of July 2020, this is
* deprecated, and the generic identifiers above should be used.
*
*
* The following legacy instance types are available, but their use is discouraged:
*
*
* -
*
* T2_SMALL: A t2.small instance type.
*
*
* -
*
* T2_MEDIUM: A t2.medium instance type.
*
*
* -
*
* R4_LARGE: A r4.large instance type.
*
*
* -
*
* R4_XLARGE: A r4.xlarge instance type.
*
*
* -
*
* R4_2XLARGE: A r4.2xlarge instance type.
*
*
* -
*
* R4_4XLARGE: A r4.4xlarge instance type.
*
*
* -
*
* R4_8XLARGE: A r4.8xlarge instance type.
*
*
* @see ApiCacheType
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiCacheType
*/
Builder type(ApiCacheType type);
/**
*
* The cache instance status.
*
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
*
*
* @param status
* The cache instance status.
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
* @see ApiCacheStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiCacheStatus
*/
Builder status(String status);
/**
*
* The cache instance status.
*
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
*
*
* @param status
* The cache instance status.
*
* -
*
* AVAILABLE: The instance is available for use.
*
*
* -
*
* CREATING: The instance is currently creating.
*
*
* -
*
* DELETING: The instance is currently deleting.
*
*
* -
*
* MODIFYING: The instance is currently modifying.
*
*
* -
*
* FAILED: The instance has failed creation.
*
*
* @see ApiCacheStatus
* @return Returns a reference to this object so that method calls can be chained together.
* @see ApiCacheStatus
*/
Builder status(ApiCacheStatus status);
/**
*
* Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the
* aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for
* diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or DISABLED
.
*
*
* @param healthMetricsConfig
* Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the
* aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful
* for diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or
* DISABLED
.
* @see CacheHealthMetricsConfig
* @return Returns a reference to this object so that method calls can be chained together.
* @see CacheHealthMetricsConfig
*/
Builder healthMetricsConfig(String healthMetricsConfig);
/**
*
* Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the
* aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful for
* diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or DISABLED
.
*
*
* @param healthMetricsConfig
* Controls how cache health metrics will be emitted to CloudWatch. Cache health metrics include:
*
* -
*
* NetworkBandwidthOutAllowanceExceeded: The network packets dropped because the throughput exceeded the
* aggregated bandwidth limit. This is useful for diagnosing bottlenecks in a cache configuration.
*
*
* -
*
* EngineCPUUtilization: The CPU utilization (percentage) allocated to the Redis process. This is useful
* for diagnosing bottlenecks in a cache configuration.
*
*
*
*
* Metrics will be recorded by API ID. You can set the value to ENABLED
or
* DISABLED
.
* @see CacheHealthMetricsConfig
* @return Returns a reference to this object so that method calls can be chained together.
* @see CacheHealthMetricsConfig
*/
Builder healthMetricsConfig(CacheHealthMetricsConfig healthMetricsConfig);
}
static final class BuilderImpl implements Builder {
private Long ttl;
private String apiCachingBehavior;
private Boolean transitEncryptionEnabled;
private Boolean atRestEncryptionEnabled;
private String type;
private String status;
private String healthMetricsConfig;
private BuilderImpl() {
}
private BuilderImpl(ApiCache model) {
ttl(model.ttl);
apiCachingBehavior(model.apiCachingBehavior);
transitEncryptionEnabled(model.transitEncryptionEnabled);
atRestEncryptionEnabled(model.atRestEncryptionEnabled);
type(model.type);
status(model.status);
healthMetricsConfig(model.healthMetricsConfig);
}
public final Long getTtl() {
return ttl;
}
public final void setTtl(Long ttl) {
this.ttl = ttl;
}
@Override
public final Builder ttl(Long ttl) {
this.ttl = ttl;
return this;
}
public final String getApiCachingBehavior() {
return apiCachingBehavior;
}
public final void setApiCachingBehavior(String apiCachingBehavior) {
this.apiCachingBehavior = apiCachingBehavior;
}
@Override
public final Builder apiCachingBehavior(String apiCachingBehavior) {
this.apiCachingBehavior = apiCachingBehavior;
return this;
}
@Override
public final Builder apiCachingBehavior(ApiCachingBehavior apiCachingBehavior) {
this.apiCachingBehavior(apiCachingBehavior == null ? null : apiCachingBehavior.toString());
return this;
}
public final Boolean getTransitEncryptionEnabled() {
return transitEncryptionEnabled;
}
public final void setTransitEncryptionEnabled(Boolean transitEncryptionEnabled) {
this.transitEncryptionEnabled = transitEncryptionEnabled;
}
@Override
public final Builder transitEncryptionEnabled(Boolean transitEncryptionEnabled) {
this.transitEncryptionEnabled = transitEncryptionEnabled;
return this;
}
public final Boolean getAtRestEncryptionEnabled() {
return atRestEncryptionEnabled;
}
public final void setAtRestEncryptionEnabled(Boolean atRestEncryptionEnabled) {
this.atRestEncryptionEnabled = atRestEncryptionEnabled;
}
@Override
public final Builder atRestEncryptionEnabled(Boolean atRestEncryptionEnabled) {
this.atRestEncryptionEnabled = atRestEncryptionEnabled;
return this;
}
public final String getType() {
return type;
}
public final void setType(String type) {
this.type = type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
@Override
public final Builder type(ApiCacheType type) {
this.type(type == null ? null : type.toString());
return this;
}
public final String getStatus() {
return status;
}
public final void setStatus(String status) {
this.status = status;
}
@Override
public final Builder status(String status) {
this.status = status;
return this;
}
@Override
public final Builder status(ApiCacheStatus status) {
this.status(status == null ? null : status.toString());
return this;
}
public final String getHealthMetricsConfig() {
return healthMetricsConfig;
}
public final void setHealthMetricsConfig(String healthMetricsConfig) {
this.healthMetricsConfig = healthMetricsConfig;
}
@Override
public final Builder healthMetricsConfig(String healthMetricsConfig) {
this.healthMetricsConfig = healthMetricsConfig;
return this;
}
@Override
public final Builder healthMetricsConfig(CacheHealthMetricsConfig healthMetricsConfig) {
this.healthMetricsConfig(healthMetricsConfig == null ? null : healthMetricsConfig.toString());
return this;
}
@Override
public ApiCache build() {
return new ApiCache(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}