Class S3CopyObjectOperation

java.lang.Object
software.amazon.awssdk.services.s3control.model.S3CopyObjectOperation
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<S3CopyObjectOperation.Builder,S3CopyObjectOperation>

@Generated("software.amazon.awssdk:codegen") public final class S3CopyObjectOperation extends Object implements SdkPojo, Serializable, ToCopyableBuilder<S3CopyObjectOperation.Builder,S3CopyObjectOperation>

Contains the configuration parameters for a PUT Copy object operation. S3 Batch Operations passes every object to the underlying CopyObject API operation. For more information about the parameters for this operation, see CopyObject.

See Also:
  • Method Details

    • targetResource

      public final String targetResource()

      Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.

      • General purpose buckets - For example, to copy objects to a general purpose bucket named destinationBucket, set the TargetResource property to arn:aws:s3:::destinationBucket.

      • Directory buckets - For example, to copy objects to a directory bucket named destinationBucket in the Availability Zone; identified by the AZ ID usw2-az1, set the TargetResource property to arn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az1--x-s3 .

      Returns:
      Specifies the destination bucket Amazon Resource Name (ARN) for the batch copy operation.

      • General purpose buckets - For example, to copy objects to a general purpose bucket named destinationBucket, set the TargetResource property to arn:aws:s3:::destinationBucket.

      • Directory buckets - For example, to copy objects to a directory bucket named destinationBucket in the Availability Zone; identified by the AZ ID usw2-az1, set the TargetResource property to arn:aws:s3express:region:account_id:/bucket/destination_bucket_base_name--usw2-az1--x-s3 .

    • cannedAccessControlList

      public final S3CannedAccessControlList cannedAccessControlList()

      This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, cannedAccessControlList will return S3CannedAccessControlList.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from cannedAccessControlListAsString().

      Returns:

      This functionality is not supported by directory buckets.

      See Also:
    • cannedAccessControlListAsString

      public final String cannedAccessControlListAsString()

      This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, cannedAccessControlList will return S3CannedAccessControlList.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from cannedAccessControlListAsString().

      Returns:

      This functionality is not supported by directory buckets.

      See Also:
    • hasAccessControlGrants

      public final boolean hasAccessControlGrants()
      For responses, this returns true if the service returned a value for the AccessControlGrants property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • accessControlGrants

      public final List<S3Grant> accessControlGrants()

      This functionality is not supported by directory buckets.

      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 hasAccessControlGrants() method.

      Returns:

      This functionality is not supported by directory buckets.

    • metadataDirective

      public final S3MetadataDirective metadataDirective()

      If the service returns an enum value that is not available in the current SDK version, metadataDirective will return S3MetadataDirective.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from metadataDirectiveAsString().

      Returns:
      See Also:
    • metadataDirectiveAsString

      public final String metadataDirectiveAsString()

      If the service returns an enum value that is not available in the current SDK version, metadataDirective will return S3MetadataDirective.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from metadataDirectiveAsString().

      Returns:
      See Also:
    • modifiedSinceConstraint

      public final Instant modifiedSinceConstraint()

      Returns:
    • newObjectMetadata

      public final S3ObjectMetadata newObjectMetadata()

      If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.

      Returns:
      If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.
    • hasNewObjectTagging

      public final boolean hasNewObjectTagging()
      For responses, this returns true if the service returned a value for the NewObjectTagging property. This DOES NOT check that the value is non-empty (for which, you should check the 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.
    • newObjectTagging

      public final List<S3Tag> newObjectTagging()

      Specifies a list of tags to add to the destination objects after they are copied. If NewObjectTagging is not specified, the tags of the source objects are copied to destination objects by default.

      Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the NewObjectTagging field to prevent copying the source object tags to the directory bucket.

      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 hasNewObjectTagging() method.

      Returns:
      Specifies a list of tags to add to the destination objects after they are copied. If NewObjectTagging is not specified, the tags of the source objects are copied to destination objects by default.

      Directory buckets - Tags aren't supported by directory buckets. If your source objects have tags and your destination bucket is a directory bucket, specify an empty tag set in the NewObjectTagging field to prevent copying the source object tags to the directory bucket.

    • redirectLocation

      public final String redirectLocation()

      If the destination bucket is configured as a website, specifies an optional metadata property for website redirects, x-amz-website-redirect-location. Allows webpage redirects if the object copy is accessed through a website endpoint.

      This functionality is not supported by directory buckets.

      Returns:
      If the destination bucket is configured as a website, specifies an optional metadata property for website redirects, x-amz-website-redirect-location. Allows webpage redirects if the object copy is accessed through a website endpoint.

      This functionality is not supported by directory buckets.

    • requesterPays

      public final Boolean requesterPays()

      This functionality is not supported by directory buckets.

      Returns:

      This functionality is not supported by directory buckets.

    • storageClass

      public final S3StorageClass storageClass()

      Specify the storage class for the destination objects in a Copy operation.

      Directory buckets - This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, storageClass will return S3StorageClass.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from storageClassAsString().

      Returns:
      Specify the storage class for the destination objects in a Copy operation.

      Directory buckets - This functionality is not supported by directory buckets.

      See Also:
    • storageClassAsString

      public final String storageClassAsString()

      Specify the storage class for the destination objects in a Copy operation.

      Directory buckets - This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, storageClass will return S3StorageClass.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from storageClassAsString().

      Returns:
      Specify the storage class for the destination objects in a Copy operation.

      Directory buckets - This functionality is not supported by directory buckets.

      See Also:
    • unModifiedSinceConstraint

      public final Instant unModifiedSinceConstraint()

      Returns:
    • sseAwsKmsKeyId

      public final String sseAwsKmsKeyId()

      This functionality is not supported by directory buckets.

      Returns:

      This functionality is not supported by directory buckets.

    • targetKeyPrefix

      public final String targetKeyPrefix()

      Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named Folder1 in the destination bucket, set the TargetKeyPrefix property to Folder1.

      Returns:
      Specifies the folder prefix that you want the objects to be copied into. For example, to copy objects into a folder named Folder1 in the destination bucket, set the TargetKeyPrefix property to Folder1.
    • objectLockLegalHoldStatus

      public final S3ObjectLockLegalHoldStatus objectLockLegalHoldStatus()

      The legal hold status to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, objectLockLegalHoldStatus will return S3ObjectLockLegalHoldStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from objectLockLegalHoldStatusAsString().

      Returns:
      The legal hold status to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      See Also:
    • objectLockLegalHoldStatusAsString

      public final String objectLockLegalHoldStatusAsString()

      The legal hold status to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, objectLockLegalHoldStatus will return S3ObjectLockLegalHoldStatus.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from objectLockLegalHoldStatusAsString().

      Returns:
      The legal hold status to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      See Also:
    • objectLockMode

      public final S3ObjectLockMode objectLockMode()

      The retention mode to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, objectLockMode will return S3ObjectLockMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from objectLockModeAsString().

      Returns:
      The retention mode to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      See Also:
    • objectLockModeAsString

      public final String objectLockModeAsString()

      The retention mode to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      If the service returns an enum value that is not available in the current SDK version, objectLockMode will return S3ObjectLockMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from objectLockModeAsString().

      Returns:
      The retention mode to be applied to all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      See Also:
    • objectLockRetainUntilDate

      public final Instant objectLockRetainUntilDate()

      The date when the applied object retention configuration expires on all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

      Returns:
      The date when the applied object retention configuration expires on all objects in the Batch Operations job.

      This functionality is not supported by directory buckets.

    • bucketKeyEnabled

      public final Boolean bucketKeyEnabled()

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      This functionality is not supported by directory buckets.

      Returns:
      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      This functionality is not supported by directory buckets.

    • checksumAlgorithm

      public final S3ChecksumAlgorithm checksumAlgorithm()

      Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.

      If the service returns an enum value that is not available in the current SDK version, checksumAlgorithm will return S3ChecksumAlgorithm.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from checksumAlgorithmAsString().

      Returns:
      Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
      See Also:
    • checksumAlgorithmAsString

      public final String checksumAlgorithmAsString()

      Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.

      If the service returns an enum value that is not available in the current SDK version, checksumAlgorithm will return S3ChecksumAlgorithm.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from checksumAlgorithmAsString().

      Returns:
      Indicates the algorithm that you want Amazon S3 to use to create the checksum. For more information, see Checking object integrity in the Amazon S3 User Guide.
      See Also:
    • toBuilder

      public S3CopyObjectOperation.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<S3CopyObjectOperation.Builder,S3CopyObjectOperation>
      Returns:
      a builder for type T
    • builder

      public static S3CopyObjectOperation.Builder builder()
    • serializableBuilderClass

      public static Class<? extends S3CopyObjectOperation.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      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.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.