software.amazon.awssdk.services.rds.model.DBSnapshotTenantDatabase 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.time.Instant;
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.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
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;
/**
*
* Contains the details of a tenant database in a snapshot of a DB instance.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class DBSnapshotTenantDatabase implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DB_SNAPSHOT_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBSnapshotIdentifier").getter(getter(DBSnapshotTenantDatabase::dbSnapshotIdentifier))
.setter(setter(Builder::dbSnapshotIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBSnapshotIdentifier").build())
.build();
private static final SdkField DB_INSTANCE_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DBInstanceIdentifier").getter(getter(DBSnapshotTenantDatabase::dbInstanceIdentifier))
.setter(setter(Builder::dbInstanceIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBInstanceIdentifier").build())
.build();
private static final SdkField DBI_RESOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DbiResourceId").getter(getter(DBSnapshotTenantDatabase::dbiResourceId))
.setter(setter(Builder::dbiResourceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DbiResourceId").build()).build();
private static final SdkField ENGINE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EngineName").getter(getter(DBSnapshotTenantDatabase::engineName)).setter(setter(Builder::engineName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineName").build()).build();
private static final SdkField SNAPSHOT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SnapshotType").getter(getter(DBSnapshotTenantDatabase::snapshotType))
.setter(setter(Builder::snapshotType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotType").build()).build();
private static final SdkField TENANT_DATABASE_CREATE_TIME_FIELD = SdkField
. builder(MarshallingType.INSTANT).memberName("TenantDatabaseCreateTime")
.getter(getter(DBSnapshotTenantDatabase::tenantDatabaseCreateTime)).setter(setter(Builder::tenantDatabaseCreateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TenantDatabaseCreateTime").build())
.build();
private static final SdkField TENANT_DB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TenantDBName").getter(getter(DBSnapshotTenantDatabase::tenantDBName))
.setter(setter(Builder::tenantDBName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TenantDBName").build()).build();
private static final SdkField MASTER_USERNAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("MasterUsername").getter(getter(DBSnapshotTenantDatabase::masterUsername))
.setter(setter(Builder::masterUsername))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MasterUsername").build()).build();
private static final SdkField TENANT_DATABASE_RESOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TenantDatabaseResourceId").getter(getter(DBSnapshotTenantDatabase::tenantDatabaseResourceId))
.setter(setter(Builder::tenantDatabaseResourceId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TenantDatabaseResourceId").build())
.build();
private static final SdkField CHARACTER_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CharacterSetName").getter(getter(DBSnapshotTenantDatabase::characterSetName))
.setter(setter(Builder::characterSetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CharacterSetName").build()).build();
private static final SdkField DB_SNAPSHOT_TENANT_DATABASE_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("DBSnapshotTenantDatabaseARN")
.getter(getter(DBSnapshotTenantDatabase::dbSnapshotTenantDatabaseARN))
.setter(setter(Builder::dbSnapshotTenantDatabaseARN))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DBSnapshotTenantDatabaseARN")
.build()).build();
private static final SdkField NCHAR_CHARACTER_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("NcharCharacterSetName").getter(getter(DBSnapshotTenantDatabase::ncharCharacterSetName))
.setter(setter(Builder::ncharCharacterSetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NcharCharacterSetName").build())
.build();
private static final SdkField> TAG_LIST_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("TagList")
.getter(getter(DBSnapshotTenantDatabase::tagList))
.setter(setter(Builder::tagList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TagList").build(),
ListTrait
.builder()
.memberLocationName("Tag")
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("Tag").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DB_SNAPSHOT_IDENTIFIER_FIELD,
DB_INSTANCE_IDENTIFIER_FIELD, DBI_RESOURCE_ID_FIELD, ENGINE_NAME_FIELD, SNAPSHOT_TYPE_FIELD,
TENANT_DATABASE_CREATE_TIME_FIELD, TENANT_DB_NAME_FIELD, MASTER_USERNAME_FIELD, TENANT_DATABASE_RESOURCE_ID_FIELD,
CHARACTER_SET_NAME_FIELD, DB_SNAPSHOT_TENANT_DATABASE_ARN_FIELD, NCHAR_CHARACTER_SET_NAME_FIELD, TAG_LIST_FIELD));
private static final long serialVersionUID = 1L;
private final String dbSnapshotIdentifier;
private final String dbInstanceIdentifier;
private final String dbiResourceId;
private final String engineName;
private final String snapshotType;
private final Instant tenantDatabaseCreateTime;
private final String tenantDBName;
private final String masterUsername;
private final String tenantDatabaseResourceId;
private final String characterSetName;
private final String dbSnapshotTenantDatabaseARN;
private final String ncharCharacterSetName;
private final List tagList;
private DBSnapshotTenantDatabase(BuilderImpl builder) {
this.dbSnapshotIdentifier = builder.dbSnapshotIdentifier;
this.dbInstanceIdentifier = builder.dbInstanceIdentifier;
this.dbiResourceId = builder.dbiResourceId;
this.engineName = builder.engineName;
this.snapshotType = builder.snapshotType;
this.tenantDatabaseCreateTime = builder.tenantDatabaseCreateTime;
this.tenantDBName = builder.tenantDBName;
this.masterUsername = builder.masterUsername;
this.tenantDatabaseResourceId = builder.tenantDatabaseResourceId;
this.characterSetName = builder.characterSetName;
this.dbSnapshotTenantDatabaseARN = builder.dbSnapshotTenantDatabaseARN;
this.ncharCharacterSetName = builder.ncharCharacterSetName;
this.tagList = builder.tagList;
}
/**
*
* The identifier for the snapshot of the DB instance.
*
*
* @return The identifier for the snapshot of the DB instance.
*/
public final String dbSnapshotIdentifier() {
return dbSnapshotIdentifier;
}
/**
*
* The ID for the DB instance that contains the tenant databases.
*
*
* @return The ID for the DB instance that contains the tenant databases.
*/
public final String dbInstanceIdentifier() {
return dbInstanceIdentifier;
}
/**
*
* The resource identifier of the source CDB instance. This identifier can't be changed and is unique to an Amazon
* Web Services Region.
*
*
* @return The resource identifier of the source CDB instance. This identifier can't be changed and is unique to an
* Amazon Web Services Region.
*/
public final String dbiResourceId() {
return dbiResourceId;
}
/**
*
* The name of the database engine.
*
*
* @return The name of the database engine.
*/
public final String engineName() {
return engineName;
}
/**
*
* The type of DB snapshot.
*
*
* @return The type of DB snapshot.
*/
public final String snapshotType() {
return snapshotType;
}
/**
*
* The time the DB snapshot was taken, specified in Coordinated Universal Time (UTC). If you copy the snapshot, the
* creation time changes.
*
*
* @return The time the DB snapshot was taken, specified in Coordinated Universal Time (UTC). If you copy the
* snapshot, the creation time changes.
*/
public final Instant tenantDatabaseCreateTime() {
return tenantDatabaseCreateTime;
}
/**
*
* The name of the tenant database.
*
*
* @return The name of the tenant database.
*/
public final String tenantDBName() {
return tenantDBName;
}
/**
*
* The master username of the tenant database.
*
*
* @return The master username of the tenant database.
*/
public final String masterUsername() {
return masterUsername;
}
/**
*
* The resource ID of the tenant database.
*
*
* @return The resource ID of the tenant database.
*/
public final String tenantDatabaseResourceId() {
return tenantDatabaseResourceId;
}
/**
*
* The name of the character set of a tenant database.
*
*
* @return The name of the character set of a tenant database.
*/
public final String characterSetName() {
return characterSetName;
}
/**
*
* The Amazon Resource Name (ARN) for the snapshot tenant database.
*
*
* @return The Amazon Resource Name (ARN) for the snapshot tenant database.
*/
public final String dbSnapshotTenantDatabaseARN() {
return dbSnapshotTenantDatabaseARN;
}
/**
*
* The NCHAR
character set name of the tenant database.
*
*
* @return The NCHAR
character set name of the tenant database.
*/
public final String ncharCharacterSetName() {
return ncharCharacterSetName;
}
/**
* For responses, this returns true if the service returned a value for the TagList 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 hasTagList() {
return tagList != null && !(tagList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the TagList property for this object.
*
* 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 #hasTagList} method.
*
*
* @return The value of the TagList property for this object.
*/
public final List tagList() {
return tagList;
}
@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(dbSnapshotIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(dbInstanceIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(dbiResourceId());
hashCode = 31 * hashCode + Objects.hashCode(engineName());
hashCode = 31 * hashCode + Objects.hashCode(snapshotType());
hashCode = 31 * hashCode + Objects.hashCode(tenantDatabaseCreateTime());
hashCode = 31 * hashCode + Objects.hashCode(tenantDBName());
hashCode = 31 * hashCode + Objects.hashCode(masterUsername());
hashCode = 31 * hashCode + Objects.hashCode(tenantDatabaseResourceId());
hashCode = 31 * hashCode + Objects.hashCode(characterSetName());
hashCode = 31 * hashCode + Objects.hashCode(dbSnapshotTenantDatabaseARN());
hashCode = 31 * hashCode + Objects.hashCode(ncharCharacterSetName());
hashCode = 31 * hashCode + Objects.hashCode(hasTagList() ? tagList() : null);
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 DBSnapshotTenantDatabase)) {
return false;
}
DBSnapshotTenantDatabase other = (DBSnapshotTenantDatabase) obj;
return Objects.equals(dbSnapshotIdentifier(), other.dbSnapshotIdentifier())
&& Objects.equals(dbInstanceIdentifier(), other.dbInstanceIdentifier())
&& Objects.equals(dbiResourceId(), other.dbiResourceId()) && Objects.equals(engineName(), other.engineName())
&& Objects.equals(snapshotType(), other.snapshotType())
&& Objects.equals(tenantDatabaseCreateTime(), other.tenantDatabaseCreateTime())
&& Objects.equals(tenantDBName(), other.tenantDBName())
&& Objects.equals(masterUsername(), other.masterUsername())
&& Objects.equals(tenantDatabaseResourceId(), other.tenantDatabaseResourceId())
&& Objects.equals(characterSetName(), other.characterSetName())
&& Objects.equals(dbSnapshotTenantDatabaseARN(), other.dbSnapshotTenantDatabaseARN())
&& Objects.equals(ncharCharacterSetName(), other.ncharCharacterSetName()) && hasTagList() == other.hasTagList()
&& Objects.equals(tagList(), other.tagList());
}
/**
* 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("DBSnapshotTenantDatabase").add("DBSnapshotIdentifier", dbSnapshotIdentifier())
.add("DBInstanceIdentifier", dbInstanceIdentifier()).add("DbiResourceId", dbiResourceId())
.add("EngineName", engineName()).add("SnapshotType", snapshotType())
.add("TenantDatabaseCreateTime", tenantDatabaseCreateTime()).add("TenantDBName", tenantDBName())
.add("MasterUsername", masterUsername()).add("TenantDatabaseResourceId", tenantDatabaseResourceId())
.add("CharacterSetName", characterSetName()).add("DBSnapshotTenantDatabaseARN", dbSnapshotTenantDatabaseARN())
.add("NcharCharacterSetName", ncharCharacterSetName()).add("TagList", hasTagList() ? tagList() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DBSnapshotIdentifier":
return Optional.ofNullable(clazz.cast(dbSnapshotIdentifier()));
case "DBInstanceIdentifier":
return Optional.ofNullable(clazz.cast(dbInstanceIdentifier()));
case "DbiResourceId":
return Optional.ofNullable(clazz.cast(dbiResourceId()));
case "EngineName":
return Optional.ofNullable(clazz.cast(engineName()));
case "SnapshotType":
return Optional.ofNullable(clazz.cast(snapshotType()));
case "TenantDatabaseCreateTime":
return Optional.ofNullable(clazz.cast(tenantDatabaseCreateTime()));
case "TenantDBName":
return Optional.ofNullable(clazz.cast(tenantDBName()));
case "MasterUsername":
return Optional.ofNullable(clazz.cast(masterUsername()));
case "TenantDatabaseResourceId":
return Optional.ofNullable(clazz.cast(tenantDatabaseResourceId()));
case "CharacterSetName":
return Optional.ofNullable(clazz.cast(characterSetName()));
case "DBSnapshotTenantDatabaseARN":
return Optional.ofNullable(clazz.cast(dbSnapshotTenantDatabaseARN()));
case "NcharCharacterSetName":
return Optional.ofNullable(clazz.cast(ncharCharacterSetName()));
case "TagList":
return Optional.ofNullable(clazz.cast(tagList()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function