All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.databasemigration.model.CreateReplicationTaskRequest Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
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 CreateReplicationTaskRequest extends DatabaseMigrationRequest implements ToCopyableBuilder { private static final SdkField REPLICATION_TASK_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CreateReplicationTaskRequest::replicationTaskIdentifier)) .setter(setter(Builder::replicationTaskIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskIdentifier").build()) .build(); private static final SdkField SOURCE_ENDPOINT_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CreateReplicationTaskRequest::sourceEndpointArn)).setter(setter(Builder::sourceEndpointArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceEndpointArn").build()).build(); private static final SdkField TARGET_ENDPOINT_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CreateReplicationTaskRequest::targetEndpointArn)).setter(setter(Builder::targetEndpointArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetEndpointArn").build()).build(); private static final SdkField REPLICATION_INSTANCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CreateReplicationTaskRequest::replicationInstanceArn)).setter(setter(Builder::replicationInstanceArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationInstanceArn").build()) .build(); private static final SdkField MIGRATION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CreateReplicationTaskRequest::migrationTypeAsString)).setter(setter(Builder::migrationType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MigrationType").build()).build(); private static final SdkField TABLE_MAPPINGS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CreateReplicationTaskRequest::tableMappings)).setter(setter(Builder::tableMappings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableMappings").build()).build(); private static final SdkField REPLICATION_TASK_SETTINGS_FIELD = SdkField. builder(MarshallingType.STRING) .getter(getter(CreateReplicationTaskRequest::replicationTaskSettings)) .setter(setter(Builder::replicationTaskSettings)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplicationTaskSettings").build()) .build(); private static final SdkField CDC_START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .getter(getter(CreateReplicationTaskRequest::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) .getter(getter(CreateReplicationTaskRequest::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) .getter(getter(CreateReplicationTaskRequest::cdcStopPosition)).setter(setter(Builder::cdcStopPosition)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CdcStopPosition").build()).build(); private static final SdkField> TAGS_FIELD = SdkField .> builder(MarshallingType.LIST) .getter(getter(CreateReplicationTaskRequest::tags)) .setter(setter(Builder::tags)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(Tag::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( REPLICATION_TASK_IDENTIFIER_FIELD, SOURCE_ENDPOINT_ARN_FIELD, TARGET_ENDPOINT_ARN_FIELD, REPLICATION_INSTANCE_ARN_FIELD, MIGRATION_TYPE_FIELD, TABLE_MAPPINGS_FIELD, REPLICATION_TASK_SETTINGS_FIELD, CDC_START_TIME_FIELD, CDC_START_POSITION_FIELD, CDC_STOP_POSITION_FIELD, TAGS_FIELD)); private final String replicationTaskIdentifier; private final String sourceEndpointArn; private final String targetEndpointArn; private final String replicationInstanceArn; private final String migrationType; private final String tableMappings; private final String replicationTaskSettings; private final Instant cdcStartTime; private final String cdcStartPosition; private final String cdcStopPosition; private final List tags; private CreateReplicationTaskRequest(BuilderImpl builder) { super(builder); this.replicationTaskIdentifier = builder.replicationTaskIdentifier; this.sourceEndpointArn = builder.sourceEndpointArn; this.targetEndpointArn = builder.targetEndpointArn; this.replicationInstanceArn = builder.replicationInstanceArn; this.migrationType = builder.migrationType; this.tableMappings = builder.tableMappings; this.replicationTaskSettings = builder.replicationTaskSettings; this.cdcStartTime = builder.cdcStartTime; this.cdcStartPosition = builder.cdcStartPosition; this.cdcStopPosition = builder.cdcStopPosition; this.tags = builder.tags; } /** *

* An identifier for the replication task. *

*

* 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 An identifier for the replication task.

*

* 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; } /** *

    * An Amazon Resource Name (ARN) that uniquely identifies the source endpoint. *

    * * @return An Amazon Resource Name (ARN) that uniquely identifies the source endpoint. */ public String sourceEndpointArn() { return sourceEndpointArn; } /** *

    * An Amazon Resource Name (ARN) that uniquely identifies the target endpoint. *

    * * @return An Amazon Resource Name (ARN) that uniquely identifies the target endpoint. */ public String targetEndpointArn() { return targetEndpointArn; } /** *

    * The Amazon Resource Name (ARN) of a replication instance. *

    * * @return The Amazon Resource Name (ARN) of a replication instance. */ public String replicationInstanceArn() { return replicationInstanceArn; } /** *

    * 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 #migrationTypeAsString}. *

    * * @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 #migrationTypeAsString}. *

    * * @return The migration type. Valid values: full-load | cdc | * full-load-and-cdc * @see MigrationTypeValue */ public String migrationTypeAsString() { return migrationType; } /** *

    * The table mappings for the task, in JSON format. For more information, see Table * Mapping in the AWS Database Migration User Guide. *

    * * @return The table mappings for the task, in JSON format. For more information, see Table Mapping in the AWS Database Migration User Guide. */ public String tableMappings() { return tableMappings; } /** *

    * Overall settings for the task, in JSON format. For more information, see Task * Settings in the AWS Database Migration User Guide. *

    * * @return Overall settings for the task, in JSON format. For more information, see Task Settings in the AWS Database Migration User Guide. */ public String replicationTaskSettings() { return replicationTaskSettings; } /** *

    * 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. *

    *

    * Timestamp Example: --cdc-start-time “2018-03-08T12:12:12” *

    * * @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.

    *

    * Timestamp Example: --cdc-start-time “2018-03-08T12:12:12” */ public 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. *

    *

    * Date Example: --cdc-start-position “2018-03-08T12:12:12” *

    *

    * Checkpoint Example: --cdc-start-position * "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" *

    *

    * LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” *

    * * @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. *

    *

    * Date Example: --cdc-start-position “2018-03-08T12:12:12” *

    *

    * Checkpoint Example: --cdc-start-position * "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" *

    *

    * LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” */ public 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. *

    *

    * Server time example: --cdc-stop-position “server_time:3018-02-09T12:12:12” *

    *

    * Commit time example: --cdc-stop-position “commit_time: 3018-02-09T12:12:12 “ *

    * * @return Indicates when you want a change data capture (CDC) operation to stop. The value can be either server * time or commit time.

    *

    * Server time example: --cdc-stop-position “server_time:3018-02-09T12:12:12” *

    *

    * Commit time example: --cdc-stop-position “commit_time: 3018-02-09T12:12:12 “ */ public String cdcStopPosition() { return cdcStopPosition; } /** *

    * One or more tags to be assigned to the replication task. *

    *

    * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

    * * @return One or more tags to be assigned to the replication task. */ public List tags() { return tags; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(replicationTaskIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(sourceEndpointArn()); hashCode = 31 * hashCode + Objects.hashCode(targetEndpointArn()); hashCode = 31 * hashCode + Objects.hashCode(replicationInstanceArn()); hashCode = 31 * hashCode + Objects.hashCode(migrationTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(tableMappings()); hashCode = 31 * hashCode + Objects.hashCode(replicationTaskSettings()); hashCode = 31 * hashCode + Objects.hashCode(cdcStartTime()); hashCode = 31 * hashCode + Objects.hashCode(cdcStartPosition()); hashCode = 31 * hashCode + Objects.hashCode(cdcStopPosition()); hashCode = 31 * hashCode + Objects.hashCode(tags()); return hashCode; } @Override public boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof CreateReplicationTaskRequest)) { return false; } CreateReplicationTaskRequest other = (CreateReplicationTaskRequest) obj; return Objects.equals(replicationTaskIdentifier(), other.replicationTaskIdentifier()) && Objects.equals(sourceEndpointArn(), other.sourceEndpointArn()) && Objects.equals(targetEndpointArn(), other.targetEndpointArn()) && Objects.equals(replicationInstanceArn(), other.replicationInstanceArn()) && Objects.equals(migrationTypeAsString(), other.migrationTypeAsString()) && Objects.equals(tableMappings(), other.tableMappings()) && Objects.equals(replicationTaskSettings(), other.replicationTaskSettings()) && Objects.equals(cdcStartTime(), other.cdcStartTime()) && Objects.equals(cdcStartPosition(), other.cdcStartPosition()) && Objects.equals(cdcStopPosition(), other.cdcStopPosition()) && Objects.equals(tags(), other.tags()); } /** * 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 String toString() { return ToString.builder("CreateReplicationTaskRequest").add("ReplicationTaskIdentifier", replicationTaskIdentifier()) .add("SourceEndpointArn", sourceEndpointArn()).add("TargetEndpointArn", targetEndpointArn()) .add("ReplicationInstanceArn", replicationInstanceArn()).add("MigrationType", migrationTypeAsString()) .add("TableMappings", tableMappings()).add("ReplicationTaskSettings", replicationTaskSettings()) .add("CdcStartTime", cdcStartTime()).add("CdcStartPosition", cdcStartPosition()) .add("CdcStopPosition", cdcStopPosition()).add("Tags", tags()).build(); } public Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ReplicationTaskIdentifier": return Optional.ofNullable(clazz.cast(replicationTaskIdentifier())); case "SourceEndpointArn": return Optional.ofNullable(clazz.cast(sourceEndpointArn())); case "TargetEndpointArn": return Optional.ofNullable(clazz.cast(targetEndpointArn())); case "ReplicationInstanceArn": return Optional.ofNullable(clazz.cast(replicationInstanceArn())); case "MigrationType": return Optional.ofNullable(clazz.cast(migrationTypeAsString())); case "TableMappings": return Optional.ofNullable(clazz.cast(tableMappings())); case "ReplicationTaskSettings": return Optional.ofNullable(clazz.cast(replicationTaskSettings())); case "CdcStartTime": return Optional.ofNullable(clazz.cast(cdcStartTime())); case "CdcStartPosition": return Optional.ofNullable(clazz.cast(cdcStartPosition())); case "CdcStopPosition": return Optional.ofNullable(clazz.cast(cdcStopPosition())); case "Tags": return Optional.ofNullable(clazz.cast(tags())); default: return Optional.empty(); } } @Override public List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CreateReplicationTaskRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends DatabaseMigrationRequest.Builder, SdkPojo, CopyableBuilder { /** *

    * An identifier for the replication task. *

    *

    * 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 * An identifier for the replication task.

    *

    * 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); /** *

      * An Amazon Resource Name (ARN) that uniquely identifies the source endpoint. *

      * * @param sourceEndpointArn * An Amazon Resource Name (ARN) that uniquely identifies the source endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceEndpointArn(String sourceEndpointArn); /** *

      * An Amazon Resource Name (ARN) that uniquely identifies the target endpoint. *

      * * @param targetEndpointArn * An Amazon Resource Name (ARN) that uniquely identifies the target endpoint. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetEndpointArn(String targetEndpointArn); /** *

      * The Amazon Resource Name (ARN) of a replication instance. *

      * * @param replicationInstanceArn * The Amazon Resource Name (ARN) of a replication instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationInstanceArn(String replicationInstanceArn); /** *

      * 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); /** *

      * The table mappings for the task, in JSON format. For more information, see Table * Mapping in the AWS Database Migration User Guide. *

      * * @param tableMappings * The table mappings for the task, in JSON format. For more information, see Table * Mapping in the AWS Database Migration User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tableMappings(String tableMappings); /** *

      * Overall settings for the task, in JSON format. For more information, see Task * Settings in the AWS Database Migration User Guide. *

      * * @param replicationTaskSettings * Overall settings for the task, in JSON format. For more information, see Task * Settings in the AWS Database Migration User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ Builder replicationTaskSettings(String replicationTaskSettings); /** *

      * 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. *

      *

      * Timestamp Example: --cdc-start-time “2018-03-08T12:12:12” *

      * * @param cdcStartTime * 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.

      *

      * Timestamp Example: --cdc-start-time “2018-03-08T12:12:12” * @return Returns a reference to this object so that method calls can be chained together. */ Builder cdcStartTime(Instant 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. *

      *

      * Date Example: --cdc-start-position “2018-03-08T12:12:12” *

      *

      * Checkpoint Example: --cdc-start-position * "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" *

      *

      * LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” *

      * * @param cdcStartPosition * 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. *

      *

      * Date Example: --cdc-start-position “2018-03-08T12:12:12” *

      *

      * Checkpoint Example: --cdc-start-position * "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" *

      *

      * LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” * @return Returns a reference to this object so that method calls can be chained together. */ Builder cdcStartPosition(String cdcStartPosition); /** *

      * Indicates when you want a change data capture (CDC) operation to stop. The value can be either server time or * commit time. *

      *

      * Server time example: --cdc-stop-position “server_time:3018-02-09T12:12:12” *

      *

      * Commit time example: --cdc-stop-position “commit_time: 3018-02-09T12:12:12 “ *

      * * @param cdcStopPosition * Indicates when you want a change data capture (CDC) operation to stop. The value can be either server * time or commit time.

      *

      * Server time example: --cdc-stop-position “server_time:3018-02-09T12:12:12” *

      *

      * Commit time example: --cdc-stop-position “commit_time: 3018-02-09T12:12:12 “ * @return Returns a reference to this object so that method calls can be chained together. */ Builder cdcStopPosition(String cdcStopPosition); /** *

      * One or more tags to be assigned to the replication task. *

      * * @param tags * One or more tags to be assigned to the replication task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Collection tags); /** *

      * One or more tags to be assigned to the replication task. *

      * * @param tags * One or more tags to be assigned to the replication task. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Tag... tags); /** *

      * One or more tags to be assigned to the replication task. *

      * This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to create * one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its result * is passed to {@link #tags(List)}. * * @param tags * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #tags(List) */ Builder tags(Consumer... tags); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends DatabaseMigrationRequest.BuilderImpl implements Builder { private String replicationTaskIdentifier; private String sourceEndpointArn; private String targetEndpointArn; private String replicationInstanceArn; private String migrationType; private String tableMappings; private String replicationTaskSettings; private Instant cdcStartTime; private String cdcStartPosition; private String cdcStopPosition; private List tags = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(CreateReplicationTaskRequest model) { super(model); replicationTaskIdentifier(model.replicationTaskIdentifier); sourceEndpointArn(model.sourceEndpointArn); targetEndpointArn(model.targetEndpointArn); replicationInstanceArn(model.replicationInstanceArn); migrationType(model.migrationType); tableMappings(model.tableMappings); replicationTaskSettings(model.replicationTaskSettings); cdcStartTime(model.cdcStartTime); cdcStartPosition(model.cdcStartPosition); cdcStopPosition(model.cdcStopPosition); tags(model.tags); } 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 getSourceEndpointArn() { return sourceEndpointArn; } @Override public final Builder sourceEndpointArn(String sourceEndpointArn) { this.sourceEndpointArn = sourceEndpointArn; return this; } public final void setSourceEndpointArn(String sourceEndpointArn) { this.sourceEndpointArn = sourceEndpointArn; } public final String getTargetEndpointArn() { return targetEndpointArn; } @Override public final Builder targetEndpointArn(String targetEndpointArn) { this.targetEndpointArn = targetEndpointArn; return this; } public final void setTargetEndpointArn(String targetEndpointArn) { this.targetEndpointArn = targetEndpointArn; } public final String getReplicationInstanceArn() { return replicationInstanceArn; } @Override public final Builder replicationInstanceArn(String replicationInstanceArn) { this.replicationInstanceArn = replicationInstanceArn; return this; } public final void setReplicationInstanceArn(String replicationInstanceArn) { this.replicationInstanceArn = replicationInstanceArn; } public final String getMigrationTypeAsString() { return migrationType; } @Override public final Builder migrationType(String migrationType) { this.migrationType = migrationType; return this; } @Override public final Builder migrationType(MigrationTypeValue migrationType) { this.migrationType(migrationType == null ? null : 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; } public final String getCdcStartPosition() { return cdcStartPosition; } @Override public final Builder cdcStartPosition(String cdcStartPosition) { this.cdcStartPosition = cdcStartPosition; return this; } public final void setCdcStartPosition(String cdcStartPosition) { this.cdcStartPosition = cdcStartPosition; } public final String getCdcStopPosition() { return cdcStopPosition; } @Override public final Builder cdcStopPosition(String cdcStopPosition) { this.cdcStopPosition = cdcStopPosition; return this; } public final void setCdcStopPosition(String cdcStopPosition) { this.cdcStopPosition = cdcStopPosition; } public final Collection getTags() { return tags != null ? tags.stream().map(Tag::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder tags(Collection tags) { this.tags = TagListCopier.copy(tags); return this; } @Override @SafeVarargs public final Builder tags(Tag... tags) { tags(Arrays.asList(tags)); return this; } @Override @SafeVarargs public final Builder tags(Consumer... tags) { tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setTags(Collection tags) { this.tags = TagListCopier.copyFromBuilder(tags); } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public CreateReplicationTaskRequest build() { return new CreateReplicationTaskRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy