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

software.amazon.awssdk.services.codepipeline.model.PipelineExecution 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.codepipeline.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Represents information about an execution of a pipeline. *

*/ @Generated("software.amazon.awssdk:codegen") public final class PipelineExecution implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField PIPELINE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("pipelineName").getter(getter(PipelineExecution::pipelineName)).setter(setter(Builder::pipelineName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pipelineName").build()).build(); private static final SdkField PIPELINE_VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER) .memberName("pipelineVersion").getter(getter(PipelineExecution::pipelineVersion)) .setter(setter(Builder::pipelineVersion)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pipelineVersion").build()).build(); private static final SdkField PIPELINE_EXECUTION_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("pipelineExecutionId").getter(getter(PipelineExecution::pipelineExecutionId)) .setter(setter(Builder::pipelineExecutionId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("pipelineExecutionId").build()) .build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(PipelineExecution::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField STATUS_SUMMARY_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("statusSummary").getter(getter(PipelineExecution::statusSummary)).setter(setter(Builder::statusSummary)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusSummary").build()).build(); private static final SdkField> ARTIFACT_REVISIONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("artifactRevisions") .getter(getter(PipelineExecution::artifactRevisions)) .setter(setter(Builder::artifactRevisions)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("artifactRevisions").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(ArtifactRevision::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PIPELINE_NAME_FIELD, PIPELINE_VERSION_FIELD, PIPELINE_EXECUTION_ID_FIELD, STATUS_FIELD, STATUS_SUMMARY_FIELD, ARTIFACT_REVISIONS_FIELD)); private static final long serialVersionUID = 1L; private final String pipelineName; private final Integer pipelineVersion; private final String pipelineExecutionId; private final String status; private final String statusSummary; private final List artifactRevisions; private PipelineExecution(BuilderImpl builder) { this.pipelineName = builder.pipelineName; this.pipelineVersion = builder.pipelineVersion; this.pipelineExecutionId = builder.pipelineExecutionId; this.status = builder.status; this.statusSummary = builder.statusSummary; this.artifactRevisions = builder.artifactRevisions; } /** *

* The name of the pipeline with the specified pipeline execution. *

* * @return The name of the pipeline with the specified pipeline execution. */ public final String pipelineName() { return pipelineName; } /** *

* The version number of the pipeline with the specified pipeline execution. *

* * @return The version number of the pipeline with the specified pipeline execution. */ public final Integer pipelineVersion() { return pipelineVersion; } /** *

* The ID of the pipeline execution. *

* * @return The ID of the pipeline execution. */ public final String pipelineExecutionId() { return pipelineExecutionId; } /** *

* The status of the pipeline execution. *

*
    *
  • *

    * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

    *
  • *
  • *

    * InProgress: The pipeline execution is currently running. *

    *
  • *
  • *

    * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

    *
  • *
  • *

    * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected stop mode, * the execution is either completing or abandoning in-progress actions. For more information, see Stopped Executions. *

    *
  • *
  • *

    * Succeeded: The pipeline execution was completed successfully. *

    *
  • *
  • *

    * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline * execution advanced and continued through the pipeline instead. For more information, see Superseded * Executions. *

    *
  • *
  • *

    * Failed: The pipeline execution was not completed successfully. *

    *
  • *
*

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

* * @return The status of the pipeline execution.

*
    *
  • *

    * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

    *
  • *
  • *

    * InProgress: The pipeline execution is currently running. *

    *
  • *
  • *

    * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

    *
  • *
  • *

    * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected * stop mode, the execution is either completing or abandoning in-progress actions. For more information, * see Stopped Executions. *

    *
  • *
  • *

    * Succeeded: The pipeline execution was completed successfully. *

    *
  • *
  • *

    * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer * pipeline execution advanced and continued through the pipeline instead. For more information, see Superseded * Executions. *

    *
  • *
  • *

    * Failed: The pipeline execution was not completed successfully. *

    *
  • * @see PipelineExecutionStatus */ public final PipelineExecutionStatus status() { return PipelineExecutionStatus.fromValue(status); } /** *

    * The status of the pipeline execution. *

    *
      *
    • *

      * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

      *
    • *
    • *

      * InProgress: The pipeline execution is currently running. *

      *
    • *
    • *

      * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

      *
    • *
    • *

      * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected stop mode, * the execution is either completing or abandoning in-progress actions. For more information, see Stopped Executions. *

      *
    • *
    • *

      * Succeeded: The pipeline execution was completed successfully. *

      *
    • *
    • *

      * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline * execution advanced and continued through the pipeline instead. For more information, see Superseded * Executions. *

      *
    • *
    • *

      * Failed: The pipeline execution was not completed successfully. *

      *
    • *
    *

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

    * * @return The status of the pipeline execution.

    *
      *
    • *

      * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

      *
    • *
    • *

      * InProgress: The pipeline execution is currently running. *

      *
    • *
    • *

      * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

      *
    • *
    • *

      * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected * stop mode, the execution is either completing or abandoning in-progress actions. For more information, * see Stopped Executions. *

      *
    • *
    • *

      * Succeeded: The pipeline execution was completed successfully. *

      *
    • *
    • *

      * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer * pipeline execution advanced and continued through the pipeline instead. For more information, see Superseded * Executions. *

      *
    • *
    • *

      * Failed: The pipeline execution was not completed successfully. *

      *
    • * @see PipelineExecutionStatus */ public final String statusAsString() { return status; } /** *

      * A summary that contains a description of the pipeline execution status. *

      * * @return A summary that contains a description of the pipeline execution status. */ public final String statusSummary() { return statusSummary; } /** * For responses, this returns true if the service returned a value for the ArtifactRevisions property. This DOES * NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasArtifactRevisions() { return artifactRevisions != null && !(artifactRevisions instanceof SdkAutoConstructList); } /** *

      * A list of ArtifactRevision objects included in a pipeline execution. *

      *

      * Attempts to modify the collection returned by this method will result in an UnsupportedOperationException. *

      *

      * This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasArtifactRevisions} method. *

      * * @return A list of ArtifactRevision objects included in a pipeline execution. */ public final List artifactRevisions() { return artifactRevisions; } @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(pipelineName()); hashCode = 31 * hashCode + Objects.hashCode(pipelineVersion()); hashCode = 31 * hashCode + Objects.hashCode(pipelineExecutionId()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusSummary()); hashCode = 31 * hashCode + Objects.hashCode(hasArtifactRevisions() ? artifactRevisions() : null); 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 PipelineExecution)) { return false; } PipelineExecution other = (PipelineExecution) obj; return Objects.equals(pipelineName(), other.pipelineName()) && Objects.equals(pipelineVersion(), other.pipelineVersion()) && Objects.equals(pipelineExecutionId(), other.pipelineExecutionId()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusSummary(), other.statusSummary()) && hasArtifactRevisions() == other.hasArtifactRevisions() && Objects.equals(artifactRevisions(), other.artifactRevisions()); } /** * 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("PipelineExecution").add("PipelineName", pipelineName()) .add("PipelineVersion", pipelineVersion()).add("PipelineExecutionId", pipelineExecutionId()) .add("Status", statusAsString()).add("StatusSummary", statusSummary()) .add("ArtifactRevisions", hasArtifactRevisions() ? artifactRevisions() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "pipelineName": return Optional.ofNullable(clazz.cast(pipelineName())); case "pipelineVersion": return Optional.ofNullable(clazz.cast(pipelineVersion())); case "pipelineExecutionId": return Optional.ofNullable(clazz.cast(pipelineExecutionId())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "statusSummary": return Optional.ofNullable(clazz.cast(statusSummary())); case "artifactRevisions": return Optional.ofNullable(clazz.cast(artifactRevisions())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((PipelineExecution) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * The name of the pipeline with the specified pipeline execution. *

      * * @param pipelineName * The name of the pipeline with the specified pipeline execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pipelineName(String pipelineName); /** *

      * The version number of the pipeline with the specified pipeline execution. *

      * * @param pipelineVersion * The version number of the pipeline with the specified pipeline execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pipelineVersion(Integer pipelineVersion); /** *

      * The ID of the pipeline execution. *

      * * @param pipelineExecutionId * The ID of the pipeline execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder pipelineExecutionId(String pipelineExecutionId); /** *

      * The status of the pipeline execution. *

      *
        *
      • *

        * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

        *
      • *
      • *

        * InProgress: The pipeline execution is currently running. *

        *
      • *
      • *

        * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

        *
      • *
      • *

        * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected stop * mode, the execution is either completing or abandoning in-progress actions. For more information, see * Stopped Executions. *

        *
      • *
      • *

        * Succeeded: The pipeline execution was completed successfully. *

        *
      • *
      • *

        * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline * execution advanced and continued through the pipeline instead. For more information, see Superseded * Executions. *

        *
      • *
      • *

        * Failed: The pipeline execution was not completed successfully. *

        *
      • *
      * * @param status * The status of the pipeline execution.

      *
        *
      • *

        * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

        *
      • *
      • *

        * InProgress: The pipeline execution is currently running. *

        *
      • *
      • *

        * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

        *
      • *
      • *

        * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected * stop mode, the execution is either completing or abandoning in-progress actions. For more information, * see Stopped Executions. *

        *
      • *
      • *

        * Succeeded: The pipeline execution was completed successfully. *

        *
      • *
      • *

        * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer * pipeline execution advanced and continued through the pipeline instead. For more information, see * Superseded Executions. *

        *
      • *
      • *

        * Failed: The pipeline execution was not completed successfully. *

        *
      • * @see PipelineExecutionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see PipelineExecutionStatus */ Builder status(String status); /** *

        * The status of the pipeline execution. *

        *
          *
        • *

          * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

          *
        • *
        • *

          * InProgress: The pipeline execution is currently running. *

          *
        • *
        • *

          * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

          *
        • *
        • *

          * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected stop * mode, the execution is either completing or abandoning in-progress actions. For more information, see * Stopped Executions. *

          *
        • *
        • *

          * Succeeded: The pipeline execution was completed successfully. *

          *
        • *
        • *

          * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer pipeline * execution advanced and continued through the pipeline instead. For more information, see Superseded * Executions. *

          *
        • *
        • *

          * Failed: The pipeline execution was not completed successfully. *

          *
        • *
        * * @param status * The status of the pipeline execution.

        *
          *
        • *

          * Cancelled: The pipeline’s definition was updated before the pipeline execution could be completed. *

          *
        • *
        • *

          * InProgress: The pipeline execution is currently running. *

          *
        • *
        • *

          * Stopped: The pipeline execution was manually stopped. For more information, see Stopped Executions. *

          *
        • *
        • *

          * Stopping: The pipeline execution received a request to be manually stopped. Depending on the selected * stop mode, the execution is either completing or abandoning in-progress actions. For more information, * see Stopped Executions. *

          *
        • *
        • *

          * Succeeded: The pipeline execution was completed successfully. *

          *
        • *
        • *

          * Superseded: While this pipeline execution was waiting for the next stage to be completed, a newer * pipeline execution advanced and continued through the pipeline instead. For more information, see * Superseded Executions. *

          *
        • *
        • *

          * Failed: The pipeline execution was not completed successfully. *

          *
        • * @see PipelineExecutionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see PipelineExecutionStatus */ Builder status(PipelineExecutionStatus status); /** *

          * A summary that contains a description of the pipeline execution status. *

          * * @param statusSummary * A summary that contains a description of the pipeline execution status. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusSummary(String statusSummary); /** *

          * A list of ArtifactRevision objects included in a pipeline execution. *

          * * @param artifactRevisions * A list of ArtifactRevision objects included in a pipeline execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder artifactRevisions(Collection artifactRevisions); /** *

          * A list of ArtifactRevision objects included in a pipeline execution. *

          * * @param artifactRevisions * A list of ArtifactRevision objects included in a pipeline execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder artifactRevisions(ArtifactRevision... artifactRevisions); /** *

          * A list of ArtifactRevision objects included in a pipeline execution. *

          * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.codepipeline.model.ArtifactRevision.Builder} avoiding the need to * create one manually via {@link software.amazon.awssdk.services.codepipeline.model.ArtifactRevision#builder()} * . * *

          * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.codepipeline.model.ArtifactRevision.Builder#build()} is called * immediately and its result is passed to {@link #artifactRevisions(List)}. * * @param artifactRevisions * a consumer that will call methods on * {@link software.amazon.awssdk.services.codepipeline.model.ArtifactRevision.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #artifactRevisions(java.util.Collection) */ Builder artifactRevisions(Consumer... artifactRevisions); } static final class BuilderImpl implements Builder { private String pipelineName; private Integer pipelineVersion; private String pipelineExecutionId; private String status; private String statusSummary; private List artifactRevisions = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(PipelineExecution model) { pipelineName(model.pipelineName); pipelineVersion(model.pipelineVersion); pipelineExecutionId(model.pipelineExecutionId); status(model.status); statusSummary(model.statusSummary); artifactRevisions(model.artifactRevisions); } public final String getPipelineName() { return pipelineName; } public final void setPipelineName(String pipelineName) { this.pipelineName = pipelineName; } @Override public final Builder pipelineName(String pipelineName) { this.pipelineName = pipelineName; return this; } public final Integer getPipelineVersion() { return pipelineVersion; } public final void setPipelineVersion(Integer pipelineVersion) { this.pipelineVersion = pipelineVersion; } @Override public final Builder pipelineVersion(Integer pipelineVersion) { this.pipelineVersion = pipelineVersion; return this; } public final String getPipelineExecutionId() { return pipelineExecutionId; } public final void setPipelineExecutionId(String pipelineExecutionId) { this.pipelineExecutionId = pipelineExecutionId; } @Override public final Builder pipelineExecutionId(String pipelineExecutionId) { this.pipelineExecutionId = pipelineExecutionId; 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(PipelineExecutionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getStatusSummary() { return statusSummary; } public final void setStatusSummary(String statusSummary) { this.statusSummary = statusSummary; } @Override public final Builder statusSummary(String statusSummary) { this.statusSummary = statusSummary; return this; } public final List getArtifactRevisions() { List result = ArtifactRevisionListCopier.copyToBuilder(this.artifactRevisions); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setArtifactRevisions(Collection artifactRevisions) { this.artifactRevisions = ArtifactRevisionListCopier.copyFromBuilder(artifactRevisions); } @Override public final Builder artifactRevisions(Collection artifactRevisions) { this.artifactRevisions = ArtifactRevisionListCopier.copy(artifactRevisions); return this; } @Override @SafeVarargs public final Builder artifactRevisions(ArtifactRevision... artifactRevisions) { artifactRevisions(Arrays.asList(artifactRevisions)); return this; } @Override @SafeVarargs public final Builder artifactRevisions(Consumer... artifactRevisions) { artifactRevisions(Stream.of(artifactRevisions).map(c -> ArtifactRevision.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } @Override public PipelineExecution build() { return new PipelineExecution(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy