software.amazon.awssdk.services.rds.model.UpgradeTarget Maven / Gradle / Ivy
Show all versions of rds 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.rds.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The version of the database engine that a DB instance can be upgraded to.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class UpgradeTarget implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine")
.getter(getter(UpgradeTarget::engine)).setter(setter(Builder::engine))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Engine").build()).build();
private static final SdkField ENGINE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EngineVersion").getter(getter(UpgradeTarget::engineVersion)).setter(setter(Builder::engineVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(UpgradeTarget::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField AUTO_UPGRADE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("AutoUpgrade").getter(getter(UpgradeTarget::autoUpgrade)).setter(setter(Builder::autoUpgrade))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AutoUpgrade").build()).build();
private static final SdkField IS_MAJOR_VERSION_UPGRADE_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("IsMajorVersionUpgrade").getter(getter(UpgradeTarget::isMajorVersionUpgrade))
.setter(setter(Builder::isMajorVersionUpgrade))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsMajorVersionUpgrade").build())
.build();
private static final SdkField> SUPPORTED_ENGINE_MODES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("SupportedEngineModes")
.getter(getter(UpgradeTarget::supportedEngineModes))
.setter(setter(Builder::supportedEngineModes))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportedEngineModes").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField SUPPORTS_PARALLEL_QUERY_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SupportsParallelQuery").getter(getter(UpgradeTarget::supportsParallelQuery))
.setter(setter(Builder::supportsParallelQuery))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsParallelQuery").build())
.build();
private static final SdkField SUPPORTS_GLOBAL_DATABASES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SupportsGlobalDatabases").getter(getter(UpgradeTarget::supportsGlobalDatabases))
.setter(setter(Builder::supportsGlobalDatabases))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsGlobalDatabases").build())
.build();
private static final SdkField SUPPORTS_BABELFISH_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SupportsBabelfish").getter(getter(UpgradeTarget::supportsBabelfish))
.setter(setter(Builder::supportsBabelfish))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsBabelfish").build()).build();
private static final SdkField SUPPORTS_LIMITLESS_DATABASE_FIELD = SdkField
. builder(MarshallingType.BOOLEAN).memberName("SupportsLimitlessDatabase")
.getter(getter(UpgradeTarget::supportsLimitlessDatabase)).setter(setter(Builder::supportsLimitlessDatabase))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsLimitlessDatabase").build())
.build();
private static final SdkField SUPPORTS_LOCAL_WRITE_FORWARDING_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("SupportsLocalWriteForwarding")
.getter(getter(UpgradeTarget::supportsLocalWriteForwarding))
.setter(setter(Builder::supportsLocalWriteForwarding))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsLocalWriteForwarding")
.build()).build();
private static final SdkField SUPPORTS_INTEGRATIONS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("SupportsIntegrations").getter(getter(UpgradeTarget::supportsIntegrations))
.setter(setter(Builder::supportsIntegrations))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SupportsIntegrations").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ENGINE_FIELD,
ENGINE_VERSION_FIELD, DESCRIPTION_FIELD, AUTO_UPGRADE_FIELD, IS_MAJOR_VERSION_UPGRADE_FIELD,
SUPPORTED_ENGINE_MODES_FIELD, SUPPORTS_PARALLEL_QUERY_FIELD, SUPPORTS_GLOBAL_DATABASES_FIELD,
SUPPORTS_BABELFISH_FIELD, SUPPORTS_LIMITLESS_DATABASE_FIELD, SUPPORTS_LOCAL_WRITE_FORWARDING_FIELD,
SUPPORTS_INTEGRATIONS_FIELD));
private static final long serialVersionUID = 1L;
private final String engine;
private final String engineVersion;
private final String description;
private final Boolean autoUpgrade;
private final Boolean isMajorVersionUpgrade;
private final List supportedEngineModes;
private final Boolean supportsParallelQuery;
private final Boolean supportsGlobalDatabases;
private final Boolean supportsBabelfish;
private final Boolean supportsLimitlessDatabase;
private final Boolean supportsLocalWriteForwarding;
private final Boolean supportsIntegrations;
private UpgradeTarget(BuilderImpl builder) {
this.engine = builder.engine;
this.engineVersion = builder.engineVersion;
this.description = builder.description;
this.autoUpgrade = builder.autoUpgrade;
this.isMajorVersionUpgrade = builder.isMajorVersionUpgrade;
this.supportedEngineModes = builder.supportedEngineModes;
this.supportsParallelQuery = builder.supportsParallelQuery;
this.supportsGlobalDatabases = builder.supportsGlobalDatabases;
this.supportsBabelfish = builder.supportsBabelfish;
this.supportsLimitlessDatabase = builder.supportsLimitlessDatabase;
this.supportsLocalWriteForwarding = builder.supportsLocalWriteForwarding;
this.supportsIntegrations = builder.supportsIntegrations;
}
/**
*
* The name of the upgrade target database engine.
*
*
* @return The name of the upgrade target database engine.
*/
public final String engine() {
return engine;
}
/**
*
* The version number of the upgrade target database engine.
*
*
* @return The version number of the upgrade target database engine.
*/
public final String engineVersion() {
return engineVersion;
}
/**
*
* The version of the database engine that a DB instance can be upgraded to.
*
*
* @return The version of the database engine that a DB instance can be upgraded to.
*/
public final String description() {
return description;
}
/**
*
* Indicates whether the target version is applied to any source DB instances that have
* AutoMinorVersionUpgrade
set to true.
*
*
* This parameter is dynamic, and is set by RDS.
*
*
* @return Indicates whether the target version is applied to any source DB instances that have
* AutoMinorVersionUpgrade
set to true.
*
* This parameter is dynamic, and is set by RDS.
*/
public final Boolean autoUpgrade() {
return autoUpgrade;
}
/**
*
* Indicates whether upgrading to the target version requires upgrading the major version of the database engine.
*
*
* @return Indicates whether upgrading to the target version requires upgrading the major version of the database
* engine.
*/
public final Boolean isMajorVersionUpgrade() {
return isMajorVersionUpgrade;
}
/**
* For responses, this returns true if the service returned a value for the SupportedEngineModes property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasSupportedEngineModes() {
return supportedEngineModes != null && !(supportedEngineModes instanceof SdkAutoConstructList);
}
/**
*
* A list of the supported DB engine modes for the target engine version.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSupportedEngineModes} method.
*
*
* @return A list of the supported DB engine modes for the target engine version.
*/
public final List supportedEngineModes() {
return supportedEngineModes;
}
/**
*
* Indicates whether you can use Aurora parallel query with the target engine version.
*
*
* @return Indicates whether you can use Aurora parallel query with the target engine version.
*/
public final Boolean supportsParallelQuery() {
return supportsParallelQuery;
}
/**
*
* Indicates whether you can use Aurora global databases with the target engine version.
*
*
* @return Indicates whether you can use Aurora global databases with the target engine version.
*/
public final Boolean supportsGlobalDatabases() {
return supportsGlobalDatabases;
}
/**
*
* Indicates whether you can use Babelfish for Aurora PostgreSQL with the target engine version.
*
*
* @return Indicates whether you can use Babelfish for Aurora PostgreSQL with the target engine version.
*/
public final Boolean supportsBabelfish() {
return supportsBabelfish;
}
/**
*
* Indicates whether the DB engine version supports Aurora Limitless Database.
*
*
* @return Indicates whether the DB engine version supports Aurora Limitless Database.
*/
public final Boolean supportsLimitlessDatabase() {
return supportsLimitlessDatabase;
}
/**
*
* Indicates whether the target engine version supports forwarding write operations from reader DB instances to the
* writer DB instance in the DB cluster. By default, write operations aren't allowed on reader DB instances.
*
*
* Valid for: Aurora DB clusters only
*
*
* @return Indicates whether the target engine version supports forwarding write operations from reader DB instances
* to the writer DB instance in the DB cluster. By default, write operations aren't allowed on reader DB
* instances.
*
* Valid for: Aurora DB clusters only
*/
public final Boolean supportsLocalWriteForwarding() {
return supportsLocalWriteForwarding;
}
/**
*
* Indicates whether the DB engine version supports zero-ETL integrations with Amazon Redshift.
*
*
* @return Indicates whether the DB engine version supports zero-ETL integrations with Amazon Redshift.
*/
public final Boolean supportsIntegrations() {
return supportsIntegrations;
}
@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(engine());
hashCode = 31 * hashCode + Objects.hashCode(engineVersion());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(autoUpgrade());
hashCode = 31 * hashCode + Objects.hashCode(isMajorVersionUpgrade());
hashCode = 31 * hashCode + Objects.hashCode(hasSupportedEngineModes() ? supportedEngineModes() : null);
hashCode = 31 * hashCode + Objects.hashCode(supportsParallelQuery());
hashCode = 31 * hashCode + Objects.hashCode(supportsGlobalDatabases());
hashCode = 31 * hashCode + Objects.hashCode(supportsBabelfish());
hashCode = 31 * hashCode + Objects.hashCode(supportsLimitlessDatabase());
hashCode = 31 * hashCode + Objects.hashCode(supportsLocalWriteForwarding());
hashCode = 31 * hashCode + Objects.hashCode(supportsIntegrations());
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 UpgradeTarget)) {
return false;
}
UpgradeTarget other = (UpgradeTarget) obj;
return Objects.equals(engine(), other.engine()) && Objects.equals(engineVersion(), other.engineVersion())
&& Objects.equals(description(), other.description()) && Objects.equals(autoUpgrade(), other.autoUpgrade())
&& Objects.equals(isMajorVersionUpgrade(), other.isMajorVersionUpgrade())
&& hasSupportedEngineModes() == other.hasSupportedEngineModes()
&& Objects.equals(supportedEngineModes(), other.supportedEngineModes())
&& Objects.equals(supportsParallelQuery(), other.supportsParallelQuery())
&& Objects.equals(supportsGlobalDatabases(), other.supportsGlobalDatabases())
&& Objects.equals(supportsBabelfish(), other.supportsBabelfish())
&& Objects.equals(supportsLimitlessDatabase(), other.supportsLimitlessDatabase())
&& Objects.equals(supportsLocalWriteForwarding(), other.supportsLocalWriteForwarding())
&& Objects.equals(supportsIntegrations(), other.supportsIntegrations());
}
/**
* 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("UpgradeTarget").add("Engine", engine()).add("EngineVersion", engineVersion())
.add("Description", description()).add("AutoUpgrade", autoUpgrade())
.add("IsMajorVersionUpgrade", isMajorVersionUpgrade())
.add("SupportedEngineModes", hasSupportedEngineModes() ? supportedEngineModes() : null)
.add("SupportsParallelQuery", supportsParallelQuery()).add("SupportsGlobalDatabases", supportsGlobalDatabases())
.add("SupportsBabelfish", supportsBabelfish()).add("SupportsLimitlessDatabase", supportsLimitlessDatabase())
.add("SupportsLocalWriteForwarding", supportsLocalWriteForwarding())
.add("SupportsIntegrations", supportsIntegrations()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Engine":
return Optional.ofNullable(clazz.cast(engine()));
case "EngineVersion":
return Optional.ofNullable(clazz.cast(engineVersion()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "AutoUpgrade":
return Optional.ofNullable(clazz.cast(autoUpgrade()));
case "IsMajorVersionUpgrade":
return Optional.ofNullable(clazz.cast(isMajorVersionUpgrade()));
case "SupportedEngineModes":
return Optional.ofNullable(clazz.cast(supportedEngineModes()));
case "SupportsParallelQuery":
return Optional.ofNullable(clazz.cast(supportsParallelQuery()));
case "SupportsGlobalDatabases":
return Optional.ofNullable(clazz.cast(supportsGlobalDatabases()));
case "SupportsBabelfish":
return Optional.ofNullable(clazz.cast(supportsBabelfish()));
case "SupportsLimitlessDatabase":
return Optional.ofNullable(clazz.cast(supportsLimitlessDatabase()));
case "SupportsLocalWriteForwarding":
return Optional.ofNullable(clazz.cast(supportsLocalWriteForwarding()));
case "SupportsIntegrations":
return Optional.ofNullable(clazz.cast(supportsIntegrations()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function