software.amazon.awssdk.services.redshiftserverless.model.ListSnapshotsRequest Maven / Gradle / Ivy
Show all versions of redshiftserverless 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.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 extends Builder> 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