software.amazon.awssdk.services.databasemigration.model.ModifyReplicationTaskRequest 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 ModifyReplicationTaskRequest extends DatabaseMigrationRequest implements
ToCopyableBuilder {
private final String replicationTaskArn;
private final String replicationTaskIdentifier;
private final String migrationType;
private final String tableMappings;
private final String replicationTaskSettings;
private final Instant cdcStartTime;
private ModifyReplicationTaskRequest(BuilderImpl builder) {
super(builder);
this.replicationTaskArn = builder.replicationTaskArn;
this.replicationTaskIdentifier = builder.replicationTaskIdentifier;
this.migrationType = builder.migrationType;
this.tableMappings = builder.tableMappings;
this.replicationTaskSettings = builder.replicationTaskSettings;
this.cdcStartTime = builder.cdcStartTime;
}
/**
*
* The Amazon Resource Name (ARN) of the replication task.
*
*
* @return The Amazon Resource Name (ARN) of the replication task.
*/
public String replicationTaskArn() {
return replicationTaskArn;
}
/**
*
* The replication task identifier.
*
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 255 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens.
*
*
*
*
* @return The replication task identifier.
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 255 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens.
*
*
*/
public String replicationTaskIdentifier() {
return replicationTaskIdentifier;
}
/**
*
* The migration type.
*
*
* Valid values: full-load | cdc | full-load-and-cdc
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #migrationType}
* will return {@link MigrationTypeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #migrationTypeString}.
*
*
* @return The migration type.
*
* Valid values: full-load | cdc | full-load-and-cdc
* @see MigrationTypeValue
*/
public MigrationTypeValue migrationType() {
return MigrationTypeValue.fromValue(migrationType);
}
/**
*
* The migration type.
*
*
* Valid values: full-load | cdc | full-load-and-cdc
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #migrationType}
* will return {@link MigrationTypeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #migrationTypeString}.
*
*
* @return The migration type.
*
* Valid values: full-load | cdc | full-load-and-cdc
* @see MigrationTypeValue
*/
public String migrationTypeString() {
return migrationType;
}
/**
*
* When using the AWS CLI or boto3, provide the path of the JSON file that contains the table mappings. Precede the
* path with "file://". When working with the DMS API, provide the JSON as the parameter value.
*
*
* For example, --table-mappings file://mappingfile.json
*
*
* @return When using the AWS CLI or boto3, provide the path of the JSON file that contains the table mappings.
* Precede the path with "file://". When working with the DMS API, provide the JSON as the parameter
* value.
*
* For example, --table-mappings file://mappingfile.json
*/
public String tableMappings() {
return tableMappings;
}
/**
*
* JSON file that contains settings for the task, such as target metadata settings.
*
*
* @return JSON file that contains settings for the task, such as target metadata settings.
*/
public String replicationTaskSettings() {
return replicationTaskSettings;
}
/**
*
* 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(replicationTaskIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(migrationTypeString());
hashCode = 31 * hashCode + Objects.hashCode(tableMappings());
hashCode = 31 * hashCode + Objects.hashCode(replicationTaskSettings());
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 ModifyReplicationTaskRequest)) {
return false;
}
ModifyReplicationTaskRequest other = (ModifyReplicationTaskRequest) obj;
return Objects.equals(replicationTaskArn(), other.replicationTaskArn())
&& Objects.equals(replicationTaskIdentifier(), other.replicationTaskIdentifier())
&& Objects.equals(migrationTypeString(), other.migrationTypeString())
&& Objects.equals(tableMappings(), other.tableMappings())
&& Objects.equals(replicationTaskSettings(), other.replicationTaskSettings())
&& Objects.equals(cdcStartTime(), other.cdcStartTime());
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("{");
if (replicationTaskArn() != null) {
sb.append("ReplicationTaskArn: ").append(replicationTaskArn()).append(",");
}
if (replicationTaskIdentifier() != null) {
sb.append("ReplicationTaskIdentifier: ").append(replicationTaskIdentifier()).append(",");
}
if (migrationTypeString() != null) {
sb.append("MigrationType: ").append(migrationTypeString()).append(",");
}
if (tableMappings() != null) {
sb.append("TableMappings: ").append(tableMappings()).append(",");
}
if (replicationTaskSettings() != null) {
sb.append("ReplicationTaskSettings: ").append(replicationTaskSettings()).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 "ReplicationTaskIdentifier":
return Optional.of(clazz.cast(replicationTaskIdentifier()));
case "MigrationType":
return Optional.of(clazz.cast(migrationTypeString()));
case "TableMappings":
return Optional.of(clazz.cast(tableMappings()));
case "ReplicationTaskSettings":
return Optional.of(clazz.cast(replicationTaskSettings()));
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.
*
*
* @param replicationTaskArn
* The Amazon Resource Name (ARN) of the replication task.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationTaskArn(String replicationTaskArn);
/**
*
* The replication task identifier.
*
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 255 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens.
*
*
*
*
* @param replicationTaskIdentifier
* The replication task identifier.
*
* Constraints:
*
*
* -
*
* Must contain from 1 to 255 alphanumeric characters or hyphens.
*
*
* -
*
* First character must be a letter.
*
*
* -
*
* Cannot end with a hyphen or contain two consecutive hyphens.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationTaskIdentifier(String replicationTaskIdentifier);
/**
*
* The migration type.
*
*
* Valid values: full-load | cdc | full-load-and-cdc
*
*
* @param migrationType
* The migration type.
*
* Valid values: full-load | cdc | full-load-and-cdc
* @see MigrationTypeValue
* @return Returns a reference to this object so that method calls can be chained together.
* @see MigrationTypeValue
*/
Builder migrationType(String migrationType);
/**
*
* The migration type.
*
*
* Valid values: full-load | cdc | full-load-and-cdc
*
*
* @param migrationType
* The migration type.
*
* Valid values: full-load | cdc | full-load-and-cdc
* @see MigrationTypeValue
* @return Returns a reference to this object so that method calls can be chained together.
* @see MigrationTypeValue
*/
Builder migrationType(MigrationTypeValue migrationType);
/**
*
* When using the AWS CLI or boto3, provide the path of the JSON file that contains the table mappings. Precede
* the path with "file://". When working with the DMS API, provide the JSON as the parameter value.
*
*
* For example, --table-mappings file://mappingfile.json
*
*
* @param tableMappings
* When using the AWS CLI or boto3, provide the path of the JSON file that contains the table mappings.
* Precede the path with "file://". When working with the DMS API, provide the JSON as the parameter
* value.
*
* For example, --table-mappings file://mappingfile.json
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tableMappings(String tableMappings);
/**
*
* JSON file that contains settings for the task, such as target metadata settings.
*
*
* @param replicationTaskSettings
* JSON file that contains settings for the task, such as target metadata settings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder replicationTaskSettings(String replicationTaskSettings);
/**
*
* 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 replicationTaskIdentifier;
private String migrationType;
private String tableMappings;
private String replicationTaskSettings;
private Instant cdcStartTime;
private BuilderImpl() {
}
private BuilderImpl(ModifyReplicationTaskRequest model) {
replicationTaskArn(model.replicationTaskArn);
replicationTaskIdentifier(model.replicationTaskIdentifier);
migrationType(model.migrationType);
tableMappings(model.tableMappings);
replicationTaskSettings(model.replicationTaskSettings);
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 getReplicationTaskIdentifier() {
return replicationTaskIdentifier;
}
@Override
public final Builder replicationTaskIdentifier(String replicationTaskIdentifier) {
this.replicationTaskIdentifier = replicationTaskIdentifier;
return this;
}
public final void setReplicationTaskIdentifier(String replicationTaskIdentifier) {
this.replicationTaskIdentifier = replicationTaskIdentifier;
}
public final String getMigrationType() {
return migrationType;
}
@Override
public final Builder migrationType(String migrationType) {
this.migrationType = migrationType;
return this;
}
@Override
public final Builder migrationType(MigrationTypeValue migrationType) {
this.migrationType(migrationType.toString());
return this;
}
public final void setMigrationType(String migrationType) {
this.migrationType = migrationType;
}
public final String getTableMappings() {
return tableMappings;
}
@Override
public final Builder tableMappings(String tableMappings) {
this.tableMappings = tableMappings;
return this;
}
public final void setTableMappings(String tableMappings) {
this.tableMappings = tableMappings;
}
public final String getReplicationTaskSettings() {
return replicationTaskSettings;
}
@Override
public final Builder replicationTaskSettings(String replicationTaskSettings) {
this.replicationTaskSettings = replicationTaskSettings;
return this;
}
public final void setReplicationTaskSettings(String replicationTaskSettings) {
this.replicationTaskSettings = replicationTaskSettings;
}
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 ModifyReplicationTaskRequest build() {
return new ModifyReplicationTaskRequest(this);
}
}
}