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

software.amazon.awssdk.services.glacier.model.DescribeJobResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Glacier module holds the client classes that are used for communicating with Amazon Glacier Service

There is a newer version: 2.30.1
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.glacier.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.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;

/**
 * 

* Contains the description of an Amazon S3 Glacier job. *

*/ @Generated("software.amazon.awssdk:codegen") public final class DescribeJobResponse extends GlacierResponse implements ToCopyableBuilder { private static final SdkField JOB_ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("JobId") .getter(getter(DescribeJobResponse::jobId)).setter(setter(Builder::jobId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobId").build()).build(); private static final SdkField JOB_DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("JobDescription").getter(getter(DescribeJobResponse::jobDescription)) .setter(setter(Builder::jobDescription)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobDescription").build()).build(); private static final SdkField ACTION_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Action") .getter(getter(DescribeJobResponse::actionAsString)).setter(setter(Builder::action)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Action").build()).build(); private static final SdkField ARCHIVE_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ArchiveId").getter(getter(DescribeJobResponse::archiveId)).setter(setter(Builder::archiveId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ArchiveId").build()).build(); private static final SdkField VAULT_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("VaultARN").getter(getter(DescribeJobResponse::vaultARN)).setter(setter(Builder::vaultARN)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VaultARN").build()).build(); private static final SdkField CREATION_DATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CreationDate").getter(getter(DescribeJobResponse::creationDate)).setter(setter(Builder::creationDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationDate").build()).build(); private static final SdkField COMPLETED_FIELD = SdkField. builder(MarshallingType.BOOLEAN) .memberName("Completed").getter(getter(DescribeJobResponse::completed)).setter(setter(Builder::completed)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Completed").build()).build(); private static final SdkField STATUS_CODE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StatusCode").getter(getter(DescribeJobResponse::statusCodeAsString)).setter(setter(Builder::statusCode)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusCode").build()).build(); private static final SdkField STATUS_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("StatusMessage").getter(getter(DescribeJobResponse::statusMessage)) .setter(setter(Builder::statusMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusMessage").build()).build(); private static final SdkField ARCHIVE_SIZE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("ArchiveSizeInBytes").getter(getter(DescribeJobResponse::archiveSizeInBytes)) .setter(setter(Builder::archiveSizeInBytes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ArchiveSizeInBytes").build()) .build(); private static final SdkField INVENTORY_SIZE_IN_BYTES_FIELD = SdkField. builder(MarshallingType.LONG) .memberName("InventorySizeInBytes").getter(getter(DescribeJobResponse::inventorySizeInBytes)) .setter(setter(Builder::inventorySizeInBytes)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InventorySizeInBytes").build()) .build(); private static final SdkField SNS_TOPIC_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SNSTopic").getter(getter(DescribeJobResponse::snsTopic)).setter(setter(Builder::snsTopic)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SNSTopic").build()).build(); private static final SdkField COMPLETION_DATE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("CompletionDate").getter(getter(DescribeJobResponse::completionDate)) .setter(setter(Builder::completionDate)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CompletionDate").build()).build(); private static final SdkField SHA256_TREE_HASH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SHA256TreeHash").getter(getter(DescribeJobResponse::sha256TreeHash)) .setter(setter(Builder::sha256TreeHash)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SHA256TreeHash").build()).build(); private static final SdkField ARCHIVE_SHA256_TREE_HASH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ArchiveSHA256TreeHash").getter(getter(DescribeJobResponse::archiveSHA256TreeHash)) .setter(setter(Builder::archiveSHA256TreeHash)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ArchiveSHA256TreeHash").build()) .build(); private static final SdkField RETRIEVAL_BYTE_RANGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("RetrievalByteRange").getter(getter(DescribeJobResponse::retrievalByteRange)) .setter(setter(Builder::retrievalByteRange)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetrievalByteRange").build()) .build(); private static final SdkField TIER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Tier") .getter(getter(DescribeJobResponse::tier)).setter(setter(Builder::tier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tier").build()).build(); private static final SdkField INVENTORY_RETRIEVAL_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO) .memberName("InventoryRetrievalParameters") .getter(getter(DescribeJobResponse::inventoryRetrievalParameters)) .setter(setter(Builder::inventoryRetrievalParameters)) .constructor(InventoryRetrievalJobDescription::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InventoryRetrievalParameters") .build()).build(); private static final SdkField JOB_OUTPUT_PATH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("JobOutputPath").getter(getter(DescribeJobResponse::jobOutputPath)) .setter(setter(Builder::jobOutputPath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobOutputPath").build()).build(); private static final SdkField SELECT_PARAMETERS_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("SelectParameters") .getter(getter(DescribeJobResponse::selectParameters)).setter(setter(Builder::selectParameters)) .constructor(SelectParameters::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SelectParameters").build()).build(); private static final SdkField OUTPUT_LOCATION_FIELD = SdkField . builder(MarshallingType.SDK_POJO).memberName("OutputLocation") .getter(getter(DescribeJobResponse::outputLocation)).setter(setter(Builder::outputLocation)) .constructor(OutputLocation::builder) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputLocation").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_ID_FIELD, JOB_DESCRIPTION_FIELD, ACTION_FIELD, ARCHIVE_ID_FIELD, VAULT_ARN_FIELD, CREATION_DATE_FIELD, COMPLETED_FIELD, STATUS_CODE_FIELD, STATUS_MESSAGE_FIELD, ARCHIVE_SIZE_IN_BYTES_FIELD, INVENTORY_SIZE_IN_BYTES_FIELD, SNS_TOPIC_FIELD, COMPLETION_DATE_FIELD, SHA256_TREE_HASH_FIELD, ARCHIVE_SHA256_TREE_HASH_FIELD, RETRIEVAL_BYTE_RANGE_FIELD, TIER_FIELD, INVENTORY_RETRIEVAL_PARAMETERS_FIELD, JOB_OUTPUT_PATH_FIELD, SELECT_PARAMETERS_FIELD, OUTPUT_LOCATION_FIELD)); private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer(); private final String jobId; private final String jobDescription; private final String action; private final String archiveId; private final String vaultARN; private final String creationDate; private final Boolean completed; private final String statusCode; private final String statusMessage; private final Long archiveSizeInBytes; private final Long inventorySizeInBytes; private final String snsTopic; private final String completionDate; private final String sha256TreeHash; private final String archiveSHA256TreeHash; private final String retrievalByteRange; private final String tier; private final InventoryRetrievalJobDescription inventoryRetrievalParameters; private final String jobOutputPath; private final SelectParameters selectParameters; private final OutputLocation outputLocation; private DescribeJobResponse(BuilderImpl builder) { super(builder); this.jobId = builder.jobId; this.jobDescription = builder.jobDescription; this.action = builder.action; this.archiveId = builder.archiveId; this.vaultARN = builder.vaultARN; this.creationDate = builder.creationDate; this.completed = builder.completed; this.statusCode = builder.statusCode; this.statusMessage = builder.statusMessage; this.archiveSizeInBytes = builder.archiveSizeInBytes; this.inventorySizeInBytes = builder.inventorySizeInBytes; this.snsTopic = builder.snsTopic; this.completionDate = builder.completionDate; this.sha256TreeHash = builder.sha256TreeHash; this.archiveSHA256TreeHash = builder.archiveSHA256TreeHash; this.retrievalByteRange = builder.retrievalByteRange; this.tier = builder.tier; this.inventoryRetrievalParameters = builder.inventoryRetrievalParameters; this.jobOutputPath = builder.jobOutputPath; this.selectParameters = builder.selectParameters; this.outputLocation = builder.outputLocation; } /** *

* An opaque string that identifies an Amazon S3 Glacier job. *

* * @return An opaque string that identifies an Amazon S3 Glacier job. */ public final String jobId() { return jobId; } /** *

* The job description provided when initiating the job. *

* * @return The job description provided when initiating the job. */ public final String jobDescription() { return jobDescription; } /** *

* The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. *

*

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

* * @return The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. * @see ActionCode */ public final ActionCode action() { return ActionCode.fromValue(action); } /** *

* The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. *

*

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

* * @return The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. * @see ActionCode */ public final String actionAsString() { return action; } /** *

* The archive ID requested for a select job or archive retrieval. Otherwise, this field is null. *

* * @return The archive ID requested for a select job or archive retrieval. Otherwise, this field is null. */ public final String archiveId() { return archiveId; } /** *

* The Amazon Resource Name (ARN) of the vault from which an archive retrieval was requested. *

* * @return The Amazon Resource Name (ARN) of the vault from which an archive retrieval was requested. */ public final String vaultARN() { return vaultARN; } /** *

* The UTC date when the job was created. This value is a string representation of ISO 8601 date format, for example * "2012-03-20T17:03:43.221Z". *

* * @return The UTC date when the job was created. This value is a string representation of ISO 8601 date format, for * example "2012-03-20T17:03:43.221Z". */ public final String creationDate() { return creationDate; } /** *

* The job status. When a job is completed, you get the job's output using Get Job Output (GET output). *

* * @return The job status. When a job is completed, you get the job's output using Get Job Output (GET output). */ public final Boolean completed() { return completed; } /** *

* The status code can be InProgress, Succeeded, or Failed, and indicates the * status of the job. *

*

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

* * @return The status code can be InProgress, Succeeded, or Failed, and * indicates the status of the job. * @see StatusCode */ public final StatusCode statusCode() { return StatusCode.fromValue(statusCode); } /** *

* The status code can be InProgress, Succeeded, or Failed, and indicates the * status of the job. *

*

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

* * @return The status code can be InProgress, Succeeded, or Failed, and * indicates the status of the job. * @see StatusCode */ public final String statusCodeAsString() { return statusCode; } /** *

* A friendly message that describes the job status. *

* * @return A friendly message that describes the job status. */ public final String statusMessage() { return statusMessage; } /** *

* For an archive retrieval job, this value is the size in bytes of the archive being requested for download. For an * inventory retrieval or select job, this value is null. *

* * @return For an archive retrieval job, this value is the size in bytes of the archive being requested for * download. For an inventory retrieval or select job, this value is null. */ public final Long archiveSizeInBytes() { return archiveSizeInBytes; } /** *

* For an inventory retrieval job, this value is the size in bytes of the inventory requested for download. For an * archive retrieval or select job, this value is null. *

* * @return For an inventory retrieval job, this value is the size in bytes of the inventory requested for download. * For an archive retrieval or select job, this value is null. */ public final Long inventorySizeInBytes() { return inventorySizeInBytes; } /** *

* An Amazon SNS topic that receives notification. *

* * @return An Amazon SNS topic that receives notification. */ public final String snsTopic() { return snsTopic; } /** *

* The UTC time that the job request completed. While the job is in progress, the value is null. *

* * @return The UTC time that the job request completed. While the job is in progress, the value is null. */ public final String completionDate() { return completionDate; } /** *

* For an archive retrieval job, this value is the checksum of the archive. Otherwise, this value is null. *

*

* The SHA256 tree hash value for the requested range of an archive. If the InitiateJob request for an * archive specified a tree-hash aligned range, then this field returns a value. *

*

* If the whole archive is retrieved, this value is the same as the ArchiveSHA256TreeHash value. *

*

* This field is null for the following: *

*
    *
  • *

    * Archive retrieval jobs that specify a range that is not tree-hash aligned *

    *
  • *
*
    *
  • *

    * Archival jobs that specify a range that is equal to the whole archive, when the job status is * InProgress *

    *
  • *
*
    *
  • *

    * Inventory jobs *

    *
  • *
  • *

    * Select jobs *

    *
  • *
* * @return For an archive retrieval job, this value is the checksum of the archive. Otherwise, this value is * null.

*

* The SHA256 tree hash value for the requested range of an archive. If the InitiateJob request for * an archive specified a tree-hash aligned range, then this field returns a value. *

*

* If the whole archive is retrieved, this value is the same as the ArchiveSHA256TreeHash value. *

*

* This field is null for the following: *

*
    *
  • *

    * Archive retrieval jobs that specify a range that is not tree-hash aligned *

    *
  • *
*
    *
  • *

    * Archival jobs that specify a range that is equal to the whole archive, when the job status is * InProgress *

    *
  • *
*
    *
  • *

    * Inventory jobs *

    *
  • *
  • *

    * Select jobs *

    *
  • */ public final String sha256TreeHash() { return sha256TreeHash; } /** *

    * The SHA256 tree hash of the entire archive for an archive retrieval. For inventory retrieval or select jobs, this * field is null. *

    * * @return The SHA256 tree hash of the entire archive for an archive retrieval. For inventory retrieval or select * jobs, this field is null. */ public final String archiveSHA256TreeHash() { return archiveSHA256TreeHash; } /** *

    * The retrieved byte range for archive retrieval jobs in the form StartByteValue-EndByteValue. If no * range was specified in the archive retrieval, then the whole archive is retrieved. In this case, * StartByteValue equals 0 and EndByteValue equals the size of the archive minus 1. For inventory * retrieval or select jobs, this field is null. *

    * * @return The retrieved byte range for archive retrieval jobs in the form * StartByteValue-EndByteValue. If no range was specified in the archive retrieval, then the * whole archive is retrieved. In this case, StartByteValue equals 0 and EndByteValue equals * the size of the archive minus 1. For inventory retrieval or select jobs, this field is null. */ public final String retrievalByteRange() { return retrievalByteRange; } /** *

    * The tier to use for a select or an archive retrieval. Valid values are Expedited, * Standard, or Bulk. Standard is the default. *

    * * @return The tier to use for a select or an archive retrieval. Valid values are Expedited, * Standard, or Bulk. Standard is the default. */ public final String tier() { return tier; } /** *

    * Parameters used for range inventory retrieval. *

    * * @return Parameters used for range inventory retrieval. */ public final InventoryRetrievalJobDescription inventoryRetrievalParameters() { return inventoryRetrievalParameters; } /** *

    * Contains the job output location. *

    * * @return Contains the job output location. */ public final String jobOutputPath() { return jobOutputPath; } /** *

    * Contains the parameters used for a select. *

    * * @return Contains the parameters used for a select. */ public final SelectParameters selectParameters() { return selectParameters; } /** *

    * Contains the location where the data from the select job is stored. *

    * * @return Contains the location where the data from the select job is stored. */ public final OutputLocation outputLocation() { return outputLocation; } @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(jobId()); hashCode = 31 * hashCode + Objects.hashCode(jobDescription()); hashCode = 31 * hashCode + Objects.hashCode(actionAsString()); hashCode = 31 * hashCode + Objects.hashCode(archiveId()); hashCode = 31 * hashCode + Objects.hashCode(vaultARN()); hashCode = 31 * hashCode + Objects.hashCode(creationDate()); hashCode = 31 * hashCode + Objects.hashCode(completed()); hashCode = 31 * hashCode + Objects.hashCode(statusCodeAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusMessage()); hashCode = 31 * hashCode + Objects.hashCode(archiveSizeInBytes()); hashCode = 31 * hashCode + Objects.hashCode(inventorySizeInBytes()); hashCode = 31 * hashCode + Objects.hashCode(snsTopic()); hashCode = 31 * hashCode + Objects.hashCode(completionDate()); hashCode = 31 * hashCode + Objects.hashCode(sha256TreeHash()); hashCode = 31 * hashCode + Objects.hashCode(archiveSHA256TreeHash()); hashCode = 31 * hashCode + Objects.hashCode(retrievalByteRange()); hashCode = 31 * hashCode + Objects.hashCode(tier()); hashCode = 31 * hashCode + Objects.hashCode(inventoryRetrievalParameters()); hashCode = 31 * hashCode + Objects.hashCode(jobOutputPath()); hashCode = 31 * hashCode + Objects.hashCode(selectParameters()); hashCode = 31 * hashCode + Objects.hashCode(outputLocation()); 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 DescribeJobResponse)) { return false; } DescribeJobResponse other = (DescribeJobResponse) obj; return Objects.equals(jobId(), other.jobId()) && Objects.equals(jobDescription(), other.jobDescription()) && Objects.equals(actionAsString(), other.actionAsString()) && Objects.equals(archiveId(), other.archiveId()) && Objects.equals(vaultARN(), other.vaultARN()) && Objects.equals(creationDate(), other.creationDate()) && Objects.equals(completed(), other.completed()) && Objects.equals(statusCodeAsString(), other.statusCodeAsString()) && Objects.equals(statusMessage(), other.statusMessage()) && Objects.equals(archiveSizeInBytes(), other.archiveSizeInBytes()) && Objects.equals(inventorySizeInBytes(), other.inventorySizeInBytes()) && Objects.equals(snsTopic(), other.snsTopic()) && Objects.equals(completionDate(), other.completionDate()) && Objects.equals(sha256TreeHash(), other.sha256TreeHash()) && Objects.equals(archiveSHA256TreeHash(), other.archiveSHA256TreeHash()) && Objects.equals(retrievalByteRange(), other.retrievalByteRange()) && Objects.equals(tier(), other.tier()) && Objects.equals(inventoryRetrievalParameters(), other.inventoryRetrievalParameters()) && Objects.equals(jobOutputPath(), other.jobOutputPath()) && Objects.equals(selectParameters(), other.selectParameters()) && Objects.equals(outputLocation(), other.outputLocation()); } /** * 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("DescribeJobResponse").add("JobId", jobId()).add("JobDescription", jobDescription()) .add("Action", actionAsString()).add("ArchiveId", archiveId()).add("VaultARN", vaultARN()) .add("CreationDate", creationDate()).add("Completed", completed()).add("StatusCode", statusCodeAsString()) .add("StatusMessage", statusMessage()).add("ArchiveSizeInBytes", archiveSizeInBytes()) .add("InventorySizeInBytes", inventorySizeInBytes()).add("SNSTopic", snsTopic()) .add("CompletionDate", completionDate()).add("SHA256TreeHash", sha256TreeHash()) .add("ArchiveSHA256TreeHash", archiveSHA256TreeHash()).add("RetrievalByteRange", retrievalByteRange()) .add("Tier", tier()).add("InventoryRetrievalParameters", inventoryRetrievalParameters()) .add("JobOutputPath", jobOutputPath()).add("SelectParameters", selectParameters()) .add("OutputLocation", outputLocation()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "JobId": return Optional.ofNullable(clazz.cast(jobId())); case "JobDescription": return Optional.ofNullable(clazz.cast(jobDescription())); case "Action": return Optional.ofNullable(clazz.cast(actionAsString())); case "ArchiveId": return Optional.ofNullable(clazz.cast(archiveId())); case "VaultARN": return Optional.ofNullable(clazz.cast(vaultARN())); case "CreationDate": return Optional.ofNullable(clazz.cast(creationDate())); case "Completed": return Optional.ofNullable(clazz.cast(completed())); case "StatusCode": return Optional.ofNullable(clazz.cast(statusCodeAsString())); case "StatusMessage": return Optional.ofNullable(clazz.cast(statusMessage())); case "ArchiveSizeInBytes": return Optional.ofNullable(clazz.cast(archiveSizeInBytes())); case "InventorySizeInBytes": return Optional.ofNullable(clazz.cast(inventorySizeInBytes())); case "SNSTopic": return Optional.ofNullable(clazz.cast(snsTopic())); case "CompletionDate": return Optional.ofNullable(clazz.cast(completionDate())); case "SHA256TreeHash": return Optional.ofNullable(clazz.cast(sha256TreeHash())); case "ArchiveSHA256TreeHash": return Optional.ofNullable(clazz.cast(archiveSHA256TreeHash())); case "RetrievalByteRange": return Optional.ofNullable(clazz.cast(retrievalByteRange())); case "Tier": return Optional.ofNullable(clazz.cast(tier())); case "InventoryRetrievalParameters": return Optional.ofNullable(clazz.cast(inventoryRetrievalParameters())); case "JobOutputPath": return Optional.ofNullable(clazz.cast(jobOutputPath())); case "SelectParameters": return Optional.ofNullable(clazz.cast(selectParameters())); case "OutputLocation": return Optional.ofNullable(clazz.cast(outputLocation())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } @Override public final Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } private static Map> memberNameToFieldInitializer() { Map> map = new HashMap<>(); map.put("JobId", JOB_ID_FIELD); map.put("JobDescription", JOB_DESCRIPTION_FIELD); map.put("Action", ACTION_FIELD); map.put("ArchiveId", ARCHIVE_ID_FIELD); map.put("VaultARN", VAULT_ARN_FIELD); map.put("CreationDate", CREATION_DATE_FIELD); map.put("Completed", COMPLETED_FIELD); map.put("StatusCode", STATUS_CODE_FIELD); map.put("StatusMessage", STATUS_MESSAGE_FIELD); map.put("ArchiveSizeInBytes", ARCHIVE_SIZE_IN_BYTES_FIELD); map.put("InventorySizeInBytes", INVENTORY_SIZE_IN_BYTES_FIELD); map.put("SNSTopic", SNS_TOPIC_FIELD); map.put("CompletionDate", COMPLETION_DATE_FIELD); map.put("SHA256TreeHash", SHA256_TREE_HASH_FIELD); map.put("ArchiveSHA256TreeHash", ARCHIVE_SHA256_TREE_HASH_FIELD); map.put("RetrievalByteRange", RETRIEVAL_BYTE_RANGE_FIELD); map.put("Tier", TIER_FIELD); map.put("InventoryRetrievalParameters", INVENTORY_RETRIEVAL_PARAMETERS_FIELD); map.put("JobOutputPath", JOB_OUTPUT_PATH_FIELD); map.put("SelectParameters", SELECT_PARAMETERS_FIELD); map.put("OutputLocation", OUTPUT_LOCATION_FIELD); return Collections.unmodifiableMap(map); } private static Function getter(Function g) { return obj -> g.apply((DescribeJobResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends GlacierResponse.Builder, SdkPojo, CopyableBuilder { /** *

    * An opaque string that identifies an Amazon S3 Glacier job. *

    * * @param jobId * An opaque string that identifies an Amazon S3 Glacier job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobId(String jobId); /** *

    * The job description provided when initiating the job. *

    * * @param jobDescription * The job description provided when initiating the job. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobDescription(String jobDescription); /** *

    * The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. *

    * * @param action * The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. * @see ActionCode * @return Returns a reference to this object so that method calls can be chained together. * @see ActionCode */ Builder action(String action); /** *

    * The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. *

    * * @param action * The job type. This value is either ArchiveRetrieval, InventoryRetrieval, or * Select. * @see ActionCode * @return Returns a reference to this object so that method calls can be chained together. * @see ActionCode */ Builder action(ActionCode action); /** *

    * The archive ID requested for a select job or archive retrieval. Otherwise, this field is null. *

    * * @param archiveId * The archive ID requested for a select job or archive retrieval. Otherwise, this field is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder archiveId(String archiveId); /** *

    * The Amazon Resource Name (ARN) of the vault from which an archive retrieval was requested. *

    * * @param vaultARN * The Amazon Resource Name (ARN) of the vault from which an archive retrieval was requested. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vaultARN(String vaultARN); /** *

    * The UTC date when the job was created. This value is a string representation of ISO 8601 date format, for * example "2012-03-20T17:03:43.221Z". *

    * * @param creationDate * The UTC date when the job was created. This value is a string representation of ISO 8601 date format, * for example "2012-03-20T17:03:43.221Z". * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDate(String creationDate); /** *

    * The job status. When a job is completed, you get the job's output using Get Job Output (GET output). *

    * * @param completed * The job status. When a job is completed, you get the job's output using Get Job Output (GET output). * @return Returns a reference to this object so that method calls can be chained together. */ Builder completed(Boolean completed); /** *

    * The status code can be InProgress, Succeeded, or Failed, and indicates * the status of the job. *

    * * @param statusCode * The status code can be InProgress, Succeeded, or Failed, and * indicates the status of the job. * @see StatusCode * @return Returns a reference to this object so that method calls can be chained together. * @see StatusCode */ Builder statusCode(String statusCode); /** *

    * The status code can be InProgress, Succeeded, or Failed, and indicates * the status of the job. *

    * * @param statusCode * The status code can be InProgress, Succeeded, or Failed, and * indicates the status of the job. * @see StatusCode * @return Returns a reference to this object so that method calls can be chained together. * @see StatusCode */ Builder statusCode(StatusCode statusCode); /** *

    * A friendly message that describes the job status. *

    * * @param statusMessage * A friendly message that describes the job status. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusMessage(String statusMessage); /** *

    * For an archive retrieval job, this value is the size in bytes of the archive being requested for download. * For an inventory retrieval or select job, this value is null. *

    * * @param archiveSizeInBytes * For an archive retrieval job, this value is the size in bytes of the archive being requested for * download. For an inventory retrieval or select job, this value is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder archiveSizeInBytes(Long archiveSizeInBytes); /** *

    * For an inventory retrieval job, this value is the size in bytes of the inventory requested for download. For * an archive retrieval or select job, this value is null. *

    * * @param inventorySizeInBytes * For an inventory retrieval job, this value is the size in bytes of the inventory requested for * download. For an archive retrieval or select job, this value is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inventorySizeInBytes(Long inventorySizeInBytes); /** *

    * An Amazon SNS topic that receives notification. *

    * * @param snsTopic * An Amazon SNS topic that receives notification. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snsTopic(String snsTopic); /** *

    * The UTC time that the job request completed. While the job is in progress, the value is null. *

    * * @param completionDate * The UTC time that the job request completed. While the job is in progress, the value is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder completionDate(String completionDate); /** *

    * For an archive retrieval job, this value is the checksum of the archive. Otherwise, this value is null. *

    *

    * The SHA256 tree hash value for the requested range of an archive. If the InitiateJob request for an * archive specified a tree-hash aligned range, then this field returns a value. *

    *

    * If the whole archive is retrieved, this value is the same as the ArchiveSHA256TreeHash value. *

    *

    * This field is null for the following: *

    *
      *
    • *

      * Archive retrieval jobs that specify a range that is not tree-hash aligned *

      *
    • *
    *
      *
    • *

      * Archival jobs that specify a range that is equal to the whole archive, when the job status is * InProgress *

      *
    • *
    *
      *
    • *

      * Inventory jobs *

      *
    • *
    • *

      * Select jobs *

      *
    • *
    * * @param sha256TreeHash * For an archive retrieval job, this value is the checksum of the archive. Otherwise, this value is * null.

    *

    * The SHA256 tree hash value for the requested range of an archive. If the InitiateJob request * for an archive specified a tree-hash aligned range, then this field returns a value. *

    *

    * If the whole archive is retrieved, this value is the same as the ArchiveSHA256TreeHash value. *

    *

    * This field is null for the following: *

    *
      *
    • *

      * Archive retrieval jobs that specify a range that is not tree-hash aligned *

      *
    • *
    *
      *
    • *

      * Archival jobs that specify a range that is equal to the whole archive, when the job status is * InProgress *

      *
    • *
    *
      *
    • *

      * Inventory jobs *

      *
    • *
    • *

      * Select jobs *

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

      * The SHA256 tree hash of the entire archive for an archive retrieval. For inventory retrieval or select jobs, * this field is null. *

      * * @param archiveSHA256TreeHash * The SHA256 tree hash of the entire archive for an archive retrieval. For inventory retrieval or select * jobs, this field is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder archiveSHA256TreeHash(String archiveSHA256TreeHash); /** *

      * The retrieved byte range for archive retrieval jobs in the form StartByteValue-EndByteValue. If * no range was specified in the archive retrieval, then the whole archive is retrieved. In this case, * StartByteValue equals 0 and EndByteValue equals the size of the archive minus 1. For inventory * retrieval or select jobs, this field is null. *

      * * @param retrievalByteRange * The retrieved byte range for archive retrieval jobs in the form * StartByteValue-EndByteValue. If no range was specified in the archive retrieval, then * the whole archive is retrieved. In this case, StartByteValue equals 0 and EndByteValue * equals the size of the archive minus 1. For inventory retrieval or select jobs, this field is null. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retrievalByteRange(String retrievalByteRange); /** *

      * The tier to use for a select or an archive retrieval. Valid values are Expedited, * Standard, or Bulk. Standard is the default. *

      * * @param tier * The tier to use for a select or an archive retrieval. Valid values are Expedited, * Standard, or Bulk. Standard is the default. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tier(String tier); /** *

      * Parameters used for range inventory retrieval. *

      * * @param inventoryRetrievalParameters * Parameters used for range inventory retrieval. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inventoryRetrievalParameters(InventoryRetrievalJobDescription inventoryRetrievalParameters); /** *

      * Parameters used for range inventory retrieval. *

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

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

      * Contains the job output location. *

      * * @param jobOutputPath * Contains the job output location. * @return Returns a reference to this object so that method calls can be chained together. */ Builder jobOutputPath(String jobOutputPath); /** *

      * Contains the parameters used for a select. *

      * * @param selectParameters * Contains the parameters used for a select. * @return Returns a reference to this object so that method calls can be chained together. */ Builder selectParameters(SelectParameters selectParameters); /** *

      * Contains the parameters used for a select. *

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

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

      * Contains the location where the data from the select job is stored. *

      * * @param outputLocation * Contains the location where the data from the select job is stored. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputLocation(OutputLocation outputLocation); /** *

      * Contains the location where the data from the select job is stored. *

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

      * When the {@link Consumer} completes, {@link OutputLocation.Builder#build()} is called immediately and its * result is passed to {@link #outputLocation(OutputLocation)}. * * @param outputLocation * a consumer that will call methods on {@link OutputLocation.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #outputLocation(OutputLocation) */ default Builder outputLocation(Consumer outputLocation) { return outputLocation(OutputLocation.builder().applyMutation(outputLocation).build()); } } static final class BuilderImpl extends GlacierResponse.BuilderImpl implements Builder { private String jobId; private String jobDescription; private String action; private String archiveId; private String vaultARN; private String creationDate; private Boolean completed; private String statusCode; private String statusMessage; private Long archiveSizeInBytes; private Long inventorySizeInBytes; private String snsTopic; private String completionDate; private String sha256TreeHash; private String archiveSHA256TreeHash; private String retrievalByteRange; private String tier; private InventoryRetrievalJobDescription inventoryRetrievalParameters; private String jobOutputPath; private SelectParameters selectParameters; private OutputLocation outputLocation; private BuilderImpl() { } private BuilderImpl(DescribeJobResponse model) { super(model); jobId(model.jobId); jobDescription(model.jobDescription); action(model.action); archiveId(model.archiveId); vaultARN(model.vaultARN); creationDate(model.creationDate); completed(model.completed); statusCode(model.statusCode); statusMessage(model.statusMessage); archiveSizeInBytes(model.archiveSizeInBytes); inventorySizeInBytes(model.inventorySizeInBytes); snsTopic(model.snsTopic); completionDate(model.completionDate); sha256TreeHash(model.sha256TreeHash); archiveSHA256TreeHash(model.archiveSHA256TreeHash); retrievalByteRange(model.retrievalByteRange); tier(model.tier); inventoryRetrievalParameters(model.inventoryRetrievalParameters); jobOutputPath(model.jobOutputPath); selectParameters(model.selectParameters); outputLocation(model.outputLocation); } public final String getJobId() { return jobId; } public final void setJobId(String jobId) { this.jobId = jobId; } @Override public final Builder jobId(String jobId) { this.jobId = jobId; return this; } public final String getJobDescription() { return jobDescription; } public final void setJobDescription(String jobDescription) { this.jobDescription = jobDescription; } @Override public final Builder jobDescription(String jobDescription) { this.jobDescription = jobDescription; return this; } public final String getAction() { return action; } public final void setAction(String action) { this.action = action; } @Override public final Builder action(String action) { this.action = action; return this; } @Override public final Builder action(ActionCode action) { this.action(action == null ? null : action.toString()); return this; } public final String getArchiveId() { return archiveId; } public final void setArchiveId(String archiveId) { this.archiveId = archiveId; } @Override public final Builder archiveId(String archiveId) { this.archiveId = archiveId; return this; } public final String getVaultARN() { return vaultARN; } public final void setVaultARN(String vaultARN) { this.vaultARN = vaultARN; } @Override public final Builder vaultARN(String vaultARN) { this.vaultARN = vaultARN; return this; } public final String getCreationDate() { return creationDate; } public final void setCreationDate(String creationDate) { this.creationDate = creationDate; } @Override public final Builder creationDate(String creationDate) { this.creationDate = creationDate; return this; } public final Boolean getCompleted() { return completed; } public final void setCompleted(Boolean completed) { this.completed = completed; } @Override public final Builder completed(Boolean completed) { this.completed = completed; return this; } public final String getStatusCode() { return statusCode; } public final void setStatusCode(String statusCode) { this.statusCode = statusCode; } @Override public final Builder statusCode(String statusCode) { this.statusCode = statusCode; return this; } @Override public final Builder statusCode(StatusCode statusCode) { this.statusCode(statusCode == null ? null : statusCode.toString()); return this; } public final String getStatusMessage() { return statusMessage; } public final void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } @Override public final Builder statusMessage(String statusMessage) { this.statusMessage = statusMessage; return this; } public final Long getArchiveSizeInBytes() { return archiveSizeInBytes; } public final void setArchiveSizeInBytes(Long archiveSizeInBytes) { this.archiveSizeInBytes = archiveSizeInBytes; } @Override public final Builder archiveSizeInBytes(Long archiveSizeInBytes) { this.archiveSizeInBytes = archiveSizeInBytes; return this; } public final Long getInventorySizeInBytes() { return inventorySizeInBytes; } public final void setInventorySizeInBytes(Long inventorySizeInBytes) { this.inventorySizeInBytes = inventorySizeInBytes; } @Override public final Builder inventorySizeInBytes(Long inventorySizeInBytes) { this.inventorySizeInBytes = inventorySizeInBytes; return this; } public final String getSnsTopic() { return snsTopic; } public final void setSnsTopic(String snsTopic) { this.snsTopic = snsTopic; } @Override public final Builder snsTopic(String snsTopic) { this.snsTopic = snsTopic; return this; } public final String getCompletionDate() { return completionDate; } public final void setCompletionDate(String completionDate) { this.completionDate = completionDate; } @Override public final Builder completionDate(String completionDate) { this.completionDate = completionDate; return this; } public final String getSha256TreeHash() { return sha256TreeHash; } public final void setSha256TreeHash(String sha256TreeHash) { this.sha256TreeHash = sha256TreeHash; } @Override public final Builder sha256TreeHash(String sha256TreeHash) { this.sha256TreeHash = sha256TreeHash; return this; } public final String getArchiveSHA256TreeHash() { return archiveSHA256TreeHash; } public final void setArchiveSHA256TreeHash(String archiveSHA256TreeHash) { this.archiveSHA256TreeHash = archiveSHA256TreeHash; } @Override public final Builder archiveSHA256TreeHash(String archiveSHA256TreeHash) { this.archiveSHA256TreeHash = archiveSHA256TreeHash; return this; } public final String getRetrievalByteRange() { return retrievalByteRange; } public final void setRetrievalByteRange(String retrievalByteRange) { this.retrievalByteRange = retrievalByteRange; } @Override public final Builder retrievalByteRange(String retrievalByteRange) { this.retrievalByteRange = retrievalByteRange; return this; } public final String getTier() { return tier; } public final void setTier(String tier) { this.tier = tier; } @Override public final Builder tier(String tier) { this.tier = tier; return this; } public final InventoryRetrievalJobDescription.Builder getInventoryRetrievalParameters() { return inventoryRetrievalParameters != null ? inventoryRetrievalParameters.toBuilder() : null; } public final void setInventoryRetrievalParameters( InventoryRetrievalJobDescription.BuilderImpl inventoryRetrievalParameters) { this.inventoryRetrievalParameters = inventoryRetrievalParameters != null ? inventoryRetrievalParameters.build() : null; } @Override public final Builder inventoryRetrievalParameters(InventoryRetrievalJobDescription inventoryRetrievalParameters) { this.inventoryRetrievalParameters = inventoryRetrievalParameters; return this; } public final String getJobOutputPath() { return jobOutputPath; } public final void setJobOutputPath(String jobOutputPath) { this.jobOutputPath = jobOutputPath; } @Override public final Builder jobOutputPath(String jobOutputPath) { this.jobOutputPath = jobOutputPath; return this; } public final SelectParameters.Builder getSelectParameters() { return selectParameters != null ? selectParameters.toBuilder() : null; } public final void setSelectParameters(SelectParameters.BuilderImpl selectParameters) { this.selectParameters = selectParameters != null ? selectParameters.build() : null; } @Override public final Builder selectParameters(SelectParameters selectParameters) { this.selectParameters = selectParameters; return this; } public final OutputLocation.Builder getOutputLocation() { return outputLocation != null ? outputLocation.toBuilder() : null; } public final void setOutputLocation(OutputLocation.BuilderImpl outputLocation) { this.outputLocation = outputLocation != null ? outputLocation.build() : null; } @Override public final Builder outputLocation(OutputLocation outputLocation) { this.outputLocation = outputLocation; return this; } @Override public DescribeJobResponse build() { return new DescribeJobResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy