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

software.amazon.awssdk.services.elasticbeanstalk.model.ManagedActionHistoryItem Maven / Gradle / Ivy

/*
 * 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.elasticbeanstalk.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 record of a completed or failed managed action. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ManagedActionHistoryItem implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ACTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ActionId").getter(getter(ManagedActionHistoryItem::actionId)).setter(setter(Builder::actionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActionId").build()).build(); private static final SdkField ACTION_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ActionType").getter(getter(ManagedActionHistoryItem::actionTypeAsString)) .setter(setter(Builder::actionType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActionType").build()).build(); private static final SdkField ACTION_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ActionDescription").getter(getter(ManagedActionHistoryItem::actionDescription)) .setter(setter(Builder::actionDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActionDescription").build()).build(); private static final SdkField FAILURE_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FailureType").getter(getter(ManagedActionHistoryItem::failureTypeAsString)) .setter(setter(Builder::failureType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureType").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(ManagedActionHistoryItem::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField FAILURE_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("FailureDescription").getter(getter(ManagedActionHistoryItem::failureDescription)) .setter(setter(Builder::failureDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureDescription").build()) .build(); private static final SdkField EXECUTED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("ExecutedTime").getter(getter(ManagedActionHistoryItem::executedTime)) .setter(setter(Builder::executedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExecutedTime").build()).build(); private static final SdkField FINISHED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("FinishedTime").getter(getter(ManagedActionHistoryItem::finishedTime)) .setter(setter(Builder::finishedTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FinishedTime").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ACTION_ID_FIELD, ACTION_TYPE_FIELD, ACTION_DESCRIPTION_FIELD, FAILURE_TYPE_FIELD, STATUS_FIELD, FAILURE_DESCRIPTION_FIELD, EXECUTED_TIME_FIELD, FINISHED_TIME_FIELD)); private static final long serialVersionUID = 1L; private final String actionId; private final String actionType; private final String actionDescription; private final String failureType; private final String status; private final String failureDescription; private final Instant executedTime; private final Instant finishedTime; private ManagedActionHistoryItem(BuilderImpl builder) { this.actionId = builder.actionId; this.actionType = builder.actionType; this.actionDescription = builder.actionDescription; this.failureType = builder.failureType; this.status = builder.status; this.failureDescription = builder.failureDescription; this.executedTime = builder.executedTime; this.finishedTime = builder.finishedTime; } /** *

* A unique identifier for the managed action. *

* * @return A unique identifier for the managed action. */ public final String actionId() { return actionId; } /** *

* The type of the managed action. *

*

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

* * @return The type of the managed action. * @see ActionType */ public final ActionType actionType() { return ActionType.fromValue(actionType); } /** *

* The type of the managed action. *

*

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

* * @return The type of the managed action. * @see ActionType */ public final String actionTypeAsString() { return actionType; } /** *

* A description of the managed action. *

* * @return A description of the managed action. */ public final String actionDescription() { return actionDescription; } /** *

* If the action failed, the type of failure. *

*

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

* * @return If the action failed, the type of failure. * @see FailureType */ public final FailureType failureType() { return FailureType.fromValue(failureType); } /** *

* If the action failed, the type of failure. *

*

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

* * @return If the action failed, the type of failure. * @see FailureType */ public final String failureTypeAsString() { return failureType; } /** *

* The status of the action. *

*

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

* * @return The status of the action. * @see ActionHistoryStatus */ public final ActionHistoryStatus status() { return ActionHistoryStatus.fromValue(status); } /** *

* The status of the action. *

*

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

* * @return The status of the action. * @see ActionHistoryStatus */ public final String statusAsString() { return status; } /** *

* If the action failed, a description of the failure. *

* * @return If the action failed, a description of the failure. */ public final String failureDescription() { return failureDescription; } /** *

* The date and time that the action started executing. *

* * @return The date and time that the action started executing. */ public final Instant executedTime() { return executedTime; } /** *

* The date and time that the action finished executing. *

* * @return The date and time that the action finished executing. */ public final Instant finishedTime() { return finishedTime; } @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(actionId()); hashCode = 31 * hashCode + Objects.hashCode(actionTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(actionDescription()); hashCode = 31 * hashCode + Objects.hashCode(failureTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(failureDescription()); hashCode = 31 * hashCode + Objects.hashCode(executedTime()); hashCode = 31 * hashCode + Objects.hashCode(finishedTime()); 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 ManagedActionHistoryItem)) { return false; } ManagedActionHistoryItem other = (ManagedActionHistoryItem) obj; return Objects.equals(actionId(), other.actionId()) && Objects.equals(actionTypeAsString(), other.actionTypeAsString()) && Objects.equals(actionDescription(), other.actionDescription()) && Objects.equals(failureTypeAsString(), other.failureTypeAsString()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(failureDescription(), other.failureDescription()) && Objects.equals(executedTime(), other.executedTime()) && Objects.equals(finishedTime(), other.finishedTime()); } /** * 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("ManagedActionHistoryItem").add("ActionId", actionId()).add("ActionType", actionTypeAsString()) .add("ActionDescription", actionDescription()).add("FailureType", failureTypeAsString()) .add("Status", statusAsString()).add("FailureDescription", failureDescription()) .add("ExecutedTime", executedTime()).add("FinishedTime", finishedTime()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ActionId": return Optional.ofNullable(clazz.cast(actionId())); case "ActionType": return Optional.ofNullable(clazz.cast(actionTypeAsString())); case "ActionDescription": return Optional.ofNullable(clazz.cast(actionDescription())); case "FailureType": return Optional.ofNullable(clazz.cast(failureTypeAsString())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "FailureDescription": return Optional.ofNullable(clazz.cast(failureDescription())); case "ExecutedTime": return Optional.ofNullable(clazz.cast(executedTime())); case "FinishedTime": return Optional.ofNullable(clazz.cast(finishedTime())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ManagedActionHistoryItem) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* A unique identifier for the managed action. *

* * @param actionId * A unique identifier for the managed action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionId(String actionId); /** *

* The type of the managed action. *

* * @param actionType * The type of the managed action. * @see ActionType * @return Returns a reference to this object so that method calls can be chained together. * @see ActionType */ Builder actionType(String actionType); /** *

* The type of the managed action. *

* * @param actionType * The type of the managed action. * @see ActionType * @return Returns a reference to this object so that method calls can be chained together. * @see ActionType */ Builder actionType(ActionType actionType); /** *

* A description of the managed action. *

* * @param actionDescription * A description of the managed action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder actionDescription(String actionDescription); /** *

* If the action failed, the type of failure. *

* * @param failureType * If the action failed, the type of failure. * @see FailureType * @return Returns a reference to this object so that method calls can be chained together. * @see FailureType */ Builder failureType(String failureType); /** *

* If the action failed, the type of failure. *

* * @param failureType * If the action failed, the type of failure. * @see FailureType * @return Returns a reference to this object so that method calls can be chained together. * @see FailureType */ Builder failureType(FailureType failureType); /** *

* The status of the action. *

* * @param status * The status of the action. * @see ActionHistoryStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ActionHistoryStatus */ Builder status(String status); /** *

* The status of the action. *

* * @param status * The status of the action. * @see ActionHistoryStatus * @return Returns a reference to this object so that method calls can be chained together. * @see ActionHistoryStatus */ Builder status(ActionHistoryStatus status); /** *

* If the action failed, a description of the failure. *

* * @param failureDescription * If the action failed, a description of the failure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureDescription(String failureDescription); /** *

* The date and time that the action started executing. *

* * @param executedTime * The date and time that the action started executing. * @return Returns a reference to this object so that method calls can be chained together. */ Builder executedTime(Instant executedTime); /** *

* The date and time that the action finished executing. *

* * @param finishedTime * The date and time that the action finished executing. * @return Returns a reference to this object so that method calls can be chained together. */ Builder finishedTime(Instant finishedTime); } static final class BuilderImpl implements Builder { private String actionId; private String actionType; private String actionDescription; private String failureType; private String status; private String failureDescription; private Instant executedTime; private Instant finishedTime; private BuilderImpl() { } private BuilderImpl(ManagedActionHistoryItem model) { actionId(model.actionId); actionType(model.actionType); actionDescription(model.actionDescription); failureType(model.failureType); status(model.status); failureDescription(model.failureDescription); executedTime(model.executedTime); finishedTime(model.finishedTime); } public final String getActionId() { return actionId; } public final void setActionId(String actionId) { this.actionId = actionId; } @Override public final Builder actionId(String actionId) { this.actionId = actionId; return this; } public final String getActionType() { return actionType; } public final void setActionType(String actionType) { this.actionType = actionType; } @Override public final Builder actionType(String actionType) { this.actionType = actionType; return this; } @Override public final Builder actionType(ActionType actionType) { this.actionType(actionType == null ? null : actionType.toString()); return this; } public final String getActionDescription() { return actionDescription; } public final void setActionDescription(String actionDescription) { this.actionDescription = actionDescription; } @Override public final Builder actionDescription(String actionDescription) { this.actionDescription = actionDescription; return this; } public final String getFailureType() { return failureType; } public final void setFailureType(String failureType) { this.failureType = failureType; } @Override public final Builder failureType(String failureType) { this.failureType = failureType; return this; } @Override public final Builder failureType(FailureType failureType) { this.failureType(failureType == null ? null : failureType.toString()); 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(ActionHistoryStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getFailureDescription() { return failureDescription; } public final void setFailureDescription(String failureDescription) { this.failureDescription = failureDescription; } @Override public final Builder failureDescription(String failureDescription) { this.failureDescription = failureDescription; return this; } public final Instant getExecutedTime() { return executedTime; } public final void setExecutedTime(Instant executedTime) { this.executedTime = executedTime; } @Override public final Builder executedTime(Instant executedTime) { this.executedTime = executedTime; return this; } public final Instant getFinishedTime() { return finishedTime; } public final void setFinishedTime(Instant finishedTime) { this.finishedTime = finishedTime; } @Override public final Builder finishedTime(Instant finishedTime) { this.finishedTime = finishedTime; return this; } @Override public ManagedActionHistoryItem build() { return new ManagedActionHistoryItem(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy