
software.amazon.awssdk.services.databasemigration.model.RedshiftSettings Maven / Gradle / Ivy
/*
* 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.io.Serializable;
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.Function;
import software.amazon.awssdk.annotations.Generated;
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;
/**
*
* Provides information that defines an Amazon Redshift endpoint.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RedshiftSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACCEPT_ANY_DATE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AcceptAnyDate").getter(getter(RedshiftSettings::acceptAnyDate)).setter(setter(Builder::acceptAnyDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AcceptAnyDate").build()).build();
private static final SdkField AFTER_CONNECT_SCRIPT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("AfterConnectScript").getter(getter(RedshiftSettings::afterConnectScript))
.setter(setter(Builder::afterConnectScript))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AfterConnectScript").build())
.build();
private static final SdkField BUCKET_FOLDER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BucketFolder").getter(getter(RedshiftSettings::bucketFolder)).setter(setter(Builder::bucketFolder))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BucketFolder").build()).build();
private static final SdkField BUCKET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("BucketName").getter(getter(RedshiftSettings::bucketName)).setter(setter(Builder::bucketName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BucketName").build()).build();
private static final SdkField CASE_SENSITIVE_NAMES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CaseSensitiveNames").getter(getter(RedshiftSettings::caseSensitiveNames))
.setter(setter(Builder::caseSensitiveNames))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CaseSensitiveNames").build())
.build();
private static final SdkField COMP_UPDATE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("CompUpdate").getter(getter(RedshiftSettings::compUpdate)).setter(setter(Builder::compUpdate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompUpdate").build()).build();
private static final SdkField CONNECTION_TIMEOUT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ConnectionTimeout").getter(getter(RedshiftSettings::connectionTimeout))
.setter(setter(Builder::connectionTimeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConnectionTimeout").build()).build();
private static final SdkField DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DatabaseName").getter(getter(RedshiftSettings::databaseName)).setter(setter(Builder::databaseName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseName").build()).build();
private static final SdkField DATE_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DateFormat").getter(getter(RedshiftSettings::dateFormat)).setter(setter(Builder::dateFormat))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DateFormat").build()).build();
private static final SdkField EMPTY_AS_NULL_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("EmptyAsNull").getter(getter(RedshiftSettings::emptyAsNull)).setter(setter(Builder::emptyAsNull))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EmptyAsNull").build()).build();
private static final SdkField ENCRYPTION_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EncryptionMode").getter(getter(RedshiftSettings::encryptionModeAsString))
.setter(setter(Builder::encryptionMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EncryptionMode").build()).build();
private static final SdkField EXPLICIT_IDS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ExplicitIds").getter(getter(RedshiftSettings::explicitIds)).setter(setter(Builder::explicitIds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExplicitIds").build()).build();
private static final SdkField FILE_TRANSFER_UPLOAD_STREAMS_FIELD = SdkField
. builder(MarshallingType.INTEGER).memberName("FileTransferUploadStreams")
.getter(getter(RedshiftSettings::fileTransferUploadStreams)).setter(setter(Builder::fileTransferUploadStreams))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FileTransferUploadStreams").build())
.build();
private static final SdkField LOAD_TIMEOUT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("LoadTimeout").getter(getter(RedshiftSettings::loadTimeout)).setter(setter(Builder::loadTimeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LoadTimeout").build()).build();
private static final SdkField MAX_FILE_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("MaxFileSize").getter(getter(RedshiftSettings::maxFileSize)).setter(setter(Builder::maxFileSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxFileSize").build()).build();
private static final SdkField PASSWORD_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Password").getter(getter(RedshiftSettings::password)).setter(setter(Builder::password))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Password").build()).build();
private static final SdkField PORT_FIELD = SdkField. builder(MarshallingType.INTEGER).memberName("Port")
.getter(getter(RedshiftSettings::port)).setter(setter(Builder::port))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Port").build()).build();
private static final SdkField REMOVE_QUOTES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("RemoveQuotes").getter(getter(RedshiftSettings::removeQuotes)).setter(setter(Builder::removeQuotes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RemoveQuotes").build()).build();
private static final SdkField REPLACE_INVALID_CHARS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplaceInvalidChars").getter(getter(RedshiftSettings::replaceInvalidChars))
.setter(setter(Builder::replaceInvalidChars))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplaceInvalidChars").build())
.build();
private static final SdkField REPLACE_CHARS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ReplaceChars").getter(getter(RedshiftSettings::replaceChars)).setter(setter(Builder::replaceChars))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReplaceChars").build()).build();
private static final SdkField SERVER_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServerName").getter(getter(RedshiftSettings::serverName)).setter(setter(Builder::serverName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerName").build()).build();
private static final SdkField SERVICE_ACCESS_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ServiceAccessRoleArn").getter(getter(RedshiftSettings::serviceAccessRoleArn))
.setter(setter(Builder::serviceAccessRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServiceAccessRoleArn").build())
.build();
private static final SdkField SERVER_SIDE_ENCRYPTION_KMS_KEY_ID_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("ServerSideEncryptionKmsKeyId")
.getter(getter(RedshiftSettings::serverSideEncryptionKmsKeyId))
.setter(setter(Builder::serverSideEncryptionKmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ServerSideEncryptionKmsKeyId")
.build()).build();
private static final SdkField TIME_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TimeFormat").getter(getter(RedshiftSettings::timeFormat)).setter(setter(Builder::timeFormat))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeFormat").build()).build();
private static final SdkField TRIM_BLANKS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("TrimBlanks").getter(getter(RedshiftSettings::trimBlanks)).setter(setter(Builder::trimBlanks))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrimBlanks").build()).build();
private static final SdkField TRUNCATE_COLUMNS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("TruncateColumns").getter(getter(RedshiftSettings::truncateColumns))
.setter(setter(Builder::truncateColumns))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TruncateColumns").build()).build();
private static final SdkField USERNAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Username").getter(getter(RedshiftSettings::username)).setter(setter(Builder::username))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Username").build()).build();
private static final SdkField WRITE_BUFFER_SIZE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("WriteBufferSize").getter(getter(RedshiftSettings::writeBufferSize))
.setter(setter(Builder::writeBufferSize))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WriteBufferSize").build()).build();
private static final SdkField SECRETS_MANAGER_ACCESS_ROLE_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("SecretsManagerAccessRoleArn")
.getter(getter(RedshiftSettings::secretsManagerAccessRoleArn))
.setter(setter(Builder::secretsManagerAccessRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretsManagerAccessRoleArn")
.build()).build();
private static final SdkField SECRETS_MANAGER_SECRET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SecretsManagerSecretId").getter(getter(RedshiftSettings::secretsManagerSecretId))
.setter(setter(Builder::secretsManagerSecretId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretsManagerSecretId").build())
.build();
private static final SdkField MAP_BOOLEAN_AS_BOOLEAN_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("MapBooleanAsBoolean").getter(getter(RedshiftSettings::mapBooleanAsBoolean))
.setter(setter(Builder::mapBooleanAsBoolean))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapBooleanAsBoolean").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCEPT_ANY_DATE_FIELD,
AFTER_CONNECT_SCRIPT_FIELD, BUCKET_FOLDER_FIELD, BUCKET_NAME_FIELD, CASE_SENSITIVE_NAMES_FIELD, COMP_UPDATE_FIELD,
CONNECTION_TIMEOUT_FIELD, DATABASE_NAME_FIELD, DATE_FORMAT_FIELD, EMPTY_AS_NULL_FIELD, ENCRYPTION_MODE_FIELD,
EXPLICIT_IDS_FIELD, FILE_TRANSFER_UPLOAD_STREAMS_FIELD, LOAD_TIMEOUT_FIELD, MAX_FILE_SIZE_FIELD, PASSWORD_FIELD,
PORT_FIELD, REMOVE_QUOTES_FIELD, REPLACE_INVALID_CHARS_FIELD, REPLACE_CHARS_FIELD, SERVER_NAME_FIELD,
SERVICE_ACCESS_ROLE_ARN_FIELD, SERVER_SIDE_ENCRYPTION_KMS_KEY_ID_FIELD, TIME_FORMAT_FIELD, TRIM_BLANKS_FIELD,
TRUNCATE_COLUMNS_FIELD, USERNAME_FIELD, WRITE_BUFFER_SIZE_FIELD, SECRETS_MANAGER_ACCESS_ROLE_ARN_FIELD,
SECRETS_MANAGER_SECRET_ID_FIELD, MAP_BOOLEAN_AS_BOOLEAN_FIELD));
private static final long serialVersionUID = 1L;
private final Boolean acceptAnyDate;
private final String afterConnectScript;
private final String bucketFolder;
private final String bucketName;
private final Boolean caseSensitiveNames;
private final Boolean compUpdate;
private final Integer connectionTimeout;
private final String databaseName;
private final String dateFormat;
private final Boolean emptyAsNull;
private final String encryptionMode;
private final Boolean explicitIds;
private final Integer fileTransferUploadStreams;
private final Integer loadTimeout;
private final Integer maxFileSize;
private final String password;
private final Integer port;
private final Boolean removeQuotes;
private final String replaceInvalidChars;
private final String replaceChars;
private final String serverName;
private final String serviceAccessRoleArn;
private final String serverSideEncryptionKmsKeyId;
private final String timeFormat;
private final Boolean trimBlanks;
private final Boolean truncateColumns;
private final String username;
private final Integer writeBufferSize;
private final String secretsManagerAccessRoleArn;
private final String secretsManagerSecretId;
private final Boolean mapBooleanAsBoolean;
private RedshiftSettings(BuilderImpl builder) {
this.acceptAnyDate = builder.acceptAnyDate;
this.afterConnectScript = builder.afterConnectScript;
this.bucketFolder = builder.bucketFolder;
this.bucketName = builder.bucketName;
this.caseSensitiveNames = builder.caseSensitiveNames;
this.compUpdate = builder.compUpdate;
this.connectionTimeout = builder.connectionTimeout;
this.databaseName = builder.databaseName;
this.dateFormat = builder.dateFormat;
this.emptyAsNull = builder.emptyAsNull;
this.encryptionMode = builder.encryptionMode;
this.explicitIds = builder.explicitIds;
this.fileTransferUploadStreams = builder.fileTransferUploadStreams;
this.loadTimeout = builder.loadTimeout;
this.maxFileSize = builder.maxFileSize;
this.password = builder.password;
this.port = builder.port;
this.removeQuotes = builder.removeQuotes;
this.replaceInvalidChars = builder.replaceInvalidChars;
this.replaceChars = builder.replaceChars;
this.serverName = builder.serverName;
this.serviceAccessRoleArn = builder.serviceAccessRoleArn;
this.serverSideEncryptionKmsKeyId = builder.serverSideEncryptionKmsKeyId;
this.timeFormat = builder.timeFormat;
this.trimBlanks = builder.trimBlanks;
this.truncateColumns = builder.truncateColumns;
this.username = builder.username;
this.writeBufferSize = builder.writeBufferSize;
this.secretsManagerAccessRoleArn = builder.secretsManagerAccessRoleArn;
this.secretsManagerSecretId = builder.secretsManagerSecretId;
this.mapBooleanAsBoolean = builder.mapBooleanAsBoolean;
}
/**
*
* A value that indicates to allow any date format, including invalid formats such as 00/00/00 00:00:00, to be
* loaded without generating an error. You can choose true
or false
(the default).
*
*
* This parameter applies only to TIMESTAMP and DATE columns. Always use ACCEPTANYDATE with the DATEFORMAT
* parameter. If the date format for the data doesn't match the DATEFORMAT specification, Amazon Redshift inserts a
* NULL value into that field.
*
*
* @return A value that indicates to allow any date format, including invalid formats such as 00/00/00 00:00:00, to
* be loaded without generating an error. You can choose true
or false
(the
* default).
*
* This parameter applies only to TIMESTAMP and DATE columns. Always use ACCEPTANYDATE with the DATEFORMAT
* parameter. If the date format for the data doesn't match the DATEFORMAT specification, Amazon Redshift
* inserts a NULL value into that field.
*/
public final Boolean acceptAnyDate() {
return acceptAnyDate;
}
/**
*
* Code to run after connecting. This parameter should contain the code itself, not the name of a file containing
* the code.
*
*
* @return Code to run after connecting. This parameter should contain the code itself, not the name of a file
* containing the code.
*/
public final String afterConnectScript() {
return afterConnectScript;
}
/**
*
* An S3 folder where the comma-separated-value (.csv) files are stored before being uploaded to the target Redshift
* cluster.
*
*
* For full load mode, DMS converts source records into .csv files and loads them to the BucketFolder/TableID
* path. DMS uses the Redshift COPY
command to upload the .csv files to the target table. The files are
* deleted once the COPY
operation has finished. For more information, see COPY in the Amazon Redshift Database
* Developer Guide.
*
*
* For change-data-capture (CDC) mode, DMS creates a NetChanges table, and loads the .csv files to this
* BucketFolder/NetChangesTableID path.
*
*
* @return An S3 folder where the comma-separated-value (.csv) files are stored before being uploaded to the target
* Redshift cluster.
*
* For full load mode, DMS converts source records into .csv files and loads them to the
* BucketFolder/TableID path. DMS uses the Redshift COPY
command to upload the .csv
* files to the target table. The files are deleted once the COPY
operation has finished. For
* more information, see COPY in
* the Amazon Redshift Database Developer Guide.
*
*
* For change-data-capture (CDC) mode, DMS creates a NetChanges table, and loads the .csv files to
* this BucketFolder/NetChangesTableID path.
*/
public final String bucketFolder() {
return bucketFolder;
}
/**
*
* The name of the intermediate S3 bucket used to store .csv files before uploading data to Redshift.
*
*
* @return The name of the intermediate S3 bucket used to store .csv files before uploading data to Redshift.
*/
public final String bucketName() {
return bucketName;
}
/**
*
* If Amazon Redshift is configured to support case sensitive schema names, set CaseSensitiveNames
to
* true
. The default is false
.
*
*
* @return If Amazon Redshift is configured to support case sensitive schema names, set
* CaseSensitiveNames
to true
. The default is false
.
*/
public final Boolean caseSensitiveNames() {
return caseSensitiveNames;
}
/**
*
* If you set CompUpdate
to true
Amazon Redshift applies automatic compression if the
* table is empty. This applies even if the table columns already have encodings other than RAW
. If you
* set CompUpdate
to false
, automatic compression is disabled and existing column
* encodings aren't changed. The default is true
.
*
*
* @return If you set CompUpdate
to true
Amazon Redshift applies automatic compression if
* the table is empty. This applies even if the table columns already have encodings other than
* RAW
. If you set CompUpdate
to false
, automatic compression is
* disabled and existing column encodings aren't changed. The default is true
.
*/
public final Boolean compUpdate() {
return compUpdate;
}
/**
*
* A value that sets the amount of time to wait (in milliseconds) before timing out, beginning from when you
* initially establish a connection.
*
*
* @return A value that sets the amount of time to wait (in milliseconds) before timing out, beginning from when you
* initially establish a connection.
*/
public final Integer connectionTimeout() {
return connectionTimeout;
}
/**
*
* The name of the Amazon Redshift data warehouse (service) that you are working with.
*
*
* @return The name of the Amazon Redshift data warehouse (service) that you are working with.
*/
public final String databaseName() {
return databaseName;
}
/**
*
* The date format that you are using. Valid values are auto
(case-sensitive), your date format string
* enclosed in quotes, or NULL. If this parameter is left unset (NULL), it defaults to a format of 'YYYY-MM-DD'.
* Using auto
recognizes most strings, even some that aren't supported when you use a date format
* string.
*
*
* If your date and time values use formats different from each other, set this to auto
.
*
*
* @return The date format that you are using. Valid values are auto
(case-sensitive), your date format
* string enclosed in quotes, or NULL. If this parameter is left unset (NULL), it defaults to a format of
* 'YYYY-MM-DD'. Using auto
recognizes most strings, even some that aren't supported when you
* use a date format string.
*
* If your date and time values use formats different from each other, set this to auto
.
*/
public final String dateFormat() {
return dateFormat;
}
/**
*
* A value that specifies whether DMS should migrate empty CHAR and VARCHAR fields as NULL. A value of
* true
sets empty CHAR and VARCHAR fields to null. The default is false
.
*
*
* @return A value that specifies whether DMS should migrate empty CHAR and VARCHAR fields as NULL. A value of
* true
sets empty CHAR and VARCHAR fields to null. The default is false
.
*/
public final Boolean emptyAsNull() {
return emptyAsNull;
}
/**
*
* The type of server-side encryption that you want to use for your data. This encryption type is part of the
* endpoint settings or the extra connections attributes for Amazon S3. You can choose either SSE_S3
* (the default) or SSE_KMS
.
*
*
*
* For the ModifyEndpoint
operation, you can change the existing value of the
* EncryptionMode
parameter from SSE_KMS
to SSE_S3
. But you can’t change the
* existing value from SSE_S3
to SSE_KMS
.
*
*
*
* To use SSE_S3
, create an Identity and Access Management (IAM) role with a policy that allows
* "arn:aws:s3:::*"
to use the following actions: "s3:PutObject", "s3:ListBucket"
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #encryptionMode}
* will return {@link EncryptionModeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #encryptionModeAsString}.
*
*
* @return The type of server-side encryption that you want to use for your data. This encryption type is part of
* the endpoint settings or the extra connections attributes for Amazon S3. You can choose either
* SSE_S3
(the default) or SSE_KMS
.
*
* For the ModifyEndpoint
operation, you can change the existing value of the
* EncryptionMode
parameter from SSE_KMS
to SSE_S3
. But you can’t
* change the existing value from SSE_S3
to SSE_KMS
.
*
*
*
* To use SSE_S3
, create an Identity and Access Management (IAM) role with a policy that allows
* "arn:aws:s3:::*"
to use the following actions: "s3:PutObject", "s3:ListBucket"
* @see EncryptionModeValue
*/
public final EncryptionModeValue encryptionMode() {
return EncryptionModeValue.fromValue(encryptionMode);
}
/**
*
* The type of server-side encryption that you want to use for your data. This encryption type is part of the
* endpoint settings or the extra connections attributes for Amazon S3. You can choose either SSE_S3
* (the default) or SSE_KMS
.
*
*
*
* For the ModifyEndpoint
operation, you can change the existing value of the
* EncryptionMode
parameter from SSE_KMS
to SSE_S3
. But you can’t change the
* existing value from SSE_S3
to SSE_KMS
.
*
*
*
* To use SSE_S3
, create an Identity and Access Management (IAM) role with a policy that allows
* "arn:aws:s3:::*"
to use the following actions: "s3:PutObject", "s3:ListBucket"
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #encryptionMode}
* will return {@link EncryptionModeValue#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #encryptionModeAsString}.
*
*
* @return The type of server-side encryption that you want to use for your data. This encryption type is part of
* the endpoint settings or the extra connections attributes for Amazon S3. You can choose either
* SSE_S3
(the default) or SSE_KMS
.
*
* For the ModifyEndpoint
operation, you can change the existing value of the
* EncryptionMode
parameter from SSE_KMS
to SSE_S3
. But you can’t
* change the existing value from SSE_S3
to SSE_KMS
.
*
*
*
* To use SSE_S3
, create an Identity and Access Management (IAM) role with a policy that allows
* "arn:aws:s3:::*"
to use the following actions: "s3:PutObject", "s3:ListBucket"
* @see EncryptionModeValue
*/
public final String encryptionModeAsString() {
return encryptionMode;
}
/**
*
* This setting is only valid for a full-load migration task. Set ExplicitIds
to true
to
* have tables with IDENTITY
columns override their auto-generated values with explicit values loaded
* from the source data files used to populate the tables. The default is false
.
*
*
* @return This setting is only valid for a full-load migration task. Set ExplicitIds
to
* true
to have tables with IDENTITY
columns override their auto-generated values
* with explicit values loaded from the source data files used to populate the tables. The default is
* false
.
*/
public final Boolean explicitIds() {
return explicitIds;
}
/**
*
* The number of threads used to upload a single file. This parameter accepts a value from 1 through 64. It defaults
* to 10.
*
*
* The number of parallel streams used to upload a single .csv file to an S3 bucket using S3 Multipart Upload. For
* more information, see Multipart upload
* overview.
*
*
* FileTransferUploadStreams
accepts a value from 1 through 64. It defaults to 10.
*
*
* @return The number of threads used to upload a single file. This parameter accepts a value from 1 through 64. It
* defaults to 10.
*
* The number of parallel streams used to upload a single .csv file to an S3 bucket using S3 Multipart
* Upload. For more information, see Multipart upload overview.
*
*
* FileTransferUploadStreams
accepts a value from 1 through 64. It defaults to 10.
*/
public final Integer fileTransferUploadStreams() {
return fileTransferUploadStreams;
}
/**
*
* The amount of time to wait (in milliseconds) before timing out of operations performed by DMS on a Redshift
* cluster, such as Redshift COPY, INSERT, DELETE, and UPDATE.
*
*
* @return The amount of time to wait (in milliseconds) before timing out of operations performed by DMS on a
* Redshift cluster, such as Redshift COPY, INSERT, DELETE, and UPDATE.
*/
public final Integer loadTimeout() {
return loadTimeout;
}
/**
*
* The maximum size (in KB) of any .csv file used to load data on an S3 bucket and transfer data to Amazon Redshift.
* It defaults to 1048576KB (1 GB).
*
*
* @return The maximum size (in KB) of any .csv file used to load data on an S3 bucket and transfer data to Amazon
* Redshift. It defaults to 1048576KB (1 GB).
*/
public final Integer maxFileSize() {
return maxFileSize;
}
/**
*
* The password for the user named in the username
property.
*
*
* @return The password for the user named in the username
property.
*/
public final String password() {
return password;
}
/**
*
* The port number for Amazon Redshift. The default value is 5439.
*
*
* @return The port number for Amazon Redshift. The default value is 5439.
*/
public final Integer port() {
return port;
}
/**
*
* A value that specifies to remove surrounding quotation marks from strings in the incoming data. All characters
* within the quotation marks, including delimiters, are retained. Choose true
to remove quotation
* marks. The default is false
.
*
*
* @return A value that specifies to remove surrounding quotation marks from strings in the incoming data. All
* characters within the quotation marks, including delimiters, are retained. Choose true
to
* remove quotation marks. The default is false
.
*/
public final Boolean removeQuotes() {
return removeQuotes;
}
/**
*
* A list of characters that you want to replace. Use with ReplaceChars
.
*
*
* @return A list of characters that you want to replace. Use with ReplaceChars
.
*/
public final String replaceInvalidChars() {
return replaceInvalidChars;
}
/**
*
* A value that specifies to replaces the invalid characters specified in ReplaceInvalidChars
,
* substituting the specified characters instead. The default is "?"
.
*
*
* @return A value that specifies to replaces the invalid characters specified in ReplaceInvalidChars
,
* substituting the specified characters instead. The default is "?"
.
*/
public final String replaceChars() {
return replaceChars;
}
/**
*
* The name of the Amazon Redshift cluster you are using.
*
*
* @return The name of the Amazon Redshift cluster you are using.
*/
public final String serverName() {
return serverName;
}
/**
*
* The Amazon Resource Name (ARN) of the IAM role that has access to the Amazon Redshift service. The role must
* allow the iam:PassRole
action.
*
*
* @return The Amazon Resource Name (ARN) of the IAM role that has access to the Amazon Redshift service. The role
* must allow the iam:PassRole
action.
*/
public final String serviceAccessRoleArn() {
return serviceAccessRoleArn;
}
/**
*
* The KMS key ID. If you are using SSE_KMS
for the EncryptionMode
, provide this key ID.
* The key that you use needs an attached policy that enables IAM user permissions and allows use of the key.
*
*
* @return The KMS key ID. If you are using SSE_KMS
for the EncryptionMode
, provide this
* key ID. The key that you use needs an attached policy that enables IAM user permissions and allows use of
* the key.
*/
public final String serverSideEncryptionKmsKeyId() {
return serverSideEncryptionKmsKeyId;
}
/**
*
* The time format that you want to use. Valid values are auto
(case-sensitive),
* 'timeformat_string'
, 'epochsecs'
, or 'epochmillisecs'
. It defaults to 10.
* Using auto
recognizes most strings, even some that aren't supported when you use a time format
* string.
*
*
* If your date and time values use formats different from each other, set this parameter to auto
.
*
*
* @return The time format that you want to use. Valid values are auto
(case-sensitive),
* 'timeformat_string'
, 'epochsecs'
, or 'epochmillisecs'
. It defaults
* to 10. Using auto
recognizes most strings, even some that aren't supported when you use a
* time format string.
*
* If your date and time values use formats different from each other, set this parameter to
* auto
.
*/
public final String timeFormat() {
return timeFormat;
}
/**
*
* A value that specifies to remove the trailing white space characters from a VARCHAR string. This parameter
* applies only to columns with a VARCHAR data type. Choose true
to remove unneeded white space. The
* default is false
.
*
*
* @return A value that specifies to remove the trailing white space characters from a VARCHAR string. This
* parameter applies only to columns with a VARCHAR data type. Choose true
to remove unneeded
* white space. The default is false
.
*/
public final Boolean trimBlanks() {
return trimBlanks;
}
/**
*
* A value that specifies to truncate data in columns to the appropriate number of characters, so that the data fits
* in the column. This parameter applies only to columns with a VARCHAR or CHAR data type, and rows with a size of 4
* MB or less. Choose true
to truncate data. The default is false
.
*
*
* @return A value that specifies to truncate data in columns to the appropriate number of characters, so that the
* data fits in the column. This parameter applies only to columns with a VARCHAR or CHAR data type, and
* rows with a size of 4 MB or less. Choose true
to truncate data. The default is
* false
.
*/
public final Boolean truncateColumns() {
return truncateColumns;
}
/**
*
* An Amazon Redshift user name for a registered user.
*
*
* @return An Amazon Redshift user name for a registered user.
*/
public final String username() {
return username;
}
/**
*
* The size (in KB) of the in-memory file write buffer used when generating .csv files on the local disk at the DMS
* replication instance. The default value is 1000 (buffer size is 1000KB).
*
*
* @return The size (in KB) of the in-memory file write buffer used when generating .csv files on the local disk at
* the DMS replication instance. The default value is 1000 (buffer size is 1000KB).
*/
public final Integer writeBufferSize() {
return writeBufferSize;
}
/**
*
* The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as the trusted entity and grants the
* required permissions to access the value in SecretsManagerSecret
. The role must allow the
* iam:PassRole
action. SecretsManagerSecret
has the value of the Amazon Web Services
* Secrets Manager secret that allows access to the Amazon Redshift endpoint.
*
*
*
* You can specify one of two sets of values for these permissions. You can specify the values for this setting and
* SecretsManagerSecretId
. Or you can specify clear-text values for UserName
,
* Password
, ServerName
, and Port
. You can't specify both. For more
* information on creating this SecretsManagerSecret
and the SecretsManagerAccessRoleArn
* and SecretsManagerSecretId
required to access it, see Using
* secrets to access Database Migration Service resources in the Database Migration Service User Guide.
*
*
*
* @return The full Amazon Resource Name (ARN) of the IAM role that specifies DMS as the trusted entity and grants
* the required permissions to access the value in SecretsManagerSecret
. The role must allow
* the iam:PassRole
action. SecretsManagerSecret
has the value of the Amazon Web
* Services Secrets Manager secret that allows access to the Amazon Redshift endpoint.
*
* You can specify one of two sets of values for these permissions. You can specify the values for this
* setting and SecretsManagerSecretId
. Or you can specify clear-text values for
* UserName
, Password
, ServerName
, and Port
. You can't
* specify both. For more information on creating this SecretsManagerSecret
and the
* SecretsManagerAccessRoleArn
and SecretsManagerSecretId
required to access it,
* see Using secrets to access Database Migration Service resources in the Database Migration Service
* User Guide.
*
*/
public final String secretsManagerAccessRoleArn() {
return secretsManagerAccessRoleArn;
}
/**
*
* The full ARN, partial ARN, or friendly name of the SecretsManagerSecret
that contains the Amazon
* Redshift endpoint connection details.
*
*
* @return The full ARN, partial ARN, or friendly name of the SecretsManagerSecret
that contains the
* Amazon Redshift endpoint connection details.
*/
public final String secretsManagerSecretId() {
return secretsManagerSecretId;
}
/**
*
* When true, lets Redshift migrate the boolean type as boolean. By default, Redshift migrates booleans as
* varchar(1)
. You must set this setting on both the source and target endpoints for it to take effect.
*
*
* @return When true, lets Redshift migrate the boolean type as boolean. By default, Redshift migrates booleans as
* varchar(1)
. You must set this setting on both the source and target endpoints for it to take
* effect.
*/
public final Boolean mapBooleanAsBoolean() {
return mapBooleanAsBoolean;
}
@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 + Objects.hashCode(acceptAnyDate());
hashCode = 31 * hashCode + Objects.hashCode(afterConnectScript());
hashCode = 31 * hashCode + Objects.hashCode(bucketFolder());
hashCode = 31 * hashCode + Objects.hashCode(bucketName());
hashCode = 31 * hashCode + Objects.hashCode(caseSensitiveNames());
hashCode = 31 * hashCode + Objects.hashCode(compUpdate());
hashCode = 31 * hashCode + Objects.hashCode(connectionTimeout());
hashCode = 31 * hashCode + Objects.hashCode(databaseName());
hashCode = 31 * hashCode + Objects.hashCode(dateFormat());
hashCode = 31 * hashCode + Objects.hashCode(emptyAsNull());
hashCode = 31 * hashCode + Objects.hashCode(encryptionModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(explicitIds());
hashCode = 31 * hashCode + Objects.hashCode(fileTransferUploadStreams());
hashCode = 31 * hashCode + Objects.hashCode(loadTimeout());
hashCode = 31 * hashCode + Objects.hashCode(maxFileSize());
hashCode = 31 * hashCode + Objects.hashCode(password());
hashCode = 31 * hashCode + Objects.hashCode(port());
hashCode = 31 * hashCode + Objects.hashCode(removeQuotes());
hashCode = 31 * hashCode + Objects.hashCode(replaceInvalidChars());
hashCode = 31 * hashCode + Objects.hashCode(replaceChars());
hashCode = 31 * hashCode + Objects.hashCode(serverName());
hashCode = 31 * hashCode + Objects.hashCode(serviceAccessRoleArn());
hashCode = 31 * hashCode + Objects.hashCode(serverSideEncryptionKmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(timeFormat());
hashCode = 31 * hashCode + Objects.hashCode(trimBlanks());
hashCode = 31 * hashCode + Objects.hashCode(truncateColumns());
hashCode = 31 * hashCode + Objects.hashCode(username());
hashCode = 31 * hashCode + Objects.hashCode(writeBufferSize());
hashCode = 31 * hashCode + Objects.hashCode(secretsManagerAccessRoleArn());
hashCode = 31 * hashCode + Objects.hashCode(secretsManagerSecretId());
hashCode = 31 * hashCode + Objects.hashCode(mapBooleanAsBoolean());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RedshiftSettings)) {
return false;
}
RedshiftSettings other = (RedshiftSettings) obj;
return Objects.equals(acceptAnyDate(), other.acceptAnyDate())
&& Objects.equals(afterConnectScript(), other.afterConnectScript())
&& Objects.equals(bucketFolder(), other.bucketFolder()) && Objects.equals(bucketName(), other.bucketName())
&& Objects.equals(caseSensitiveNames(), other.caseSensitiveNames())
&& Objects.equals(compUpdate(), other.compUpdate())
&& Objects.equals(connectionTimeout(), other.connectionTimeout())
&& Objects.equals(databaseName(), other.databaseName()) && Objects.equals(dateFormat(), other.dateFormat())
&& Objects.equals(emptyAsNull(), other.emptyAsNull())
&& Objects.equals(encryptionModeAsString(), other.encryptionModeAsString())
&& Objects.equals(explicitIds(), other.explicitIds())
&& Objects.equals(fileTransferUploadStreams(), other.fileTransferUploadStreams())
&& Objects.equals(loadTimeout(), other.loadTimeout()) && Objects.equals(maxFileSize(), other.maxFileSize())
&& Objects.equals(password(), other.password()) && Objects.equals(port(), other.port())
&& Objects.equals(removeQuotes(), other.removeQuotes())
&& Objects.equals(replaceInvalidChars(), other.replaceInvalidChars())
&& Objects.equals(replaceChars(), other.replaceChars()) && Objects.equals(serverName(), other.serverName())
&& Objects.equals(serviceAccessRoleArn(), other.serviceAccessRoleArn())
&& Objects.equals(serverSideEncryptionKmsKeyId(), other.serverSideEncryptionKmsKeyId())
&& Objects.equals(timeFormat(), other.timeFormat()) && Objects.equals(trimBlanks(), other.trimBlanks())
&& Objects.equals(truncateColumns(), other.truncateColumns()) && Objects.equals(username(), other.username())
&& Objects.equals(writeBufferSize(), other.writeBufferSize())
&& Objects.equals(secretsManagerAccessRoleArn(), other.secretsManagerAccessRoleArn())
&& Objects.equals(secretsManagerSecretId(), other.secretsManagerSecretId())
&& Objects.equals(mapBooleanAsBoolean(), other.mapBooleanAsBoolean());
}
/**
* 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("RedshiftSettings").add("AcceptAnyDate", acceptAnyDate())
.add("AfterConnectScript", afterConnectScript()).add("BucketFolder", bucketFolder())
.add("BucketName", bucketName()).add("CaseSensitiveNames", caseSensitiveNames()).add("CompUpdate", compUpdate())
.add("ConnectionTimeout", connectionTimeout()).add("DatabaseName", databaseName())
.add("DateFormat", dateFormat()).add("EmptyAsNull", emptyAsNull())
.add("EncryptionMode", encryptionModeAsString()).add("ExplicitIds", explicitIds())
.add("FileTransferUploadStreams", fileTransferUploadStreams()).add("LoadTimeout", loadTimeout())
.add("MaxFileSize", maxFileSize()).add("Password", password() == null ? null : "*** Sensitive Data Redacted ***")
.add("Port", port()).add("RemoveQuotes", removeQuotes()).add("ReplaceInvalidChars", replaceInvalidChars())
.add("ReplaceChars", replaceChars()).add("ServerName", serverName())
.add("ServiceAccessRoleArn", serviceAccessRoleArn())
.add("ServerSideEncryptionKmsKeyId", serverSideEncryptionKmsKeyId()).add("TimeFormat", timeFormat())
.add("TrimBlanks", trimBlanks()).add("TruncateColumns", truncateColumns()).add("Username", username())
.add("WriteBufferSize", writeBufferSize()).add("SecretsManagerAccessRoleArn", secretsManagerAccessRoleArn())
.add("SecretsManagerSecretId", secretsManagerSecretId()).add("MapBooleanAsBoolean", mapBooleanAsBoolean())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "AcceptAnyDate":
return Optional.ofNullable(clazz.cast(acceptAnyDate()));
case "AfterConnectScript":
return Optional.ofNullable(clazz.cast(afterConnectScript()));
case "BucketFolder":
return Optional.ofNullable(clazz.cast(bucketFolder()));
case "BucketName":
return Optional.ofNullable(clazz.cast(bucketName()));
case "CaseSensitiveNames":
return Optional.ofNullable(clazz.cast(caseSensitiveNames()));
case "CompUpdate":
return Optional.ofNullable(clazz.cast(compUpdate()));
case "ConnectionTimeout":
return Optional.ofNullable(clazz.cast(connectionTimeout()));
case "DatabaseName":
return Optional.ofNullable(clazz.cast(databaseName()));
case "DateFormat":
return Optional.ofNullable(clazz.cast(dateFormat()));
case "EmptyAsNull":
return Optional.ofNullable(clazz.cast(emptyAsNull()));
case "EncryptionMode":
return Optional.ofNullable(clazz.cast(encryptionModeAsString()));
case "ExplicitIds":
return Optional.ofNullable(clazz.cast(explicitIds()));
case "FileTransferUploadStreams":
return Optional.ofNullable(clazz.cast(fileTransferUploadStreams()));
case "LoadTimeout":
return Optional.ofNullable(clazz.cast(loadTimeout()));
case "MaxFileSize":
return Optional.ofNullable(clazz.cast(maxFileSize()));
case "Password":
return Optional.ofNullable(clazz.cast(password()));
case "Port":
return Optional.ofNullable(clazz.cast(port()));
case "RemoveQuotes":
return Optional.ofNullable(clazz.cast(removeQuotes()));
case "ReplaceInvalidChars":
return Optional.ofNullable(clazz.cast(replaceInvalidChars()));
case "ReplaceChars":
return Optional.ofNullable(clazz.cast(replaceChars()));
case "ServerName":
return Optional.ofNullable(clazz.cast(serverName()));
case "ServiceAccessRoleArn":
return Optional.ofNullable(clazz.cast(serviceAccessRoleArn()));
case "ServerSideEncryptionKmsKeyId":
return Optional.ofNullable(clazz.cast(serverSideEncryptionKmsKeyId()));
case "TimeFormat":
return Optional.ofNullable(clazz.cast(timeFormat()));
case "TrimBlanks":
return Optional.ofNullable(clazz.cast(trimBlanks()));
case "TruncateColumns":
return Optional.ofNullable(clazz.cast(truncateColumns()));
case "Username":
return Optional.ofNullable(clazz.cast(username()));
case "WriteBufferSize":
return Optional.ofNullable(clazz.cast(writeBufferSize()));
case "SecretsManagerAccessRoleArn":
return Optional.ofNullable(clazz.cast(secretsManagerAccessRoleArn()));
case "SecretsManagerSecretId":
return Optional.ofNullable(clazz.cast(secretsManagerSecretId()));
case "MapBooleanAsBoolean":
return Optional.ofNullable(clazz.cast(mapBooleanAsBoolean()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function