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

software.amazon.awssdk.services.neptune.model.GlobalCluster Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.15
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.neptune.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.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 an Amazon Neptune global database. *

*

* This data type is used as a response element for the CreateGlobalCluster, DescribeGlobalClusters, * ModifyGlobalCluster, DeleteGlobalCluster, FailoverGlobalCluster, and * RemoveFromGlobalCluster actions. *

*/ @Generated("software.amazon.awssdk:codegen") public final class GlobalCluster implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField GLOBAL_CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("GlobalClusterIdentifier").getter(getter(GlobalCluster::globalClusterIdentifier)) .setter(setter(Builder::globalClusterIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalClusterIdentifier").build()) .build(); private static final SdkField GLOBAL_CLUSTER_RESOURCE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("GlobalClusterResourceId").getter(getter(GlobalCluster::globalClusterResourceId)) .setter(setter(Builder::globalClusterResourceId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalClusterResourceId").build()) .build(); private static final SdkField GLOBAL_CLUSTER_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("GlobalClusterArn").getter(getter(GlobalCluster::globalClusterArn)) .setter(setter(Builder::globalClusterArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalClusterArn").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(GlobalCluster::status)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField ENGINE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Engine") .getter(getter(GlobalCluster::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(GlobalCluster::engineVersion)).setter(setter(Builder::engineVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EngineVersion").build()).build(); private static final SdkField STORAGE_ENCRYPTED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("StorageEncrypted").getter(getter(GlobalCluster::storageEncrypted)) .setter(setter(Builder::storageEncrypted)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageEncrypted").build()).build(); private static final SdkField DELETION_PROTECTION_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("DeletionProtection").getter(getter(GlobalCluster::deletionProtection)) .setter(setter(Builder::deletionProtection)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DeletionProtection").build()) .build(); private static final SdkField> GLOBAL_CLUSTER_MEMBERS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("GlobalClusterMembers") .getter(getter(GlobalCluster::globalClusterMembers)) .setter(setter(Builder::globalClusterMembers)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlobalClusterMembers").build(), ListTrait .builder() .memberLocationName("GlobalClusterMember") .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(GlobalClusterMember::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("GlobalClusterMember").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections .unmodifiableList(Arrays.asList(GLOBAL_CLUSTER_IDENTIFIER_FIELD, GLOBAL_CLUSTER_RESOURCE_ID_FIELD, GLOBAL_CLUSTER_ARN_FIELD, STATUS_FIELD, ENGINE_FIELD, ENGINE_VERSION_FIELD, STORAGE_ENCRYPTED_FIELD, DELETION_PROTECTION_FIELD, GLOBAL_CLUSTER_MEMBERS_FIELD)); private static final long serialVersionUID = 1L; private final String globalClusterIdentifier; private final String globalClusterResourceId; private final String globalClusterArn; private final String status; private final String engine; private final String engineVersion; private final Boolean storageEncrypted; private final Boolean deletionProtection; private final List globalClusterMembers; private GlobalCluster(BuilderImpl builder) { this.globalClusterIdentifier = builder.globalClusterIdentifier; this.globalClusterResourceId = builder.globalClusterResourceId; this.globalClusterArn = builder.globalClusterArn; this.status = builder.status; this.engine = builder.engine; this.engineVersion = builder.engineVersion; this.storageEncrypted = builder.storageEncrypted; this.deletionProtection = builder.deletionProtection; this.globalClusterMembers = builder.globalClusterMembers; } /** *

* Contains a user-supplied global database cluster identifier. This identifier is the unique key that identifies a * global database. *

* * @return Contains a user-supplied global database cluster identifier. This identifier is the unique key that * identifies a global database. */ public final String globalClusterIdentifier() { return globalClusterIdentifier; } /** *

* An immutable identifier for the global database that is unique within in all regions. This identifier is found in * CloudTrail log entries whenever the KMS key for the DB cluster is accessed. *

* * @return An immutable identifier for the global database that is unique within in all regions. This identifier is * found in CloudTrail log entries whenever the KMS key for the DB cluster is accessed. */ public final String globalClusterResourceId() { return globalClusterResourceId; } /** *

* The Amazon Resource Name (ARN) for the global database. *

* * @return The Amazon Resource Name (ARN) for the global database. */ public final String globalClusterArn() { return globalClusterArn; } /** *

* Specifies the current state of this global database. *

* * @return Specifies the current state of this global database. */ public final String status() { return status; } /** *

* The Neptune database engine used by the global database ("neptune"). *

* * @return The Neptune database engine used by the global database ("neptune"). */ public final String engine() { return engine; } /** *

* The Neptune engine version used by the global database. *

* * @return The Neptune engine version used by the global database. */ public final String engineVersion() { return engineVersion; } /** *

* The storage encryption setting for the global database. *

* * @return The storage encryption setting for the global database. */ public final Boolean storageEncrypted() { return storageEncrypted; } /** *

* The deletion protection setting for the global database. *

* * @return The deletion protection setting for the global database. */ public final Boolean deletionProtection() { return deletionProtection; } /** * For responses, this returns true if the service returned a value for the GlobalClusterMembers 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 hasGlobalClusterMembers() { return globalClusterMembers != null && !(globalClusterMembers instanceof SdkAutoConstructList); } /** *

* A list of cluster ARNs and instance ARNs for all the DB clusters that are part of the global database. *

*

* 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 #hasGlobalClusterMembers} method. *

* * @return A list of cluster ARNs and instance ARNs for all the DB clusters that are part of the global database. */ public final List globalClusterMembers() { return globalClusterMembers; } @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(globalClusterIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(globalClusterResourceId()); hashCode = 31 * hashCode + Objects.hashCode(globalClusterArn()); hashCode = 31 * hashCode + Objects.hashCode(status()); hashCode = 31 * hashCode + Objects.hashCode(engine()); hashCode = 31 * hashCode + Objects.hashCode(engineVersion()); hashCode = 31 * hashCode + Objects.hashCode(storageEncrypted()); hashCode = 31 * hashCode + Objects.hashCode(deletionProtection()); hashCode = 31 * hashCode + Objects.hashCode(hasGlobalClusterMembers() ? globalClusterMembers() : 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 GlobalCluster)) { return false; } GlobalCluster other = (GlobalCluster) obj; return Objects.equals(globalClusterIdentifier(), other.globalClusterIdentifier()) && Objects.equals(globalClusterResourceId(), other.globalClusterResourceId()) && Objects.equals(globalClusterArn(), other.globalClusterArn()) && Objects.equals(status(), other.status()) && Objects.equals(engine(), other.engine()) && Objects.equals(engineVersion(), other.engineVersion()) && Objects.equals(storageEncrypted(), other.storageEncrypted()) && Objects.equals(deletionProtection(), other.deletionProtection()) && hasGlobalClusterMembers() == other.hasGlobalClusterMembers() && Objects.equals(globalClusterMembers(), other.globalClusterMembers()); } /** * 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("GlobalCluster").add("GlobalClusterIdentifier", globalClusterIdentifier()) .add("GlobalClusterResourceId", globalClusterResourceId()).add("GlobalClusterArn", globalClusterArn()) .add("Status", status()).add("Engine", engine()).add("EngineVersion", engineVersion()) .add("StorageEncrypted", storageEncrypted()).add("DeletionProtection", deletionProtection()) .add("GlobalClusterMembers", hasGlobalClusterMembers() ? globalClusterMembers() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "GlobalClusterIdentifier": return Optional.ofNullable(clazz.cast(globalClusterIdentifier())); case "GlobalClusterResourceId": return Optional.ofNullable(clazz.cast(globalClusterResourceId())); case "GlobalClusterArn": return Optional.ofNullable(clazz.cast(globalClusterArn())); case "Status": return Optional.ofNullable(clazz.cast(status())); case "Engine": return Optional.ofNullable(clazz.cast(engine())); case "EngineVersion": return Optional.ofNullable(clazz.cast(engineVersion())); case "StorageEncrypted": return Optional.ofNullable(clazz.cast(storageEncrypted())); case "DeletionProtection": return Optional.ofNullable(clazz.cast(deletionProtection())); case "GlobalClusterMembers": return Optional.ofNullable(clazz.cast(globalClusterMembers())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GlobalCluster) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Contains a user-supplied global database cluster identifier. This identifier is the unique key that * identifies a global database. *

* * @param globalClusterIdentifier * Contains a user-supplied global database cluster identifier. This identifier is the unique key that * identifies a global database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalClusterIdentifier(String globalClusterIdentifier); /** *

* An immutable identifier for the global database that is unique within in all regions. This identifier is * found in CloudTrail log entries whenever the KMS key for the DB cluster is accessed. *

* * @param globalClusterResourceId * An immutable identifier for the global database that is unique within in all regions. This identifier * is found in CloudTrail log entries whenever the KMS key for the DB cluster is accessed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalClusterResourceId(String globalClusterResourceId); /** *

* The Amazon Resource Name (ARN) for the global database. *

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

* Specifies the current state of this global database. *

* * @param status * Specifies the current state of this global database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(String status); /** *

* The Neptune database engine used by the global database ("neptune"). *

* * @param engine * The Neptune database engine used by the global database ("neptune"). * @return Returns a reference to this object so that method calls can be chained together. */ Builder engine(String engine); /** *

* The Neptune engine version used by the global database. *

* * @param engineVersion * The Neptune engine version used by the global database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder engineVersion(String engineVersion); /** *

* The storage encryption setting for the global database. *

* * @param storageEncrypted * The storage encryption setting for the global database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder storageEncrypted(Boolean storageEncrypted); /** *

* The deletion protection setting for the global database. *

* * @param deletionProtection * The deletion protection setting for the global database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder deletionProtection(Boolean deletionProtection); /** *

* A list of cluster ARNs and instance ARNs for all the DB clusters that are part of the global database. *

* * @param globalClusterMembers * A list of cluster ARNs and instance ARNs for all the DB clusters that are part of the global database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalClusterMembers(Collection globalClusterMembers); /** *

* A list of cluster ARNs and instance ARNs for all the DB clusters that are part of the global database. *

* * @param globalClusterMembers * A list of cluster ARNs and instance ARNs for all the DB clusters that are part of the global database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder globalClusterMembers(GlobalClusterMember... globalClusterMembers); /** *

* A list of cluster ARNs and instance ARNs for all the DB clusters that are part of the global database. *

* This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.neptune.model.GlobalClusterMember.Builder} avoiding the need to create * one manually via {@link software.amazon.awssdk.services.neptune.model.GlobalClusterMember#builder()}. * *

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.neptune.model.GlobalClusterMember.Builder#build()} is called * immediately and its result is passed to {@link #globalClusterMembers(List)}. * * @param globalClusterMembers * a consumer that will call methods on * {@link software.amazon.awssdk.services.neptune.model.GlobalClusterMember.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #globalClusterMembers(java.util.Collection) */ Builder globalClusterMembers(Consumer... globalClusterMembers); } static final class BuilderImpl implements Builder { private String globalClusterIdentifier; private String globalClusterResourceId; private String globalClusterArn; private String status; private String engine; private String engineVersion; private Boolean storageEncrypted; private Boolean deletionProtection; private List globalClusterMembers = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(GlobalCluster model) { globalClusterIdentifier(model.globalClusterIdentifier); globalClusterResourceId(model.globalClusterResourceId); globalClusterArn(model.globalClusterArn); status(model.status); engine(model.engine); engineVersion(model.engineVersion); storageEncrypted(model.storageEncrypted); deletionProtection(model.deletionProtection); globalClusterMembers(model.globalClusterMembers); } public final String getGlobalClusterIdentifier() { return globalClusterIdentifier; } public final void setGlobalClusterIdentifier(String globalClusterIdentifier) { this.globalClusterIdentifier = globalClusterIdentifier; } @Override public final Builder globalClusterIdentifier(String globalClusterIdentifier) { this.globalClusterIdentifier = globalClusterIdentifier; return this; } public final String getGlobalClusterResourceId() { return globalClusterResourceId; } public final void setGlobalClusterResourceId(String globalClusterResourceId) { this.globalClusterResourceId = globalClusterResourceId; } @Override public final Builder globalClusterResourceId(String globalClusterResourceId) { this.globalClusterResourceId = globalClusterResourceId; return this; } public final String getGlobalClusterArn() { return globalClusterArn; } public final void setGlobalClusterArn(String globalClusterArn) { this.globalClusterArn = globalClusterArn; } @Override public final Builder globalClusterArn(String globalClusterArn) { this.globalClusterArn = globalClusterArn; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } public final String getEngine() { return engine; } public final void setEngine(String engine) { this.engine = engine; } @Override public final Builder engine(String engine) { this.engine = engine; return this; } public final String getEngineVersion() { return engineVersion; } public final void setEngineVersion(String engineVersion) { this.engineVersion = engineVersion; } @Override public final Builder engineVersion(String engineVersion) { this.engineVersion = engineVersion; return this; } public final Boolean getStorageEncrypted() { return storageEncrypted; } public final void setStorageEncrypted(Boolean storageEncrypted) { this.storageEncrypted = storageEncrypted; } @Override public final Builder storageEncrypted(Boolean storageEncrypted) { this.storageEncrypted = storageEncrypted; return this; } public final Boolean getDeletionProtection() { return deletionProtection; } public final void setDeletionProtection(Boolean deletionProtection) { this.deletionProtection = deletionProtection; } @Override public final Builder deletionProtection(Boolean deletionProtection) { this.deletionProtection = deletionProtection; return this; } public final List getGlobalClusterMembers() { List result = GlobalClusterMemberListCopier.copyToBuilder(this.globalClusterMembers); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setGlobalClusterMembers(Collection globalClusterMembers) { this.globalClusterMembers = GlobalClusterMemberListCopier.copyFromBuilder(globalClusterMembers); } @Override public final Builder globalClusterMembers(Collection globalClusterMembers) { this.globalClusterMembers = GlobalClusterMemberListCopier.copy(globalClusterMembers); return this; } @Override @SafeVarargs public final Builder globalClusterMembers(GlobalClusterMember... globalClusterMembers) { globalClusterMembers(Arrays.asList(globalClusterMembers)); return this; } @Override @SafeVarargs public final Builder globalClusterMembers(Consumer... globalClusterMembers) { globalClusterMembers(Stream.of(globalClusterMembers).map(c -> GlobalClusterMember.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } @Override public GlobalCluster build() { return new GlobalCluster(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy