Skip to content

untag_resource

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

Removes a specific tag associated with an Amazon Comprehend resource.

Parameters:

  • resource_arn (ComprehendArn) –

    The Amazon Resource Name (ARN) of the given Amazon Comprehend resource from which you want to remove the tags.

  • tag_keys (TagKeyList) –

    The initial part of a key-value pair that forms a tag being removed from a given resource. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department. Keys must be unique and cannot be duplicated for a particular resource.

Raises:

Source code in docs_src/capo_comprehend/_services/comprehend.py
def untag_resource(
    self,
    resource_arn: "capo_comprehend.types.comprehend_arn.ComprehendArn",
    tag_keys: "capo_comprehend.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[ComprehendClientConfig] = None,
) -> "capo_comprehend.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes a specific tag associated with an Amazon Comprehend resource. </p>

    Args:
        resource_arn: <p> The Amazon Resource Name (ARN) of the given Amazon Comprehend resource from which you want to remove the tags. </p>
        tag_keys: <p>The initial part of a key-value pair that forms a tag being removed from a given resource. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department. Keys must be unique and cannot be duplicated for a particular resource. </p>

    Raises:
        capo_comprehend.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Concurrent modification of the tags associated with an Amazon Comprehend resource is not supported. </p>
        capo_comprehend.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_comprehend.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_comprehend.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
        capo_comprehend.errors.too_many_tag_keys_exception.TooManyTagKeysException: <p>The request contains more tag keys than can be associated with a resource (50 tag keys per resource).</p>
        capo_comprehend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_comprehend._operations.comprehend_20171127.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_comprehend.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