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

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

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.s3.model;

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 ListMultipartUploadsResponse extends S3Response implements
        ToCopyableBuilder {
    private static final SdkField BUCKET_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Bucket")
            .getter(getter(ListMultipartUploadsResponse::bucket))
            .setter(setter(Builder::bucket))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Bucket")
                    .unmarshallLocationName("Bucket").build()).build();

    private static final SdkField KEY_MARKER_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("KeyMarker")
            .getter(getter(ListMultipartUploadsResponse::keyMarker))
            .setter(setter(Builder::keyMarker))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KeyMarker")
                    .unmarshallLocationName("KeyMarker").build()).build();

    private static final SdkField UPLOAD_ID_MARKER_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("UploadIdMarker")
            .getter(getter(ListMultipartUploadsResponse::uploadIdMarker))
            .setter(setter(Builder::uploadIdMarker))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UploadIdMarker")
                    .unmarshallLocationName("UploadIdMarker").build()).build();

    private static final SdkField NEXT_KEY_MARKER_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("NextKeyMarker")
            .getter(getter(ListMultipartUploadsResponse::nextKeyMarker))
            .setter(setter(Builder::nextKeyMarker))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextKeyMarker")
                    .unmarshallLocationName("NextKeyMarker").build()).build();

    private static final SdkField PREFIX_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Prefix")
            .getter(getter(ListMultipartUploadsResponse::prefix))
            .setter(setter(Builder::prefix))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Prefix")
                    .unmarshallLocationName("Prefix").build()).build();

    private static final SdkField DELIMITER_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("Delimiter")
            .getter(getter(ListMultipartUploadsResponse::delimiter))
            .setter(setter(Builder::delimiter))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Delimiter")
                    .unmarshallLocationName("Delimiter").build()).build();

    private static final SdkField NEXT_UPLOAD_ID_MARKER_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("NextUploadIdMarker")
            .getter(getter(ListMultipartUploadsResponse::nextUploadIdMarker))
            .setter(setter(Builder::nextUploadIdMarker))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NextUploadIdMarker")
                    .unmarshallLocationName("NextUploadIdMarker").build()).build();

    private static final SdkField MAX_UPLOADS_FIELD = SdkField
            . builder(MarshallingType.INTEGER)
            .memberName("MaxUploads")
            .getter(getter(ListMultipartUploadsResponse::maxUploads))
            .setter(setter(Builder::maxUploads))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxUploads")
                    .unmarshallLocationName("MaxUploads").build()).build();

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

    private static final SdkField> UPLOADS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Uploads")
            .getter(getter(ListMultipartUploadsResponse::uploads))
            .setter(setter(Builder::uploads))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Upload")
                    .unmarshallLocationName("Upload").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(MultipartUpload::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").unmarshallLocationName("member").build()).build())
                            .isFlattened(true).build()).build();

    private static final SdkField> COMMON_PREFIXES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("CommonPrefixes")
            .getter(getter(ListMultipartUploadsResponse::commonPrefixes))
            .setter(setter(Builder::commonPrefixes))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CommonPrefixes")
                    .unmarshallLocationName("CommonPrefixes").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(CommonPrefix::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").unmarshallLocationName("member").build()).build())
                            .isFlattened(true).build()).build();

    private static final SdkField ENCODING_TYPE_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("EncodingType")
            .getter(getter(ListMultipartUploadsResponse::encodingTypeAsString))
            .setter(setter(Builder::encodingType))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EncodingType")
                    .unmarshallLocationName("EncodingType").build()).build();

    private static final SdkField REQUEST_CHARGED_FIELD = SdkField
            . builder(MarshallingType.STRING)
            .memberName("RequestCharged")
            .getter(getter(ListMultipartUploadsResponse::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(BUCKET_FIELD,
            KEY_MARKER_FIELD, UPLOAD_ID_MARKER_FIELD, NEXT_KEY_MARKER_FIELD, PREFIX_FIELD, DELIMITER_FIELD,
            NEXT_UPLOAD_ID_MARKER_FIELD, MAX_UPLOADS_FIELD, IS_TRUNCATED_FIELD, UPLOADS_FIELD, COMMON_PREFIXES_FIELD,
            ENCODING_TYPE_FIELD, REQUEST_CHARGED_FIELD));

    private final String bucket;

    private final String keyMarker;

    private final String uploadIdMarker;

    private final String nextKeyMarker;

    private final String prefix;

    private final String delimiter;

    private final String nextUploadIdMarker;

    private final Integer maxUploads;

    private final Boolean isTruncated;

    private final List uploads;

    private final List commonPrefixes;

    private final String encodingType;

    private final String requestCharged;

    private ListMultipartUploadsResponse(BuilderImpl builder) {
        super(builder);
        this.bucket = builder.bucket;
        this.keyMarker = builder.keyMarker;
        this.uploadIdMarker = builder.uploadIdMarker;
        this.nextKeyMarker = builder.nextKeyMarker;
        this.prefix = builder.prefix;
        this.delimiter = builder.delimiter;
        this.nextUploadIdMarker = builder.nextUploadIdMarker;
        this.maxUploads = builder.maxUploads;
        this.isTruncated = builder.isTruncated;
        this.uploads = builder.uploads;
        this.commonPrefixes = builder.commonPrefixes;
        this.encodingType = builder.encodingType;
        this.requestCharged = builder.requestCharged;
    }

    /**
     * 

* The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or * access point alias if used. *

* * @return The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN * or access point alias if used. */ public final String bucket() { return bucket; } /** *

* The key at or after which the listing began. *

* * @return The key at or after which the listing began. */ public final String keyMarker() { return keyMarker; } /** *

* Together with key-marker, specifies the multipart upload after which listing should begin. If key-marker is not * specified, the upload-id-marker parameter is ignored. Otherwise, any multipart uploads for a key equal to the * key-marker might be included in the list only if they have an upload ID lexicographically greater than the * specified upload-id-marker. *

* *

* This functionality is not supported for directory buckets. *

*
* * @return Together with key-marker, specifies the multipart upload after which listing should begin. If key-marker * is not specified, the upload-id-marker parameter is ignored. Otherwise, any multipart uploads for a key * equal to the key-marker might be included in the list only if they have an upload ID lexicographically * greater than the specified upload-id-marker.

*

* This functionality is not supported for directory buckets. *

*/ public final String uploadIdMarker() { return uploadIdMarker; } /** *

* When a list is truncated, this element specifies the value that should be used for the key-marker request * parameter in a subsequent request. *

* * @return When a list is truncated, this element specifies the value that should be used for the key-marker request * parameter in a subsequent request. */ public final String nextKeyMarker() { return nextKeyMarker; } /** *

* When a prefix is provided in the request, this field contains the specified prefix. The result contains only keys * starting with the specified prefix. *

* *

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are * supported. *

*
* * @return When a prefix is provided in the request, this field contains the specified prefix. The result contains * only keys starting with the specified prefix.

*

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) * are supported. *

*/ public final String prefix() { return prefix; } /** *

* Contains the delimiter you specified in the request. If you don't specify a delimiter in your request, this * element is absent from the response. *

* *

* Directory buckets - For directory buckets, / is the only supported delimiter. *

*
* * @return Contains the delimiter you specified in the request. If you don't specify a delimiter in your request, * this element is absent from the response.

*

* Directory buckets - For directory buckets, / is the only supported delimiter. *

*/ public final String delimiter() { return delimiter; } /** *

* When a list is truncated, this element specifies the value that should be used for the * upload-id-marker request parameter in a subsequent request. *

* *

* This functionality is not supported for directory buckets. *

*
* * @return When a list is truncated, this element specifies the value that should be used for the * upload-id-marker request parameter in a subsequent request.

*

* This functionality is not supported for directory buckets. *

*/ public final String nextUploadIdMarker() { return nextUploadIdMarker; } /** *

* Maximum number of multipart uploads that could have been included in the response. *

* * @return Maximum number of multipart uploads that could have been included in the response. */ public final Integer maxUploads() { return maxUploads; } /** *

* Indicates whether the returned list of multipart uploads is truncated. A value of true indicates that the list * was truncated. The list can be truncated if the number of multipart uploads exceeds the limit allowed or * specified by max uploads. *

* * @return Indicates whether the returned list of multipart uploads is truncated. A value of true indicates that the * list was truncated. The list can be truncated if the number of multipart uploads exceeds the limit * allowed or specified by max uploads. */ public final Boolean isTruncated() { return isTruncated; } /** * For responses, this returns true if the service returned a value for the Uploads property. This DOES NOT check * that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is * useful because the SDK will never return a null collection or map, but you may need to differentiate between the * service returning nothing (or null) and the service returning an empty collection or map. For requests, this * returns true if a value for the property was specified in the request builder, and false if a value was not * specified. */ public final boolean hasUploads() { return uploads != null && !(uploads instanceof SdkAutoConstructList); } /** *

* Container for elements related to a particular multipart upload. A response can contain zero or more * Upload elements. *

*

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

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasUploads} method. *

* * @return Container for elements related to a particular multipart upload. A response can contain zero or more * Upload elements. */ public final List uploads() { return uploads; } /** * For responses, this returns true if the service returned a value for the CommonPrefixes property. This DOES NOT * check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). * This is useful because the SDK will never return a null collection or map, but you may need to differentiate * between the service returning nothing (or null) and the service returning an empty collection or map. For * requests, this returns true if a value for the property was specified in the request builder, and false if a * value was not specified. */ public final boolean hasCommonPrefixes() { return commonPrefixes != null && !(commonPrefixes instanceof SdkAutoConstructList); } /** *

* If you specify a delimiter in the request, then the result returns each distinct key prefix containing the * delimiter in a CommonPrefixes element. The distinct key prefixes are returned in the * Prefix child element. *

* *

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are * supported. *

*
*

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

*

* This method will never return null. If you would like to know whether the service returned this field (so that * you can differentiate between null and empty), you can use the {@link #hasCommonPrefixes} method. *

* * @return If you specify a delimiter in the request, then the result returns each distinct key prefix containing * the delimiter in a CommonPrefixes element. The distinct key prefixes are returned in the * Prefix child element.

*

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) * are supported. *

*/ public final List commonPrefixes() { return commonPrefixes; } /** *

* Encoding type used by Amazon S3 to encode object keys in the response. *

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in the response, * and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, Key * . *

*

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

* * @return Encoding type used by Amazon S3 to encode object keys in the response.

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in the * response, and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, * Key. * @see EncodingType */ public final EncodingType encodingType() { return EncodingType.fromValue(encodingType); } /** *

* Encoding type used by Amazon S3 to encode object keys in the response. *

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in the response, * and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, Key * . *

*

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

* * @return Encoding type used by Amazon S3 to encode object keys in the response.

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in the * response, and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, * Key. * @see EncodingType */ public final String encodingTypeAsString() { return encodingType; } /** * 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(bucket()); hashCode = 31 * hashCode + Objects.hashCode(keyMarker()); hashCode = 31 * hashCode + Objects.hashCode(uploadIdMarker()); hashCode = 31 * hashCode + Objects.hashCode(nextKeyMarker()); hashCode = 31 * hashCode + Objects.hashCode(prefix()); hashCode = 31 * hashCode + Objects.hashCode(delimiter()); hashCode = 31 * hashCode + Objects.hashCode(nextUploadIdMarker()); hashCode = 31 * hashCode + Objects.hashCode(maxUploads()); hashCode = 31 * hashCode + Objects.hashCode(isTruncated()); hashCode = 31 * hashCode + Objects.hashCode(hasUploads() ? uploads() : null); hashCode = 31 * hashCode + Objects.hashCode(hasCommonPrefixes() ? commonPrefixes() : null); hashCode = 31 * hashCode + Objects.hashCode(encodingTypeAsString()); 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 ListMultipartUploadsResponse)) { return false; } ListMultipartUploadsResponse other = (ListMultipartUploadsResponse) obj; return Objects.equals(bucket(), other.bucket()) && Objects.equals(keyMarker(), other.keyMarker()) && Objects.equals(uploadIdMarker(), other.uploadIdMarker()) && Objects.equals(nextKeyMarker(), other.nextKeyMarker()) && Objects.equals(prefix(), other.prefix()) && Objects.equals(delimiter(), other.delimiter()) && Objects.equals(nextUploadIdMarker(), other.nextUploadIdMarker()) && Objects.equals(maxUploads(), other.maxUploads()) && Objects.equals(isTruncated(), other.isTruncated()) && hasUploads() == other.hasUploads() && Objects.equals(uploads(), other.uploads()) && hasCommonPrefixes() == other.hasCommonPrefixes() && Objects.equals(commonPrefixes(), other.commonPrefixes()) && Objects.equals(encodingTypeAsString(), other.encodingTypeAsString()) && 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("ListMultipartUploadsResponse").add("Bucket", bucket()).add("KeyMarker", keyMarker()) .add("UploadIdMarker", uploadIdMarker()).add("NextKeyMarker", nextKeyMarker()).add("Prefix", prefix()) .add("Delimiter", delimiter()).add("NextUploadIdMarker", nextUploadIdMarker()).add("MaxUploads", maxUploads()) .add("IsTruncated", isTruncated()).add("Uploads", hasUploads() ? uploads() : null) .add("CommonPrefixes", hasCommonPrefixes() ? commonPrefixes() : null).add("EncodingType", encodingTypeAsString()) .add("RequestCharged", requestChargedAsString()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Bucket": return Optional.ofNullable(clazz.cast(bucket())); case "KeyMarker": return Optional.ofNullable(clazz.cast(keyMarker())); case "UploadIdMarker": return Optional.ofNullable(clazz.cast(uploadIdMarker())); case "NextKeyMarker": return Optional.ofNullable(clazz.cast(nextKeyMarker())); case "Prefix": return Optional.ofNullable(clazz.cast(prefix())); case "Delimiter": return Optional.ofNullable(clazz.cast(delimiter())); case "NextUploadIdMarker": return Optional.ofNullable(clazz.cast(nextUploadIdMarker())); case "MaxUploads": return Optional.ofNullable(clazz.cast(maxUploads())); case "IsTruncated": return Optional.ofNullable(clazz.cast(isTruncated())); case "Uploads": return Optional.ofNullable(clazz.cast(uploads())); case "CommonPrefixes": return Optional.ofNullable(clazz.cast(commonPrefixes())); case "EncodingType": return Optional.ofNullable(clazz.cast(encodingTypeAsString())); 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((ListMultipartUploadsResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends S3Response.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or * access point alias if used. *

* * @param bucket * The name of the bucket to which the multipart upload was initiated. Does not return the access point * ARN or access point alias if used. * @return Returns a reference to this object so that method calls can be chained together. */ Builder bucket(String bucket); /** *

* The key at or after which the listing began. *

* * @param keyMarker * The key at or after which the listing began. * @return Returns a reference to this object so that method calls can be chained together. */ Builder keyMarker(String keyMarker); /** *

* Together with key-marker, specifies the multipart upload after which listing should begin. If key-marker is * not specified, the upload-id-marker parameter is ignored. Otherwise, any multipart uploads for a key equal to * the key-marker might be included in the list only if they have an upload ID lexicographically greater than * the specified upload-id-marker. *

* *

* This functionality is not supported for directory buckets. *

*
* * @param uploadIdMarker * Together with key-marker, specifies the multipart upload after which listing should begin. If * key-marker is not specified, the upload-id-marker parameter is ignored. Otherwise, any multipart * uploads for a key equal to the key-marker might be included in the list only if they have an upload ID * lexicographically greater than the specified upload-id-marker.

*

* This functionality is not supported for directory buckets. *

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

* When a list is truncated, this element specifies the value that should be used for the key-marker request * parameter in a subsequent request. *

* * @param nextKeyMarker * When a list is truncated, this element specifies the value that should be used for the key-marker * request parameter in a subsequent request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder nextKeyMarker(String nextKeyMarker); /** *

* When a prefix is provided in the request, this field contains the specified prefix. The result contains only * keys starting with the specified prefix. *

* *

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are * supported. *

*
* * @param prefix * When a prefix is provided in the request, this field contains the specified prefix. The result * contains only keys starting with the specified prefix.

*

* Directory buckets - For directory buckets, only prefixes that end in a delimiter ( * /) are supported. *

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

* Contains the delimiter you specified in the request. If you don't specify a delimiter in your request, this * element is absent from the response. *

* *

* Directory buckets - For directory buckets, / is the only supported delimiter. *

*
* * @param delimiter * Contains the delimiter you specified in the request. If you don't specify a delimiter in your request, * this element is absent from the response.

*

* Directory buckets - For directory buckets, / is the only supported delimiter. *

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

* When a list is truncated, this element specifies the value that should be used for the * upload-id-marker request parameter in a subsequent request. *

* *

* This functionality is not supported for directory buckets. *

*
* * @param nextUploadIdMarker * When a list is truncated, this element specifies the value that should be used for the * upload-id-marker request parameter in a subsequent request.

*

* This functionality is not supported for directory buckets. *

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

* Maximum number of multipart uploads that could have been included in the response. *

* * @param maxUploads * Maximum number of multipart uploads that could have been included in the response. * @return Returns a reference to this object so that method calls can be chained together. */ Builder maxUploads(Integer maxUploads); /** *

* Indicates whether the returned list of multipart uploads is truncated. A value of true indicates that the * list was truncated. The list can be truncated if the number of multipart uploads exceeds the limit allowed or * specified by max uploads. *

* * @param isTruncated * Indicates whether the returned list of multipart uploads is truncated. A value of true indicates that * the list was truncated. The list can be truncated if the number of multipart uploads exceeds the limit * allowed or specified by max uploads. * @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 multipart upload. A response can contain zero or more * Upload elements. *

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

* Container for elements related to a particular multipart upload. A response can contain zero or more * Upload elements. *

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

* Container for elements related to a particular multipart upload. A response can contain zero or more * Upload elements. *

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

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

* If you specify a delimiter in the request, then the result returns each distinct key prefix containing the * delimiter in a CommonPrefixes element. The distinct key prefixes are returned in the * Prefix child element. *

* *

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are * supported. *

*
* * @param commonPrefixes * If you specify a delimiter in the request, then the result returns each distinct key prefix containing * the delimiter in a CommonPrefixes element. The distinct key prefixes are returned in the * Prefix child element.

*

* Directory buckets - For directory buckets, only prefixes that end in a delimiter ( * /) are supported. *

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

* If you specify a delimiter in the request, then the result returns each distinct key prefix containing the * delimiter in a CommonPrefixes element. The distinct key prefixes are returned in the * Prefix child element. *

* *

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are * supported. *

*
* * @param commonPrefixes * If you specify a delimiter in the request, then the result returns each distinct key prefix containing * the delimiter in a CommonPrefixes element. The distinct key prefixes are returned in the * Prefix child element.

*

* Directory buckets - For directory buckets, only prefixes that end in a delimiter ( * /) are supported. *

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

* If you specify a delimiter in the request, then the result returns each distinct key prefix containing the * delimiter in a CommonPrefixes element. The distinct key prefixes are returned in the * Prefix child element. *

* *

* Directory buckets - For directory buckets, only prefixes that end in a delimiter (/) are * supported. *

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

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

* Encoding type used by Amazon S3 to encode object keys in the response. *

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in the * response, and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, * Key. *

* * @param encodingType * Encoding type used by Amazon S3 to encode object keys in the response.

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in * the response, and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, * Key. * @see EncodingType * @return Returns a reference to this object so that method calls can be chained together. * @see EncodingType */ Builder encodingType(String encodingType); /** *

* Encoding type used by Amazon S3 to encode object keys in the response. *

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in the * response, and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, * Key. *

* * @param encodingType * Encoding type used by Amazon S3 to encode object keys in the response.

*

* If you specify the encoding-type request parameter, Amazon S3 includes this element in * the response, and returns encoded key name values in the following response elements: *

*

* Delimiter, KeyMarker, Prefix, NextKeyMarker, * Key. * @see EncodingType * @return Returns a reference to this object so that method calls can be chained together. * @see EncodingType */ Builder encodingType(EncodingType encodingType); /** * 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 String bucket; private String keyMarker; private String uploadIdMarker; private String nextKeyMarker; private String prefix; private String delimiter; private String nextUploadIdMarker; private Integer maxUploads; private Boolean isTruncated; private List uploads = DefaultSdkAutoConstructList.getInstance(); private List commonPrefixes = DefaultSdkAutoConstructList.getInstance(); private String encodingType; private String requestCharged; private BuilderImpl() { } private BuilderImpl(ListMultipartUploadsResponse model) { super(model); bucket(model.bucket); keyMarker(model.keyMarker); uploadIdMarker(model.uploadIdMarker); nextKeyMarker(model.nextKeyMarker); prefix(model.prefix); delimiter(model.delimiter); nextUploadIdMarker(model.nextUploadIdMarker); maxUploads(model.maxUploads); isTruncated(model.isTruncated); uploads(model.uploads); commonPrefixes(model.commonPrefixes); encodingType(model.encodingType); requestCharged(model.requestCharged); } public final String getBucket() { return bucket; } public final void setBucket(String bucket) { this.bucket = bucket; } @Override public final Builder bucket(String bucket) { this.bucket = bucket; return this; } public final String getKeyMarker() { return keyMarker; } public final void setKeyMarker(String keyMarker) { this.keyMarker = keyMarker; } @Override public final Builder keyMarker(String keyMarker) { this.keyMarker = keyMarker; return this; } public final String getUploadIdMarker() { return uploadIdMarker; } public final void setUploadIdMarker(String uploadIdMarker) { this.uploadIdMarker = uploadIdMarker; } @Override public final Builder uploadIdMarker(String uploadIdMarker) { this.uploadIdMarker = uploadIdMarker; return this; } public final String getNextKeyMarker() { return nextKeyMarker; } public final void setNextKeyMarker(String nextKeyMarker) { this.nextKeyMarker = nextKeyMarker; } @Override public final Builder nextKeyMarker(String nextKeyMarker) { this.nextKeyMarker = nextKeyMarker; return this; } public final String getPrefix() { return prefix; } public final void setPrefix(String prefix) { this.prefix = prefix; } @Override public final Builder prefix(String prefix) { this.prefix = prefix; return this; } public final String getDelimiter() { return delimiter; } public final void setDelimiter(String delimiter) { this.delimiter = delimiter; } @Override public final Builder delimiter(String delimiter) { this.delimiter = delimiter; return this; } public final String getNextUploadIdMarker() { return nextUploadIdMarker; } public final void setNextUploadIdMarker(String nextUploadIdMarker) { this.nextUploadIdMarker = nextUploadIdMarker; } @Override public final Builder nextUploadIdMarker(String nextUploadIdMarker) { this.nextUploadIdMarker = nextUploadIdMarker; return this; } public final Integer getMaxUploads() { return maxUploads; } public final void setMaxUploads(Integer maxUploads) { this.maxUploads = maxUploads; } @Override public final Builder maxUploads(Integer maxUploads) { this.maxUploads = maxUploads; return this; } public final Boolean getIsTruncated() { return isTruncated; } public final void setIsTruncated(Boolean isTruncated) { this.isTruncated = isTruncated; } @Override public final Builder isTruncated(Boolean isTruncated) { this.isTruncated = isTruncated; return this; } public final List getUploads() { List result = MultipartUploadListCopier.copyToBuilder(this.uploads); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setUploads(Collection uploads) { this.uploads = MultipartUploadListCopier.copyFromBuilder(uploads); } @Override public final Builder uploads(Collection uploads) { this.uploads = MultipartUploadListCopier.copy(uploads); return this; } @Override @SafeVarargs public final Builder uploads(MultipartUpload... uploads) { uploads(Arrays.asList(uploads)); return this; } @Override @SafeVarargs public final Builder uploads(Consumer... uploads) { uploads(Stream.of(uploads).map(c -> MultipartUpload.builder().applyMutation(c).build()).collect(Collectors.toList())); return this; } public final List getCommonPrefixes() { List result = CommonPrefixListCopier.copyToBuilder(this.commonPrefixes); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setCommonPrefixes(Collection commonPrefixes) { this.commonPrefixes = CommonPrefixListCopier.copyFromBuilder(commonPrefixes); } @Override public final Builder commonPrefixes(Collection commonPrefixes) { this.commonPrefixes = CommonPrefixListCopier.copy(commonPrefixes); return this; } @Override @SafeVarargs public final Builder commonPrefixes(CommonPrefix... commonPrefixes) { commonPrefixes(Arrays.asList(commonPrefixes)); return this; } @Override @SafeVarargs public final Builder commonPrefixes(Consumer... commonPrefixes) { commonPrefixes(Stream.of(commonPrefixes).map(c -> CommonPrefix.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getEncodingType() { return encodingType; } public final void setEncodingType(String encodingType) { this.encodingType = encodingType; } @Override public final Builder encodingType(String encodingType) { this.encodingType = encodingType; return this; } @Override public final Builder encodingType(EncodingType encodingType) { this.encodingType(encodingType == null ? null : encodingType.toString()); return this; } public final String getRequestCharged() { return requestCharged; } public final void setRequestCharged(String requestCharged) { this.requestCharged = 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; } @Override public ListMultipartUploadsResponse build() { return new ListMultipartUploadsResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy