software.amazon.awssdk.services.lookoutmetrics.model.RDSSourceConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lookoutmetrics Show documentation
Show all versions of lookoutmetrics Show documentation
The AWS Java SDK for Lookout Metrics module holds the client classes that are used for
communicating with Lookout Metrics.
/*
* 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.lookoutmetrics.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.Consumer;
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;
/**
*
* Contains information about the Amazon Relational Database Service (RDS) configuration.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RDSSourceConfig implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField DB_INSTANCE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBInstanceIdentifier").getter(getter(RDSSourceConfig::dbInstanceIdentifier))
.setter(setter(Builder::dbInstanceIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBInstanceIdentifier").build())
.build();
private static final SdkField DATABASE_HOST_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DatabaseHost").getter(getter(RDSSourceConfig::databaseHost)).setter(setter(Builder::databaseHost))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseHost").build()).build();
private static final SdkField DATABASE_PORT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("DatabasePort").getter(getter(RDSSourceConfig::databasePort)).setter(setter(Builder::databasePort))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabasePort").build()).build();
private static final SdkField SECRET_MANAGER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SecretManagerArn").getter(getter(RDSSourceConfig::secretManagerArn))
.setter(setter(Builder::secretManagerArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretManagerArn").build()).build();
private static final SdkField DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DatabaseName").getter(getter(RDSSourceConfig::databaseName)).setter(setter(Builder::databaseName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DatabaseName").build()).build();
private static final SdkField TABLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TableName").getter(getter(RDSSourceConfig::tableName)).setter(setter(Builder::tableName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableName").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleArn").getter(getter(RDSSourceConfig::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();
private static final SdkField VPC_CONFIGURATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("VpcConfiguration")
.getter(getter(RDSSourceConfig::vpcConfiguration)).setter(setter(Builder::vpcConfiguration))
.constructor(VpcConfiguration::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfiguration").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DB_INSTANCE_IDENTIFIER_FIELD,
DATABASE_HOST_FIELD, DATABASE_PORT_FIELD, SECRET_MANAGER_ARN_FIELD, DATABASE_NAME_FIELD, TABLE_NAME_FIELD,
ROLE_ARN_FIELD, VPC_CONFIGURATION_FIELD));
private static final long serialVersionUID = 1L;
private final String dbInstanceIdentifier;
private final String databaseHost;
private final Integer databasePort;
private final String secretManagerArn;
private final String databaseName;
private final String tableName;
private final String roleArn;
private final VpcConfiguration vpcConfiguration;
private RDSSourceConfig(BuilderImpl builder) {
this.dbInstanceIdentifier = builder.dbInstanceIdentifier;
this.databaseHost = builder.databaseHost;
this.databasePort = builder.databasePort;
this.secretManagerArn = builder.secretManagerArn;
this.databaseName = builder.databaseName;
this.tableName = builder.tableName;
this.roleArn = builder.roleArn;
this.vpcConfiguration = builder.vpcConfiguration;
}
/**
*
* A string identifying the database instance.
*
*
* @return A string identifying the database instance.
*/
public final String dbInstanceIdentifier() {
return dbInstanceIdentifier;
}
/**
*
* The host name of the database.
*
*
* @return The host name of the database.
*/
public final String databaseHost() {
return databaseHost;
}
/**
*
* The port number where the database can be accessed.
*
*
* @return The port number where the database can be accessed.
*/
public final Integer databasePort() {
return databasePort;
}
/**
*
* The Amazon Resource Name (ARN) of the AWS Secrets Manager role.
*
*
* @return The Amazon Resource Name (ARN) of the AWS Secrets Manager role.
*/
public final String secretManagerArn() {
return secretManagerArn;
}
/**
*
* The name of the RDS database.
*
*
* @return The name of the RDS database.
*/
public final String databaseName() {
return databaseName;
}
/**
*
* The name of the table in the database.
*
*
* @return The name of the table in the database.
*/
public final String tableName() {
return tableName;
}
/**
*
* The Amazon Resource Name (ARN) of the role.
*
*
* @return The Amazon Resource Name (ARN) of the role.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* An object containing information about the Amazon Virtual Private Cloud (VPC) configuration.
*
*
* @return An object containing information about the Amazon Virtual Private Cloud (VPC) configuration.
*/
public final VpcConfiguration vpcConfiguration() {
return vpcConfiguration;
}
@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(dbInstanceIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(databaseHost());
hashCode = 31 * hashCode + Objects.hashCode(databasePort());
hashCode = 31 * hashCode + Objects.hashCode(secretManagerArn());
hashCode = 31 * hashCode + Objects.hashCode(databaseName());
hashCode = 31 * hashCode + Objects.hashCode(tableName());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(vpcConfiguration());
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 RDSSourceConfig)) {
return false;
}
RDSSourceConfig other = (RDSSourceConfig) obj;
return Objects.equals(dbInstanceIdentifier(), other.dbInstanceIdentifier())
&& Objects.equals(databaseHost(), other.databaseHost()) && Objects.equals(databasePort(), other.databasePort())
&& Objects.equals(secretManagerArn(), other.secretManagerArn())
&& Objects.equals(databaseName(), other.databaseName()) && Objects.equals(tableName(), other.tableName())
&& Objects.equals(roleArn(), other.roleArn()) && Objects.equals(vpcConfiguration(), other.vpcConfiguration());
}
/**
* 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("RDSSourceConfig").add("DBInstanceIdentifier", dbInstanceIdentifier())
.add("DatabaseHost", databaseHost()).add("DatabasePort", databasePort())
.add("SecretManagerArn", secretManagerArn()).add("DatabaseName", databaseName()).add("TableName", tableName())
.add("RoleArn", roleArn()).add("VpcConfiguration", vpcConfiguration()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DBInstanceIdentifier":
return Optional.ofNullable(clazz.cast(dbInstanceIdentifier()));
case "DatabaseHost":
return Optional.ofNullable(clazz.cast(databaseHost()));
case "DatabasePort":
return Optional.ofNullable(clazz.cast(databasePort()));
case "SecretManagerArn":
return Optional.ofNullable(clazz.cast(secretManagerArn()));
case "DatabaseName":
return Optional.ofNullable(clazz.cast(databaseName()));
case "TableName":
return Optional.ofNullable(clazz.cast(tableName()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "VpcConfiguration":
return Optional.ofNullable(clazz.cast(vpcConfiguration()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function