async def untag_resource(
self,
account_id: "capo_s3_control.types.account_id.AccountId",
resource_arn: "capo_s3_control.types.s3_resource_arn.S3ResourceArn",
tag_keys: "capo_s3_control.types.tag_key_list.TagKeyList",
*,
config_overrides: Optional[AsyncS3ControlClientConfig] = None,
) -> "capo_s3_control.types.untag_resource_result.UntagResourceResult":
"""<p>This operation removes the specified user-defined tags from an S3 resource. You can pass one or more tag keys. </p> <note> <p>This operation is only supported for the following Amazon S3 resources:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/buckets-tagging.html">General purpose buckets</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-db-tagging.html">Access Points for directory buckets</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-tagging.html">Access Points for general purpose buckets</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html">Directory buckets</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-lens-groups.html">S3 Storage Lens groups</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-grants-tagging.html">S3 Access Grants instances, registered locations, and grants</a>.</p> </li> </ul> </note> <dl> <dt>Permissions</dt> <dd> <p>For general purpose buckets, access points for general purpose buckets, Storage Lens groups, and S3 Access Grants, you must have the <code>s3:UntagResource</code> permission to use this operation. </p> </dd> <dt>Directory bucket permissions</dt> <dd> <p>For directory buckets, you must have the <code>s3express:UntagResource</code> permission to use this operation. For more information about directory buckets policies and permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-permissions.html">Identity and Access Management (IAM) for S3 Express One Zone</a> in the <i>Amazon S3 User Guide</i>.</p> </dd> <dt>HTTP Host header syntax</dt> <dd> <p> <b>Directory buckets </b> - The HTTP Host header syntax is <code>s3express-control.<i>region</i>.amazonaws.com</code>.</p> </dd> </dl> <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>
Args:
account_id: <p> The Amazon Web Services account ID that owns the resource that you're trying to remove the tags from. </p>
resource_arn: <p>The Amazon Resource Name (ARN) of the S3 resource that you're removing tags from. The tagged resource can be a directory bucket, S3 Storage Lens group or S3 Access Grants instance, registered location, or grant.</p>
tag_keys: <p> The array of tag key-value pairs that you're trying to remove from of the S3 resource. </p>
Raises:
capo_s3_control.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_s3_control.types.untag_resource_request.UntagResourceRequest]",
) -> AsyncOperationResponse[
"capo_s3_control.types.untag_resource_result.UntagResourceResult"
]:
import capo_s3_control._operations.awss3_control_service_v20180820.untag_resource
(
output,
http_response,
) = await capo_s3_control._operations.awss3_control_service_v20180820.untag_resource.async_untag_resource(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UntagResource")
)
input_: capo_s3_control.types.untag_resource_request.UntagResourceRequest = {
"account_id": account_id,
"resource_arn": resource_arn,
"tag_keys": tag_keys,
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output