software.amazon.awssdk.services.rds.model.BacktrackDbClusterRequest Maven / Gradle / Ivy
Show all versions of rds 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.rds.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 BacktrackDbClusterRequest extends RdsRequest implements
ToCopyableBuilder {
private static final SdkField DB_CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBClusterIdentifier").getter(getter(BacktrackDbClusterRequest::dbClusterIdentifier))
.setter(setter(Builder::dbClusterIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBClusterIdentifier").build())
.build();
private static final SdkField BACKTRACK_TO_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("BacktrackTo").getter(getter(BacktrackDbClusterRequest::backtrackTo))
.setter(setter(Builder::backtrackTo))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BacktrackTo").build()).build();
private static final SdkField FORCE_FIELD = SdkField. builder(MarshallingType.BOOLEAN).memberName("Force")
.getter(getter(BacktrackDbClusterRequest::force)).setter(setter(Builder::force))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Force").build()).build();
private static final SdkField USE_EARLIEST_TIME_ON_POINT_IN_TIME_UNAVAILABLE_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("UseEarliestTimeOnPointInTimeUnavailable")
.getter(getter(BacktrackDbClusterRequest::useEarliestTimeOnPointInTimeUnavailable))
.setter(setter(Builder::useEarliestTimeOnPointInTimeUnavailable))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("UseEarliestTimeOnPointInTimeUnavailable").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DB_CLUSTER_IDENTIFIER_FIELD,
BACKTRACK_TO_FIELD, FORCE_FIELD, USE_EARLIEST_TIME_ON_POINT_IN_TIME_UNAVAILABLE_FIELD));
private final String dbClusterIdentifier;
private final Instant backtrackTo;
private final Boolean force;
private final Boolean useEarliestTimeOnPointInTimeUnavailable;
private BacktrackDbClusterRequest(BuilderImpl builder) {
super(builder);
this.dbClusterIdentifier = builder.dbClusterIdentifier;
this.backtrackTo = builder.backtrackTo;
this.force = builder.force;
this.useEarliestTimeOnPointInTimeUnavailable = builder.useEarliestTimeOnPointInTimeUnavailable;
}
/**
*
* The DB cluster identifier of the DB cluster to be backtracked. This parameter is stored as a lowercase string.
*
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 63 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Can't end with a hyphen or contain two consecutive hyphens.
*
*
*
*
* Example: my-cluster1
*
*
* @return The DB cluster identifier of the DB cluster to be backtracked. This parameter is stored as a lowercase
* string.
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 63 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Can't end with a hyphen or contain two consecutive hyphens.
*
*
*
*
* Example: my-cluster1
*/
public final String dbClusterIdentifier() {
return dbClusterIdentifier;
}
/**
*
* The timestamp of the time to backtrack the DB cluster to, specified in ISO 8601 format. For more information
* about ISO 8601, see the ISO8601 Wikipedia page.
*
*
*
* If the specified time isn't a consistent time for the DB cluster, Aurora automatically chooses the nearest
* possible consistent time for the DB cluster.
*
*
*
* Constraints:
*
*
* -
*
* Must contain a valid ISO 8601 timestamp.
*
*
* -
*
* Can't contain a timestamp set in the future.
*
*
*
*
* Example: 2017-07-08T18:00Z
*
*
* @return The timestamp of the time to backtrack the DB cluster to, specified in ISO 8601 format. For more
* information about ISO 8601, see the ISO8601 Wikipedia
* page.
*
* If the specified time isn't a consistent time for the DB cluster, Aurora automatically chooses the
* nearest possible consistent time for the DB cluster.
*
*
*
* Constraints:
*
*
* -
*
* Must contain a valid ISO 8601 timestamp.
*
*
* -
*
* Can't contain a timestamp set in the future.
*
*
*
*
* Example: 2017-07-08T18:00Z
*/
public final Instant backtrackTo() {
return backtrackTo;
}
/**
*
* Specifies whether to force the DB cluster to backtrack when binary logging is enabled. Otherwise, an error occurs
* when binary logging is enabled.
*
*
* @return Specifies whether to force the DB cluster to backtrack when binary logging is enabled. Otherwise, an
* error occurs when binary logging is enabled.
*/
public final Boolean force() {
return force;
}
/**
*
* Specifies whether to backtrack the DB cluster to the earliest possible backtrack time when BacktrackTo is
* set to a timestamp earlier than the earliest backtrack time. When this parameter is disabled and
* BacktrackTo is set to a timestamp earlier than the earliest backtrack time, an error occurs.
*
*
* @return Specifies whether to backtrack the DB cluster to the earliest possible backtrack time when
* BacktrackTo is set to a timestamp earlier than the earliest backtrack time. When this parameter is
* disabled and BacktrackTo is set to a timestamp earlier than the earliest backtrack time, an error
* occurs.
*/
public final Boolean useEarliestTimeOnPointInTimeUnavailable() {
return useEarliestTimeOnPointInTimeUnavailable;
}
@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(dbClusterIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(backtrackTo());
hashCode = 31 * hashCode + Objects.hashCode(force());
hashCode = 31 * hashCode + Objects.hashCode(useEarliestTimeOnPointInTimeUnavailable());
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 BacktrackDbClusterRequest)) {
return false;
}
BacktrackDbClusterRequest other = (BacktrackDbClusterRequest) obj;
return Objects.equals(dbClusterIdentifier(), other.dbClusterIdentifier())
&& Objects.equals(backtrackTo(), other.backtrackTo()) && Objects.equals(force(), other.force())
&& Objects.equals(useEarliestTimeOnPointInTimeUnavailable(), other.useEarliestTimeOnPointInTimeUnavailable());
}
/**
* 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("BacktrackDbClusterRequest").add("DBClusterIdentifier", dbClusterIdentifier())
.add("BacktrackTo", backtrackTo()).add("Force", force())
.add("UseEarliestTimeOnPointInTimeUnavailable", useEarliestTimeOnPointInTimeUnavailable()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DBClusterIdentifier":
return Optional.ofNullable(clazz.cast(dbClusterIdentifier()));
case "BacktrackTo":
return Optional.ofNullable(clazz.cast(backtrackTo()));
case "Force":
return Optional.ofNullable(clazz.cast(force()));
case "UseEarliestTimeOnPointInTimeUnavailable":
return Optional.ofNullable(clazz.cast(useEarliestTimeOnPointInTimeUnavailable()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function