Skip to content

untag_resource async

untag_resource(
    resource_arn: str,
    tag_keys: TagKeys,
    *,
    config_overrides: Optional[AsyncWorkSpacesThinClientClientConfig] = None,
) -> UntagResourceResponse

Removes a tag or tags from a resource.

Parameters:

  • resource_arn (str) –

    The Amazon Resource Name (ARN) of the resource that you want to untag.

  • tag_keys (TagKeys) –

    The keys of the key-value pairs for the tag or tags you want to remove from the specified resource.

Raises:

Source code in docs_src/capo_workspaces_thin_client/_services/async_work_spaces_thin_client.py
async def untag_resource(
    self,
    resource_arn: str,
    tag_keys: "capo_workspaces_thin_client.types.tag_keys.TagKeys",
    *,
    config_overrides: Optional[AsyncWorkSpacesThinClientClientConfig] = None,
) -> "capo_workspaces_thin_client.types.untag_resource_response.UntagResourceResponse":
    """<p>Removes a tag or tags from a resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to untag.</p>
        tag_keys: <p>The keys of the key-value pairs for the tag or tags you want to remove from the specified resource.</p>

    Raises:
        capo_workspaces_thin_client.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_workspaces_thin_client.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.</p>
        capo_workspaces_thin_client.errors.internal_server_exception.InternalServerException: <p>The server encountered an internal error and is unable to complete the request.</p>
        capo_workspaces_thin_client.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request was not found.</p>
        capo_workspaces_thin_client.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_workspaces_thin_client.errors.validation_exception.ValidationException: <p>The input fails to satisfy the specified constraints.</p>
        capo_workspaces_thin_client.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces_thin_client.types.untag_resource_request.UntagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_thin_client.types.untag_resource_response.UntagResourceResponse"
    ]:
        import capo_workspaces_thin_client._operations.thin_client.untag_resource

        (
            output,
            http_response,
        ) = await capo_workspaces_thin_client._operations.thin_client.untag_resource.async_untag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workspaces_thin_client.types.untag_resource_request.UntagResourceRequest",
    ) -> dict[str, Any]:
        import capo_workspaces_thin_client.types.untag_resource_request

        return capo_workspaces_thin_client.types.untag_resource_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UntagResource", redact_input=_redact_input),
    )
    input_: capo_workspaces_thin_client.types.untag_resource_request.UntagResourceRequest = {
        "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