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

software.amazon.awssdk.services.datasync.model.DescribeTaskExecutionResponse 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.datasync.model;

import java.time.Instant;
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;

/**
 * 

* DescribeTaskExecutionResponse *

*/ @Generated("software.amazon.awssdk:codegen") public final class DescribeTaskExecutionResponse extends DataSyncResponse implements ToCopyableBuilder { private static final SdkField TASK_EXECUTION_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TaskExecutionArn").getter(getter(DescribeTaskExecutionResponse::taskExecutionArn)) .setter(setter(Builder::taskExecutionArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TaskExecutionArn").build()).build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status") .getter(getter(DescribeTaskExecutionResponse::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build(); private static final SdkField OPTIONS_FIELD = SdkField. builder(MarshallingType.SDK_POJO) .memberName("Options").getter(getter(DescribeTaskExecutionResponse::options)).setter(setter(Builder::options)) .constructor(Options::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Options").build()).build(); private static final SdkField> EXCLUDES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Excludes") .getter(getter(DescribeTaskExecutionResponse::excludes)) .setter(setter(Builder::excludes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Excludes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(FilterRule::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField> INCLUDES_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("Includes") .getter(getter(DescribeTaskExecutionResponse::includes)) .setter(setter(Builder::includes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Includes").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(FilterRule::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").build()).build()).build()).build(); private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("StartTime").getter(getter(DescribeTaskExecutionResponse::startTime)).setter(setter(Builder::startTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build(); private static final SdkField ESTIMATED_FILES_TO_TRANSFER_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("EstimatedFilesToTransfer").getter(getter(DescribeTaskExecutionResponse::estimatedFilesToTransfer)) .setter(setter(Builder::estimatedFilesToTransfer)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedFilesToTransfer").build()) .build(); private static final SdkField ESTIMATED_BYTES_TO_TRANSFER_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("EstimatedBytesToTransfer").getter(getter(DescribeTaskExecutionResponse::estimatedBytesToTransfer)) .setter(setter(Builder::estimatedBytesToTransfer)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EstimatedBytesToTransfer").build()) .build(); private static final SdkField FILES_TRANSFERRED_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("FilesTransferred").getter(getter(DescribeTaskExecutionResponse::filesTransferred)) .setter(setter(Builder::filesTransferred)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FilesTransferred").build()).build(); private static final SdkField BYTES_WRITTEN_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("BytesWritten").getter(getter(DescribeTaskExecutionResponse::bytesWritten)) .setter(setter(Builder::bytesWritten)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BytesWritten").build()).build(); private static final SdkField BYTES_TRANSFERRED_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("BytesTransferred").getter(getter(DescribeTaskExecutionResponse::bytesTransferred)) .setter(setter(Builder::bytesTransferred)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BytesTransferred").build()).build(); private static final SdkField RESULT_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("Result") .getter(getter(DescribeTaskExecutionResponse::result)).setter(setter(Builder::result)) .constructor(TaskExecutionResultDetail::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Result").build()).build(); private static final SdkField BYTES_COMPRESSED_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("BytesCompressed").getter(getter(DescribeTaskExecutionResponse::bytesCompressed)) .setter(setter(Builder::bytesCompressed)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BytesCompressed").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TASK_EXECUTION_ARN_FIELD, STATUS_FIELD, OPTIONS_FIELD, EXCLUDES_FIELD, INCLUDES_FIELD, START_TIME_FIELD, ESTIMATED_FILES_TO_TRANSFER_FIELD, ESTIMATED_BYTES_TO_TRANSFER_FIELD, FILES_TRANSFERRED_FIELD, BYTES_WRITTEN_FIELD, BYTES_TRANSFERRED_FIELD, RESULT_FIELD, BYTES_COMPRESSED_FIELD)); private final String taskExecutionArn; private final String status; private final Options options; private final List excludes; private final List includes; private final Instant startTime; private final Long estimatedFilesToTransfer; private final Long estimatedBytesToTransfer; private final Long filesTransferred; private final Long bytesWritten; private final Long bytesTransferred; private final TaskExecutionResultDetail result; private final Long bytesCompressed; private DescribeTaskExecutionResponse(BuilderImpl builder) { super(builder); this.taskExecutionArn = builder.taskExecutionArn; this.status = builder.status; this.options = builder.options; this.excludes = builder.excludes; this.includes = builder.includes; this.startTime = builder.startTime; this.estimatedFilesToTransfer = builder.estimatedFilesToTransfer; this.estimatedBytesToTransfer = builder.estimatedBytesToTransfer; this.filesTransferred = builder.filesTransferred; this.bytesWritten = builder.bytesWritten; this.bytesTransferred = builder.bytesTransferred; this.result = builder.result; this.bytesCompressed = builder.bytesCompressed; } /** *

* The Amazon Resource Name (ARN) of the task execution that was described. TaskExecutionArn is * hierarchical and includes TaskArn for the task that was executed. *

*

* For example, a TaskExecution value with the ARN * arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2/execution/exec-08ef1e88ec491019b * executed the task with the ARN arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2. *

* * @return The Amazon Resource Name (ARN) of the task execution that was described. TaskExecutionArn is * hierarchical and includes TaskArn for the task that was executed.

*

* For example, a TaskExecution value with the ARN * arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2/execution/exec-08ef1e88ec491019b * executed the task with the ARN * arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2. */ public final String taskExecutionArn() { return taskExecutionArn; } /** *

* The status of the task execution. *

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the DataSync User * Guide. *

*

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

* * @return The status of the task execution.

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the * DataSync User Guide. * @see TaskExecutionStatus */ public final TaskExecutionStatus status() { return TaskExecutionStatus.fromValue(status); } /** *

* The status of the task execution. *

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the DataSync User * Guide. *

*

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

* * @return The status of the task execution.

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the * DataSync User Guide. * @see TaskExecutionStatus */ public final String statusAsString() { return status; } /** * Returns the value of the Options property for this object. * * @return The value of the Options property for this object. */ public final Options options() { return options; } /** * For responses, this returns true if the service returned a value for the Excludes 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 hasExcludes() { return excludes != null && !(excludes instanceof SdkAutoConstructList); } /** *

* A list of filter rules that determines which files to exclude from a task. The list should contain a single * filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), for * example: "/folder1|/folder2" *

*

* 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 #hasExcludes} method. *

* * @return A list of filter rules that determines which files to exclude from a task. The list should contain a * single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that * is, a pipe), for example: "/folder1|/folder2" */ public final List excludes() { return excludes; } /** * For responses, this returns true if the service returned a value for the Includes 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 hasIncludes() { return includes != null && !(includes instanceof SdkAutoConstructList); } /** *

* A list of filter rules that determines which files to include when running a task. The list should contain a * single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a * pipe), for example: "/folder1|/folder2" *

*

* 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 #hasIncludes} method. *

* * @return A list of filter rules that determines which files to include when running a task. The list should * contain a single filter string that consists of the patterns to include. The patterns are delimited by * "|" (that is, a pipe), for example: "/folder1|/folder2" */ public final List includes() { return includes; } /** *

* The time that the task execution was started. *

* * @return The time that the task execution was started. */ public final Instant startTime() { return startTime; } /** *

* The expected number of files that is to be transferred over the network. This value is calculated during the * PREPARING phase, before the TRANSFERRING phase. This value is the expected number of files to be transferred. * It's calculated based on comparing the content of the source and destination locations and finding the delta that * needs to be transferred. *

* * @return The expected number of files that is to be transferred over the network. This value is calculated during * the PREPARING phase, before the TRANSFERRING phase. This value is the expected number of files to be * transferred. It's calculated based on comparing the content of the source and destination locations and * finding the delta that needs to be transferred. */ public final Long estimatedFilesToTransfer() { return estimatedFilesToTransfer; } /** *

* The estimated physical number of bytes that is to be transferred over the network. *

* * @return The estimated physical number of bytes that is to be transferred over the network. */ public final Long estimatedBytesToTransfer() { return estimatedBytesToTransfer; } /** *

* The actual number of files that was transferred over the network. This value is calculated and updated on an * ongoing basis during the TRANSFERRING phase. It's updated periodically when each file is read from the source and * sent over the network. *

*

* If failures occur during a transfer, this value can be less than EstimatedFilesToTransfer. This * value can also be greater than EstimatedFilesTransferred in some cases. This element is * implementation-specific for some location types, so don't use it as an indicator for a correct file number or to * monitor your task execution. *

* * @return The actual number of files that was transferred over the network. This value is calculated and updated on * an ongoing basis during the TRANSFERRING phase. It's updated periodically when each file is read from the * source and sent over the network.

*

* If failures occur during a transfer, this value can be less than EstimatedFilesToTransfer. * This value can also be greater than EstimatedFilesTransferred in some cases. This element is * implementation-specific for some location types, so don't use it as an indicator for a correct file * number or to monitor your task execution. */ public final Long filesTransferred() { return filesTransferred; } /** *

* The number of logical bytes written to the destination Amazon Web Services storage resource. *

* * @return The number of logical bytes written to the destination Amazon Web Services storage resource. */ public final Long bytesWritten() { return bytesWritten; } /** *

* The physical number of bytes transferred over the network. *

* * @return The physical number of bytes transferred over the network. */ public final Long bytesTransferred() { return bytesTransferred; } /** *

* The result of the task execution. *

* * @return The result of the task execution. */ public final TaskExecutionResultDetail result() { return result; } /** *

* The physical number of bytes transferred over the network after compression was applied. In most cases, this * number is less than BytesTransferred. *

* * @return The physical number of bytes transferred over the network after compression was applied. In most cases, * this number is less than BytesTransferred. */ public final Long bytesCompressed() { return bytesCompressed; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(taskExecutionArn()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(options()); hashCode = 31 * hashCode + Objects.hashCode(hasExcludes() ? excludes() : null); hashCode = 31 * hashCode + Objects.hashCode(hasIncludes() ? includes() : null); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(estimatedFilesToTransfer()); hashCode = 31 * hashCode + Objects.hashCode(estimatedBytesToTransfer()); hashCode = 31 * hashCode + Objects.hashCode(filesTransferred()); hashCode = 31 * hashCode + Objects.hashCode(bytesWritten()); hashCode = 31 * hashCode + Objects.hashCode(bytesTransferred()); hashCode = 31 * hashCode + Objects.hashCode(result()); hashCode = 31 * hashCode + Objects.hashCode(bytesCompressed()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof DescribeTaskExecutionResponse)) { return false; } DescribeTaskExecutionResponse other = (DescribeTaskExecutionResponse) obj; return Objects.equals(taskExecutionArn(), other.taskExecutionArn()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(options(), other.options()) && hasExcludes() == other.hasExcludes() && Objects.equals(excludes(), other.excludes()) && hasIncludes() == other.hasIncludes() && Objects.equals(includes(), other.includes()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(estimatedFilesToTransfer(), other.estimatedFilesToTransfer()) && Objects.equals(estimatedBytesToTransfer(), other.estimatedBytesToTransfer()) && Objects.equals(filesTransferred(), other.filesTransferred()) && Objects.equals(bytesWritten(), other.bytesWritten()) && Objects.equals(bytesTransferred(), other.bytesTransferred()) && Objects.equals(result(), other.result()) && Objects.equals(bytesCompressed(), other.bytesCompressed()); } /** * 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("DescribeTaskExecutionResponse").add("TaskExecutionArn", taskExecutionArn()) .add("Status", statusAsString()).add("Options", options()).add("Excludes", hasExcludes() ? excludes() : null) .add("Includes", hasIncludes() ? includes() : null).add("StartTime", startTime()) .add("EstimatedFilesToTransfer", estimatedFilesToTransfer()) .add("EstimatedBytesToTransfer", estimatedBytesToTransfer()).add("FilesTransferred", filesTransferred()) .add("BytesWritten", bytesWritten()).add("BytesTransferred", bytesTransferred()).add("Result", result()) .add("BytesCompressed", bytesCompressed()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TaskExecutionArn": return Optional.ofNullable(clazz.cast(taskExecutionArn())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "Options": return Optional.ofNullable(clazz.cast(options())); case "Excludes": return Optional.ofNullable(clazz.cast(excludes())); case "Includes": return Optional.ofNullable(clazz.cast(includes())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EstimatedFilesToTransfer": return Optional.ofNullable(clazz.cast(estimatedFilesToTransfer())); case "EstimatedBytesToTransfer": return Optional.ofNullable(clazz.cast(estimatedBytesToTransfer())); case "FilesTransferred": return Optional.ofNullable(clazz.cast(filesTransferred())); case "BytesWritten": return Optional.ofNullable(clazz.cast(bytesWritten())); case "BytesTransferred": return Optional.ofNullable(clazz.cast(bytesTransferred())); case "Result": return Optional.ofNullable(clazz.cast(result())); case "BytesCompressed": return Optional.ofNullable(clazz.cast(bytesCompressed())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeTaskExecutionResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends DataSyncResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The Amazon Resource Name (ARN) of the task execution that was described. TaskExecutionArn is * hierarchical and includes TaskArn for the task that was executed. *

*

* For example, a TaskExecution value with the ARN * arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2/execution/exec-08ef1e88ec491019b * executed the task with the ARN * arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2. *

* * @param taskExecutionArn * The Amazon Resource Name (ARN) of the task execution that was described. TaskExecutionArn * is hierarchical and includes TaskArn for the task that was executed.

*

* For example, a TaskExecution value with the ARN * arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2/execution/exec-08ef1e88ec491019b * executed the task with the ARN * arn:aws:datasync:us-east-1:111222333444:task/task-0208075f79cedf4a2. * @return Returns a reference to this object so that method calls can be chained together. */ Builder taskExecutionArn(String taskExecutionArn); /** *

* The status of the task execution. *

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the DataSync * User Guide. *

* * @param status * The status of the task execution.

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the * DataSync User Guide. * @see TaskExecutionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TaskExecutionStatus */ Builder status(String status); /** *

* The status of the task execution. *

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the DataSync * User Guide. *

* * @param status * The status of the task execution.

*

* For detailed information about task execution statuses, see Understanding Task Statuses in the * DataSync User Guide. * @see TaskExecutionStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TaskExecutionStatus */ Builder status(TaskExecutionStatus status); /** * Sets the value of the Options property for this object. * * @param options * The new value for the Options property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder options(Options options); /** * Sets the value of the Options property for this object. * * This is a convenience method that creates an instance of the {@link Options.Builder} avoiding the need to * create one manually via {@link Options#builder()}. * *

* When the {@link Consumer} completes, {@link Options.Builder#build()} is called immediately and its result is * passed to {@link #options(Options)}. * * @param options * a consumer that will call methods on {@link Options.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #options(Options) */ default Builder options(Consumer options) { return options(Options.builder().applyMutation(options).build()); } /** *

* A list of filter rules that determines which files to exclude from a task. The list should contain a single * filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), * for example: "/folder1|/folder2" *

* * @param excludes * A list of filter rules that determines which files to exclude from a task. The list should contain a * single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that * is, a pipe), for example: "/folder1|/folder2" * @return Returns a reference to this object so that method calls can be chained together. */ Builder excludes(Collection excludes); /** *

* A list of filter rules that determines which files to exclude from a task. The list should contain a single * filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), * for example: "/folder1|/folder2" *

* * @param excludes * A list of filter rules that determines which files to exclude from a task. The list should contain a * single filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that * is, a pipe), for example: "/folder1|/folder2" * @return Returns a reference to this object so that method calls can be chained together. */ Builder excludes(FilterRule... excludes); /** *

* A list of filter rules that determines which files to exclude from a task. The list should contain a single * filter string that consists of the patterns to exclude. The patterns are delimited by "|" (that is, a pipe), * for example: "/folder1|/folder2" *

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

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.datasync.model.FilterRule.Builder#build()} is called immediately and * its result is passed to {@link #excludes(List)}. * * @param excludes * a consumer that will call methods on * {@link software.amazon.awssdk.services.datasync.model.FilterRule.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #excludes(java.util.Collection) */ Builder excludes(Consumer... excludes); /** *

* A list of filter rules that determines which files to include when running a task. The list should contain a * single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a * pipe), for example: "/folder1|/folder2" *

* * @param includes * A list of filter rules that determines which files to include when running a task. The list should * contain a single filter string that consists of the patterns to include. The patterns are delimited by * "|" (that is, a pipe), for example: "/folder1|/folder2" * @return Returns a reference to this object so that method calls can be chained together. */ Builder includes(Collection includes); /** *

* A list of filter rules that determines which files to include when running a task. The list should contain a * single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a * pipe), for example: "/folder1|/folder2" *

* * @param includes * A list of filter rules that determines which files to include when running a task. The list should * contain a single filter string that consists of the patterns to include. The patterns are delimited by * "|" (that is, a pipe), for example: "/folder1|/folder2" * @return Returns a reference to this object so that method calls can be chained together. */ Builder includes(FilterRule... includes); /** *

* A list of filter rules that determines which files to include when running a task. The list should contain a * single filter string that consists of the patterns to include. The patterns are delimited by "|" (that is, a * pipe), for example: "/folder1|/folder2" *

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

* When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.datasync.model.FilterRule.Builder#build()} is called immediately and * its result is passed to {@link #includes(List)}. * * @param includes * a consumer that will call methods on * {@link software.amazon.awssdk.services.datasync.model.FilterRule.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #includes(java.util.Collection) */ Builder includes(Consumer... includes); /** *

* The time that the task execution was started. *

* * @param startTime * The time that the task execution was started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

* The expected number of files that is to be transferred over the network. This value is calculated during the * PREPARING phase, before the TRANSFERRING phase. This value is the expected number of files to be transferred. * It's calculated based on comparing the content of the source and destination locations and finding the delta * that needs to be transferred. *

* * @param estimatedFilesToTransfer * The expected number of files that is to be transferred over the network. This value is calculated * during the PREPARING phase, before the TRANSFERRING phase. This value is the expected number of files * to be transferred. It's calculated based on comparing the content of the source and destination * locations and finding the delta that needs to be transferred. * @return Returns a reference to this object so that method calls can be chained together. */ Builder estimatedFilesToTransfer(Long estimatedFilesToTransfer); /** *

* The estimated physical number of bytes that is to be transferred over the network. *

* * @param estimatedBytesToTransfer * The estimated physical number of bytes that is to be transferred over the network. * @return Returns a reference to this object so that method calls can be chained together. */ Builder estimatedBytesToTransfer(Long estimatedBytesToTransfer); /** *

* The actual number of files that was transferred over the network. This value is calculated and updated on an * ongoing basis during the TRANSFERRING phase. It's updated periodically when each file is read from the source * and sent over the network. *

*

* If failures occur during a transfer, this value can be less than EstimatedFilesToTransfer. This * value can also be greater than EstimatedFilesTransferred in some cases. This element is * implementation-specific for some location types, so don't use it as an indicator for a correct file number or * to monitor your task execution. *

* * @param filesTransferred * The actual number of files that was transferred over the network. This value is calculated and updated * on an ongoing basis during the TRANSFERRING phase. It's updated periodically when each file is read * from the source and sent over the network.

*

* If failures occur during a transfer, this value can be less than EstimatedFilesToTransfer * . This value can also be greater than EstimatedFilesTransferred in some cases. This * element is implementation-specific for some location types, so don't use it as an indicator for a * correct file number or to monitor your task execution. * @return Returns a reference to this object so that method calls can be chained together. */ Builder filesTransferred(Long filesTransferred); /** *

* The number of logical bytes written to the destination Amazon Web Services storage resource. *

* * @param bytesWritten * The number of logical bytes written to the destination Amazon Web Services storage resource. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bytesWritten(Long bytesWritten); /** *

* The physical number of bytes transferred over the network. *

* * @param bytesTransferred * The physical number of bytes transferred over the network. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bytesTransferred(Long bytesTransferred); /** *

* The result of the task execution. *

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

* The result of the task execution. *

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

* When the {@link Consumer} completes, {@link TaskExecutionResultDetail.Builder#build()} is called immediately * and its result is passed to {@link #result(TaskExecutionResultDetail)}. * * @param result * a consumer that will call methods on {@link TaskExecutionResultDetail.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #result(TaskExecutionResultDetail) */ default Builder result(Consumer result) { return result(TaskExecutionResultDetail.builder().applyMutation(result).build()); } /** *

* The physical number of bytes transferred over the network after compression was applied. In most cases, this * number is less than BytesTransferred. *

* * @param bytesCompressed * The physical number of bytes transferred over the network after compression was applied. In most * cases, this number is less than BytesTransferred. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bytesCompressed(Long bytesCompressed); } static final class BuilderImpl extends DataSyncResponse.BuilderImpl implements Builder { private String taskExecutionArn; private String status; private Options options; private List excludes = DefaultSdkAutoConstructList.getInstance(); private List includes = DefaultSdkAutoConstructList.getInstance(); private Instant startTime; private Long estimatedFilesToTransfer; private Long estimatedBytesToTransfer; private Long filesTransferred; private Long bytesWritten; private Long bytesTransferred; private TaskExecutionResultDetail result; private Long bytesCompressed; private BuilderImpl() { } private BuilderImpl(DescribeTaskExecutionResponse model) { super(model); taskExecutionArn(model.taskExecutionArn); status(model.status); options(model.options); excludes(model.excludes); includes(model.includes); startTime(model.startTime); estimatedFilesToTransfer(model.estimatedFilesToTransfer); estimatedBytesToTransfer(model.estimatedBytesToTransfer); filesTransferred(model.filesTransferred); bytesWritten(model.bytesWritten); bytesTransferred(model.bytesTransferred); result(model.result); bytesCompressed(model.bytesCompressed); } public final String getTaskExecutionArn() { return taskExecutionArn; } public final void setTaskExecutionArn(String taskExecutionArn) { this.taskExecutionArn = taskExecutionArn; } @Override public final Builder taskExecutionArn(String taskExecutionArn) { this.taskExecutionArn = taskExecutionArn; 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(TaskExecutionStatus status) { this.status(status == null ? null : status.toString()); return this; } public final Options.Builder getOptions() { return options != null ? options.toBuilder() : null; } public final void setOptions(Options.BuilderImpl options) { this.options = options != null ? options.build() : null; } @Override public final Builder options(Options options) { this.options = options; return this; } public final List getExcludes() { List result = FilterListCopier.copyToBuilder(this.excludes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setExcludes(Collection excludes) { this.excludes = FilterListCopier.copyFromBuilder(excludes); } @Override public final Builder excludes(Collection excludes) { this.excludes = FilterListCopier.copy(excludes); return this; } @Override @SafeVarargs public final Builder excludes(FilterRule... excludes) { excludes(Arrays.asList(excludes)); return this; } @Override @SafeVarargs public final Builder excludes(Consumer... excludes) { excludes(Stream.of(excludes).map(c -> FilterRule.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getIncludes() { List result = FilterListCopier.copyToBuilder(this.includes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setIncludes(Collection includes) { this.includes = FilterListCopier.copyFromBuilder(includes); } @Override public final Builder includes(Collection includes) { this.includes = FilterListCopier.copy(includes); return this; } @Override @SafeVarargs public final Builder includes(FilterRule... includes) { includes(Arrays.asList(includes)); return this; } @Override @SafeVarargs public final Builder includes(Consumer... includes) { includes(Stream.of(includes).map(c -> FilterRule.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Long getEstimatedFilesToTransfer() { return estimatedFilesToTransfer; } public final void setEstimatedFilesToTransfer(Long estimatedFilesToTransfer) { this.estimatedFilesToTransfer = estimatedFilesToTransfer; } @Override public final Builder estimatedFilesToTransfer(Long estimatedFilesToTransfer) { this.estimatedFilesToTransfer = estimatedFilesToTransfer; return this; } public final Long getEstimatedBytesToTransfer() { return estimatedBytesToTransfer; } public final void setEstimatedBytesToTransfer(Long estimatedBytesToTransfer) { this.estimatedBytesToTransfer = estimatedBytesToTransfer; } @Override public final Builder estimatedBytesToTransfer(Long estimatedBytesToTransfer) { this.estimatedBytesToTransfer = estimatedBytesToTransfer; return this; } public final Long getFilesTransferred() { return filesTransferred; } public final void setFilesTransferred(Long filesTransferred) { this.filesTransferred = filesTransferred; } @Override public final Builder filesTransferred(Long filesTransferred) { this.filesTransferred = filesTransferred; return this; } public final Long getBytesWritten() { return bytesWritten; } public final void setBytesWritten(Long bytesWritten) { this.bytesWritten = bytesWritten; } @Override public final Builder bytesWritten(Long bytesWritten) { this.bytesWritten = bytesWritten; return this; } public final Long getBytesTransferred() { return bytesTransferred; } public final void setBytesTransferred(Long bytesTransferred) { this.bytesTransferred = bytesTransferred; } @Override public final Builder bytesTransferred(Long bytesTransferred) { this.bytesTransferred = bytesTransferred; return this; } public final TaskExecutionResultDetail.Builder getResult() { return result != null ? result.toBuilder() : null; } public final void setResult(TaskExecutionResultDetail.BuilderImpl result) { this.result = result != null ? result.build() : null; } @Override public final Builder result(TaskExecutionResultDetail result) { this.result = result; return this; } public final Long getBytesCompressed() { return bytesCompressed; } public final void setBytesCompressed(Long bytesCompressed) { this.bytesCompressed = bytesCompressed; } @Override public final Builder bytesCompressed(Long bytesCompressed) { this.bytesCompressed = bytesCompressed; return this; } @Override public DescribeTaskExecutionResponse build() { return new DescribeTaskExecutionResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy