software.amazon.awssdk.services.databasemigration.model.StartReplicationTaskRequest Maven / Gradle / Ivy
Show all versions of dms Show documentation
/*
* Copyright 2012-2017 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.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import javax.annotation.Generated;
import software.amazon.awssdk.core.AwsRequestOverrideConfig;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
*/
@Generated("software.amazon.awssdk:codegen")
public class StartReplicationTaskRequest extends DatabaseMigrationRequest implements
ToCopyableBuilder {
private final String replicationTaskArn;
private final String startReplicationTaskType;
private final Instant cdcStartTime;
private StartReplicationTaskRequest(BuilderImpl builder) {
super(builder);
this.replicationTaskArn = builder.replicationTaskArn;
this.startReplicationTaskType = builder.startReplicationTaskType;
this.cdcStartTime = builder.cdcStartTime;
}
/**
*
* The Amazon Resource Name (ARN) of the replication task to be started.
*
*
* @return The Amazon Resource Name (ARN) of the replication task to be started.
*/
public String replicationTaskArn() {
return replicationTaskArn;
}
/**
*
* The type of replication task.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #startReplicationTaskType} will return {@link StartReplicationTaskTypeValue#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #startReplicationTaskTypeString}.
*
*
* @return The type of replication task.
* @see StartReplicationTaskTypeValue
*/
public StartReplicationTaskTypeValue startReplicationTaskType() {
return StartReplicationTaskTypeValue.fromValue(startReplicationTaskType);
}
/**
*
* The type of replication task.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #startReplicationTaskType} will return {@link StartReplicationTaskTypeValue#UNKNOWN_TO_SDK_VERSION}. The
* raw value returned by the service is available from {@link #startReplicationTaskTypeString}.
*
*
* @return The type of replication task.
* @see StartReplicationTaskTypeValue
*/
public String startReplicationTaskTypeString() {
return startReplicationTaskType;
}
/**
*
* The start time for the Change Data Capture (CDC) operation.
*
*
* @return The start time for the Change Data Capture (CDC) operation.
*/
public Instant cdcStartTime() {
return cdcStartTime;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskArn());
hashCode = 31 * hashCode + Objects.hashCode(startReplicationTaskTypeString());
hashCode = 31 * hashCode + Objects.hashCode(cdcStartTime());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StartReplicationTaskRequest)) {
return false;
}
StartReplicationTaskRequest other = (StartReplicationTaskRequest) obj;
return Objects.equals(replicationTaskArn(), other.replicationTaskArn())
&& Objects.equals(startReplicationTaskTypeString(), other.startReplicationTaskTypeString())
&& Objects.equals(cdcStartTime(), other.cdcStartTime());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("{");
if (replicationTaskArn() != null) {
sb.append("ReplicationTaskArn: ").append(replicationTaskArn()).append(",");
}
if (startReplicationTaskTypeString() != null) {
sb.append("StartReplicationTaskType: ").append(startReplicationTaskTypeString()).append(",");
}
if (cdcStartTime() != null) {
sb.append("CdcStartTime: ").append(cdcStartTime()).append(",");
}
if (sb.length() > 1) {
sb.setLength(sb.length() - 1);
}
sb.append("}");
return sb.toString();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ReplicationTaskArn":
return Optional.of(clazz.cast(replicationTaskArn()));
case "StartReplicationTaskType":
return Optional.of(clazz.cast(startReplicationTaskTypeString()));
case "CdcStartTime":
return Optional.of(clazz.cast(cdcStartTime()));
default:
return Optional.empty();
}
}
public interface Builder extends DatabaseMigrationRequest.Builder, CopyableBuilder {
/**
*
* The Amazon Resource Name (ARN) of the replication task to be started.
*
*
* @param replicationTaskArn
* The Amazon Resource Name (ARN) of the replication task to be started.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationTaskArn(String replicationTaskArn);
/**
*
* The type of replication task.
*
*
* @param startReplicationTaskType
* The type of replication task.
* @see StartReplicationTaskTypeValue
* @return Returns a reference to this object so that method calls can be chained together.
* @see StartReplicationTaskTypeValue
*/
Builder startReplicationTaskType(String startReplicationTaskType);
/**
*
* The type of replication task.
*
*
* @param startReplicationTaskType
* The type of replication task.
* @see StartReplicationTaskTypeValue
* @return Returns a reference to this object so that method calls can be chained together.
* @see StartReplicationTaskTypeValue
*/
Builder startReplicationTaskType(StartReplicationTaskTypeValue startReplicationTaskType);
/**
*
* The start time for the Change Data Capture (CDC) operation.
*
*
* @param cdcStartTime
* The start time for the Change Data Capture (CDC) operation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cdcStartTime(Instant cdcStartTime);
@Override
Builder requestOverrideConfig(AwsRequestOverrideConfig awsRequestOverrideConfig);
}
static final class BuilderImpl extends DatabaseMigrationRequest.BuilderImpl implements Builder {
private String replicationTaskArn;
private String startReplicationTaskType;
private Instant cdcStartTime;
private BuilderImpl() {
}
private BuilderImpl(StartReplicationTaskRequest model) {
replicationTaskArn(model.replicationTaskArn);
startReplicationTaskType(model.startReplicationTaskType);
cdcStartTime(model.cdcStartTime);
}
public final String getReplicationTaskArn() {
return replicationTaskArn;
}
@Override
public final Builder replicationTaskArn(String replicationTaskArn) {
this.replicationTaskArn = replicationTaskArn;
return this;
}
public final void setReplicationTaskArn(String replicationTaskArn) {
this.replicationTaskArn = replicationTaskArn;
}
public final String getStartReplicationTaskType() {
return startReplicationTaskType;
}
@Override
public final Builder startReplicationTaskType(String startReplicationTaskType) {
this.startReplicationTaskType = startReplicationTaskType;
return this;
}
@Override
public final Builder startReplicationTaskType(StartReplicationTaskTypeValue startReplicationTaskType) {
this.startReplicationTaskType(startReplicationTaskType.toString());
return this;
}
public final void setStartReplicationTaskType(String startReplicationTaskType) {
this.startReplicationTaskType = startReplicationTaskType;
}
public final Instant getCdcStartTime() {
return cdcStartTime;
}
@Override
public final Builder cdcStartTime(Instant cdcStartTime) {
this.cdcStartTime = cdcStartTime;
return this;
}
public final void setCdcStartTime(Instant cdcStartTime) {
this.cdcStartTime = cdcStartTime;
}
@Override
public Builder requestOverrideConfig(AwsRequestOverrideConfig awsRequestOverrideConfig) {
super.requestOverrideConfig(awsRequestOverrideConfig);
return this;
}
@Override
public Builder requestOverrideConfig(Consumer builderConsumer) {
super.requestOverrideConfig(builderConsumer);
return this;
}
@Override
public StartReplicationTaskRequest build() {
return new StartReplicationTaskRequest(this);
}
}
}