Skip to content

untag_resource async

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

Deletes specified tags from a resource.

Parameters:

  • resource_arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) of the resource to remove tags from. You can tag Amazon Polly lexicons and custom voices.

  • tag_keys (TagKeyList) –

    The keys of the tags to be removed.

Raises:

  • InvalidTagParameterException –

    The resource ARN or a tag in the request isn't valid. Specify the ARN of a supported resource in the Amazon Web Services account and Region of the request. Tag keys can have a maximum length of 128 characters, and tag values can have a maximum length of 256 characters. Correct the ARN or the tags, and then try again.

  • ResourceNotFoundException –

    Amazon Polly can't find the specified resource. Verify that the resource exists in the Amazon Web Services account and Region of the request and that its ARN or ID is spelled correctly, and then try again.

  • ServiceFailureException –

    An unknown condition has caused a service failure.

  • ThrottlingException –

    The request was denied because of request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

To remove tags from a lexicon The following example removes the tags with the specified keys from a pronunciation lexicon.

>>> await client.untag_resource(resource_arn='arn:aws:polly:us-east-1:111122223333:lexicon/example', tag_keys=['Environment'])
Source code in docs_src/capo_polly/_services/async_polly.py
async def untag_resource(
    self,
    resource_arn: "capo_polly.types.amazon_resource_name.AmazonResourceName",
    tag_keys: "capo_polly.types.tag_key_list.TagKeyList",
    *,
    config_overrides: Optional[AsyncPollyClientConfig] = None,
) -> "capo_polly.types.untag_resource_output.UntagResourceOutput":
    """<p>Deletes specified tags from a resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource to remove tags from. You can tag Amazon Polly lexicons and custom voices.</p>
        tag_keys: <p>The keys of the tags to be removed.</p>

    Raises:
        capo_polly.errors.invalid_tag_parameter_exception.InvalidTagParameterException: <p>The resource ARN or a tag in the request isn't valid. Specify the ARN of a supported resource in the Amazon Web Services account and Region of the request. Tag keys can have a maximum length of 128 characters, and tag values can have a maximum length of 256 characters. Correct the ARN or the tags, and then try again.</p>
        capo_polly.errors.resource_not_found_exception.ResourceNotFoundException: <p>Amazon Polly can't find the specified resource. Verify that the resource exists in the Amazon Web Services account and Region of the request and that its ARN or ID is spelled correctly, and then try again.</p>
        capo_polly.errors.service_failure_exception.ServiceFailureException: <p>An unknown condition has caused a service failure.</p>
        capo_polly.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
        capo_polly.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service.</p>
        capo_polly.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To remove tags from a lexicon
        The following example removes the tags with the specified keys from a pronunciation lexicon.

        >>> await client.untag_resource(resource_arn='arn:aws:polly:us-east-1:111122223333:lexicon/example', tag_keys=['Environment'])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_polly.types.untag_resource_input.UntagResourceInput]",
    ) -> AsyncOperationResponse[
        "capo_polly.types.untag_resource_output.UntagResourceOutput"
    ]:
        import capo_polly._operations.parrot_v1.untag_resource

        (
            output,
            http_response,
        ) = await capo_polly._operations.parrot_v1.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_polly.types.untag_resource_input.UntagResourceInput = {
        "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