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

software.amazon.awssdk.services.s3.model.ListPartsResponse Maven / Gradle / Ivy

Go to download

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

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.s3.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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class ListPartsResponse extends S3Response implements
        ToCopyableBuilder {
    private static final SdkField ABORT_DATE_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("AbortDate")
            .getter(getter(ListPartsResponse::abortDate))
            .setter(setter(Builder::abortDate))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-abort-date")
                    .unmarshallLocationName("x-amz-abort-date").build()).build();

    private static final SdkField ABORT_RULE_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("AbortRuleId")
            .getter(getter(ListPartsResponse::abortRuleId))
            .setter(setter(Builder::abortRuleId))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-abort-rule-id")
                    .unmarshallLocationName("x-amz-abort-rule-id").build()).build();

    private static final SdkField BUCKET_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Bucket")
            .getter(getter(ListPartsResponse::bucket))
            .setter(setter(Builder::bucket))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Bucket")
                    .unmarshallLocationName("Bucket").build()).build();

    private static final SdkField KEY_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Key")
            .getter(getter(ListPartsResponse::key))
            .setter(setter(Builder::key))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Key").unmarshallLocationName("Key")
                    .build()).build();

    private static final SdkField UPLOAD_ID_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("UploadId")
            .getter(getter(ListPartsResponse::uploadId))
            .setter(setter(Builder::uploadId))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UploadId")
                    .unmarshallLocationName("UploadId").build()).build();

    private static final SdkField PART_NUMBER_MARKER_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("PartNumberMarker")
            .getter(getter(ListPartsResponse::partNumberMarker))
            .setter(setter(Builder::partNumberMarker))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PartNumberMarker")
                    .unmarshallLocationName("PartNumberMarker").build()).build();

    private static final SdkField NEXT_PART_NUMBER_MARKER_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("NextPartNumberMarker")
            .getter(getter(ListPartsResponse::nextPartNumberMarker))
            .setter(setter(Builder::nextPartNumberMarker))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextPartNumberMarker")
                    .unmarshallLocationName("NextPartNumberMarker").build()).build();

    private static final SdkField MAX_PARTS_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("MaxParts")
            .getter(getter(ListPartsResponse::maxParts))
            .setter(setter(Builder::maxParts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxParts")
                    .unmarshallLocationName("MaxParts").build()).build();

    private static final SdkField IS_TRUNCATED_FIELD = SdkField
            . builder(MarshallingType.BOOLEAN)
            .memberName("IsTruncated")
            .getter(getter(ListPartsResponse::isTruncated))
            .setter(setter(Builder::isTruncated))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IsTruncated")
                    .unmarshallLocationName("IsTruncated").build()).build();

    private static final SdkField> PARTS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Parts")
            .getter(getter(ListPartsResponse::parts))
            .setter(setter(Builder::parts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Part")
                    .unmarshallLocationName("Part").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(Part::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").unmarshallLocationName("member").build()).build())
                            .isFlattened(true).build()).build();

    private static final SdkField INITIATOR_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO)
            .memberName("Initiator")
            .getter(getter(ListPartsResponse::initiator))
            .setter(setter(Builder::initiator))
            .constructor(Initiator::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Initiator")
                    .unmarshallLocationName("Initiator").build()).build();

    private static final SdkField OWNER_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO)
            .memberName("Owner")
            .getter(getter(ListPartsResponse::owner))
            .setter(setter(Builder::owner))
            .constructor(Owner::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Owner")
                    .unmarshallLocationName("Owner").build()).build();

    private static final SdkField STORAGE_CLASS_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("StorageClass")
            .getter(getter(ListPartsResponse::storageClassAsString))
            .setter(setter(Builder::storageClass))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StorageClass")
                    .unmarshallLocationName("StorageClass").build()).build();

    private static final SdkField REQUEST_CHARGED_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("RequestCharged")
            .getter(getter(ListPartsResponse::requestChargedAsString))
            .setter(setter(Builder::requestCharged))
            .traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-request-charged")
                    .unmarshallLocationName("x-amz-request-charged").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ABORT_DATE_FIELD,
            ABORT_RULE_ID_FIELD, BUCKET_FIELD, KEY_FIELD, UPLOAD_ID_FIELD, PART_NUMBER_MARKER_FIELD,
            NEXT_PART_NUMBER_MARKER_FIELD, MAX_PARTS_FIELD, IS_TRUNCATED_FIELD, PARTS_FIELD, INITIATOR_FIELD, OWNER_FIELD,
            STORAGE_CLASS_FIELD, REQUEST_CHARGED_FIELD));

    private final Instant abortDate;

    private final String abortRuleId;

    private final String bucket;

    private final String key;

    private final String uploadId;

    private final Integer partNumberMarker;

    private final Integer nextPartNumberMarker;

    private final Integer maxParts;

    private final Boolean isTruncated;

    private final List parts;

    private final Initiator initiator;

    private final Owner owner;

    private final String storageClass;

    private final String requestCharged;

    private ListPartsResponse(BuilderImpl builder) {
        super(builder);
        this.abortDate = builder.abortDate;
        this.abortRuleId = builder.abortRuleId;
        this.bucket = builder.bucket;
        this.key = builder.key;
        this.uploadId = builder.uploadId;
        this.partNumberMarker = builder.partNumberMarker;
        this.nextPartNumberMarker = builder.nextPartNumberMarker;
        this.maxParts = builder.maxParts;
        this.isTruncated = builder.isTruncated;
        this.parts = builder.parts;
        this.initiator = builder.initiator;
        this.owner = builder.owner;
        this.storageClass = builder.storageClass;
        this.requestCharged = builder.requestCharged;
    }

    /**
     * 

* If the bucket has a lifecycle rule configured with an action to abort incomplete multipart uploads and the prefix * in the lifecycle rule matches the object name in the request, then the response includes this header indicating * when the initiated multipart upload will become eligible for abort operation. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy. *

*

* The response will also include the x-amz-abort-rule-id header that will provide the ID of the * lifecycle configuration rule that defines this action. *

* * @return If the bucket has a lifecycle rule configured with an action to abort incomplete multipart uploads and * the prefix in the lifecycle rule matches the object name in the request, then the response includes this * header indicating when the initiated multipart upload will become eligible for abort operation. For more * information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy.

*

* The response will also include the x-amz-abort-rule-id header that will provide the ID of * the lifecycle configuration rule that defines this action. */ public final Instant abortDate() { return abortDate; } /** *

* This header is returned along with the x-amz-abort-date header. It identifies applicable lifecycle * configuration rule that defines the action to abort incomplete multipart uploads. *

* * @return This header is returned along with the x-amz-abort-date header. It identifies applicable * lifecycle configuration rule that defines the action to abort incomplete multipart uploads. */ public final String abortRuleId() { return abortRuleId; } /** *

* The name of the bucket to which the multipart upload was initiated. *

* * @return The name of the bucket to which the multipart upload was initiated. */ public final String bucket() { return bucket; } /** *

* Object key for which the multipart upload was initiated. *

* * @return Object key for which the multipart upload was initiated. */ public final String key() { return key; } /** *

* Upload ID identifying the multipart upload whose parts are being listed. *

* * @return Upload ID identifying the multipart upload whose parts are being listed. */ public final String uploadId() { return uploadId; } /** *

* When a list is truncated, this element specifies the last part in the list, as well as the value to use for the * part-number-marker request parameter in a subsequent request. *

* * @return When a list is truncated, this element specifies the last part in the list, as well as the value to use * for the part-number-marker request parameter in a subsequent request. */ public final Integer partNumberMarker() { return partNumberMarker; } /** *

* When a list is truncated, this element specifies the last part in the list, as well as the value to use for the * part-number-marker request parameter in a subsequent request. *

* * @return When a list is truncated, this element specifies the last part in the list, as well as the value to use * for the part-number-marker request parameter in a subsequent request. */ public final Integer nextPartNumberMarker() { return nextPartNumberMarker; } /** *

* Maximum number of parts that were allowed in the response. *

* * @return Maximum number of parts that were allowed in the response. */ public final Integer maxParts() { return maxParts; } /** *

* Indicates whether the returned list of parts is truncated. A true value indicates that the list was truncated. A * list can be truncated if the number of parts exceeds the limit returned in the MaxParts element. *

* * @return Indicates whether the returned list of parts is truncated. A true value indicates that the list was * truncated. A list can be truncated if the number of parts exceeds the limit returned in the MaxParts * element. */ public final Boolean isTruncated() { return isTruncated; } /** * Returns true if the Parts 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 hasParts() { return parts != null && !(parts instanceof SdkAutoConstructList); } /** *

* Container for elements related to a particular part. A response can contain zero or more Part * elements. *

*

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

*

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

* * @return Container for elements related to a particular part. A response can contain zero or more * Part elements. */ public final List parts() { return parts; } /** *

* Container element that identifies who initiated the multipart upload. If the initiator is an AWS account, this * element provides the same information as the Owner element. If the initiator is an IAM User, this * element provides the user ARN and display name. *

* * @return Container element that identifies who initiated the multipart upload. If the initiator is an AWS account, * this element provides the same information as the Owner element. If the initiator is an IAM * User, this element provides the user ARN and display name. */ public final Initiator initiator() { return initiator; } /** *

* Container element that identifies the object owner, after the object is created. If multipart upload is initiated * by an IAM user, this element provides the parent account ID and display name. *

* * @return Container element that identifies the object owner, after the object is created. If multipart upload is * initiated by an IAM user, this element provides the parent account ID and display name. */ public final Owner owner() { return owner; } /** *

* Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. *

*

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

* * @return Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. * @see StorageClass */ public final StorageClass storageClass() { return StorageClass.fromValue(storageClass); } /** *

* Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. *

*

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

* * @return Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. * @see StorageClass */ public final String storageClassAsString() { return storageClass; } /** * Returns the value of the RequestCharged property for this object. *

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

* * @return The value of the RequestCharged property for this object. * @see RequestCharged */ public final RequestCharged requestCharged() { return RequestCharged.fromValue(requestCharged); } /** * Returns the value of the RequestCharged property for this object. *

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

* * @return The value of the RequestCharged property for this object. * @see RequestCharged */ public final String requestChargedAsString() { return requestCharged; } @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(abortDate()); hashCode = 31 * hashCode + Objects.hashCode(abortRuleId()); hashCode = 31 * hashCode + Objects.hashCode(bucket()); hashCode = 31 * hashCode + Objects.hashCode(key()); hashCode = 31 * hashCode + Objects.hashCode(uploadId()); hashCode = 31 * hashCode + Objects.hashCode(partNumberMarker()); hashCode = 31 * hashCode + Objects.hashCode(nextPartNumberMarker()); hashCode = 31 * hashCode + Objects.hashCode(maxParts()); hashCode = 31 * hashCode + Objects.hashCode(isTruncated()); hashCode = 31 * hashCode + Objects.hashCode(hasParts() ? parts() : null); hashCode = 31 * hashCode + Objects.hashCode(initiator()); hashCode = 31 * hashCode + Objects.hashCode(owner()); hashCode = 31 * hashCode + Objects.hashCode(storageClassAsString()); hashCode = 31 * hashCode + Objects.hashCode(requestChargedAsString()); 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 ListPartsResponse)) { return false; } ListPartsResponse other = (ListPartsResponse) obj; return Objects.equals(abortDate(), other.abortDate()) && Objects.equals(abortRuleId(), other.abortRuleId()) && Objects.equals(bucket(), other.bucket()) && Objects.equals(key(), other.key()) && Objects.equals(uploadId(), other.uploadId()) && Objects.equals(partNumberMarker(), other.partNumberMarker()) && Objects.equals(nextPartNumberMarker(), other.nextPartNumberMarker()) && Objects.equals(maxParts(), other.maxParts()) && Objects.equals(isTruncated(), other.isTruncated()) && hasParts() == other.hasParts() && Objects.equals(parts(), other.parts()) && Objects.equals(initiator(), other.initiator()) && Objects.equals(owner(), other.owner()) && Objects.equals(storageClassAsString(), other.storageClassAsString()) && Objects.equals(requestChargedAsString(), other.requestChargedAsString()); } /** * 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("ListPartsResponse").add("AbortDate", abortDate()).add("AbortRuleId", abortRuleId()) .add("Bucket", bucket()).add("Key", key()).add("UploadId", uploadId()) .add("PartNumberMarker", partNumberMarker()).add("NextPartNumberMarker", nextPartNumberMarker()) .add("MaxParts", maxParts()).add("IsTruncated", isTruncated()).add("Parts", hasParts() ? parts() : null) .add("Initiator", initiator()).add("Owner", owner()).add("StorageClass", storageClassAsString()) .add("RequestCharged", requestChargedAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "AbortDate": return Optional.ofNullable(clazz.cast(abortDate())); case "AbortRuleId": return Optional.ofNullable(clazz.cast(abortRuleId())); case "Bucket": return Optional.ofNullable(clazz.cast(bucket())); case "Key": return Optional.ofNullable(clazz.cast(key())); case "UploadId": return Optional.ofNullable(clazz.cast(uploadId())); case "PartNumberMarker": return Optional.ofNullable(clazz.cast(partNumberMarker())); case "NextPartNumberMarker": return Optional.ofNullable(clazz.cast(nextPartNumberMarker())); case "MaxParts": return Optional.ofNullable(clazz.cast(maxParts())); case "IsTruncated": return Optional.ofNullable(clazz.cast(isTruncated())); case "Parts": return Optional.ofNullable(clazz.cast(parts())); case "Initiator": return Optional.ofNullable(clazz.cast(initiator())); case "Owner": return Optional.ofNullable(clazz.cast(owner())); case "StorageClass": return Optional.ofNullable(clazz.cast(storageClassAsString())); case "RequestCharged": return Optional.ofNullable(clazz.cast(requestChargedAsString())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((ListPartsResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends S3Response.Builder, SdkPojo, CopyableBuilder { /** *

* If the bucket has a lifecycle rule configured with an action to abort incomplete multipart uploads and the * prefix in the lifecycle rule matches the object name in the request, then the response includes this header * indicating when the initiated multipart upload will become eligible for abort operation. For more * information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy. *

*

* The response will also include the x-amz-abort-rule-id header that will provide the ID of the * lifecycle configuration rule that defines this action. *

* * @param abortDate * If the bucket has a lifecycle rule configured with an action to abort incomplete multipart uploads and * the prefix in the lifecycle rule matches the object name in the request, then the response includes * this header indicating when the initiated multipart upload will become eligible for abort operation. * For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle Policy.

*

* The response will also include the x-amz-abort-rule-id header that will provide the ID of * the lifecycle configuration rule that defines this action. * @return Returns a reference to this object so that method calls can be chained together. */ Builder abortDate(Instant abortDate); /** *

* This header is returned along with the x-amz-abort-date header. It identifies applicable * lifecycle configuration rule that defines the action to abort incomplete multipart uploads. *

* * @param abortRuleId * This header is returned along with the x-amz-abort-date header. It identifies applicable * lifecycle configuration rule that defines the action to abort incomplete multipart uploads. * @return Returns a reference to this object so that method calls can be chained together. */ Builder abortRuleId(String abortRuleId); /** *

* The name of the bucket to which the multipart upload was initiated. *

* * @param bucket * The name of the bucket to which the multipart upload was initiated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bucket(String bucket); /** *

* Object key for which the multipart upload was initiated. *

* * @param key * Object key for which the multipart upload was initiated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder key(String key); /** *

* Upload ID identifying the multipart upload whose parts are being listed. *

* * @param uploadId * Upload ID identifying the multipart upload whose parts are being listed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder uploadId(String uploadId); /** *

* When a list is truncated, this element specifies the last part in the list, as well as the value to use for * the part-number-marker request parameter in a subsequent request. *

* * @param partNumberMarker * When a list is truncated, this element specifies the last part in the list, as well as the value to * use for the part-number-marker request parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder partNumberMarker(Integer partNumberMarker); /** *

* When a list is truncated, this element specifies the last part in the list, as well as the value to use for * the part-number-marker request parameter in a subsequent request. *

* * @param nextPartNumberMarker * When a list is truncated, this element specifies the last part in the list, as well as the value to * use for the part-number-marker request parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextPartNumberMarker(Integer nextPartNumberMarker); /** *

* Maximum number of parts that were allowed in the response. *

* * @param maxParts * Maximum number of parts that were allowed in the response. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxParts(Integer maxParts); /** *

* Indicates whether the returned list of parts is truncated. A true value indicates that the list was * truncated. A list can be truncated if the number of parts exceeds the limit returned in the MaxParts element. *

* * @param isTruncated * Indicates whether the returned list of parts is truncated. A true value indicates that the list was * truncated. A list can be truncated if the number of parts exceeds the limit returned in the MaxParts * element. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isTruncated(Boolean isTruncated); /** *

* Container for elements related to a particular part. A response can contain zero or more Part * elements. *

* * @param parts * Container for elements related to a particular part. A response can contain zero or more * Part elements. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parts(Collection parts); /** *

* Container for elements related to a particular part. A response can contain zero or more Part * elements. *

* * @param parts * Container for elements related to a particular part. A response can contain zero or more * Part elements. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parts(Part... parts); /** *

* Container for elements related to a particular part. A response can contain zero or more Part * elements. *

* 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 #parts(List)}. * * @param parts * 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 #parts(List) */ Builder parts(Consumer... parts); /** *

* Container element that identifies who initiated the multipart upload. If the initiator is an AWS account, * this element provides the same information as the Owner element. If the initiator is an IAM * User, this element provides the user ARN and display name. *

* * @param initiator * Container element that identifies who initiated the multipart upload. If the initiator is an AWS * account, this element provides the same information as the Owner element. If the * initiator is an IAM User, this element provides the user ARN and display name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder initiator(Initiator initiator); /** *

* Container element that identifies who initiated the multipart upload. If the initiator is an AWS account, * this element provides the same information as the Owner element. If the initiator is an IAM * User, this element provides the user ARN and display name. *

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

* Container element that identifies the object owner, after the object is created. If multipart upload is * initiated by an IAM user, this element provides the parent account ID and display name. *

* * @param owner * Container element that identifies the object owner, after the object is created. If multipart upload * is initiated by an IAM user, this element provides the parent account ID and display name. * @return Returns a reference to this object so that method calls can be chained together. */ Builder owner(Owner owner); /** *

* Container element that identifies the object owner, after the object is created. If multipart upload is * initiated by an IAM user, this element provides the parent account ID and display name. *

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

* Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. *

* * @param storageClass * Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. * @see StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see StorageClass */ Builder storageClass(String storageClass); /** *

* Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. *

* * @param storageClass * Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded object. * @see StorageClass * @return Returns a reference to this object so that method calls can be chained together. * @see StorageClass */ Builder storageClass(StorageClass storageClass); /** * Sets the value of the RequestCharged property for this object. * * @param requestCharged * The new value for the RequestCharged property for this object. * @see RequestCharged * @return Returns a reference to this object so that method calls can be chained together. * @see RequestCharged */ Builder requestCharged(String requestCharged); /** * Sets the value of the RequestCharged property for this object. * * @param requestCharged * The new value for the RequestCharged property for this object. * @see RequestCharged * @return Returns a reference to this object so that method calls can be chained together. * @see RequestCharged */ Builder requestCharged(RequestCharged requestCharged); } static final class BuilderImpl extends S3Response.BuilderImpl implements Builder { private Instant abortDate; private String abortRuleId; private String bucket; private String key; private String uploadId; private Integer partNumberMarker; private Integer nextPartNumberMarker; private Integer maxParts; private Boolean isTruncated; private List parts = DefaultSdkAutoConstructList.getInstance(); private Initiator initiator; private Owner owner; private String storageClass; private String requestCharged; private BuilderImpl() { } private BuilderImpl(ListPartsResponse model) { super(model); abortDate(model.abortDate); abortRuleId(model.abortRuleId); bucket(model.bucket); key(model.key); uploadId(model.uploadId); partNumberMarker(model.partNumberMarker); nextPartNumberMarker(model.nextPartNumberMarker); maxParts(model.maxParts); isTruncated(model.isTruncated); parts(model.parts); initiator(model.initiator); owner(model.owner); storageClass(model.storageClass); requestCharged(model.requestCharged); } public final Instant getAbortDate() { return abortDate; } @Override public final Builder abortDate(Instant abortDate) { this.abortDate = abortDate; return this; } public final void setAbortDate(Instant abortDate) { this.abortDate = abortDate; } public final String getAbortRuleId() { return abortRuleId; } @Override public final Builder abortRuleId(String abortRuleId) { this.abortRuleId = abortRuleId; return this; } public final void setAbortRuleId(String abortRuleId) { this.abortRuleId = abortRuleId; } public final String getBucket() { return bucket; } @Override public final Builder bucket(String bucket) { this.bucket = bucket; return this; } public final void setBucket(String bucket) { this.bucket = bucket; } public final String getKey() { return key; } @Override public final Builder key(String key) { this.key = key; return this; } public final void setKey(String key) { this.key = key; } public final String getUploadId() { return uploadId; } @Override public final Builder uploadId(String uploadId) { this.uploadId = uploadId; return this; } public final void setUploadId(String uploadId) { this.uploadId = uploadId; } public final Integer getPartNumberMarker() { return partNumberMarker; } @Override public final Builder partNumberMarker(Integer partNumberMarker) { this.partNumberMarker = partNumberMarker; return this; } public final void setPartNumberMarker(Integer partNumberMarker) { this.partNumberMarker = partNumberMarker; } public final Integer getNextPartNumberMarker() { return nextPartNumberMarker; } @Override public final Builder nextPartNumberMarker(Integer nextPartNumberMarker) { this.nextPartNumberMarker = nextPartNumberMarker; return this; } public final void setNextPartNumberMarker(Integer nextPartNumberMarker) { this.nextPartNumberMarker = nextPartNumberMarker; } public final Integer getMaxParts() { return maxParts; } @Override public final Builder maxParts(Integer maxParts) { this.maxParts = maxParts; return this; } public final void setMaxParts(Integer maxParts) { this.maxParts = maxParts; } public final Boolean getIsTruncated() { return isTruncated; } @Override public final Builder isTruncated(Boolean isTruncated) { this.isTruncated = isTruncated; return this; } public final void setIsTruncated(Boolean isTruncated) { this.isTruncated = isTruncated; } public final Collection getParts() { if (parts instanceof SdkAutoConstructList) { return null; } return parts != null ? parts.stream().map(Part::toBuilder).collect(Collectors.toList()) : null; } @Override public final Builder parts(Collection parts) { this.parts = PartsCopier.copy(parts); return this; } @Override @SafeVarargs public final Builder parts(Part... parts) { parts(Arrays.asList(parts)); return this; } @Override @SafeVarargs public final Builder parts(Consumer... parts) { parts(Stream.of(parts).map(c -> Part.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final void setParts(Collection parts) { this.parts = PartsCopier.copyFromBuilder(parts); } public final Initiator.Builder getInitiator() { return initiator != null ? initiator.toBuilder() : null; } @Override public final Builder initiator(Initiator initiator) { this.initiator = initiator; return this; } public final void setInitiator(Initiator.BuilderImpl initiator) { this.initiator = initiator != null ? initiator.build() : null; } public final Owner.Builder getOwner() { return owner != null ? owner.toBuilder() : null; } @Override public final Builder owner(Owner owner) { this.owner = owner; return this; } public final void setOwner(Owner.BuilderImpl owner) { this.owner = owner != null ? owner.build() : null; } public final String getStorageClass() { return storageClass; } @Override public final Builder storageClass(String storageClass) { this.storageClass = storageClass; return this; } @Override public final Builder storageClass(StorageClass storageClass) { this.storageClass(storageClass == null ? null : storageClass.toString()); return this; } public final void setStorageClass(String storageClass) { this.storageClass = storageClass; } public final String getRequestCharged() { return requestCharged; } @Override public final Builder requestCharged(String requestCharged) { this.requestCharged = requestCharged; return this; } @Override public final Builder requestCharged(RequestCharged requestCharged) { this.requestCharged(requestCharged == null ? null : requestCharged.toString()); return this; } public final void setRequestCharged(String requestCharged) { this.requestCharged = requestCharged; } @Override public ListPartsResponse build() { return new ListPartsResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy