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

software.amazon.awssdk.services.redshift.model.ReservedNodeExchangeStatus Maven / Gradle / Ivy

Go to download

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

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.redshift.model;

import java.io.Serializable;
import java.time.Instant;
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;

/**
 * 

* Reserved-node status details, such as the source reserved-node identifier, the target reserved-node identifier, the * node type, the node count, and other details. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ReservedNodeExchangeStatus implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField RESERVED_NODE_EXCHANGE_REQUEST_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("ReservedNodeExchangeRequestId") .getter(getter(ReservedNodeExchangeStatus::reservedNodeExchangeRequestId)) .setter(setter(Builder::reservedNodeExchangeRequestId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ReservedNodeExchangeRequestId") .build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(ReservedNodeExchangeStatus::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField REQUEST_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("RequestTime").getter(getter(ReservedNodeExchangeStatus::requestTime)) .setter(setter(Builder::requestTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RequestTime").build()).build(); private static final SdkField SOURCE_RESERVED_NODE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceReservedNodeId").getter(getter(ReservedNodeExchangeStatus::sourceReservedNodeId)) .setter(setter(Builder::sourceReservedNodeId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceReservedNodeId").build()) .build(); private static final SdkField SOURCE_RESERVED_NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceReservedNodeType").getter(getter(ReservedNodeExchangeStatus::sourceReservedNodeType)) .setter(setter(Builder::sourceReservedNodeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceReservedNodeType").build()) .build(); private static final SdkField SOURCE_RESERVED_NODE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("SourceReservedNodeCount").getter(getter(ReservedNodeExchangeStatus::sourceReservedNodeCount)) .setter(setter(Builder::sourceReservedNodeCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceReservedNodeCount").build()) .build(); private static final SdkField TARGET_RESERVED_NODE_OFFERING_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("TargetReservedNodeOfferingId") .getter(getter(ReservedNodeExchangeStatus::targetReservedNodeOfferingId)) .setter(setter(Builder::targetReservedNodeOfferingId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetReservedNodeOfferingId") .build()).build(); private static final SdkField TARGET_RESERVED_NODE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TargetReservedNodeType").getter(getter(ReservedNodeExchangeStatus::targetReservedNodeType)) .setter(setter(Builder::targetReservedNodeType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetReservedNodeType").build()) .build(); private static final SdkField TARGET_RESERVED_NODE_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("TargetReservedNodeCount").getter(getter(ReservedNodeExchangeStatus::targetReservedNodeCount)) .setter(setter(Builder::targetReservedNodeCount)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetReservedNodeCount").build()) .build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList( RESERVED_NODE_EXCHANGE_REQUEST_ID_FIELD, STATUS_FIELD, REQUEST_TIME_FIELD, SOURCE_RESERVED_NODE_ID_FIELD, SOURCE_RESERVED_NODE_TYPE_FIELD, SOURCE_RESERVED_NODE_COUNT_FIELD, TARGET_RESERVED_NODE_OFFERING_ID_FIELD, TARGET_RESERVED_NODE_TYPE_FIELD, TARGET_RESERVED_NODE_COUNT_FIELD)); private static final long serialVersionUID = 1L; private final String reservedNodeExchangeRequestId; private final String status; private final Instant requestTime; private final String sourceReservedNodeId; private final String sourceReservedNodeType; private final Integer sourceReservedNodeCount; private final String targetReservedNodeOfferingId; private final String targetReservedNodeType; private final Integer targetReservedNodeCount; private ReservedNodeExchangeStatus(BuilderImpl builder) { this.reservedNodeExchangeRequestId = builder.reservedNodeExchangeRequestId; this.status = builder.status; this.requestTime = builder.requestTime; this.sourceReservedNodeId = builder.sourceReservedNodeId; this.sourceReservedNodeType = builder.sourceReservedNodeType; this.sourceReservedNodeCount = builder.sourceReservedNodeCount; this.targetReservedNodeOfferingId = builder.targetReservedNodeOfferingId; this.targetReservedNodeType = builder.targetReservedNodeType; this.targetReservedNodeCount = builder.targetReservedNodeCount; } /** *

* The identifier of the reserved-node exchange request. *

* * @return The identifier of the reserved-node exchange request. */ public final String reservedNodeExchangeRequestId() { return reservedNodeExchangeRequestId; } /** *

* The status of the reserved-node exchange request. Statuses include in-progress and requested. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ReservedNodeExchangeStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #statusAsString}. *

* * @return The status of the reserved-node exchange request. Statuses include in-progress and requested. * @see ReservedNodeExchangeStatusType */ public final ReservedNodeExchangeStatusType status() { return ReservedNodeExchangeStatusType.fromValue(status); } /** *

* The status of the reserved-node exchange request. Statuses include in-progress and requested. *

*

* If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link ReservedNodeExchangeStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is * available from {@link #statusAsString}. *

* * @return The status of the reserved-node exchange request. Statuses include in-progress and requested. * @see ReservedNodeExchangeStatusType */ public final String statusAsString() { return status; } /** *

* A date and time that indicate when the reserved-node exchange was requested. *

* * @return A date and time that indicate when the reserved-node exchange was requested. */ public final Instant requestTime() { return requestTime; } /** *

* The identifier of the source reserved node. *

* * @return The identifier of the source reserved node. */ public final String sourceReservedNodeId() { return sourceReservedNodeId; } /** *

* The source reserved-node type, for example ra3.4xlarge. *

* * @return The source reserved-node type, for example ra3.4xlarge. */ public final String sourceReservedNodeType() { return sourceReservedNodeType; } /** *

* The source reserved-node count in the cluster. *

* * @return The source reserved-node count in the cluster. */ public final Integer sourceReservedNodeCount() { return sourceReservedNodeCount; } /** *

* The identifier of the target reserved node offering. *

* * @return The identifier of the target reserved node offering. */ public final String targetReservedNodeOfferingId() { return targetReservedNodeOfferingId; } /** *

* The node type of the target reserved node, for example ra3.4xlarge. *

* * @return The node type of the target reserved node, for example ra3.4xlarge. */ public final String targetReservedNodeType() { return targetReservedNodeType; } /** *

* The count of target reserved nodes in the cluster. *

* * @return The count of target reserved nodes in the cluster. */ public final Integer targetReservedNodeCount() { return targetReservedNodeCount; } @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(reservedNodeExchangeRequestId()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(requestTime()); hashCode = 31 * hashCode + Objects.hashCode(sourceReservedNodeId()); hashCode = 31 * hashCode + Objects.hashCode(sourceReservedNodeType()); hashCode = 31 * hashCode + Objects.hashCode(sourceReservedNodeCount()); hashCode = 31 * hashCode + Objects.hashCode(targetReservedNodeOfferingId()); hashCode = 31 * hashCode + Objects.hashCode(targetReservedNodeType()); hashCode = 31 * hashCode + Objects.hashCode(targetReservedNodeCount()); 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 ReservedNodeExchangeStatus)) { return false; } ReservedNodeExchangeStatus other = (ReservedNodeExchangeStatus) obj; return Objects.equals(reservedNodeExchangeRequestId(), other.reservedNodeExchangeRequestId()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(requestTime(), other.requestTime()) && Objects.equals(sourceReservedNodeId(), other.sourceReservedNodeId()) && Objects.equals(sourceReservedNodeType(), other.sourceReservedNodeType()) && Objects.equals(sourceReservedNodeCount(), other.sourceReservedNodeCount()) && Objects.equals(targetReservedNodeOfferingId(), other.targetReservedNodeOfferingId()) && Objects.equals(targetReservedNodeType(), other.targetReservedNodeType()) && Objects.equals(targetReservedNodeCount(), other.targetReservedNodeCount()); } /** * 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("ReservedNodeExchangeStatus") .add("ReservedNodeExchangeRequestId", reservedNodeExchangeRequestId()).add("Status", statusAsString()) .add("RequestTime", requestTime()).add("SourceReservedNodeId", sourceReservedNodeId()) .add("SourceReservedNodeType", sourceReservedNodeType()) .add("SourceReservedNodeCount", sourceReservedNodeCount()) .add("TargetReservedNodeOfferingId", targetReservedNodeOfferingId()) .add("TargetReservedNodeType", targetReservedNodeType()) .add("TargetReservedNodeCount", targetReservedNodeCount()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ReservedNodeExchangeRequestId": return Optional.ofNullable(clazz.cast(reservedNodeExchangeRequestId())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "RequestTime": return Optional.ofNullable(clazz.cast(requestTime())); case "SourceReservedNodeId": return Optional.ofNullable(clazz.cast(sourceReservedNodeId())); case "SourceReservedNodeType": return Optional.ofNullable(clazz.cast(sourceReservedNodeType())); case "SourceReservedNodeCount": return Optional.ofNullable(clazz.cast(sourceReservedNodeCount())); case "TargetReservedNodeOfferingId": return Optional.ofNullable(clazz.cast(targetReservedNodeOfferingId())); case "TargetReservedNodeType": return Optional.ofNullable(clazz.cast(targetReservedNodeType())); case "TargetReservedNodeCount": return Optional.ofNullable(clazz.cast(targetReservedNodeCount())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ReservedNodeExchangeStatus) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The identifier of the reserved-node exchange request. *

* * @param reservedNodeExchangeRequestId * The identifier of the reserved-node exchange request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder reservedNodeExchangeRequestId(String reservedNodeExchangeRequestId); /** *

* The status of the reserved-node exchange request. Statuses include in-progress and requested. *

* * @param status * The status of the reserved-node exchange request. Statuses include in-progress and requested. * @see ReservedNodeExchangeStatusType * @return Returns a reference to this object so that method calls can be chained together. * @see ReservedNodeExchangeStatusType */ Builder status(String status); /** *

* The status of the reserved-node exchange request. Statuses include in-progress and requested. *

* * @param status * The status of the reserved-node exchange request. Statuses include in-progress and requested. * @see ReservedNodeExchangeStatusType * @return Returns a reference to this object so that method calls can be chained together. * @see ReservedNodeExchangeStatusType */ Builder status(ReservedNodeExchangeStatusType status); /** *

* A date and time that indicate when the reserved-node exchange was requested. *

* * @param requestTime * A date and time that indicate when the reserved-node exchange was requested. * @return Returns a reference to this object so that method calls can be chained together. */ Builder requestTime(Instant requestTime); /** *

* The identifier of the source reserved node. *

* * @param sourceReservedNodeId * The identifier of the source reserved node. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceReservedNodeId(String sourceReservedNodeId); /** *

* The source reserved-node type, for example ra3.4xlarge. *

* * @param sourceReservedNodeType * The source reserved-node type, for example ra3.4xlarge. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceReservedNodeType(String sourceReservedNodeType); /** *

* The source reserved-node count in the cluster. *

* * @param sourceReservedNodeCount * The source reserved-node count in the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceReservedNodeCount(Integer sourceReservedNodeCount); /** *

* The identifier of the target reserved node offering. *

* * @param targetReservedNodeOfferingId * The identifier of the target reserved node offering. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetReservedNodeOfferingId(String targetReservedNodeOfferingId); /** *

* The node type of the target reserved node, for example ra3.4xlarge. *

* * @param targetReservedNodeType * The node type of the target reserved node, for example ra3.4xlarge. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetReservedNodeType(String targetReservedNodeType); /** *

* The count of target reserved nodes in the cluster. *

* * @param targetReservedNodeCount * The count of target reserved nodes in the cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetReservedNodeCount(Integer targetReservedNodeCount); } static final class BuilderImpl implements Builder { private String reservedNodeExchangeRequestId; private String status; private Instant requestTime; private String sourceReservedNodeId; private String sourceReservedNodeType; private Integer sourceReservedNodeCount; private String targetReservedNodeOfferingId; private String targetReservedNodeType; private Integer targetReservedNodeCount; private BuilderImpl() { } private BuilderImpl(ReservedNodeExchangeStatus model) { reservedNodeExchangeRequestId(model.reservedNodeExchangeRequestId); status(model.status); requestTime(model.requestTime); sourceReservedNodeId(model.sourceReservedNodeId); sourceReservedNodeType(model.sourceReservedNodeType); sourceReservedNodeCount(model.sourceReservedNodeCount); targetReservedNodeOfferingId(model.targetReservedNodeOfferingId); targetReservedNodeType(model.targetReservedNodeType); targetReservedNodeCount(model.targetReservedNodeCount); } public final String getReservedNodeExchangeRequestId() { return reservedNodeExchangeRequestId; } public final void setReservedNodeExchangeRequestId(String reservedNodeExchangeRequestId) { this.reservedNodeExchangeRequestId = reservedNodeExchangeRequestId; } @Override public final Builder reservedNodeExchangeRequestId(String reservedNodeExchangeRequestId) { this.reservedNodeExchangeRequestId = reservedNodeExchangeRequestId; 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; } @Override public final Builder status(ReservedNodeExchangeStatusType status) { this.status(status == null ? null : status.toString()); return this; } public final Instant getRequestTime() { return requestTime; } public final void setRequestTime(Instant requestTime) { this.requestTime = requestTime; } @Override public final Builder requestTime(Instant requestTime) { this.requestTime = requestTime; return this; } public final String getSourceReservedNodeId() { return sourceReservedNodeId; } public final void setSourceReservedNodeId(String sourceReservedNodeId) { this.sourceReservedNodeId = sourceReservedNodeId; } @Override public final Builder sourceReservedNodeId(String sourceReservedNodeId) { this.sourceReservedNodeId = sourceReservedNodeId; return this; } public final String getSourceReservedNodeType() { return sourceReservedNodeType; } public final void setSourceReservedNodeType(String sourceReservedNodeType) { this.sourceReservedNodeType = sourceReservedNodeType; } @Override public final Builder sourceReservedNodeType(String sourceReservedNodeType) { this.sourceReservedNodeType = sourceReservedNodeType; return this; } public final Integer getSourceReservedNodeCount() { return sourceReservedNodeCount; } public final void setSourceReservedNodeCount(Integer sourceReservedNodeCount) { this.sourceReservedNodeCount = sourceReservedNodeCount; } @Override public final Builder sourceReservedNodeCount(Integer sourceReservedNodeCount) { this.sourceReservedNodeCount = sourceReservedNodeCount; return this; } public final String getTargetReservedNodeOfferingId() { return targetReservedNodeOfferingId; } public final void setTargetReservedNodeOfferingId(String targetReservedNodeOfferingId) { this.targetReservedNodeOfferingId = targetReservedNodeOfferingId; } @Override public final Builder targetReservedNodeOfferingId(String targetReservedNodeOfferingId) { this.targetReservedNodeOfferingId = targetReservedNodeOfferingId; return this; } public final String getTargetReservedNodeType() { return targetReservedNodeType; } public final void setTargetReservedNodeType(String targetReservedNodeType) { this.targetReservedNodeType = targetReservedNodeType; } @Override public final Builder targetReservedNodeType(String targetReservedNodeType) { this.targetReservedNodeType = targetReservedNodeType; return this; } public final Integer getTargetReservedNodeCount() { return targetReservedNodeCount; } public final void setTargetReservedNodeCount(Integer targetReservedNodeCount) { this.targetReservedNodeCount = targetReservedNodeCount; } @Override public final Builder targetReservedNodeCount(Integer targetReservedNodeCount) { this.targetReservedNodeCount = targetReservedNodeCount; return this; } @Override public ReservedNodeExchangeStatus build() { return new ReservedNodeExchangeStatus(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy