software.amazon.awssdk.services.databasemigration.model.StartReplicationRequest Maven / Gradle / Ivy
Show all versions of databasemigration 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.databasemigration.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 StartReplicationRequest extends DatabaseMigrationRequest implements
ToCopyableBuilder {
private static final SdkField REPLICATION_CONFIG_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplicationConfigArn").getter(getter(StartReplicationRequest::replicationConfigArn))
.setter(setter(Builder::replicationConfigArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationConfigArn").build())
.build();
private static final SdkField START_REPLICATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StartReplicationType").getter(getter(StartReplicationRequest::startReplicationType))
.setter(setter(Builder::startReplicationType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartReplicationType").build())
.build();
private static final SdkField CDC_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CdcStartTime").getter(getter(StartReplicationRequest::cdcStartTime))
.setter(setter(Builder::cdcStartTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CdcStartTime").build()).build();
private static final SdkField CDC_START_POSITION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CdcStartPosition").getter(getter(StartReplicationRequest::cdcStartPosition))
.setter(setter(Builder::cdcStartPosition))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CdcStartPosition").build()).build();
private static final SdkField CDC_STOP_POSITION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CdcStopPosition").getter(getter(StartReplicationRequest::cdcStopPosition))
.setter(setter(Builder::cdcStopPosition))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CdcStopPosition").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(REPLICATION_CONFIG_ARN_FIELD,
START_REPLICATION_TYPE_FIELD, CDC_START_TIME_FIELD, CDC_START_POSITION_FIELD, CDC_STOP_POSITION_FIELD));
private final String replicationConfigArn;
private final String startReplicationType;
private final Instant cdcStartTime;
private final String cdcStartPosition;
private final String cdcStopPosition;
private StartReplicationRequest(BuilderImpl builder) {
super(builder);
this.replicationConfigArn = builder.replicationConfigArn;
this.startReplicationType = builder.startReplicationType;
this.cdcStartTime = builder.cdcStartTime;
this.cdcStartPosition = builder.cdcStartPosition;
this.cdcStopPosition = builder.cdcStopPosition;
}
/**
*
* The Amazon Resource Name of the replication for which to start replication.
*
*
* @return The Amazon Resource Name of the replication for which to start replication.
*/
public final String replicationConfigArn() {
return replicationConfigArn;
}
/**
*
* The replication type.
*
*
* @return The replication type.
*/
public final String startReplicationType() {
return startReplicationType;
}
/**
*
* Indicates the start time for a change data capture (CDC) operation. Use either CdcStartTime
or
* CdcStartPosition
to specify when you want a CDC operation to start. Specifying both values results
* in an error.
*
*
* @return Indicates the start time for a change data capture (CDC) operation. Use either CdcStartTime
* or CdcStartPosition
to specify when you want a CDC operation to start. Specifying both
* values results in an error.
*/
public final Instant cdcStartTime() {
return cdcStartTime;
}
/**
*
* Indicates when you want a change data capture (CDC) operation to start. Use either CdcStartPosition
* or CdcStartTime
to specify when you want a CDC operation to start. Specifying both values results in
* an error.
*
*
* The value can be in date, checkpoint, or LSN/SCN format.
*
*
* @return Indicates when you want a change data capture (CDC) operation to start. Use either
* CdcStartPosition
or CdcStartTime
to specify when you want a CDC operation to
* start. Specifying both values results in an error.
*
* The value can be in date, checkpoint, or LSN/SCN format.
*/
public final String cdcStartPosition() {
return cdcStartPosition;
}
/**
*
* Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or
* commit time.
*
*
* @return Indicates when you want a change data capture (CDC) operation to stop. The value can be either server
* time or commit time.
*/
public final String cdcStopPosition() {
return cdcStopPosition;
}
@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(replicationConfigArn());
hashCode = 31 * hashCode + Objects.hashCode(startReplicationType());
hashCode = 31 * hashCode + Objects.hashCode(cdcStartTime());
hashCode = 31 * hashCode + Objects.hashCode(cdcStartPosition());
hashCode = 31 * hashCode + Objects.hashCode(cdcStopPosition());
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 StartReplicationRequest)) {
return false;
}
StartReplicationRequest other = (StartReplicationRequest) obj;
return Objects.equals(replicationConfigArn(), other.replicationConfigArn())
&& Objects.equals(startReplicationType(), other.startReplicationType())
&& Objects.equals(cdcStartTime(), other.cdcStartTime())
&& Objects.equals(cdcStartPosition(), other.cdcStartPosition())
&& Objects.equals(cdcStopPosition(), other.cdcStopPosition());
}
/**
* 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("StartReplicationRequest").add("ReplicationConfigArn", replicationConfigArn())
.add("StartReplicationType", startReplicationType()).add("CdcStartTime", cdcStartTime())
.add("CdcStartPosition", cdcStartPosition()).add("CdcStopPosition", cdcStopPosition()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReplicationConfigArn":
return Optional.ofNullable(clazz.cast(replicationConfigArn()));
case "StartReplicationType":
return Optional.ofNullable(clazz.cast(startReplicationType()));
case "CdcStartTime":
return Optional.ofNullable(clazz.cast(cdcStartTime()));
case "CdcStartPosition":
return Optional.ofNullable(clazz.cast(cdcStartPosition()));
case "CdcStopPosition":
return Optional.ofNullable(clazz.cast(cdcStopPosition()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function