Skip to content

untag_resource

untag_resource(
    resource_arn: AmazonResourceName,
    tag_keys: TagKeyList,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> UntagResourceResponse

Remove one or more tags (keys and values) from a specified resource.

Parameters:

  • resource_arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) of the resource that you want to remove one or more tags from.

  • tag_keys (TagKeyList) –

    The tags (tag keys) that you want to remove from the resource. When you specify a tag key, the action removes both that key and its associated tag value.

    To remove more than one tag from the resource, append the TagKeys parameter and argument for each additional tag to remove, separated by an ampersand. For example: /v2/email/tags?ResourceArn=ResourceArn&TagKeys=Key1&TagKeys=Key2

Raises:

Source code in docs_src/capo_sesv2/_services/se_sv2.py
def untag_resource(
    self,
    resource_arn: "capo_sesv2.types.amazon_resource_name.AmazonResourceName",
    tag_keys: "capo_sesv2.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> "capo_sesv2.types.untag_resource_response.UntagResourceResponse":
    """<p>Remove one or more tags (keys and values) from a specified resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to remove one or more tags from.</p>
        tag_keys: <p>The tags (tag keys) that you want to remove from the resource. When you specify a tag key, the action removes both that key and its associated tag value.</p> <p>To remove more than one tag from the resource, append the <code>TagKeys</code> parameter and argument for each additional tag to remove, separated by an ampersand. For example: <code>/v2/email/tags?ResourceArn=ResourceArn&TagKeys=Key1&TagKeys=Key2</code> </p>

    Raises:
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_sesv2.errors.concurrent_modification_exception.ConcurrentModificationException: <p>The resource is being modified by another operation or thread.</p>
        capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
        capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sesv2.types.untag_resource_request.UntagResourceRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.untag_resource

        output, http_response = (
            capo_sesv2._operations.simple_email_service_v2.untag_resource.untag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UntagResource")
    )
    input_: capo_sesv2.types.untag_resource_request.UntagResourceRequest = {
        "resource_arn": resource_arn,
        "tag_keys": tag_keys,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output