software.amazon.awssdk.services.codepipeline.model.ExecutionDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of codepipeline Show documentation
Show all versions of codepipeline Show documentation
The AWS Java SDK for AWS CodePipeline module holds the client classes that are used for communicating
with AWS
CodePipeline
/*
* 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.codepipeline.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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 details of the actions taken and results produced on an artifact as it passes through stages in the pipeline.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExecutionDetails implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField SUMMARY_FIELD = SdkField. builder(MarshallingType.STRING).memberName("summary")
.getter(getter(ExecutionDetails::summary)).setter(setter(Builder::summary))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("summary").build()).build();
private static final SdkField EXTERNAL_EXECUTION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("externalExecutionId").getter(getter(ExecutionDetails::externalExecutionId))
.setter(setter(Builder::externalExecutionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("externalExecutionId").build())
.build();
private static final SdkField PERCENT_COMPLETE_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("percentComplete").getter(getter(ExecutionDetails::percentComplete))
.setter(setter(Builder::percentComplete))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("percentComplete").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SUMMARY_FIELD,
EXTERNAL_EXECUTION_ID_FIELD, PERCENT_COMPLETE_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("summary", SUMMARY_FIELD);
put("externalExecutionId", EXTERNAL_EXECUTION_ID_FIELD);
put("percentComplete", PERCENT_COMPLETE_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final String summary;
private final String externalExecutionId;
private final Integer percentComplete;
private ExecutionDetails(BuilderImpl builder) {
this.summary = builder.summary;
this.externalExecutionId = builder.externalExecutionId;
this.percentComplete = builder.percentComplete;
}
/**
*
* The summary of the current status of the actions.
*
*
* @return The summary of the current status of the actions.
*/
public final String summary() {
return summary;
}
/**
*
* The system-generated unique ID of this action used to identify this job worker in any external systems, such as
* CodeDeploy.
*
*
* @return The system-generated unique ID of this action used to identify this job worker in any external systems,
* such as CodeDeploy.
*/
public final String externalExecutionId() {
return externalExecutionId;
}
/**
*
* The percentage of work completed on the action, represented on a scale of 0 to 100 percent.
*
*
* @return The percentage of work completed on the action, represented on a scale of 0 to 100 percent.
*/
public final Integer percentComplete() {
return percentComplete;
}
@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(summary());
hashCode = 31 * hashCode + Objects.hashCode(externalExecutionId());
hashCode = 31 * hashCode + Objects.hashCode(percentComplete());
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 ExecutionDetails)) {
return false;
}
ExecutionDetails other = (ExecutionDetails) obj;
return Objects.equals(summary(), other.summary()) && Objects.equals(externalExecutionId(), other.externalExecutionId())
&& Objects.equals(percentComplete(), other.percentComplete());
}
/**
* 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("ExecutionDetails").add("Summary", summary()).add("ExternalExecutionId", externalExecutionId())
.add("PercentComplete", percentComplete()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "summary":
return Optional.ofNullable(clazz.cast(summary()));
case "externalExecutionId":
return Optional.ofNullable(clazz.cast(externalExecutionId()));
case "percentComplete":
return Optional.ofNullable(clazz.cast(percentComplete()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function
© 2015 - 2024 Weber Informatics LLC | Privacy Policy