software.amazon.awssdk.services.appflow.model.RedshiftConnectorProfileProperties Maven / Gradle / Ivy
Show all versions of appflow Show documentation
/*
* 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.appflow.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;
/**
*
* The connector-specific profile properties when using Amazon Redshift.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RedshiftConnectorProfileProperties implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DATABASE_URL_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("databaseUrl").getter(getter(RedshiftConnectorProfileProperties::databaseUrl))
.setter(setter(Builder::databaseUrl))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("databaseUrl").build()).build();
private static final SdkField BUCKET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("bucketName").getter(getter(RedshiftConnectorProfileProperties::bucketName))
.setter(setter(Builder::bucketName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("bucketName").build()).build();
private static final SdkField BUCKET_PREFIX_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("bucketPrefix").getter(getter(RedshiftConnectorProfileProperties::bucketPrefix))
.setter(setter(Builder::bucketPrefix))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("bucketPrefix").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("roleArn").getter(getter(RedshiftConnectorProfileProperties::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build();
private static final SdkField DATA_API_ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("dataApiRoleArn").getter(getter(RedshiftConnectorProfileProperties::dataApiRoleArn))
.setter(setter(Builder::dataApiRoleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("dataApiRoleArn").build()).build();
private static final SdkField IS_REDSHIFT_SERVERLESS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("isRedshiftServerless").getter(getter(RedshiftConnectorProfileProperties::isRedshiftServerless))
.setter(setter(Builder::isRedshiftServerless))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("isRedshiftServerless").build())
.build();
private static final SdkField CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("clusterIdentifier").getter(getter(RedshiftConnectorProfileProperties::clusterIdentifier))
.setter(setter(Builder::clusterIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("clusterIdentifier").build()).build();
private static final SdkField WORKGROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("workgroupName").getter(getter(RedshiftConnectorProfileProperties::workgroupName))
.setter(setter(Builder::workgroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("workgroupName").build()).build();
private static final SdkField DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("databaseName").getter(getter(RedshiftConnectorProfileProperties::databaseName))
.setter(setter(Builder::databaseName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("databaseName").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DATABASE_URL_FIELD,
BUCKET_NAME_FIELD, BUCKET_PREFIX_FIELD, ROLE_ARN_FIELD, DATA_API_ROLE_ARN_FIELD, IS_REDSHIFT_SERVERLESS_FIELD,
CLUSTER_IDENTIFIER_FIELD, WORKGROUP_NAME_FIELD, DATABASE_NAME_FIELD));
private static final long serialVersionUID = 1L;
private final String databaseUrl;
private final String bucketName;
private final String bucketPrefix;
private final String roleArn;
private final String dataApiRoleArn;
private final Boolean isRedshiftServerless;
private final String clusterIdentifier;
private final String workgroupName;
private final String databaseName;
private RedshiftConnectorProfileProperties(BuilderImpl builder) {
this.databaseUrl = builder.databaseUrl;
this.bucketName = builder.bucketName;
this.bucketPrefix = builder.bucketPrefix;
this.roleArn = builder.roleArn;
this.dataApiRoleArn = builder.dataApiRoleArn;
this.isRedshiftServerless = builder.isRedshiftServerless;
this.clusterIdentifier = builder.clusterIdentifier;
this.workgroupName = builder.workgroupName;
this.databaseName = builder.databaseName;
}
/**
*
* The JDBC URL of the Amazon Redshift cluster.
*
*
* @return The JDBC URL of the Amazon Redshift cluster.
*/
public final String databaseUrl() {
return databaseUrl;
}
/**
*
* A name for the associated Amazon S3 bucket.
*
*
* @return A name for the associated Amazon S3 bucket.
*/
public final String bucketName() {
return bucketName;
}
/**
*
* The object key for the destination bucket in which Amazon AppFlow places the files.
*
*
* @return The object key for the destination bucket in which Amazon AppFlow places the files.
*/
public final String bucketPrefix() {
return bucketPrefix;
}
/**
*
* The Amazon Resource Name (ARN) of IAM role that grants Amazon Redshift read-only access to Amazon S3. For more
* information, and for the polices that you attach to this role, see Allow Amazon Redshift to access your Amazon AppFlow data in Amazon S3.
*
*
* @return The Amazon Resource Name (ARN) of IAM role that grants Amazon Redshift read-only access to Amazon S3. For
* more information, and for the polices that you attach to this role, see Allow Amazon Redshift to access your Amazon AppFlow data in Amazon S3.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* The Amazon Resource Name (ARN) of an IAM role that permits Amazon AppFlow to access your Amazon Redshift database
* through the Data API. For more information, and for the polices that you attach to this role, see Allow Amazon AppFlow to access Amazon Redshift databases with the Data API.
*
*
* @return The Amazon Resource Name (ARN) of an IAM role that permits Amazon AppFlow to access your Amazon Redshift
* database through the Data API. For more information, and for the polices that you attach to this role,
* see Allow Amazon AppFlow to access Amazon Redshift databases with the Data API.
*/
public final String dataApiRoleArn() {
return dataApiRoleArn;
}
/**
*
* Indicates whether the connector profile defines a connection to an Amazon Redshift Serverless data warehouse.
*
*
* @return Indicates whether the connector profile defines a connection to an Amazon Redshift Serverless data
* warehouse.
*/
public final Boolean isRedshiftServerless() {
return isRedshiftServerless;
}
/**
*
* The unique ID that's assigned to an Amazon Redshift cluster.
*
*
* @return The unique ID that's assigned to an Amazon Redshift cluster.
*/
public final String clusterIdentifier() {
return clusterIdentifier;
}
/**
*
* The name of an Amazon Redshift workgroup.
*
*
* @return The name of an Amazon Redshift workgroup.
*/
public final String workgroupName() {
return workgroupName;
}
/**
*
* The name of an Amazon Redshift database.
*
*
* @return The name of an Amazon Redshift database.
*/
public final String databaseName() {
return databaseName;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(databaseUrl());
hashCode = 31 * hashCode + Objects.hashCode(bucketName());
hashCode = 31 * hashCode + Objects.hashCode(bucketPrefix());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(dataApiRoleArn());
hashCode = 31 * hashCode + Objects.hashCode(isRedshiftServerless());
hashCode = 31 * hashCode + Objects.hashCode(clusterIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(workgroupName());
hashCode = 31 * hashCode + Objects.hashCode(databaseName());
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 RedshiftConnectorProfileProperties)) {
return false;
}
RedshiftConnectorProfileProperties other = (RedshiftConnectorProfileProperties) obj;
return Objects.equals(databaseUrl(), other.databaseUrl()) && Objects.equals(bucketName(), other.bucketName())
&& Objects.equals(bucketPrefix(), other.bucketPrefix()) && Objects.equals(roleArn(), other.roleArn())
&& Objects.equals(dataApiRoleArn(), other.dataApiRoleArn())
&& Objects.equals(isRedshiftServerless(), other.isRedshiftServerless())
&& Objects.equals(clusterIdentifier(), other.clusterIdentifier())
&& Objects.equals(workgroupName(), other.workgroupName()) && Objects.equals(databaseName(), other.databaseName());
}
/**
* 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("RedshiftConnectorProfileProperties").add("DatabaseUrl", databaseUrl())
.add("BucketName", bucketName()).add("BucketPrefix", bucketPrefix()).add("RoleArn", roleArn())
.add("DataApiRoleArn", dataApiRoleArn()).add("IsRedshiftServerless", isRedshiftServerless())
.add("ClusterIdentifier", clusterIdentifier()).add("WorkgroupName", workgroupName())
.add("DatabaseName", databaseName()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "databaseUrl":
return Optional.ofNullable(clazz.cast(databaseUrl()));
case "bucketName":
return Optional.ofNullable(clazz.cast(bucketName()));
case "bucketPrefix":
return Optional.ofNullable(clazz.cast(bucketPrefix()));
case "roleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "dataApiRoleArn":
return Optional.ofNullable(clazz.cast(dataApiRoleArn()));
case "isRedshiftServerless":
return Optional.ofNullable(clazz.cast(isRedshiftServerless()));
case "clusterIdentifier":
return Optional.ofNullable(clazz.cast(clusterIdentifier()));
case "workgroupName":
return Optional.ofNullable(clazz.cast(workgroupName()));
case "databaseName":
return Optional.ofNullable(clazz.cast(databaseName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function