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

software.amazon.awssdk.services.lookoutmetrics.model.RDSSourceConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Lookout Metrics module holds the client classes that are used for communicating with Lookout Metrics.

There is a newer version: 2.28.5
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((RDSSourceConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A string identifying the database instance. *

* * @param dbInstanceIdentifier * A string identifying the database instance. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dbInstanceIdentifier(String dbInstanceIdentifier); /** *

* The host name of the database. *

* * @param databaseHost * The host name of the database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder databaseHost(String databaseHost); /** *

* The port number where the database can be accessed. *

* * @param databasePort * The port number where the database can be accessed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder databasePort(Integer databasePort); /** *

* The Amazon Resource Name (ARN) of the AWS Secrets Manager role. *

* * @param secretManagerArn * The Amazon Resource Name (ARN) of the AWS Secrets Manager role. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secretManagerArn(String secretManagerArn); /** *

* The name of the RDS database. *

* * @param databaseName * The name of the RDS database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder databaseName(String databaseName); /** *

* The name of the table in the database. *

* * @param tableName * The name of the table in the database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tableName(String tableName); /** *

* The Amazon Resource Name (ARN) of the role. *

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

* An object containing information about the Amazon Virtual Private Cloud (VPC) configuration. *

* * @param vpcConfiguration * An object containing information about the Amazon Virtual Private Cloud (VPC) configuration. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcConfiguration(VpcConfiguration vpcConfiguration); /** *

* An object containing information about the Amazon Virtual Private Cloud (VPC) configuration. *

* This is a convenience method that creates an instance of the {@link VpcConfiguration.Builder} avoiding the * need to create one manually via {@link VpcConfiguration#builder()}. * *

* When the {@link Consumer} completes, {@link VpcConfiguration.Builder#build()} is called immediately and its * result is passed to {@link #vpcConfiguration(VpcConfiguration)}. * * @param vpcConfiguration * a consumer that will call methods on {@link VpcConfiguration.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #vpcConfiguration(VpcConfiguration) */ default Builder vpcConfiguration(Consumer vpcConfiguration) { return vpcConfiguration(VpcConfiguration.builder().applyMutation(vpcConfiguration).build()); } } static final class BuilderImpl implements Builder { private String dbInstanceIdentifier; private String databaseHost; private Integer databasePort; private String secretManagerArn; private String databaseName; private String tableName; private String roleArn; private VpcConfiguration vpcConfiguration; private BuilderImpl() { } private BuilderImpl(RDSSourceConfig model) { dbInstanceIdentifier(model.dbInstanceIdentifier); databaseHost(model.databaseHost); databasePort(model.databasePort); secretManagerArn(model.secretManagerArn); databaseName(model.databaseName); tableName(model.tableName); roleArn(model.roleArn); vpcConfiguration(model.vpcConfiguration); } public final String getDbInstanceIdentifier() { return dbInstanceIdentifier; } public final void setDbInstanceIdentifier(String dbInstanceIdentifier) { this.dbInstanceIdentifier = dbInstanceIdentifier; } @Override public final Builder dbInstanceIdentifier(String dbInstanceIdentifier) { this.dbInstanceIdentifier = dbInstanceIdentifier; return this; } public final String getDatabaseHost() { return databaseHost; } public final void setDatabaseHost(String databaseHost) { this.databaseHost = databaseHost; } @Override public final Builder databaseHost(String databaseHost) { this.databaseHost = databaseHost; return this; } public final Integer getDatabasePort() { return databasePort; } public final void setDatabasePort(Integer databasePort) { this.databasePort = databasePort; } @Override public final Builder databasePort(Integer databasePort) { this.databasePort = databasePort; return this; } public final String getSecretManagerArn() { return secretManagerArn; } public final void setSecretManagerArn(String secretManagerArn) { this.secretManagerArn = secretManagerArn; } @Override public final Builder secretManagerArn(String secretManagerArn) { this.secretManagerArn = secretManagerArn; return this; } public final String getDatabaseName() { return databaseName; } public final void setDatabaseName(String databaseName) { this.databaseName = databaseName; } @Override public final Builder databaseName(String databaseName) { this.databaseName = databaseName; return this; } public final String getTableName() { return tableName; } public final void setTableName(String tableName) { this.tableName = tableName; } @Override public final Builder tableName(String tableName) { this.tableName = tableName; return this; } public final String getRoleArn() { return roleArn; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final VpcConfiguration.Builder getVpcConfiguration() { return vpcConfiguration != null ? vpcConfiguration.toBuilder() : null; } public final void setVpcConfiguration(VpcConfiguration.BuilderImpl vpcConfiguration) { this.vpcConfiguration = vpcConfiguration != null ? vpcConfiguration.build() : null; } @Override public final Builder vpcConfiguration(VpcConfiguration vpcConfiguration) { this.vpcConfiguration = vpcConfiguration; return this; } @Override public RDSSourceConfig build() { return new RDSSourceConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy