software.amazon.awssdk.services.firehose.model.RedshiftDestinationConfiguration Maven / Gradle / Ivy
Show all versions of kinesis Show documentation
/*
* Copyright 2013-2018 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.firehose.model;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import javax.annotation.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.protocol.ProtocolMarshaller;
import software.amazon.awssdk.core.protocol.StructuredPojo;
import software.amazon.awssdk.services.firehose.transform.RedshiftDestinationConfigurationMarshaller;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Describes the configuration of a destination in Amazon Redshift.
*
*/
@Generated("software.amazon.awssdk:codegen")
public class RedshiftDestinationConfiguration implements StructuredPojo,
ToCopyableBuilder {
private final String roleARN;
private final String clusterJDBCURL;
private final CopyCommand copyCommand;
private final String username;
private final String password;
private final RedshiftRetryOptions retryOptions;
private final S3DestinationConfiguration s3Configuration;
private final ProcessingConfiguration processingConfiguration;
private final String s3BackupMode;
private final S3DestinationConfiguration s3BackupConfiguration;
private final CloudWatchLoggingOptions cloudWatchLoggingOptions;
private RedshiftDestinationConfiguration(BuilderImpl builder) {
this.roleARN = builder.roleARN;
this.clusterJDBCURL = builder.clusterJDBCURL;
this.copyCommand = builder.copyCommand;
this.username = builder.username;
this.password = builder.password;
this.retryOptions = builder.retryOptions;
this.s3Configuration = builder.s3Configuration;
this.processingConfiguration = builder.processingConfiguration;
this.s3BackupMode = builder.s3BackupMode;
this.s3BackupConfiguration = builder.s3BackupConfiguration;
this.cloudWatchLoggingOptions = builder.cloudWatchLoggingOptions;
}
/**
*
* The ARN of the AWS credentials.
*
*
* @return The ARN of the AWS credentials.
*/
public String roleARN() {
return roleARN;
}
/**
*
* The database connection string.
*
*
* @return The database connection string.
*/
public String clusterJDBCURL() {
return clusterJDBCURL;
}
/**
*
* The COPY
command.
*
*
* @return The COPY
command.
*/
public CopyCommand copyCommand() {
return copyCommand;
}
/**
*
* The name of the user.
*
*
* @return The name of the user.
*/
public String username() {
return username;
}
/**
*
* The user password.
*
*
* @return The user password.
*/
public String password() {
return password;
}
/**
*
* The retry behavior in case Kinesis Firehose is unable to deliver documents to Amazon Redshift. Default value is
* 3600 (60 minutes).
*
*
* @return The retry behavior in case Kinesis Firehose is unable to deliver documents to Amazon Redshift. Default
* value is 3600 (60 minutes).
*/
public RedshiftRetryOptions retryOptions() {
return retryOptions;
}
/**
*
* The configuration for the intermediate Amazon S3 location from which Amazon Redshift obtains data. Restrictions
* are described in the topic for CreateDeliveryStream.
*
*
* The compression formats SNAPPY
or ZIP
cannot be specified in
* RedshiftDestinationConfiguration.S3Configuration because the Amazon Redshift COPY
operation
* that reads from the S3 bucket doesn't support these compression formats.
*
*
* @return The configuration for the intermediate Amazon S3 location from which Amazon Redshift obtains data.
* Restrictions are described in the topic for CreateDeliveryStream.
*
* The compression formats SNAPPY
or ZIP
cannot be specified in
* RedshiftDestinationConfiguration.S3Configuration because the Amazon Redshift COPY
* operation that reads from the S3 bucket doesn't support these compression formats.
*/
public S3DestinationConfiguration s3Configuration() {
return s3Configuration;
}
/**
*
* The data processing configuration.
*
*
* @return The data processing configuration.
*/
public ProcessingConfiguration processingConfiguration() {
return processingConfiguration;
}
/**
*
* The Amazon S3 backup mode.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #s3BackupMode} will
* return {@link RedshiftS3BackupMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #s3BackupModeString}.
*
*
* @return The Amazon S3 backup mode.
* @see RedshiftS3BackupMode
*/
public RedshiftS3BackupMode s3BackupMode() {
return RedshiftS3BackupMode.fromValue(s3BackupMode);
}
/**
*
* The Amazon S3 backup mode.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #s3BackupMode} will
* return {@link RedshiftS3BackupMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #s3BackupModeString}.
*
*
* @return The Amazon S3 backup mode.
* @see RedshiftS3BackupMode
*/
public String s3BackupModeString() {
return s3BackupMode;
}
/**
*
* The configuration for backup in Amazon S3.
*
*
* @return The configuration for backup in Amazon S3.
*/
public S3DestinationConfiguration s3BackupConfiguration() {
return s3BackupConfiguration;
}
/**
*
* The CloudWatch logging options for your delivery stream.
*
*
* @return The CloudWatch logging options for your delivery stream.
*/
public CloudWatchLoggingOptions cloudWatchLoggingOptions() {
return cloudWatchLoggingOptions;
}
@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(roleARN());
hashCode = 31 * hashCode + Objects.hashCode(clusterJDBCURL());
hashCode = 31 * hashCode + Objects.hashCode(copyCommand());
hashCode = 31 * hashCode + Objects.hashCode(username());
hashCode = 31 * hashCode + Objects.hashCode(password());
hashCode = 31 * hashCode + Objects.hashCode(retryOptions());
hashCode = 31 * hashCode + Objects.hashCode(s3Configuration());
hashCode = 31 * hashCode + Objects.hashCode(processingConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(s3BackupModeString());
hashCode = 31 * hashCode + Objects.hashCode(s3BackupConfiguration());
hashCode = 31 * hashCode + Objects.hashCode(cloudWatchLoggingOptions());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RedshiftDestinationConfiguration)) {
return false;
}
RedshiftDestinationConfiguration other = (RedshiftDestinationConfiguration) obj;
return Objects.equals(roleARN(), other.roleARN()) && Objects.equals(clusterJDBCURL(), other.clusterJDBCURL())
&& Objects.equals(copyCommand(), other.copyCommand()) && Objects.equals(username(), other.username())
&& Objects.equals(password(), other.password()) && Objects.equals(retryOptions(), other.retryOptions())
&& Objects.equals(s3Configuration(), other.s3Configuration())
&& Objects.equals(processingConfiguration(), other.processingConfiguration())
&& Objects.equals(s3BackupModeString(), other.s3BackupModeString())
&& Objects.equals(s3BackupConfiguration(), other.s3BackupConfiguration())
&& Objects.equals(cloudWatchLoggingOptions(), other.cloudWatchLoggingOptions());
}
@Override
public String toString() {
return ToString.builder("RedshiftDestinationConfiguration").add("RoleARN", roleARN())
.add("ClusterJDBCURL", clusterJDBCURL()).add("CopyCommand", copyCommand()).add("Username", username())
.add("Password", password()).add("RetryOptions", retryOptions()).add("S3Configuration", s3Configuration())
.add("ProcessingConfiguration", processingConfiguration()).add("S3BackupMode", s3BackupModeString())
.add("S3BackupConfiguration", s3BackupConfiguration())
.add("CloudWatchLoggingOptions", cloudWatchLoggingOptions()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "RoleARN":
return Optional.of(clazz.cast(roleARN()));
case "ClusterJDBCURL":
return Optional.of(clazz.cast(clusterJDBCURL()));
case "CopyCommand":
return Optional.of(clazz.cast(copyCommand()));
case "Username":
return Optional.of(clazz.cast(username()));
case "Password":
return Optional.of(clazz.cast(password()));
case "RetryOptions":
return Optional.of(clazz.cast(retryOptions()));
case "S3Configuration":
return Optional.of(clazz.cast(s3Configuration()));
case "ProcessingConfiguration":
return Optional.of(clazz.cast(processingConfiguration()));
case "S3BackupMode":
return Optional.of(clazz.cast(s3BackupModeString()));
case "S3BackupConfiguration":
return Optional.of(clazz.cast(s3BackupConfiguration()));
case "CloudWatchLoggingOptions":
return Optional.of(clazz.cast(cloudWatchLoggingOptions()));
default:
return Optional.empty();
}
}
@SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
RedshiftDestinationConfigurationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
public interface Builder extends CopyableBuilder {
/**
*
* The ARN of the AWS credentials.
*
*
* @param roleARN
* The ARN of the AWS credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder roleARN(String roleARN);
/**
*
* The database connection string.
*
*
* @param clusterJDBCURL
* The database connection string.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder clusterJDBCURL(String clusterJDBCURL);
/**
*
* The COPY
command.
*
*
* @param copyCommand
* The COPY
command.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder copyCommand(CopyCommand copyCommand);
/**
*
* The COPY
command.
*
* This is a convenience that creates an instance of the {@link CopyCommand.Builder} avoiding the need to create
* one manually via {@link CopyCommand#builder()}.
*
* When the {@link Consumer} completes, {@link CopyCommand.Builder#build()} is called immediately and its result
* is passed to {@link #copyCommand(CopyCommand)}.
*
* @param copyCommand
* a consumer that will call methods on {@link CopyCommand.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #copyCommand(CopyCommand)
*/
default Builder copyCommand(Consumer copyCommand) {
return copyCommand(CopyCommand.builder().apply(copyCommand).build());
}
/**
*
* The name of the user.
*
*
* @param username
* The name of the user.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder username(String username);
/**
*
* The user password.
*
*
* @param password
* The user password.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder password(String password);
/**
*
* The retry behavior in case Kinesis Firehose is unable to deliver documents to Amazon Redshift. Default value
* is 3600 (60 minutes).
*
*
* @param retryOptions
* The retry behavior in case Kinesis Firehose is unable to deliver documents to Amazon Redshift. Default
* value is 3600 (60 minutes).
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder retryOptions(RedshiftRetryOptions retryOptions);
/**
*
* The retry behavior in case Kinesis Firehose is unable to deliver documents to Amazon Redshift. Default value
* is 3600 (60 minutes).
*
* This is a convenience that creates an instance of the {@link RedshiftRetryOptions.Builder} avoiding the need
* to create one manually via {@link RedshiftRetryOptions#builder()}.
*
* When the {@link Consumer} completes, {@link RedshiftRetryOptions.Builder#build()} is called immediately and
* its result is passed to {@link #retryOptions(RedshiftRetryOptions)}.
*
* @param retryOptions
* a consumer that will call methods on {@link RedshiftRetryOptions.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #retryOptions(RedshiftRetryOptions)
*/
default Builder retryOptions(Consumer retryOptions) {
return retryOptions(RedshiftRetryOptions.builder().apply(retryOptions).build());
}
/**
*
* The configuration for the intermediate Amazon S3 location from which Amazon Redshift obtains data.
* Restrictions are described in the topic for CreateDeliveryStream.
*
*
* The compression formats SNAPPY
or ZIP
cannot be specified in
* RedshiftDestinationConfiguration.S3Configuration because the Amazon Redshift COPY
* operation that reads from the S3 bucket doesn't support these compression formats.
*
*
* @param s3Configuration
* The configuration for the intermediate Amazon S3 location from which Amazon Redshift obtains data.
* Restrictions are described in the topic for CreateDeliveryStream.
*
* The compression formats SNAPPY
or ZIP
cannot be specified in
* RedshiftDestinationConfiguration.S3Configuration because the Amazon Redshift COPY
* operation that reads from the S3 bucket doesn't support these compression formats.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder s3Configuration(S3DestinationConfiguration s3Configuration);
/**
*
* The configuration for the intermediate Amazon S3 location from which Amazon Redshift obtains data.
* Restrictions are described in the topic for CreateDeliveryStream.
*
*
* The compression formats SNAPPY
or ZIP
cannot be specified in
* RedshiftDestinationConfiguration.S3Configuration because the Amazon Redshift COPY
* operation that reads from the S3 bucket doesn't support these compression formats.
*
* This is a convenience that creates an instance of the {@link S3DestinationConfiguration.Builder} avoiding the
* need to create one manually via {@link S3DestinationConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link S3DestinationConfiguration.Builder#build()} is called immediately
* and its result is passed to {@link #s3Configuration(S3DestinationConfiguration)}.
*
* @param s3Configuration
* a consumer that will call methods on {@link S3DestinationConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #s3Configuration(S3DestinationConfiguration)
*/
default Builder s3Configuration(Consumer s3Configuration) {
return s3Configuration(S3DestinationConfiguration.builder().apply(s3Configuration).build());
}
/**
*
* The data processing configuration.
*
*
* @param processingConfiguration
* The data processing configuration.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder processingConfiguration(ProcessingConfiguration processingConfiguration);
/**
*
* The data processing configuration.
*
* This is a convenience that creates an instance of the {@link ProcessingConfiguration.Builder} avoiding the
* need to create one manually via {@link ProcessingConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link ProcessingConfiguration.Builder#build()} is called immediately
* and its result is passed to {@link #processingConfiguration(ProcessingConfiguration)}.
*
* @param processingConfiguration
* a consumer that will call methods on {@link ProcessingConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #processingConfiguration(ProcessingConfiguration)
*/
default Builder processingConfiguration(Consumer processingConfiguration) {
return processingConfiguration(ProcessingConfiguration.builder().apply(processingConfiguration).build());
}
/**
*
* The Amazon S3 backup mode.
*
*
* @param s3BackupMode
* The Amazon S3 backup mode.
* @see RedshiftS3BackupMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see RedshiftS3BackupMode
*/
Builder s3BackupMode(String s3BackupMode);
/**
*
* The Amazon S3 backup mode.
*
*
* @param s3BackupMode
* The Amazon S3 backup mode.
* @see RedshiftS3BackupMode
* @return Returns a reference to this object so that method calls can be chained together.
* @see RedshiftS3BackupMode
*/
Builder s3BackupMode(RedshiftS3BackupMode s3BackupMode);
/**
*
* The configuration for backup in Amazon S3.
*
*
* @param s3BackupConfiguration
* The configuration for backup in Amazon S3.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder s3BackupConfiguration(S3DestinationConfiguration s3BackupConfiguration);
/**
*
* The configuration for backup in Amazon S3.
*
* This is a convenience that creates an instance of the {@link S3DestinationConfiguration.Builder} avoiding the
* need to create one manually via {@link S3DestinationConfiguration#builder()}.
*
* When the {@link Consumer} completes, {@link S3DestinationConfiguration.Builder#build()} is called immediately
* and its result is passed to {@link #s3BackupConfiguration(S3DestinationConfiguration)}.
*
* @param s3BackupConfiguration
* a consumer that will call methods on {@link S3DestinationConfiguration.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #s3BackupConfiguration(S3DestinationConfiguration)
*/
default Builder s3BackupConfiguration(Consumer s3BackupConfiguration) {
return s3BackupConfiguration(S3DestinationConfiguration.builder().apply(s3BackupConfiguration).build());
}
/**
*
* The CloudWatch logging options for your delivery stream.
*
*
* @param cloudWatchLoggingOptions
* The CloudWatch logging options for your delivery stream.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder cloudWatchLoggingOptions(CloudWatchLoggingOptions cloudWatchLoggingOptions);
/**
*
* The CloudWatch logging options for your delivery stream.
*
* This is a convenience that creates an instance of the {@link CloudWatchLoggingOptions.Builder} avoiding the
* need to create one manually via {@link CloudWatchLoggingOptions#builder()}.
*
* When the {@link Consumer} completes, {@link CloudWatchLoggingOptions.Builder#build()} is called immediately
* and its result is passed to {@link #cloudWatchLoggingOptions(CloudWatchLoggingOptions)}.
*
* @param cloudWatchLoggingOptions
* a consumer that will call methods on {@link CloudWatchLoggingOptions.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #cloudWatchLoggingOptions(CloudWatchLoggingOptions)
*/
default Builder cloudWatchLoggingOptions(Consumer cloudWatchLoggingOptions) {
return cloudWatchLoggingOptions(CloudWatchLoggingOptions.builder().apply(cloudWatchLoggingOptions).build());
}
}
static final class BuilderImpl implements Builder {
private String roleARN;
private String clusterJDBCURL;
private CopyCommand copyCommand;
private String username;
private String password;
private RedshiftRetryOptions retryOptions;
private S3DestinationConfiguration s3Configuration;
private ProcessingConfiguration processingConfiguration;
private String s3BackupMode;
private S3DestinationConfiguration s3BackupConfiguration;
private CloudWatchLoggingOptions cloudWatchLoggingOptions;
private BuilderImpl() {
}
private BuilderImpl(RedshiftDestinationConfiguration model) {
roleARN(model.roleARN);
clusterJDBCURL(model.clusterJDBCURL);
copyCommand(model.copyCommand);
username(model.username);
password(model.password);
retryOptions(model.retryOptions);
s3Configuration(model.s3Configuration);
processingConfiguration(model.processingConfiguration);
s3BackupMode(model.s3BackupMode);
s3BackupConfiguration(model.s3BackupConfiguration);
cloudWatchLoggingOptions(model.cloudWatchLoggingOptions);
}
public final String getRoleARN() {
return roleARN;
}
@Override
public final Builder roleARN(String roleARN) {
this.roleARN = roleARN;
return this;
}
public final void setRoleARN(String roleARN) {
this.roleARN = roleARN;
}
public final String getClusterJDBCURL() {
return clusterJDBCURL;
}
@Override
public final Builder clusterJDBCURL(String clusterJDBCURL) {
this.clusterJDBCURL = clusterJDBCURL;
return this;
}
public final void setClusterJDBCURL(String clusterJDBCURL) {
this.clusterJDBCURL = clusterJDBCURL;
}
public final CopyCommand.Builder getCopyCommand() {
return copyCommand != null ? copyCommand.toBuilder() : null;
}
@Override
public final Builder copyCommand(CopyCommand copyCommand) {
this.copyCommand = copyCommand;
return this;
}
public final void setCopyCommand(CopyCommand.BuilderImpl copyCommand) {
this.copyCommand = copyCommand != null ? copyCommand.build() : null;
}
public final String getUsername() {
return username;
}
@Override
public final Builder username(String username) {
this.username = username;
return this;
}
public final void setUsername(String username) {
this.username = username;
}
public final String getPassword() {
return password;
}
@Override
public final Builder password(String password) {
this.password = password;
return this;
}
public final void setPassword(String password) {
this.password = password;
}
public final RedshiftRetryOptions.Builder getRetryOptions() {
return retryOptions != null ? retryOptions.toBuilder() : null;
}
@Override
public final Builder retryOptions(RedshiftRetryOptions retryOptions) {
this.retryOptions = retryOptions;
return this;
}
public final void setRetryOptions(RedshiftRetryOptions.BuilderImpl retryOptions) {
this.retryOptions = retryOptions != null ? retryOptions.build() : null;
}
public final S3DestinationConfiguration.Builder getS3Configuration() {
return s3Configuration != null ? s3Configuration.toBuilder() : null;
}
@Override
public final Builder s3Configuration(S3DestinationConfiguration s3Configuration) {
this.s3Configuration = s3Configuration;
return this;
}
public final void setS3Configuration(S3DestinationConfiguration.BuilderImpl s3Configuration) {
this.s3Configuration = s3Configuration != null ? s3Configuration.build() : null;
}
public final ProcessingConfiguration.Builder getProcessingConfiguration() {
return processingConfiguration != null ? processingConfiguration.toBuilder() : null;
}
@Override
public final Builder processingConfiguration(ProcessingConfiguration processingConfiguration) {
this.processingConfiguration = processingConfiguration;
return this;
}
public final void setProcessingConfiguration(ProcessingConfiguration.BuilderImpl processingConfiguration) {
this.processingConfiguration = processingConfiguration != null ? processingConfiguration.build() : null;
}
public final String getS3BackupMode() {
return s3BackupMode;
}
@Override
public final Builder s3BackupMode(String s3BackupMode) {
this.s3BackupMode = s3BackupMode;
return this;
}
@Override
public final Builder s3BackupMode(RedshiftS3BackupMode s3BackupMode) {
this.s3BackupMode(s3BackupMode.toString());
return this;
}
public final void setS3BackupMode(String s3BackupMode) {
this.s3BackupMode = s3BackupMode;
}
public final S3DestinationConfiguration.Builder getS3BackupConfiguration() {
return s3BackupConfiguration != null ? s3BackupConfiguration.toBuilder() : null;
}
@Override
public final Builder s3BackupConfiguration(S3DestinationConfiguration s3BackupConfiguration) {
this.s3BackupConfiguration = s3BackupConfiguration;
return this;
}
public final void setS3BackupConfiguration(S3DestinationConfiguration.BuilderImpl s3BackupConfiguration) {
this.s3BackupConfiguration = s3BackupConfiguration != null ? s3BackupConfiguration.build() : null;
}
public final CloudWatchLoggingOptions.Builder getCloudWatchLoggingOptions() {
return cloudWatchLoggingOptions != null ? cloudWatchLoggingOptions.toBuilder() : null;
}
@Override
public final Builder cloudWatchLoggingOptions(CloudWatchLoggingOptions cloudWatchLoggingOptions) {
this.cloudWatchLoggingOptions = cloudWatchLoggingOptions;
return this;
}
public final void setCloudWatchLoggingOptions(CloudWatchLoggingOptions.BuilderImpl cloudWatchLoggingOptions) {
this.cloudWatchLoggingOptions = cloudWatchLoggingOptions != null ? cloudWatchLoggingOptions.build() : null;
}
@Override
public RedshiftDestinationConfiguration build() {
return new RedshiftDestinationConfiguration(this);
}
}
}