@Override
    public TagResourceResult tagResource(TagResourceRequest request) {
        request = beforeClientExecution(request);
        return executeTagResource(request);
    }
<p>
Creates a new Amazon Web Services resource tag or updates an existing resource tag. Each tag is a label
consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter
resources. You can add up to 50 Amazon Web Services resource tags for each S3 resource.
</p>
<note>
<p>
This operation is only supported for <a
href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html">S3 Storage Lens groups</a>
and for <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-tagging.html">S3 Access
Grants</a>. The tagged resource can be an S3 Storage Lens group or S3 Access Grants instance, registered
location, or grant.
</p>
</note>
<dl>
<dt>Permissions</dt>
<dd>
<p>
You must have the <code>s3:TagResource</code> permission to use this operation.
</p>
</dd>
</dl>
<p>
For more information about the required Storage Lens Groups permissions, see <a href=
"https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage_lens_iam_permissions.html#storage_lens_groups_permissions"
>Setting account permissions to use S3 Storage Lens groups</a>.
</p>
<p>
For information about S3 Tagging errors, see <a
href="https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#S3TaggingErrorCodeList">List of Amazon
S3 Tagging error codes</a>.
</p>

@param tagResourceRequest
@return Result of the TagResource operation returned by the service.
@sample AWSS3Control.TagResource
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/TagResource" target="_top">AWS API
     Documentation</a>
aws-java-sdk-s3control/src/main/java/com/amazonaws/services/s3control/AWSS3ControlClient.java