software.amazon.awssdk.services.opsworks.model.RdsDbInstance Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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.opsworks.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;
/**
*
* Describes an Amazon RDS instance.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class RdsDbInstance implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField RDS_DB_INSTANCE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::rdsDbInstanceArn)).setter(setter(Builder::rdsDbInstanceArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RdsDbInstanceArn").build()).build();
private static final SdkField DB_INSTANCE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::dbInstanceIdentifier)).setter(setter(Builder::dbInstanceIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DbInstanceIdentifier").build())
.build();
private static final SdkField DB_USER_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::dbUser)).setter(setter(Builder::dbUser))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DbUser").build()).build();
private static final SdkField DB_PASSWORD_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::dbPassword)).setter(setter(Builder::dbPassword))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DbPassword").build()).build();
private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::region)).setter(setter(Builder::region))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build();
private static final SdkField ADDRESS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::address)).setter(setter(Builder::address))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Address").build()).build();
private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::engine)).setter(setter(Builder::engine))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();
private static final SdkField STACK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(RdsDbInstance::stackId)).setter(setter(Builder::stackId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackId").build()).build();
private static final SdkField MISSING_ON_RDS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.getter(getter(RdsDbInstance::missingOnRds)).setter(setter(Builder::missingOnRds))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MissingOnRds").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RDS_DB_INSTANCE_ARN_FIELD,
DB_INSTANCE_IDENTIFIER_FIELD, DB_USER_FIELD, DB_PASSWORD_FIELD, REGION_FIELD, ADDRESS_FIELD, ENGINE_FIELD,
STACK_ID_FIELD, MISSING_ON_RDS_FIELD));
private static final long serialVersionUID = 1L;
private final String rdsDbInstanceArn;
private final String dbInstanceIdentifier;
private final String dbUser;
private final String dbPassword;
private final String region;
private final String address;
private final String engine;
private final String stackId;
private final Boolean missingOnRds;
private RdsDbInstance(BuilderImpl builder) {
this.rdsDbInstanceArn = builder.rdsDbInstanceArn;
this.dbInstanceIdentifier = builder.dbInstanceIdentifier;
this.dbUser = builder.dbUser;
this.dbPassword = builder.dbPassword;
this.region = builder.region;
this.address = builder.address;
this.engine = builder.engine;
this.stackId = builder.stackId;
this.missingOnRds = builder.missingOnRds;
}
/**
*
* The instance's ARN.
*
*
* @return The instance's ARN.
*/
public String rdsDbInstanceArn() {
return rdsDbInstanceArn;
}
/**
*
* The DB instance identifier.
*
*
* @return The DB instance identifier.
*/
public String dbInstanceIdentifier() {
return dbInstanceIdentifier;
}
/**
*
* The master user name.
*
*
* @return The master user name.
*/
public String dbUser() {
return dbUser;
}
/**
*
* AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*
*
* @return AWS OpsWorks Stacks returns *****FILTERED*****
instead of the actual value.
*/
public String dbPassword() {
return dbPassword;
}
/**
*
* The instance's AWS region.
*
*
* @return The instance's AWS region.
*/
public String region() {
return region;
}
/**
*
* The instance's address.
*
*
* @return The instance's address.
*/
public String address() {
return address;
}
/**
*
* The instance's database engine.
*
*
* @return The instance's database engine.
*/
public String engine() {
return engine;
}
/**
*
* The ID of the stack with which the instance is registered.
*
*
* @return The ID of the stack with which the instance is registered.
*/
public String stackId() {
return stackId;
}
/**
*
* Set to true
if AWS OpsWorks Stacks is unable to discover the Amazon RDS instance. AWS OpsWorks
* Stacks attempts to discover the instance only once. If this value is set to true
, you must
* deregister the instance, and then register it again.
*
*
* @return Set to true
if AWS OpsWorks Stacks is unable to discover the Amazon RDS instance. AWS
* OpsWorks Stacks attempts to discover the instance only once. If this value is set to true
,
* you must deregister the instance, and then register it again.
*/
public Boolean missingOnRds() {
return missingOnRds;
}
@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(rdsDbInstanceArn());
hashCode = 31 * hashCode + Objects.hashCode(dbInstanceIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(dbUser());
hashCode = 31 * hashCode + Objects.hashCode(dbPassword());
hashCode = 31 * hashCode + Objects.hashCode(region());
hashCode = 31 * hashCode + Objects.hashCode(address());
hashCode = 31 * hashCode + Objects.hashCode(engine());
hashCode = 31 * hashCode + Objects.hashCode(stackId());
hashCode = 31 * hashCode + Objects.hashCode(missingOnRds());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RdsDbInstance)) {
return false;
}
RdsDbInstance other = (RdsDbInstance) obj;
return Objects.equals(rdsDbInstanceArn(), other.rdsDbInstanceArn())
&& Objects.equals(dbInstanceIdentifier(), other.dbInstanceIdentifier())
&& Objects.equals(dbUser(), other.dbUser()) && Objects.equals(dbPassword(), other.dbPassword())
&& Objects.equals(region(), other.region()) && Objects.equals(address(), other.address())
&& Objects.equals(engine(), other.engine()) && Objects.equals(stackId(), other.stackId())
&& Objects.equals(missingOnRds(), other.missingOnRds());
}
/**
* 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 String toString() {
return ToString.builder("RdsDbInstance").add("RdsDbInstanceArn", rdsDbInstanceArn())
.add("DbInstanceIdentifier", dbInstanceIdentifier()).add("DbUser", dbUser()).add("DbPassword", dbPassword())
.add("Region", region()).add("Address", address()).add("Engine", engine()).add("StackId", stackId())
.add("MissingOnRds", missingOnRds()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "RdsDbInstanceArn":
return Optional.ofNullable(clazz.cast(rdsDbInstanceArn()));
case "DbInstanceIdentifier":
return Optional.ofNullable(clazz.cast(dbInstanceIdentifier()));
case "DbUser":
return Optional.ofNullable(clazz.cast(dbUser()));
case "DbPassword":
return Optional.ofNullable(clazz.cast(dbPassword()));
case "Region":
return Optional.ofNullable(clazz.cast(region()));
case "Address":
return Optional.ofNullable(clazz.cast(address()));
case "Engine":
return Optional.ofNullable(clazz.cast(engine()));
case "StackId":
return Optional.ofNullable(clazz.cast(stackId()));
case "MissingOnRds":
return Optional.ofNullable(clazz.cast(missingOnRds()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function
© 2015 - 2025 Weber Informatics LLC | Privacy Policy