software.amazon.awssdk.services.cloudformation.model.ChangeSetSummary Maven / Gradle / Ivy
Show all versions of cloudformation 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.cloudformation.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;
/**
*
* The ChangeSetSummary
structure describes a change set, its status, and the stack with which it's
* associated.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ChangeSetSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField STACK_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackId").getter(getter(ChangeSetSummary::stackId)).setter(setter(Builder::stackId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackId").build()).build();
private static final SdkField STACK_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StackName").getter(getter(ChangeSetSummary::stackName)).setter(setter(Builder::stackName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StackName").build()).build();
private static final SdkField CHANGE_SET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ChangeSetId").getter(getter(ChangeSetSummary::changeSetId)).setter(setter(Builder::changeSetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeSetId").build()).build();
private static final SdkField CHANGE_SET_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ChangeSetName").getter(getter(ChangeSetSummary::changeSetName)).setter(setter(Builder::changeSetName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ChangeSetName").build()).build();
private static final SdkField EXECUTION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ExecutionStatus").getter(getter(ChangeSetSummary::executionStatusAsString))
.setter(setter(Builder::executionStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExecutionStatus").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(ChangeSetSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField STATUS_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatusReason").getter(getter(ChangeSetSummary::statusReason)).setter(setter(Builder::statusReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusReason").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(ChangeSetSummary::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(ChangeSetSummary::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField INCLUDE_NESTED_STACKS_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("IncludeNestedStacks").getter(getter(ChangeSetSummary::includeNestedStacks))
.setter(setter(Builder::includeNestedStacks))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IncludeNestedStacks").build())
.build();
private static final SdkField PARENT_CHANGE_SET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ParentChangeSetId").getter(getter(ChangeSetSummary::parentChangeSetId))
.setter(setter(Builder::parentChangeSetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ParentChangeSetId").build()).build();
private static final SdkField ROOT_CHANGE_SET_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RootChangeSetId").getter(getter(ChangeSetSummary::rootChangeSetId))
.setter(setter(Builder::rootChangeSetId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RootChangeSetId").build()).build();
private static final SdkField IMPORT_EXISTING_RESOURCES_FIELD = SdkField. builder(MarshallingType.BOOLEAN)
.memberName("ImportExistingResources").getter(getter(ChangeSetSummary::importExistingResources))
.setter(setter(Builder::importExistingResources))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImportExistingResources").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STACK_ID_FIELD,
STACK_NAME_FIELD, CHANGE_SET_ID_FIELD, CHANGE_SET_NAME_FIELD, EXECUTION_STATUS_FIELD, STATUS_FIELD,
STATUS_REASON_FIELD, CREATION_TIME_FIELD, DESCRIPTION_FIELD, INCLUDE_NESTED_STACKS_FIELD, PARENT_CHANGE_SET_ID_FIELD,
ROOT_CHANGE_SET_ID_FIELD, IMPORT_EXISTING_RESOURCES_FIELD));
private static final long serialVersionUID = 1L;
private final String stackId;
private final String stackName;
private final String changeSetId;
private final String changeSetName;
private final String executionStatus;
private final String status;
private final String statusReason;
private final Instant creationTime;
private final String description;
private final Boolean includeNestedStacks;
private final String parentChangeSetId;
private final String rootChangeSetId;
private final Boolean importExistingResources;
private ChangeSetSummary(BuilderImpl builder) {
this.stackId = builder.stackId;
this.stackName = builder.stackName;
this.changeSetId = builder.changeSetId;
this.changeSetName = builder.changeSetName;
this.executionStatus = builder.executionStatus;
this.status = builder.status;
this.statusReason = builder.statusReason;
this.creationTime = builder.creationTime;
this.description = builder.description;
this.includeNestedStacks = builder.includeNestedStacks;
this.parentChangeSetId = builder.parentChangeSetId;
this.rootChangeSetId = builder.rootChangeSetId;
this.importExistingResources = builder.importExistingResources;
}
/**
*
* The ID of the stack with which the change set is associated.
*
*
* @return The ID of the stack with which the change set is associated.
*/
public final String stackId() {
return stackId;
}
/**
*
* The name of the stack with which the change set is associated.
*
*
* @return The name of the stack with which the change set is associated.
*/
public final String stackName() {
return stackName;
}
/**
*
* The ID of the change set.
*
*
* @return The ID of the change set.
*/
public final String changeSetId() {
return changeSetId;
}
/**
*
* The name of the change set.
*
*
* @return The name of the change set.
*/
public final String changeSetName() {
return changeSetName;
}
/**
*
* If the change set execution status is AVAILABLE
, you can execute the change set. If you can't
* execute the change set, the status indicates why. For example, a change set might be in an
* UNAVAILABLE
state because CloudFormation is still creating it or in an OBSOLETE
state
* because the stack was already updated.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #executionStatus}
* will return {@link ExecutionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #executionStatusAsString}.
*
*
* @return If the change set execution status is AVAILABLE
, you can execute the change set. If you
* can't execute the change set, the status indicates why. For example, a change set might be in an
* UNAVAILABLE
state because CloudFormation is still creating it or in an OBSOLETE
* state because the stack was already updated.
* @see ExecutionStatus
*/
public final ExecutionStatus executionStatus() {
return ExecutionStatus.fromValue(executionStatus);
}
/**
*
* If the change set execution status is AVAILABLE
, you can execute the change set. If you can't
* execute the change set, the status indicates why. For example, a change set might be in an
* UNAVAILABLE
state because CloudFormation is still creating it or in an OBSOLETE
state
* because the stack was already updated.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #executionStatus}
* will return {@link ExecutionStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #executionStatusAsString}.
*
*
* @return If the change set execution status is AVAILABLE
, you can execute the change set. If you
* can't execute the change set, the status indicates why. For example, a change set might be in an
* UNAVAILABLE
state because CloudFormation is still creating it or in an OBSOLETE
* state because the stack was already updated.
* @see ExecutionStatus
*/
public final String executionStatusAsString() {
return executionStatus;
}
/**
*
* The state of the change set, such as CREATE_IN_PROGRESS
, CREATE_COMPLETE
, or
* FAILED
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ChangeSetStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The state of the change set, such as CREATE_IN_PROGRESS
, CREATE_COMPLETE
, or
* FAILED
.
* @see ChangeSetStatus
*/
public final ChangeSetStatus status() {
return ChangeSetStatus.fromValue(status);
}
/**
*
* The state of the change set, such as CREATE_IN_PROGRESS
, CREATE_COMPLETE
, or
* FAILED
.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link ChangeSetStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The state of the change set, such as CREATE_IN_PROGRESS
, CREATE_COMPLETE
, or
* FAILED
.
* @see ChangeSetStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* A description of the change set's status. For example, if your change set is in the FAILED
state,
* CloudFormation shows the error message.
*
*
* @return A description of the change set's status. For example, if your change set is in the FAILED
* state, CloudFormation shows the error message.
*/
public final String statusReason() {
return statusReason;
}
/**
*
* The start time when the change set was created, in UTC.
*
*
* @return The start time when the change set was created, in UTC.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* Descriptive information about the change set.
*
*
* @return Descriptive information about the change set.
*/
public final String description() {
return description;
}
/**
*
* Specifies the current setting of IncludeNestedStacks
for the change set.
*
*
* @return Specifies the current setting of IncludeNestedStacks
for the change set.
*/
public final Boolean includeNestedStacks() {
return includeNestedStacks;
}
/**
*
* The parent change set ID.
*
*
* @return The parent change set ID.
*/
public final String parentChangeSetId() {
return parentChangeSetId;
}
/**
*
* The root change set ID.
*
*
* @return The root change set ID.
*/
public final String rootChangeSetId() {
return rootChangeSetId;
}
/**
*
* Indicates if the change set imports resources that already exist.
*
*
* @return Indicates if the change set imports resources that already exist.
*/
public final Boolean importExistingResources() {
return importExistingResources;
}
@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(stackId());
hashCode = 31 * hashCode + Objects.hashCode(stackName());
hashCode = 31 * hashCode + Objects.hashCode(changeSetId());
hashCode = 31 * hashCode + Objects.hashCode(changeSetName());
hashCode = 31 * hashCode + Objects.hashCode(executionStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusReason());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(includeNestedStacks());
hashCode = 31 * hashCode + Objects.hashCode(parentChangeSetId());
hashCode = 31 * hashCode + Objects.hashCode(rootChangeSetId());
hashCode = 31 * hashCode + Objects.hashCode(importExistingResources());
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 ChangeSetSummary)) {
return false;
}
ChangeSetSummary other = (ChangeSetSummary) obj;
return Objects.equals(stackId(), other.stackId()) && Objects.equals(stackName(), other.stackName())
&& Objects.equals(changeSetId(), other.changeSetId()) && Objects.equals(changeSetName(), other.changeSetName())
&& Objects.equals(executionStatusAsString(), other.executionStatusAsString())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(statusReason(), other.statusReason()) && Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(description(), other.description())
&& Objects.equals(includeNestedStacks(), other.includeNestedStacks())
&& Objects.equals(parentChangeSetId(), other.parentChangeSetId())
&& Objects.equals(rootChangeSetId(), other.rootChangeSetId())
&& Objects.equals(importExistingResources(), other.importExistingResources());
}
/**
* 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("ChangeSetSummary").add("StackId", stackId()).add("StackName", stackName())
.add("ChangeSetId", changeSetId()).add("ChangeSetName", changeSetName())
.add("ExecutionStatus", executionStatusAsString()).add("Status", statusAsString())
.add("StatusReason", statusReason()).add("CreationTime", creationTime()).add("Description", description())
.add("IncludeNestedStacks", includeNestedStacks()).add("ParentChangeSetId", parentChangeSetId())
.add("RootChangeSetId", rootChangeSetId()).add("ImportExistingResources", importExistingResources()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "StackId":
return Optional.ofNullable(clazz.cast(stackId()));
case "StackName":
return Optional.ofNullable(clazz.cast(stackName()));
case "ChangeSetId":
return Optional.ofNullable(clazz.cast(changeSetId()));
case "ChangeSetName":
return Optional.ofNullable(clazz.cast(changeSetName()));
case "ExecutionStatus":
return Optional.ofNullable(clazz.cast(executionStatusAsString()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "StatusReason":
return Optional.ofNullable(clazz.cast(statusReason()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "IncludeNestedStacks":
return Optional.ofNullable(clazz.cast(includeNestedStacks()));
case "ParentChangeSetId":
return Optional.ofNullable(clazz.cast(parentChangeSetId()));
case "RootChangeSetId":
return Optional.ofNullable(clazz.cast(rootChangeSetId()));
case "ImportExistingResources":
return Optional.ofNullable(clazz.cast(importExistingResources()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function