software.amazon.awssdk.services.elasticache.model.DescribeSnapshotsRequest Maven / Gradle / Ivy
Show all versions of elasticache 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.elasticache.model;
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.Consumer;
import java.util.function.Function;
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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Represents the input of a DescribeSnapshotsMessage
operation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeSnapshotsRequest extends ElastiCacheRequest implements
ToCopyableBuilder {
private static final SdkField REPLICATION_GROUP_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationGroupId").getter(getter(DescribeSnapshotsRequest::replicationGroupId))
.setter(setter(Builder::replicationGroupId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationGroupId").build())
.build();
private static final SdkField CACHE_CLUSTER_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CacheClusterId").getter(getter(DescribeSnapshotsRequest::cacheClusterId))
.setter(setter(Builder::cacheClusterId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CacheClusterId").build()).build();
private static final SdkField SNAPSHOT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SnapshotName").getter(getter(DescribeSnapshotsRequest::snapshotName))
.setter(setter(Builder::snapshotName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotName").build()).build();
private static final SdkField SNAPSHOT_SOURCE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SnapshotSource").getter(getter(DescribeSnapshotsRequest::snapshotSource))
.setter(setter(Builder::snapshotSource))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotSource").build()).build();
private static final SdkField MARKER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Marker")
.getter(getter(DescribeSnapshotsRequest::marker)).setter(setter(Builder::marker))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Marker").build()).build();
private static final SdkField MAX_RECORDS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxRecords").getter(getter(DescribeSnapshotsRequest::maxRecords)).setter(setter(Builder::maxRecords))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxRecords").build()).build();
private static final SdkField SHOW_NODE_GROUP_CONFIG_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ShowNodeGroupConfig").getter(getter(DescribeSnapshotsRequest::showNodeGroupConfig))
.setter(setter(Builder::showNodeGroupConfig))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShowNodeGroupConfig").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPLICATION_GROUP_ID_FIELD,
CACHE_CLUSTER_ID_FIELD, SNAPSHOT_NAME_FIELD, SNAPSHOT_SOURCE_FIELD, MARKER_FIELD, MAX_RECORDS_FIELD,
SHOW_NODE_GROUP_CONFIG_FIELD));
private final String replicationGroupId;
private final String cacheClusterId;
private final String snapshotName;
private final String snapshotSource;
private final String marker;
private final Integer maxRecords;
private final Boolean showNodeGroupConfig;
private DescribeSnapshotsRequest(BuilderImpl builder) {
super(builder);
this.replicationGroupId = builder.replicationGroupId;
this.cacheClusterId = builder.cacheClusterId;
this.snapshotName = builder.snapshotName;
this.snapshotSource = builder.snapshotSource;
this.marker = builder.marker;
this.maxRecords = builder.maxRecords;
this.showNodeGroupConfig = builder.showNodeGroupConfig;
}
/**
*
* A user-supplied replication group identifier. If this parameter is specified, only snapshots associated with that
* specific replication group are described.
*
*
* @return A user-supplied replication group identifier. If this parameter is specified, only snapshots associated
* with that specific replication group are described.
*/
public final String replicationGroupId() {
return replicationGroupId;
}
/**
*
* A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that specific
* cluster are described.
*
*
* @return A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that
* specific cluster are described.
*/
public final String cacheClusterId() {
return cacheClusterId;
}
/**
*
* A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.
*
*
* @return A user-supplied name of the snapshot. If this parameter is specified, only this snapshot are described.
*/
public final String snapshotName() {
return snapshotName;
}
/**
*
* If set to system
, the output shows snapshots that were automatically created by ElastiCache. If set
* to user
the output shows snapshots that were manually created. If omitted, the output shows both
* automatically and manually created snapshots.
*
*
* @return If set to system
, the output shows snapshots that were automatically created by ElastiCache.
* If set to user
the output shows snapshots that were manually created. If omitted, the output
* shows both automatically and manually created snapshots.
*/
public final String snapshotSource() {
return snapshotSource;
}
/**
*
* An optional marker returned from a prior request. Use this marker for pagination of results from this operation.
* If this parameter is specified, the response includes only records beyond the marker, up to the value specified
* by MaxRecords
.
*
*
* @return An optional marker returned from a prior request. Use this marker for pagination of results from this
* operation. If this parameter is specified, the response includes only records beyond the marker, up to
* the value specified by MaxRecords
.
*/
public final String marker() {
return marker;
}
/**
*
* The maximum number of records to include in the response. If more records exist than the specified
* MaxRecords
value, a marker is included in the response so that the remaining results can be
* retrieved.
*
*
* Default: 50
*
*
* Constraints: minimum 20; maximum 50.
*
*
* @return The maximum number of records to include in the response. If more records exist than the specified
* MaxRecords
value, a marker is included in the response so that the remaining results can be
* retrieved.
*
* Default: 50
*
*
* Constraints: minimum 20; maximum 50.
*/
public final Integer maxRecords() {
return maxRecords;
}
/**
*
* A Boolean value which if true, the node group (shard) configuration is included in the snapshot description.
*
*
* @return A Boolean value which if true, the node group (shard) configuration is included in the snapshot
* description.
*/
public final Boolean showNodeGroupConfig() {
return showNodeGroupConfig;
}
@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 + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(replicationGroupId());
hashCode = 31 * hashCode + Objects.hashCode(cacheClusterId());
hashCode = 31 * hashCode + Objects.hashCode(snapshotName());
hashCode = 31 * hashCode + Objects.hashCode(snapshotSource());
hashCode = 31 * hashCode + Objects.hashCode(marker());
hashCode = 31 * hashCode + Objects.hashCode(maxRecords());
hashCode = 31 * hashCode + Objects.hashCode(showNodeGroupConfig());
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 DescribeSnapshotsRequest)) {
return false;
}
DescribeSnapshotsRequest other = (DescribeSnapshotsRequest) obj;
return Objects.equals(replicationGroupId(), other.replicationGroupId())
&& Objects.equals(cacheClusterId(), other.cacheClusterId())
&& Objects.equals(snapshotName(), other.snapshotName())
&& Objects.equals(snapshotSource(), other.snapshotSource()) && Objects.equals(marker(), other.marker())
&& Objects.equals(maxRecords(), other.maxRecords())
&& Objects.equals(showNodeGroupConfig(), other.showNodeGroupConfig());
}
/**
* 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("DescribeSnapshotsRequest").add("ReplicationGroupId", replicationGroupId())
.add("CacheClusterId", cacheClusterId()).add("SnapshotName", snapshotName())
.add("SnapshotSource", snapshotSource()).add("Marker", marker()).add("MaxRecords", maxRecords())
.add("ShowNodeGroupConfig", showNodeGroupConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReplicationGroupId":
return Optional.ofNullable(clazz.cast(replicationGroupId()));
case "CacheClusterId":
return Optional.ofNullable(clazz.cast(cacheClusterId()));
case "SnapshotName":
return Optional.ofNullable(clazz.cast(snapshotName()));
case "SnapshotSource":
return Optional.ofNullable(clazz.cast(snapshotSource()));
case "Marker":
return Optional.ofNullable(clazz.cast(marker()));
case "MaxRecords":
return Optional.ofNullable(clazz.cast(maxRecords()));
case "ShowNodeGroupConfig":
return Optional.ofNullable(clazz.cast(showNodeGroupConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function