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

software.amazon.awssdk.services.redshiftserverless.model.ListSnapshotsRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Redshift Serverless module holds the client classes that are used for communicating with Redshift Serverless.

There is a newer version: 2.29.15
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.redshiftserverless.model;

import java.time.Instant;
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 ListSnapshotsRequest extends RedshiftServerlessRequest implements
        ToCopyableBuilder {
    private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("endTime").getter(getter(ListSnapshotsRequest::endTime)).setter(setter(Builder::endTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("endTime").build()).build();

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

    private static final SdkField NAMESPACE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("namespaceArn").getter(getter(ListSnapshotsRequest::namespaceArn)).setter(setter(Builder::namespaceArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("namespaceArn").build()).build();

    private static final SdkField NAMESPACE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("namespaceName").getter(getter(ListSnapshotsRequest::namespaceName))
            .setter(setter(Builder::namespaceName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("namespaceName").build()).build();

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

    private static final SdkField OWNER_ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ownerAccount").getter(getter(ListSnapshotsRequest::ownerAccount)).setter(setter(Builder::ownerAccount))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ownerAccount").build()).build();

    private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("startTime").getter(getter(ListSnapshotsRequest::startTime)).setter(setter(Builder::startTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("startTime").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays
            .asList(END_TIME_FIELD, MAX_RESULTS_FIELD, NAMESPACE_ARN_FIELD, NAMESPACE_NAME_FIELD, NEXT_TOKEN_FIELD,
                    OWNER_ACCOUNT_FIELD, START_TIME_FIELD));

    private final Instant endTime;

    private final Integer maxResults;

    private final String namespaceArn;

    private final String namespaceName;

    private final String nextToken;

    private final String ownerAccount;

    private final Instant startTime;

    private ListSnapshotsRequest(BuilderImpl builder) {
        super(builder);
        this.endTime = builder.endTime;
        this.maxResults = builder.maxResults;
        this.namespaceArn = builder.namespaceArn;
        this.namespaceName = builder.namespaceName;
        this.nextToken = builder.nextToken;
        this.ownerAccount = builder.ownerAccount;
        this.startTime = builder.startTime;
    }

    /**
     * 

* The timestamp showing when the snapshot creation finished. *

* * @return The timestamp showing when the snapshot creation finished. */ public final Instant endTime() { return endTime; } /** *

* An optional parameter that specifies the maximum number of results to return. You can use nextToken * to display the next page of results. *

* * @return An optional parameter that specifies the maximum number of results to return. You can use * nextToken to display the next page of results. */ public final Integer maxResults() { return maxResults; } /** *

* The Amazon Resource Name (ARN) of the namespace from which to list all snapshots. *

* * @return The Amazon Resource Name (ARN) of the namespace from which to list all snapshots. */ public final String namespaceArn() { return namespaceArn; } /** *

* The namespace from which to list all snapshots. *

* * @return The namespace from which to list all snapshots. */ public final String namespaceName() { return namespaceName; } /** *

* 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. *

* * @return 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. */ public final String nextToken() { return nextToken; } /** *

* The owner Amazon Web Services account of the snapshot. *

* * @return The owner Amazon Web Services account of the snapshot. */ public final String ownerAccount() { return ownerAccount; } /** *

* The time when the creation of the snapshot was initiated. *

* * @return The time when the creation of the snapshot was initiated. */ public final Instant startTime() { return startTime; } @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(endTime()); hashCode = 31 * hashCode + Objects.hashCode(maxResults()); hashCode = 31 * hashCode + Objects.hashCode(namespaceArn()); hashCode = 31 * hashCode + Objects.hashCode(namespaceName()); hashCode = 31 * hashCode + Objects.hashCode(nextToken()); hashCode = 31 * hashCode + Objects.hashCode(ownerAccount()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); 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 ListSnapshotsRequest)) { return false; } ListSnapshotsRequest other = (ListSnapshotsRequest) obj; return Objects.equals(endTime(), other.endTime()) && Objects.equals(maxResults(), other.maxResults()) && Objects.equals(namespaceArn(), other.namespaceArn()) && Objects.equals(namespaceName(), other.namespaceName()) && Objects.equals(nextToken(), other.nextToken()) && Objects.equals(ownerAccount(), other.ownerAccount()) && Objects.equals(startTime(), other.startTime()); } /** * 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("ListSnapshotsRequest").add("EndTime", endTime()).add("MaxResults", maxResults()) .add("NamespaceArn", namespaceArn()).add("NamespaceName", namespaceName()).add("NextToken", nextToken()) .add("OwnerAccount", ownerAccount()).add("StartTime", startTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "endTime": return Optional.ofNullable(clazz.cast(endTime())); case "maxResults": return Optional.ofNullable(clazz.cast(maxResults())); case "namespaceArn": return Optional.ofNullable(clazz.cast(namespaceArn())); case "namespaceName": return Optional.ofNullable(clazz.cast(namespaceName())); case "nextToken": return Optional.ofNullable(clazz.cast(nextToken())); case "ownerAccount": return Optional.ofNullable(clazz.cast(ownerAccount())); case "startTime": return Optional.ofNullable(clazz.cast(startTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ListSnapshotsRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RedshiftServerlessRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The timestamp showing when the snapshot creation finished. *

* * @param endTime * The timestamp showing when the snapshot creation finished. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

* An optional parameter that specifies the maximum number of results to return. You can use * nextToken to display the next page of results. *

* * @param maxResults * An optional parameter that specifies the maximum number of results to return. You can use * nextToken to display the next page of results. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxResults(Integer maxResults); /** *

* The Amazon Resource Name (ARN) of the namespace from which to list all snapshots. *

* * @param namespaceArn * The Amazon Resource Name (ARN) of the namespace from which to list all snapshots. * @return Returns a reference to this object so that method calls can be chained together. */ Builder namespaceArn(String namespaceArn); /** *

* The namespace from which to list all snapshots. *

* * @param namespaceName * The namespace from which to list all snapshots. * @return Returns a reference to this object so that method calls can be chained together. */ Builder namespaceName(String namespaceName); /** *

* 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. *

* * @param nextToken * 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. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextToken(String nextToken); /** *

* The owner Amazon Web Services account of the snapshot. *

* * @param ownerAccount * The owner Amazon Web Services account of the snapshot. * @return Returns a reference to this object so that method calls can be chained together. */ Builder ownerAccount(String ownerAccount); /** *

* The time when the creation of the snapshot was initiated. *

* * @param startTime * The time when the creation of the snapshot was initiated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends RedshiftServerlessRequest.BuilderImpl implements Builder { private Instant endTime; private Integer maxResults; private String namespaceArn; private String namespaceName; private String nextToken; private String ownerAccount; private Instant startTime; private BuilderImpl() { } private BuilderImpl(ListSnapshotsRequest model) { super(model); endTime(model.endTime); maxResults(model.maxResults); namespaceArn(model.namespaceArn); namespaceName(model.namespaceName); nextToken(model.nextToken); ownerAccount(model.ownerAccount); startTime(model.startTime); } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; 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 String getNamespaceArn() { return namespaceArn; } public final void setNamespaceArn(String namespaceArn) { this.namespaceArn = namespaceArn; } @Override public final Builder namespaceArn(String namespaceArn) { this.namespaceArn = namespaceArn; return this; } public final String getNamespaceName() { return namespaceName; } public final void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } @Override public final Builder namespaceName(String namespaceName) { this.namespaceName = namespaceName; 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 String getOwnerAccount() { return ownerAccount; } public final void setOwnerAccount(String ownerAccount) { this.ownerAccount = ownerAccount; } @Override public final Builder ownerAccount(String ownerAccount) { this.ownerAccount = ownerAccount; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; 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 ListSnapshotsRequest build() { return new ListSnapshotsRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy