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

software.amazon.awssdk.services.transfer.model.ExecutionStepResult 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.transfer.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;

/**
 * 

* Specifies the following details for the step: error (if any), outputs (if any), and the step type. *

*/ @Generated("software.amazon.awssdk:codegen") public final class ExecutionStepResult implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField STEP_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StepType").getter(getter(ExecutionStepResult::stepTypeAsString)).setter(setter(Builder::stepType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StepType").build()).build(); private static final SdkField OUTPUTS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Outputs") .getter(getter(ExecutionStepResult::outputs)).setter(setter(Builder::outputs)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Outputs").build()).build(); private static final SdkField ERROR_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("Error").getter(getter(ExecutionStepResult::error)).setter(setter(Builder::error)) .constructor(ExecutionError::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Error").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STEP_TYPE_FIELD, OUTPUTS_FIELD, ERROR_FIELD)); private static final long serialVersionUID = 1L; private final String stepType; private final String outputs; private final ExecutionError error; private ExecutionStepResult(BuilderImpl builder) { this.stepType = builder.stepType; this.outputs = builder.outputs; this.error = builder.error; } /** *

* One of the available step types. *

*
    *
  • *

    * COPY - Copy the file to another location. *

    *
  • *
  • *

    * CUSTOM - Perform a custom step with an Lambda function target. *

    *
  • *
  • *

    * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

    *
  • *
  • *

    * DELETE - Delete the file. *

    *
  • *
  • *

    * TAG - Add a tag to the file. *

    *
  • *
*

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

* * @return One of the available step types.

*
    *
  • *

    * COPY - Copy the file to another location. *

    *
  • *
  • *

    * CUSTOM - Perform a custom step with an Lambda function target. *

    *
  • *
  • *

    * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

    *
  • *
  • *

    * DELETE - Delete the file. *

    *
  • *
  • *

    * TAG - Add a tag to the file. *

    *
  • * @see WorkflowStepType */ public final WorkflowStepType stepType() { return WorkflowStepType.fromValue(stepType); } /** *

    * One of the available step types. *

    *
      *
    • *

      * COPY - Copy the file to another location. *

      *
    • *
    • *

      * CUSTOM - Perform a custom step with an Lambda function target. *

      *
    • *
    • *

      * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

      *
    • *
    • *

      * DELETE - Delete the file. *

      *
    • *
    • *

      * TAG - Add a tag to the file. *

      *
    • *
    *

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

    * * @return One of the available step types.

    *
      *
    • *

      * COPY - Copy the file to another location. *

      *
    • *
    • *

      * CUSTOM - Perform a custom step with an Lambda function target. *

      *
    • *
    • *

      * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

      *
    • *
    • *

      * DELETE - Delete the file. *

      *
    • *
    • *

      * TAG - Add a tag to the file. *

      *
    • * @see WorkflowStepType */ public final String stepTypeAsString() { return stepType; } /** *

      * The values for the key/value pair applied as a tag to the file. Only applicable if the step type is * TAG. *

      * * @return The values for the key/value pair applied as a tag to the file. Only applicable if the step type is * TAG. */ public final String outputs() { return outputs; } /** *

      * Specifies the details for an error, if it occurred during execution of the specified workflow step. *

      * * @return Specifies the details for an error, if it occurred during execution of the specified workflow step. */ public final ExecutionError error() { return error; } @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(stepTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(outputs()); hashCode = 31 * hashCode + Objects.hashCode(error()); 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 ExecutionStepResult)) { return false; } ExecutionStepResult other = (ExecutionStepResult) obj; return Objects.equals(stepTypeAsString(), other.stepTypeAsString()) && Objects.equals(outputs(), other.outputs()) && Objects.equals(error(), other.error()); } /** * 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("ExecutionStepResult").add("StepType", stepTypeAsString()).add("Outputs", outputs()) .add("Error", error()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "StepType": return Optional.ofNullable(clazz.cast(stepTypeAsString())); case "Outputs": return Optional.ofNullable(clazz.cast(outputs())); case "Error": return Optional.ofNullable(clazz.cast(error())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ExecutionStepResult) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

      * One of the available step types. *

      *
        *
      • *

        * COPY - Copy the file to another location. *

        *
      • *
      • *

        * CUSTOM - Perform a custom step with an Lambda function target. *

        *
      • *
      • *

        * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

        *
      • *
      • *

        * DELETE - Delete the file. *

        *
      • *
      • *

        * TAG - Add a tag to the file. *

        *
      • *
      * * @param stepType * One of the available step types.

      *
        *
      • *

        * COPY - Copy the file to another location. *

        *
      • *
      • *

        * CUSTOM - Perform a custom step with an Lambda function target. *

        *
      • *
      • *

        * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

        *
      • *
      • *

        * DELETE - Delete the file. *

        *
      • *
      • *

        * TAG - Add a tag to the file. *

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

        * One of the available step types. *

        *
          *
        • *

          * COPY - Copy the file to another location. *

          *
        • *
        • *

          * CUSTOM - Perform a custom step with an Lambda function target. *

          *
        • *
        • *

          * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

          *
        • *
        • *

          * DELETE - Delete the file. *

          *
        • *
        • *

          * TAG - Add a tag to the file. *

          *
        • *
        * * @param stepType * One of the available step types.

        *
          *
        • *

          * COPY - Copy the file to another location. *

          *
        • *
        • *

          * CUSTOM - Perform a custom step with an Lambda function target. *

          *
        • *
        • *

          * DECRYPT - Decrypt a file that was encrypted before it was uploaded. *

          *
        • *
        • *

          * DELETE - Delete the file. *

          *
        • *
        • *

          * TAG - Add a tag to the file. *

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

          * The values for the key/value pair applied as a tag to the file. Only applicable if the step type is * TAG. *

          * * @param outputs * The values for the key/value pair applied as a tag to the file. Only applicable if the step type is * TAG. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputs(String outputs); /** *

          * Specifies the details for an error, if it occurred during execution of the specified workflow step. *

          * * @param error * Specifies the details for an error, if it occurred during execution of the specified workflow step. * @return Returns a reference to this object so that method calls can be chained together. */ Builder error(ExecutionError error); /** *

          * Specifies the details for an error, if it occurred during execution of the specified workflow step. *

          * This is a convenience method that creates an instance of the {@link ExecutionError.Builder} avoiding the need * to create one manually via {@link ExecutionError#builder()}. * *

          * When the {@link Consumer} completes, {@link ExecutionError.Builder#build()} is called immediately and its * result is passed to {@link #error(ExecutionError)}. * * @param error * a consumer that will call methods on {@link ExecutionError.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #error(ExecutionError) */ default Builder error(Consumer error) { return error(ExecutionError.builder().applyMutation(error).build()); } } static final class BuilderImpl implements Builder { private String stepType; private String outputs; private ExecutionError error; private BuilderImpl() { } private BuilderImpl(ExecutionStepResult model) { stepType(model.stepType); outputs(model.outputs); error(model.error); } public final String getStepType() { return stepType; } public final void setStepType(String stepType) { this.stepType = stepType; } @Override public final Builder stepType(String stepType) { this.stepType = stepType; return this; } @Override public final Builder stepType(WorkflowStepType stepType) { this.stepType(stepType == null ? null : stepType.toString()); return this; } public final String getOutputs() { return outputs; } public final void setOutputs(String outputs) { this.outputs = outputs; } @Override public final Builder outputs(String outputs) { this.outputs = outputs; return this; } public final ExecutionError.Builder getError() { return error != null ? error.toBuilder() : null; } public final void setError(ExecutionError.BuilderImpl error) { this.error = error != null ? error.build() : null; } @Override public final Builder error(ExecutionError error) { this.error = error; return this; } @Override public ExecutionStepResult build() { return new ExecutionStepResult(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy