software.amazon.awssdk.services.cloudformation.model.StackSetOperationResultSummary 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.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.Consumer;
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 structure that contains information about a specified operation's results for a given account in a given Region.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class StackSetOperationResultSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField ACCOUNT_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(StackSetOperationResultSummary::account)).setter(setter(Builder::account))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Account").build()).build();
private static final SdkField REGION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(StackSetOperationResultSummary::region)).setter(setter(Builder::region))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Region").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(StackSetOperationResultSummary::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)
.getter(getter(StackSetOperationResultSummary::statusReason)).setter(setter(Builder::statusReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusReason").build()).build();
private static final SdkField ACCOUNT_GATE_RESULT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.getter(getter(StackSetOperationResultSummary::accountGateResult)).setter(setter(Builder::accountGateResult))
.constructor(AccountGateResult::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AccountGateResult").build()).build();
private static final SdkField ORGANIZATIONAL_UNIT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(StackSetOperationResultSummary::organizationalUnitId)).setter(setter(Builder::organizationalUnitId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OrganizationalUnitId").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACCOUNT_FIELD, REGION_FIELD,
STATUS_FIELD, STATUS_REASON_FIELD, ACCOUNT_GATE_RESULT_FIELD, ORGANIZATIONAL_UNIT_ID_FIELD));
private static final long serialVersionUID = 1L;
private final String account;
private final String region;
private final String status;
private final String statusReason;
private final AccountGateResult accountGateResult;
private final String organizationalUnitId;
private StackSetOperationResultSummary(BuilderImpl builder) {
this.account = builder.account;
this.region = builder.region;
this.status = builder.status;
this.statusReason = builder.statusReason;
this.accountGateResult = builder.accountGateResult;
this.organizationalUnitId = builder.organizationalUnitId;
}
/**
*
* [Self-managed
permissions] The name of the AWS account for this operation result.
*
*
* @return [Self-managed
permissions] The name of the AWS account for this operation result.
*/
public String account() {
return account;
}
/**
*
* The name of the AWS Region for this operation result.
*
*
* @return The name of the AWS Region for this operation result.
*/
public String region() {
return region;
}
/**
*
* The result status of the stack set operation for the given account in the given Region.
*
*
* -
*
* CANCELLED
: The operation in the specified account and Region has been cancelled. This is either
* because a user has stopped the stack set operation, or because the failure tolerance of the stack set operation
* has been exceeded.
*
*
* -
*
* FAILED
: The operation in the specified account and Region failed.
*
*
* If the stack set operation fails in enough accounts within a Region, the failure tolerance for the stack set
* operation as a whole might be exceeded.
*
*
* -
*
* RUNNING
: The operation in the specified account and Region is currently in progress.
*
*
* -
*
* PENDING
: The operation in the specified account and Region has yet to start.
*
*
* -
*
* SUCCEEDED
: The operation in the specified account and Region completed successfully.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link StackSetOperationResultStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The result status of the stack set operation for the given account in the given Region.
*
* -
*
* CANCELLED
: The operation in the specified account and Region has been cancelled. This is
* either because a user has stopped the stack set operation, or because the failure tolerance of the stack
* set operation has been exceeded.
*
*
* -
*
* FAILED
: The operation in the specified account and Region failed.
*
*
* If the stack set operation fails in enough accounts within a Region, the failure tolerance for the stack
* set operation as a whole might be exceeded.
*
*
* -
*
* RUNNING
: The operation in the specified account and Region is currently in progress.
*
*
* -
*
* PENDING
: The operation in the specified account and Region has yet to start.
*
*
* -
*
* SUCCEEDED
: The operation in the specified account and Region completed successfully.
*
*
* @see StackSetOperationResultStatus
*/
public StackSetOperationResultStatus status() {
return StackSetOperationResultStatus.fromValue(status);
}
/**
*
* The result status of the stack set operation for the given account in the given Region.
*
*
* -
*
* CANCELLED
: The operation in the specified account and Region has been cancelled. This is either
* because a user has stopped the stack set operation, or because the failure tolerance of the stack set operation
* has been exceeded.
*
*
* -
*
* FAILED
: The operation in the specified account and Region failed.
*
*
* If the stack set operation fails in enough accounts within a Region, the failure tolerance for the stack set
* operation as a whole might be exceeded.
*
*
* -
*
* RUNNING
: The operation in the specified account and Region is currently in progress.
*
*
* -
*
* PENDING
: The operation in the specified account and Region has yet to start.
*
*
* -
*
* SUCCEEDED
: The operation in the specified account and Region completed successfully.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link StackSetOperationResultStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The result status of the stack set operation for the given account in the given Region.
*
* -
*
* CANCELLED
: The operation in the specified account and Region has been cancelled. This is
* either because a user has stopped the stack set operation, or because the failure tolerance of the stack
* set operation has been exceeded.
*
*
* -
*
* FAILED
: The operation in the specified account and Region failed.
*
*
* If the stack set operation fails in enough accounts within a Region, the failure tolerance for the stack
* set operation as a whole might be exceeded.
*
*
* -
*
* RUNNING
: The operation in the specified account and Region is currently in progress.
*
*
* -
*
* PENDING
: The operation in the specified account and Region has yet to start.
*
*
* -
*
* SUCCEEDED
: The operation in the specified account and Region completed successfully.
*
*
* @see StackSetOperationResultStatus
*/
public String statusAsString() {
return status;
}
/**
*
* The reason for the assigned result status.
*
*
* @return The reason for the assigned result status.
*/
public String statusReason() {
return statusReason;
}
/**
*
* The results of the account gate function AWS CloudFormation invokes, if present, before proceeding with stack set
* operations in an account
*
*
* @return The results of the account gate function AWS CloudFormation invokes, if present, before proceeding with
* stack set operations in an account
*/
public AccountGateResult accountGateResult() {
return accountGateResult;
}
/**
*
* [Service-managed
permissions] The organization root ID or organizational unit (OU) IDs that you
* specified for DeploymentTargets.
*
*
* @return [Service-managed
permissions] The organization root ID or organizational unit (OU) IDs that
* you specified for DeploymentTargets.
*/
public String organizationalUnitId() {
return organizationalUnitId;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(account());
hashCode = 31 * hashCode + Objects.hashCode(region());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusReason());
hashCode = 31 * hashCode + Objects.hashCode(accountGateResult());
hashCode = 31 * hashCode + Objects.hashCode(organizationalUnitId());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StackSetOperationResultSummary)) {
return false;
}
StackSetOperationResultSummary other = (StackSetOperationResultSummary) obj;
return Objects.equals(account(), other.account()) && Objects.equals(region(), other.region())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(statusReason(), other.statusReason())
&& Objects.equals(accountGateResult(), other.accountGateResult())
&& Objects.equals(organizationalUnitId(), other.organizationalUnitId());
}
/**
* 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 String toString() {
return ToString.builder("StackSetOperationResultSummary").add("Account", account()).add("Region", region())
.add("Status", statusAsString()).add("StatusReason", statusReason())
.add("AccountGateResult", accountGateResult()).add("OrganizationalUnitId", organizationalUnitId()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "Account":
return Optional.ofNullable(clazz.cast(account()));
case "Region":
return Optional.ofNullable(clazz.cast(region()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "StatusReason":
return Optional.ofNullable(clazz.cast(statusReason()));
case "AccountGateResult":
return Optional.ofNullable(clazz.cast(accountGateResult()));
case "OrganizationalUnitId":
return Optional.ofNullable(clazz.cast(organizationalUnitId()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function