amazonka-s3-2.0: Amazon Simple Storage Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.S3.PutObjectTagging

Description

Sets the supplied tag-set to an object that already exists in a bucket.

A tag is a key-value pair. You can associate tags with an object by sending a PUT request against the tagging subresource that is associated with the object. You can retrieve tags by sending a GET request. For more information, see GetObjectTagging.

For tagging-related restrictions related to characters and encodings, see Tag Restrictions. Note that Amazon S3 limits the maximum number of tags to 10 tags per object.

To use this operation, you must have permission to perform the s3:PutObjectTagging action. By default, the bucket owner has this permission and can grant this permission to others.

To put tags of any other version, use the versionId query parameter. You also need permission for the s3:PutObjectVersionTagging action.

For information about the Amazon S3 object tagging feature, see Object Tagging.

Special Errors

  • - Code: InvalidTagError

    • /Cause: The tag provided was not a valid tag. This error can occur if the tag did not pass input validation. For more information, see Object Tagging./
  • - Code: MalformedXMLError

    • Cause: The XML provided does not match the schema.
  • - Code: OperationAbortedError

    • /Cause: A conflicting conditional action is currently in progress against this resource. Please try again./
  • - Code: InternalError

    • /Cause: The service was unable to apply the provided tag to the object./

Related Resources

Synopsis

Creating a Request

data PutObjectTagging Source #

See: newPutObjectTagging smart constructor.

Constructors

PutObjectTagging' 

Fields

  • checksumAlgorithm :: Maybe ChecksumAlgorithm

    Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

  • contentMD5 :: Maybe Text

    The MD5 hash for the request body.

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

  • expectedBucketOwner :: Maybe Text

    The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

  • requestPayer :: Maybe RequestPayer
     
  • versionId :: Maybe ObjectVersionId

    The versionId of the object that the tag-set will be added to.

  • bucket :: BucketName

    The bucket name containing the object.

    When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

    When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts in the Amazon S3 User Guide.

  • key :: ObjectKey

    Name of the object key.

  • tagging :: Tagging

    Container for the TagSet and Tag elements

Instances

Instances details
ToHeaders PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

ToPath PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

ToQuery PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

ToElement PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

AWSRequest PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Associated Types

type AWSResponse PutObjectTagging #

Generic PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Associated Types

type Rep PutObjectTagging :: Type -> Type #

Read PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Show PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

NFData PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Methods

rnf :: PutObjectTagging -> () #

Eq PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Hashable PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

type AWSResponse PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

type Rep PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

newPutObjectTagging Source #

Create a value of PutObjectTagging with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

PutObjectTagging, putObjectTagging_checksumAlgorithm - Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

$sel:contentMD5:PutObjectTagging', putObjectTagging_contentMD5 - The MD5 hash for the request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

$sel:expectedBucketOwner:PutObjectTagging', putObjectTagging_expectedBucketOwner - The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

$sel:requestPayer:PutObjectTagging', putObjectTagging_requestPayer - Undocumented member.

PutObjectTagging, putObjectTagging_versionId - The versionId of the object that the tag-set will be added to.

PutObjectTagging, putObjectTagging_bucket - The bucket name containing the object.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts in the Amazon S3 User Guide.

PutObjectTagging, putObjectTagging_key - Name of the object key.

PutObjectTagging, putObjectTagging_tagging - Container for the TagSet and Tag elements

Request Lenses

putObjectTagging_checksumAlgorithm :: Lens' PutObjectTagging (Maybe ChecksumAlgorithm) Source #

Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

putObjectTagging_contentMD5 :: Lens' PutObjectTagging (Maybe Text) Source #

The MD5 hash for the request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

putObjectTagging_expectedBucketOwner :: Lens' PutObjectTagging (Maybe Text) Source #

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

putObjectTagging_versionId :: Lens' PutObjectTagging (Maybe ObjectVersionId) Source #

The versionId of the object that the tag-set will be added to.

putObjectTagging_bucket :: Lens' PutObjectTagging BucketName Source #

The bucket name containing the object.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts in the Amazon S3 User Guide.

putObjectTagging_tagging :: Lens' PutObjectTagging Tagging Source #

Container for the TagSet and Tag elements

Destructuring the Response

data PutObjectTaggingResponse Source #

See: newPutObjectTaggingResponse smart constructor.

Constructors

PutObjectTaggingResponse' 

Fields

Instances

Instances details
Generic PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Associated Types

type Rep PutObjectTaggingResponse :: Type -> Type #

Read PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Show PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

NFData PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Eq PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

type Rep PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

type Rep PutObjectTaggingResponse = D1 ('MetaData "PutObjectTaggingResponse" "Amazonka.S3.PutObjectTagging" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" 'False) (C1 ('MetaCons "PutObjectTaggingResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "versionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ObjectVersionId)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newPutObjectTaggingResponse Source #

Create a value of PutObjectTaggingResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

PutObjectTagging, putObjectTaggingResponse_versionId - The versionId of the object the tag-set was added to.

$sel:httpStatus:PutObjectTaggingResponse', putObjectTaggingResponse_httpStatus - The response's http status code.

Response Lenses

putObjectTaggingResponse_versionId :: Lens' PutObjectTaggingResponse (Maybe ObjectVersionId) Source #

The versionId of the object the tag-set was added to.