libZSservicesZSamazonka-s3ZSamazonka-s3
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

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

  • versionId :: Maybe ObjectVersionId

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

  • requestPayer :: Maybe RequestPayer
     
  • 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 will fail with an HTTP 403 (Access Denied) error.

  • 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 using 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 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
Eq PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Read PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Show PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Generic PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Associated Types

type Rep PutObjectTagging :: Type -> Type #

NFData PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Methods

rnf :: PutObjectTagging -> () #

Hashable PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

AWSRequest PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Associated Types

type AWSResponse PutObjectTagging #

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

type Rep PutObjectTagging Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

type AWSResponse 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:

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

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

$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 will fail with an HTTP 403 (Access Denied) error.

$sel:bucket: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 using 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 S3 on Outposts in the Amazon S3 User Guide.

$sel:key:PutObjectTagging', putObjectTagging_key - Name of the object key.

$sel:tagging:PutObjectTagging', putObjectTagging_tagging - Container for the TagSet and Tag elements

Request Lenses

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

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

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 will fail with an HTTP 403 (Access Denied) error.

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 using 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 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
Eq PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Read PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Show PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Generic PutObjectTaggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutObjectTagging

Associated Types

type Rep PutObjectTaggingResponse :: Type -> Type #

NFData 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" "libZSservicesZSamazonka-s3ZSamazonka-s3" '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:

$sel:versionId: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.