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

software.amazon.awssdk.services.s3control.model.JobDescriptor Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon S3 Control module holds the client classes that are used for communicating with Amazon Simple Storage Service Control Plane

There is a newer version: 2.29.39
Show newest version
/*
 * 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.s3control.model;

import java.io.Serializable;
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;

/**
 * 

* A container element for the job configuration and status information returned by a Describe Job request. *

*/ @Generated("software.amazon.awssdk:codegen") public final class JobDescriptor implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField JOB_ID_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("JobId") .getter(getter(JobDescriptor::jobId)) .setter(setter(Builder::jobId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobId") .unmarshallLocationName("JobId").build()).build(); private static final SdkField CONFIRMATION_REQUIRED_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("ConfirmationRequired") .getter(getter(JobDescriptor::confirmationRequired)) .setter(setter(Builder::confirmationRequired)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ConfirmationRequired") .unmarshallLocationName("ConfirmationRequired").build()).build(); private static final SdkField DESCRIPTION_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Description") .getter(getter(JobDescriptor::description)) .setter(setter(Builder::description)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description") .unmarshallLocationName("Description").build()).build(); private static final SdkField JOB_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("JobArn") .getter(getter(JobDescriptor::jobArn)) .setter(setter(Builder::jobArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobArn") .unmarshallLocationName("JobArn").build()).build(); private static final SdkField STATUS_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("Status") .getter(getter(JobDescriptor::statusAsString)) .setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status") .unmarshallLocationName("Status").build()).build(); private static final SdkField MANIFEST_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("Manifest") .getter(getter(JobDescriptor::manifest)) .setter(setter(Builder::manifest)) .constructor(JobManifest::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Manifest") .unmarshallLocationName("Manifest").build()).build(); private static final SdkField OPERATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("Operation") .getter(getter(JobDescriptor::operation)) .setter(setter(Builder::operation)) .constructor(JobOperation::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Operation") .unmarshallLocationName("Operation").build()).build(); private static final SdkField PRIORITY_FIELD = SdkField . builder(MarshallingType.INTEGER) .memberName("Priority") .getter(getter(JobDescriptor::priority)) .setter(setter(Builder::priority)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Priority") .unmarshallLocationName("Priority").build()).build(); private static final SdkField PROGRESS_SUMMARY_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("ProgressSummary") .getter(getter(JobDescriptor::progressSummary)) .setter(setter(Builder::progressSummary)) .constructor(JobProgressSummary::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ProgressSummary") .unmarshallLocationName("ProgressSummary").build()).build(); private static final SdkField STATUS_UPDATE_REASON_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("StatusUpdateReason") .getter(getter(JobDescriptor::statusUpdateReason)) .setter(setter(Builder::statusUpdateReason)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusUpdateReason") .unmarshallLocationName("StatusUpdateReason").build()).build(); private static final SdkField> FAILURE_REASONS_FIELD = SdkField .> builder(MarshallingType.LIST) .memberName("FailureReasons") .getter(getter(JobDescriptor::failureReasons)) .setter(setter(Builder::failureReasons)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReasons") .unmarshallLocationName("FailureReasons").build(), ListTrait .builder() .memberLocationName(null) .memberFieldInfo( SdkField. builder(MarshallingType.SDK_POJO) .constructor(JobFailure::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("member").unmarshallLocationName("member").build()).build()) .build()).build(); private static final SdkField REPORT_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("Report") .getter(getter(JobDescriptor::report)) .setter(setter(Builder::report)) .constructor(JobReport::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Report") .unmarshallLocationName("Report").build()).build(); private static final SdkField CREATION_TIME_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("CreationTime") .getter(getter(JobDescriptor::creationTime)) .setter(setter(Builder::creationTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime") .unmarshallLocationName("CreationTime").build()).build(); private static final SdkField TERMINATION_DATE_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("TerminationDate") .getter(getter(JobDescriptor::terminationDate)) .setter(setter(Builder::terminationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TerminationDate") .unmarshallLocationName("TerminationDate").build()).build(); private static final SdkField ROLE_ARN_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("RoleArn") .getter(getter(JobDescriptor::roleArn)) .setter(setter(Builder::roleArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn") .unmarshallLocationName("RoleArn").build()).build(); private static final SdkField SUSPENDED_DATE_FIELD = SdkField . builder(MarshallingType.INSTANT) .memberName("SuspendedDate") .getter(getter(JobDescriptor::suspendedDate)) .setter(setter(Builder::suspendedDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SuspendedDate") .unmarshallLocationName("SuspendedDate").build()).build(); private static final SdkField SUSPENDED_CAUSE_FIELD = SdkField . builder(MarshallingType.STRING) .memberName("SuspendedCause") .getter(getter(JobDescriptor::suspendedCause)) .setter(setter(Builder::suspendedCause)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SuspendedCause") .unmarshallLocationName("SuspendedCause").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_ID_FIELD, CONFIRMATION_REQUIRED_FIELD, DESCRIPTION_FIELD, JOB_ARN_FIELD, STATUS_FIELD, MANIFEST_FIELD, OPERATION_FIELD, PRIORITY_FIELD, PROGRESS_SUMMARY_FIELD, STATUS_UPDATE_REASON_FIELD, FAILURE_REASONS_FIELD, REPORT_FIELD, CREATION_TIME_FIELD, TERMINATION_DATE_FIELD, ROLE_ARN_FIELD, SUSPENDED_DATE_FIELD, SUSPENDED_CAUSE_FIELD)); private static final long serialVersionUID = 1L; private final String jobId; private final Boolean confirmationRequired; private final String description; private final String jobArn; private final String status; private final JobManifest manifest; private final JobOperation operation; private final Integer priority; private final JobProgressSummary progressSummary; private final String statusUpdateReason; private final List failureReasons; private final JobReport report; private final Instant creationTime; private final Instant terminationDate; private final String roleArn; private final Instant suspendedDate; private final String suspendedCause; private JobDescriptor(BuilderImpl builder) { this.jobId = builder.jobId; this.confirmationRequired = builder.confirmationRequired; this.description = builder.description; this.jobArn = builder.jobArn; this.status = builder.status; this.manifest = builder.manifest; this.operation = builder.operation; this.priority = builder.priority; this.progressSummary = builder.progressSummary; this.statusUpdateReason = builder.statusUpdateReason; this.failureReasons = builder.failureReasons; this.report = builder.report; this.creationTime = builder.creationTime; this.terminationDate = builder.terminationDate; this.roleArn = builder.roleArn; this.suspendedDate = builder.suspendedDate; this.suspendedCause = builder.suspendedCause; } /** *

* The ID for the specified job. *

* * @return The ID for the specified job. */ public final String jobId() { return jobId; } /** *

* Indicates whether confirmation is required before Amazon S3 begins running the specified job. Confirmation is * required only for jobs created through the Amazon S3 console. *

* * @return Indicates whether confirmation is required before Amazon S3 begins running the specified job. * Confirmation is required only for jobs created through the Amazon S3 console. */ public final Boolean confirmationRequired() { return confirmationRequired; } /** *

* The description for this job, if one was provided in this job's Create Job request. *

* * @return The description for this job, if one was provided in this job's Create Job request. */ public final String description() { return description; } /** *

* The Amazon Resource Name (ARN) for this job. *

* * @return The Amazon Resource Name (ARN) for this job. */ public final String jobArn() { return jobArn; } /** *

* The current status of the specified job. *

*

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

* * @return The current status of the specified job. * @see JobStatus */ public final JobStatus status() { return JobStatus.fromValue(status); } /** *

* The current status of the specified job. *

*

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

* * @return The current status of the specified job. * @see JobStatus */ public final String statusAsString() { return status; } /** *

* The configuration information for the specified job's manifest object. *

* * @return The configuration information for the specified job's manifest object. */ public final JobManifest manifest() { return manifest; } /** *

* The operation that the specified job is configured to run on the objects listed in the manifest. *

* * @return The operation that the specified job is configured to run on the objects listed in the manifest. */ public final JobOperation operation() { return operation; } /** *

* The priority of the specified job. *

* * @return The priority of the specified job. */ public final Integer priority() { return priority; } /** *

* Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, and the * number of tasks that failed. *

* * @return Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, * and the number of tasks that failed. */ public final JobProgressSummary progressSummary() { return progressSummary; } /** *

* The reason for updating the job. *

* * @return The reason for updating the job. */ public final String statusUpdateReason() { return statusUpdateReason; } /** * Returns true if the FailureReasons property was specified by the sender (it may be empty), or false if the sender * did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service. */ public final boolean hasFailureReasons() { return failureReasons != null && !(failureReasons instanceof SdkAutoConstructList); } /** *

* If the specified job failed, this field contains information describing the failure. *

*

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

*

* You can use {@link #hasFailureReasons()} to see if a value was sent in this field. *

* * @return If the specified job failed, this field contains information describing the failure. */ public final List failureReasons() { return failureReasons; } /** *

* Contains the configuration information for the job-completion report if you requested one in the * Create Job request. *

* * @return Contains the configuration information for the job-completion report if you requested one in the * Create Job request. */ public final JobReport report() { return report; } /** *

* A timestamp indicating when this job was created. *

* * @return A timestamp indicating when this job was created. */ public final Instant creationTime() { return creationTime; } /** *

* A timestamp indicating when this job terminated. A job's termination date is the date and time when it succeeded, * failed, or was canceled. *

* * @return A timestamp indicating when this job terminated. A job's termination date is the date and time when it * succeeded, failed, or was canceled. */ public final Instant terminationDate() { return terminationDate; } /** *

* The Amazon Resource Name (ARN) for the AWS Identity and Access Management (IAM) role assigned to run the tasks * for this job. *

* * @return The Amazon Resource Name (ARN) for the AWS Identity and Access Management (IAM) role assigned to run the * tasks for this job. */ public final String roleArn() { return roleArn; } /** *

* The timestamp when this job was suspended, if it has been suspended. *

* * @return The timestamp when this job was suspended, if it has been suspended. */ public final Instant suspendedDate() { return suspendedDate; } /** *

* The reason why the specified job was suspended. A job is only suspended if you create it through the Amazon S3 * console. When you create the job, it enters the Suspended state to await confirmation before * running. After you confirm the job, it automatically exits the Suspended state. *

* * @return The reason why the specified job was suspended. A job is only suspended if you create it through the * Amazon S3 console. When you create the job, it enters the Suspended state to await * confirmation before running. After you confirm the job, it automatically exits the Suspended * state. */ public final String suspendedCause() { return suspendedCause; } @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(jobId()); hashCode = 31 * hashCode + Objects.hashCode(confirmationRequired()); hashCode = 31 * hashCode + Objects.hashCode(description()); hashCode = 31 * hashCode + Objects.hashCode(jobArn()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(manifest()); hashCode = 31 * hashCode + Objects.hashCode(operation()); hashCode = 31 * hashCode + Objects.hashCode(priority()); hashCode = 31 * hashCode + Objects.hashCode(progressSummary()); hashCode = 31 * hashCode + Objects.hashCode(statusUpdateReason()); hashCode = 31 * hashCode + Objects.hashCode(hasFailureReasons() ? failureReasons() : null); hashCode = 31 * hashCode + Objects.hashCode(report()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(terminationDate()); hashCode = 31 * hashCode + Objects.hashCode(roleArn()); hashCode = 31 * hashCode + Objects.hashCode(suspendedDate()); hashCode = 31 * hashCode + Objects.hashCode(suspendedCause()); 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 JobDescriptor)) { return false; } JobDescriptor other = (JobDescriptor) obj; return Objects.equals(jobId(), other.jobId()) && Objects.equals(confirmationRequired(), other.confirmationRequired()) && Objects.equals(description(), other.description()) && Objects.equals(jobArn(), other.jobArn()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(manifest(), other.manifest()) && Objects.equals(operation(), other.operation()) && Objects.equals(priority(), other.priority()) && Objects.equals(progressSummary(), other.progressSummary()) && Objects.equals(statusUpdateReason(), other.statusUpdateReason()) && hasFailureReasons() == other.hasFailureReasons() && Objects.equals(failureReasons(), other.failureReasons()) && Objects.equals(report(), other.report()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(terminationDate(), other.terminationDate()) && Objects.equals(roleArn(), other.roleArn()) && Objects.equals(suspendedDate(), other.suspendedDate()) && Objects.equals(suspendedCause(), other.suspendedCause()); } /** * 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("JobDescriptor").add("JobId", jobId()).add("ConfirmationRequired", confirmationRequired()) .add("Description", description()).add("JobArn", jobArn()).add("Status", statusAsString()) .add("Manifest", manifest()).add("Operation", operation()).add("Priority", priority()) .add("ProgressSummary", progressSummary()).add("StatusUpdateReason", statusUpdateReason()) .add("FailureReasons", hasFailureReasons() ? failureReasons() : null).add("Report", report()) .add("CreationTime", creationTime()).add("TerminationDate", terminationDate()).add("RoleArn", roleArn()) .add("SuspendedDate", suspendedDate()).add("SuspendedCause", suspendedCause()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "JobId": return Optional.ofNullable(clazz.cast(jobId())); case "ConfirmationRequired": return Optional.ofNullable(clazz.cast(confirmationRequired())); case "Description": return Optional.ofNullable(clazz.cast(description())); case "JobArn": return Optional.ofNullable(clazz.cast(jobArn())); case "Status": return Optional.ofNullable(clazz.cast(statusAsString())); case "Manifest": return Optional.ofNullable(clazz.cast(manifest())); case "Operation": return Optional.ofNullable(clazz.cast(operation())); case "Priority": return Optional.ofNullable(clazz.cast(priority())); case "ProgressSummary": return Optional.ofNullable(clazz.cast(progressSummary())); case "StatusUpdateReason": return Optional.ofNullable(clazz.cast(statusUpdateReason())); case "FailureReasons": return Optional.ofNullable(clazz.cast(failureReasons())); case "Report": return Optional.ofNullable(clazz.cast(report())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "TerminationDate": return Optional.ofNullable(clazz.cast(terminationDate())); case "RoleArn": return Optional.ofNullable(clazz.cast(roleArn())); case "SuspendedDate": return Optional.ofNullable(clazz.cast(suspendedDate())); case "SuspendedCause": return Optional.ofNullable(clazz.cast(suspendedCause())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((JobDescriptor) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The ID for the specified job. *

* * @param jobId * The ID for the specified job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobId(String jobId); /** *

* Indicates whether confirmation is required before Amazon S3 begins running the specified job. Confirmation is * required only for jobs created through the Amazon S3 console. *

* * @param confirmationRequired * Indicates whether confirmation is required before Amazon S3 begins running the specified job. * Confirmation is required only for jobs created through the Amazon S3 console. * @return Returns a reference to this object so that method calls can be chained together. */ Builder confirmationRequired(Boolean confirmationRequired); /** *

* The description for this job, if one was provided in this job's Create Job request. *

* * @param description * The description for this job, if one was provided in this job's Create Job request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); /** *

* The Amazon Resource Name (ARN) for this job. *

* * @param jobArn * The Amazon Resource Name (ARN) for this job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobArn(String jobArn); /** *

* The current status of the specified job. *

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

* The current status of the specified job. *

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

* The configuration information for the specified job's manifest object. *

* * @param manifest * The configuration information for the specified job's manifest object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder manifest(JobManifest manifest); /** *

* The configuration information for the specified job's manifest object. *

* This is a convenience that creates an instance of the {@link JobManifest.Builder} avoiding the need to create * one manually via {@link JobManifest#builder()}. * * When the {@link Consumer} completes, {@link JobManifest.Builder#build()} is called immediately and its result * is passed to {@link #manifest(JobManifest)}. * * @param manifest * a consumer that will call methods on {@link JobManifest.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #manifest(JobManifest) */ default Builder manifest(Consumer manifest) { return manifest(JobManifest.builder().applyMutation(manifest).build()); } /** *

* The operation that the specified job is configured to run on the objects listed in the manifest. *

* * @param operation * The operation that the specified job is configured to run on the objects listed in the manifest. * @return Returns a reference to this object so that method calls can be chained together. */ Builder operation(JobOperation operation); /** *

* The operation that the specified job is configured to run on the objects listed in the manifest. *

* This is a convenience that creates an instance of the {@link JobOperation.Builder} avoiding the need to * create one manually via {@link JobOperation#builder()}. * * When the {@link Consumer} completes, {@link JobOperation.Builder#build()} is called immediately and its * result is passed to {@link #operation(JobOperation)}. * * @param operation * a consumer that will call methods on {@link JobOperation.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #operation(JobOperation) */ default Builder operation(Consumer operation) { return operation(JobOperation.builder().applyMutation(operation).build()); } /** *

* The priority of the specified job. *

* * @param priority * The priority of the specified job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder priority(Integer priority); /** *

* Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, and * the number of tasks that failed. *

* * @param progressSummary * Describes the total number of tasks that the specified job has run, the number of tasks that * succeeded, and the number of tasks that failed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder progressSummary(JobProgressSummary progressSummary); /** *

* Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, and * the number of tasks that failed. *

* This is a convenience that creates an instance of the {@link JobProgressSummary.Builder} avoiding the need to * create one manually via {@link JobProgressSummary#builder()}. * * When the {@link Consumer} completes, {@link JobProgressSummary.Builder#build()} is called immediately and its * result is passed to {@link #progressSummary(JobProgressSummary)}. * * @param progressSummary * a consumer that will call methods on {@link JobProgressSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #progressSummary(JobProgressSummary) */ default Builder progressSummary(Consumer progressSummary) { return progressSummary(JobProgressSummary.builder().applyMutation(progressSummary).build()); } /** *

* The reason for updating the job. *

* * @param statusUpdateReason * The reason for updating the job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusUpdateReason(String statusUpdateReason); /** *

* If the specified job failed, this field contains information describing the failure. *

* * @param failureReasons * If the specified job failed, this field contains information describing the failure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureReasons(Collection failureReasons); /** *

* If the specified job failed, this field contains information describing the failure. *

* * @param failureReasons * If the specified job failed, this field contains information describing the failure. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failureReasons(JobFailure... failureReasons); /** *

* If the specified job failed, this field contains information describing the failure. *

* This is a convenience that creates an instance of the {@link List.Builder} avoiding the need to * create one manually via {@link List#builder()}. * * When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its * result is passed to {@link #failureReasons(List)}. * * @param failureReasons * a consumer that will call methods on {@link List.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #failureReasons(List) */ Builder failureReasons(Consumer... failureReasons); /** *

* Contains the configuration information for the job-completion report if you requested one in the * Create Job request. *

* * @param report * Contains the configuration information for the job-completion report if you requested one in the * Create Job request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder report(JobReport report); /** *

* Contains the configuration information for the job-completion report if you requested one in the * Create Job request. *

* This is a convenience that creates an instance of the {@link JobReport.Builder} avoiding the need to create * one manually via {@link JobReport#builder()}. * * When the {@link Consumer} completes, {@link JobReport.Builder#build()} is called immediately and its result * is passed to {@link #report(JobReport)}. * * @param report * a consumer that will call methods on {@link JobReport.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #report(JobReport) */ default Builder report(Consumer report) { return report(JobReport.builder().applyMutation(report).build()); } /** *

* A timestamp indicating when this job was created. *

* * @param creationTime * A timestamp indicating when this job was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

* A timestamp indicating when this job terminated. A job's termination date is the date and time when it * succeeded, failed, or was canceled. *

* * @param terminationDate * A timestamp indicating when this job terminated. A job's termination date is the date and time when it * succeeded, failed, or was canceled. * @return Returns a reference to this object so that method calls can be chained together. */ Builder terminationDate(Instant terminationDate); /** *

* The Amazon Resource Name (ARN) for the AWS Identity and Access Management (IAM) role assigned to run the * tasks for this job. *

* * @param roleArn * The Amazon Resource Name (ARN) for the AWS Identity and Access Management (IAM) role assigned to run * the tasks for this job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder roleArn(String roleArn); /** *

* The timestamp when this job was suspended, if it has been suspended. *

* * @param suspendedDate * The timestamp when this job was suspended, if it has been suspended. * @return Returns a reference to this object so that method calls can be chained together. */ Builder suspendedDate(Instant suspendedDate); /** *

* The reason why the specified job was suspended. A job is only suspended if you create it through the Amazon * S3 console. When you create the job, it enters the Suspended state to await confirmation before * running. After you confirm the job, it automatically exits the Suspended state. *

* * @param suspendedCause * The reason why the specified job was suspended. A job is only suspended if you create it through the * Amazon S3 console. When you create the job, it enters the Suspended state to await * confirmation before running. After you confirm the job, it automatically exits the * Suspended state. * @return Returns a reference to this object so that method calls can be chained together. */ Builder suspendedCause(String suspendedCause); } static final class BuilderImpl implements Builder { private String jobId; private Boolean confirmationRequired; private String description; private String jobArn; private String status; private JobManifest manifest; private JobOperation operation; private Integer priority; private JobProgressSummary progressSummary; private String statusUpdateReason; private List failureReasons = DefaultSdkAutoConstructList.getInstance(); private JobReport report; private Instant creationTime; private Instant terminationDate; private String roleArn; private Instant suspendedDate; private String suspendedCause; private BuilderImpl() { } private BuilderImpl(JobDescriptor model) { jobId(model.jobId); confirmationRequired(model.confirmationRequired); description(model.description); jobArn(model.jobArn); status(model.status); manifest(model.manifest); operation(model.operation); priority(model.priority); progressSummary(model.progressSummary); statusUpdateReason(model.statusUpdateReason); failureReasons(model.failureReasons); report(model.report); creationTime(model.creationTime); terminationDate(model.terminationDate); roleArn(model.roleArn); suspendedDate(model.suspendedDate); suspendedCause(model.suspendedCause); } public final String getJobId() { return jobId; } @Override public final Builder jobId(String jobId) { this.jobId = jobId; return this; } public final void setJobId(String jobId) { this.jobId = jobId; } public final Boolean getConfirmationRequired() { return confirmationRequired; } @Override public final Builder confirmationRequired(Boolean confirmationRequired) { this.confirmationRequired = confirmationRequired; return this; } public final void setConfirmationRequired(Boolean confirmationRequired) { this.confirmationRequired = confirmationRequired; } public final String getDescription() { return description; } @Override public final Builder description(String description) { this.description = description; return this; } public final void setDescription(String description) { this.description = description; } public final String getJobArn() { return jobArn; } @Override public final Builder jobArn(String jobArn) { this.jobArn = jobArn; return this; } public final void setJobArn(String jobArn) { this.jobArn = jobArn; } public final String getStatus() { return status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(JobStatus status) { this.status(status == null ? null : status.toString()); return this; } public final void setStatus(String status) { this.status = status; } public final JobManifest.Builder getManifest() { return manifest != null ? manifest.toBuilder() : null; } @Override public final Builder manifest(JobManifest manifest) { this.manifest = manifest; return this; } public final void setManifest(JobManifest.BuilderImpl manifest) { this.manifest = manifest != null ? manifest.build() : null; } public final JobOperation.Builder getOperation() { return operation != null ? operation.toBuilder() : null; } @Override public final Builder operation(JobOperation operation) { this.operation = operation; return this; } public final void setOperation(JobOperation.BuilderImpl operation) { this.operation = operation != null ? operation.build() : null; } public final Integer getPriority() { return priority; } @Override public final Builder priority(Integer priority) { this.priority = priority; return this; } public final void setPriority(Integer priority) { this.priority = priority; } public final JobProgressSummary.Builder getProgressSummary() { return progressSummary != null ? progressSummary.toBuilder() : null; } @Override public final Builder progressSummary(JobProgressSummary progressSummary) { this.progressSummary = progressSummary; return this; } public final void setProgressSummary(JobProgressSummary.BuilderImpl progressSummary) { this.progressSummary = progressSummary != null ? progressSummary.build() : null; } public final String getStatusUpdateReason() { return statusUpdateReason; } @Override public final Builder statusUpdateReason(String statusUpdateReason) { this.statusUpdateReason = statusUpdateReason; return this; } public final void setStatusUpdateReason(String statusUpdateReason) { this.statusUpdateReason = statusUpdateReason; } public final List getFailureReasons() { List result = JobFailureListCopier.copyToBuilder(this.failureReasons); if (result instanceof SdkAutoConstructList) { return null; } return result; } @Override public final Builder failureReasons(Collection failureReasons) { this.failureReasons = JobFailureListCopier.copy(failureReasons); return this; } @Override @SafeVarargs public final Builder failureReasons(JobFailure... failureReasons) { failureReasons(Arrays.asList(failureReasons)); return this; } @Override @SafeVarargs public final Builder failureReasons(Consumer... failureReasons) { failureReasons(Stream.of(failureReasons).map(c -> JobFailure.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final void setFailureReasons(Collection failureReasons) { this.failureReasons = JobFailureListCopier.copyFromBuilder(failureReasons); } public final JobReport.Builder getReport() { return report != null ? report.toBuilder() : null; } @Override public final Builder report(JobReport report) { this.report = report; return this; } public final void setReport(JobReport.BuilderImpl report) { this.report = report != null ? report.build() : null; } public final Instant getCreationTime() { return creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } public final Instant getTerminationDate() { return terminationDate; } @Override public final Builder terminationDate(Instant terminationDate) { this.terminationDate = terminationDate; return this; } public final void setTerminationDate(Instant terminationDate) { this.terminationDate = terminationDate; } public final String getRoleArn() { return roleArn; } @Override public final Builder roleArn(String roleArn) { this.roleArn = roleArn; return this; } public final void setRoleArn(String roleArn) { this.roleArn = roleArn; } public final Instant getSuspendedDate() { return suspendedDate; } @Override public final Builder suspendedDate(Instant suspendedDate) { this.suspendedDate = suspendedDate; return this; } public final void setSuspendedDate(Instant suspendedDate) { this.suspendedDate = suspendedDate; } public final String getSuspendedCause() { return suspendedCause; } @Override public final Builder suspendedCause(String suspendedCause) { this.suspendedCause = suspendedCause; return this; } public final void setSuspendedCause(String suspendedCause) { this.suspendedCause = suspendedCause; } @Override public JobDescriptor build() { return new JobDescriptor(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy