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

software.amazon.awssdk.services.opsworks.model.RdsDbInstance Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS OpsWorks module holds the client classes that are used for communicating with AWS OpsWorks Service

There is a newer version: 2.28.4
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.opsworks.model;

import java.beans.Transient;
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) .memberName("RdsDbInstanceArn").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) .memberName("DbInstanceIdentifier").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).memberName("DbUser") .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) .memberName("DbPassword").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).memberName("Region") .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).memberName("Address") .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).memberName("Engine") .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) .memberName("StackId").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) .memberName("MissingOnRds").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 final String rdsDbInstanceArn() { return rdsDbInstanceArn; } /** *

* The DB instance identifier. *

* * @return The DB instance identifier. */ public final String dbInstanceIdentifier() { return dbInstanceIdentifier; } /** *

* The master user name. *

* * @return The master user name. */ public final 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 final String dbPassword() { return dbPassword; } /** *

* The instance's AWS region. *

* * @return The instance's AWS region. */ public final String region() { return region; } /** *

* The instance's address. *

* * @return The instance's address. */ public final String address() { return address; } /** *

* The instance's database engine. *

* * @return The instance's database engine. */ public final 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 final 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 final Boolean missingOnRds() { return missingOnRds; } @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(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 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 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 final 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 final 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 final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RdsDbInstance) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The instance's ARN. *

* * @param rdsDbInstanceArn * The instance's ARN. * @return Returns a reference to this object so that method calls can be chained together. */ Builder rdsDbInstanceArn(String rdsDbInstanceArn); /** *

* The DB instance identifier. *

* * @param dbInstanceIdentifier * The DB instance identifier. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dbInstanceIdentifier(String dbInstanceIdentifier); /** *

* The master user name. *

* * @param dbUser * The master user name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dbUser(String dbUser); /** *

* AWS OpsWorks Stacks returns *****FILTERED***** instead of the actual value. *

* * @param dbPassword * AWS OpsWorks Stacks returns *****FILTERED***** instead of the actual value. * @return Returns a reference to this object so that method calls can be chained together. */ Builder dbPassword(String dbPassword); /** *

* The instance's AWS region. *

* * @param region * The instance's AWS region. * @return Returns a reference to this object so that method calls can be chained together. */ Builder region(String region); /** *

* The instance's address. *

* * @param address * The instance's address. * @return Returns a reference to this object so that method calls can be chained together. */ Builder address(String address); /** *

* The instance's database engine. *

* * @param engine * The instance's database engine. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engine(String engine); /** *

* The ID of the stack with which the instance is registered. *

* * @param stackId * The ID of the stack with which the instance is registered. * @return Returns a reference to this object so that method calls can be chained together. */ Builder stackId(String 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. *

* * @param missingOnRds * 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 Returns a reference to this object so that method calls can be chained together. */ Builder missingOnRds(Boolean missingOnRds); } static final class BuilderImpl implements Builder { private String rdsDbInstanceArn; private String dbInstanceIdentifier; private String dbUser; private String dbPassword; private String region; private String address; private String engine; private String stackId; private Boolean missingOnRds; private BuilderImpl() { } private BuilderImpl(RdsDbInstance model) { rdsDbInstanceArn(model.rdsDbInstanceArn); dbInstanceIdentifier(model.dbInstanceIdentifier); dbUser(model.dbUser); dbPassword(model.dbPassword); region(model.region); address(model.address); engine(model.engine); stackId(model.stackId); missingOnRds(model.missingOnRds); } public final String getRdsDbInstanceArn() { return rdsDbInstanceArn; } public final void setRdsDbInstanceArn(String rdsDbInstanceArn) { this.rdsDbInstanceArn = rdsDbInstanceArn; } @Override @Transient public final Builder rdsDbInstanceArn(String rdsDbInstanceArn) { this.rdsDbInstanceArn = rdsDbInstanceArn; return this; } public final String getDbInstanceIdentifier() { return dbInstanceIdentifier; } public final void setDbInstanceIdentifier(String dbInstanceIdentifier) { this.dbInstanceIdentifier = dbInstanceIdentifier; } @Override @Transient public final Builder dbInstanceIdentifier(String dbInstanceIdentifier) { this.dbInstanceIdentifier = dbInstanceIdentifier; return this; } public final String getDbUser() { return dbUser; } public final void setDbUser(String dbUser) { this.dbUser = dbUser; } @Override @Transient public final Builder dbUser(String dbUser) { this.dbUser = dbUser; return this; } public final String getDbPassword() { return dbPassword; } public final void setDbPassword(String dbPassword) { this.dbPassword = dbPassword; } @Override @Transient public final Builder dbPassword(String dbPassword) { this.dbPassword = dbPassword; return this; } public final String getRegion() { return region; } public final void setRegion(String region) { this.region = region; } @Override @Transient public final Builder region(String region) { this.region = region; return this; } public final String getAddress() { return address; } public final void setAddress(String address) { this.address = address; } @Override @Transient public final Builder address(String address) { this.address = address; return this; } public final String getEngine() { return engine; } public final void setEngine(String engine) { this.engine = engine; } @Override @Transient public final Builder engine(String engine) { this.engine = engine; return this; } public final String getStackId() { return stackId; } public final void setStackId(String stackId) { this.stackId = stackId; } @Override @Transient public final Builder stackId(String stackId) { this.stackId = stackId; return this; } public final Boolean getMissingOnRds() { return missingOnRds; } public final void setMissingOnRds(Boolean missingOnRds) { this.missingOnRds = missingOnRds; } @Override @Transient public final Builder missingOnRds(Boolean missingOnRds) { this.missingOnRds = missingOnRds; return this; } @Override public RdsDbInstance build() { return new RdsDbInstance(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy