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

software.amazon.awssdk.services.memorydb.model.DescribeSnapshotsRequest 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.memorydb.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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class DescribeSnapshotsRequest extends MemoryDbRequest implements
        ToCopyableBuilder {
    private static final SdkField CLUSTER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ClusterName").getter(getter(DescribeSnapshotsRequest::clusterName)).setter(setter(Builder::clusterName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterName").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 SOURCE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Source")
            .getter(getter(DescribeSnapshotsRequest::source)).setter(setter(Builder::source))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build();

    private static final SdkField NEXT_TOKEN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("NextToken").getter(getter(DescribeSnapshotsRequest::nextToken)).setter(setter(Builder::nextToken))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextToken").build()).build();

    private static final SdkField MAX_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
            .memberName("MaxResults").getter(getter(DescribeSnapshotsRequest::maxResults)).setter(setter(Builder::maxResults))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxResults").build()).build();

    private static final SdkField SHOW_DETAIL_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
            .memberName("ShowDetail").getter(getter(DescribeSnapshotsRequest::showDetail)).setter(setter(Builder::showDetail))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShowDetail").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_NAME_FIELD,
            SNAPSHOT_NAME_FIELD, SOURCE_FIELD, NEXT_TOKEN_FIELD, MAX_RESULTS_FIELD, SHOW_DETAIL_FIELD));

    private final String clusterName;

    private final String snapshotName;

    private final String source;

    private final String nextToken;

    private final Integer maxResults;

    private final Boolean showDetail;

    private DescribeSnapshotsRequest(BuilderImpl builder) {
        super(builder);
        this.clusterName = builder.clusterName;
        this.snapshotName = builder.snapshotName;
        this.source = builder.source;
        this.nextToken = builder.nextToken;
        this.maxResults = builder.maxResults;
        this.showDetail = builder.showDetail;
    }

    /**
     * 

* 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 clusterName() { return clusterName; } /** *

* A user-supplied name of the snapshot. If this parameter is specified, only this named snapshot is described. *

* * @return A user-supplied name of the snapshot. If this parameter is specified, only this named snapshot is * described. */ public final String snapshotName() { return snapshotName; } /** *

* If set to system, the output shows snapshots that were automatically created by MemoryDB. 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 MemoryDB. 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 source() { return source; } /** *

* An optional argument to pass in case the total number of records exceeds the value of MaxResults. If nextToken is * returned, there are more results available. The value of nextToken is a unique pagination token for each page. * Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. *

* * @return An optional argument to pass in case the total number of records exceeds the value of MaxResults. If * nextToken is returned, there are more results available. The value of nextToken is a unique pagination * token for each page. Make the call again using the returned token to retrieve the next page. Keep all * other arguments unchanged. */ public final String nextToken() { return nextToken; } /** *

* The maximum number of records to include in the response. If more records exist than the specified MaxResults * value, a token is included in the response so that the remaining results can be retrieved. *

* * @return The maximum number of records to include in the response. If more records exist than the specified * MaxResults value, a token is included in the response so that the remaining results can be retrieved. */ public final Integer maxResults() { return maxResults; } /** *

* A Boolean value which if true, the shard configuration is included in the snapshot description. *

* * @return A Boolean value which if true, the shard configuration is included in the snapshot description. */ public final Boolean showDetail() { return showDetail; } @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(clusterName()); hashCode = 31 * hashCode + Objects.hashCode(snapshotName()); hashCode = 31 * hashCode + Objects.hashCode(source()); hashCode = 31 * hashCode + Objects.hashCode(nextToken()); hashCode = 31 * hashCode + Objects.hashCode(maxResults()); hashCode = 31 * hashCode + Objects.hashCode(showDetail()); 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(clusterName(), other.clusterName()) && Objects.equals(snapshotName(), other.snapshotName()) && Objects.equals(source(), other.source()) && Objects.equals(nextToken(), other.nextToken()) && Objects.equals(maxResults(), other.maxResults()) && Objects.equals(showDetail(), other.showDetail()); } /** * 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("ClusterName", clusterName()).add("SnapshotName", snapshotName()) .add("Source", source()).add("NextToken", nextToken()).add("MaxResults", maxResults()) .add("ShowDetail", showDetail()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ClusterName": return Optional.ofNullable(clazz.cast(clusterName())); case "SnapshotName": return Optional.ofNullable(clazz.cast(snapshotName())); case "Source": return Optional.ofNullable(clazz.cast(source())); case "NextToken": return Optional.ofNullable(clazz.cast(nextToken())); case "MaxResults": return Optional.ofNullable(clazz.cast(maxResults())); case "ShowDetail": return Optional.ofNullable(clazz.cast(showDetail())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeSnapshotsRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends MemoryDbRequest.Builder, SdkPojo, CopyableBuilder { /** *

* A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with that * specific cluster are described. *

* * @param clusterName * A user-supplied cluster identifier. If this parameter is specified, only snapshots associated with * that specific cluster are described. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clusterName(String clusterName); /** *

* A user-supplied name of the snapshot. If this parameter is specified, only this named snapshot is described. *

* * @param snapshotName * A user-supplied name of the snapshot. If this parameter is specified, only this named snapshot is * described. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotName(String snapshotName); /** *

* If set to system, the output shows snapshots that were automatically created by MemoryDB. If set to user the * output shows snapshots that were manually created. If omitted, the output shows both automatically and * manually created snapshots. *

* * @param source * If set to system, the output shows snapshots that were automatically created by MemoryDB. If set to * user the output shows snapshots that were manually created. If omitted, the output shows both * automatically and manually created snapshots. * @return Returns a reference to this object so that method calls can be chained together. */ Builder source(String source); /** *

* An optional argument to pass in case the total number of records exceeds the value of MaxResults. If * nextToken is returned, there are more results available. The value of nextToken is a unique pagination token * for each page. Make the call again using the returned token to retrieve the next page. Keep all other * arguments unchanged. *

* * @param nextToken * An optional argument to pass in case the total number of records exceeds the value of MaxResults. If * nextToken is returned, there are more results available. The value of nextToken is a unique pagination * token for each page. Make the call again using the returned token to retrieve the next page. Keep all * other arguments unchanged. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextToken(String nextToken); /** *

* The maximum number of records to include in the response. If more records exist than the specified MaxResults * value, a token is included in the response so that the remaining results can be retrieved. *

* * @param maxResults * The maximum number of records to include in the response. If more records exist than the specified * MaxResults value, a token is included in the response so that the remaining results can be retrieved. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxResults(Integer maxResults); /** *

* A Boolean value which if true, the shard configuration is included in the snapshot description. *

* * @param showDetail * A Boolean value which if true, the shard configuration is included in the snapshot description. * @return Returns a reference to this object so that method calls can be chained together. */ Builder showDetail(Boolean showDetail); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends MemoryDbRequest.BuilderImpl implements Builder { private String clusterName; private String snapshotName; private String source; private String nextToken; private Integer maxResults; private Boolean showDetail; private BuilderImpl() { } private BuilderImpl(DescribeSnapshotsRequest model) { super(model); clusterName(model.clusterName); snapshotName(model.snapshotName); source(model.source); nextToken(model.nextToken); maxResults(model.maxResults); showDetail(model.showDetail); } public final String getClusterName() { return clusterName; } public final void setClusterName(String clusterName) { this.clusterName = clusterName; } @Override public final Builder clusterName(String clusterName) { this.clusterName = clusterName; return this; } public final String getSnapshotName() { return snapshotName; } public final void setSnapshotName(String snapshotName) { this.snapshotName = snapshotName; } @Override public final Builder snapshotName(String snapshotName) { this.snapshotName = snapshotName; return this; } public final String getSource() { return source; } public final void setSource(String source) { this.source = source; } @Override public final Builder source(String source) { this.source = source; return this; } public final String getNextToken() { return nextToken; } public final void setNextToken(String nextToken) { this.nextToken = nextToken; } @Override public final Builder nextToken(String nextToken) { this.nextToken = nextToken; return this; } public final Integer getMaxResults() { return maxResults; } public final void setMaxResults(Integer maxResults) { this.maxResults = maxResults; } @Override public final Builder maxResults(Integer maxResults) { this.maxResults = maxResults; return this; } public final Boolean getShowDetail() { return showDetail; } public final void setShowDetail(Boolean showDetail) { this.showDetail = showDetail; } @Override public final Builder showDetail(Boolean showDetail) { this.showDetail = showDetail; 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 DescribeSnapshotsRequest build() { return new DescribeSnapshotsRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy