Skip to content

tag_resource async

tag_resource(
    resource_arn: AmazonResourceName,
    tags: TagList,
    *,
    config_overrides: Optional[AsyncchatbotClientConfig] = None,
) -> TagResourceResponse

Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.

Parameters:

  • resource_arn (AmazonResourceName) –

    The ARN of the configuration.

  • tags (TagList) –

    A list of tags to apply to the configuration.

Raises:

Source code in docs_src/capo_chatbot/_services/async_chatbot.py
async def tag_resource(
    self,
    resource_arn: "capo_chatbot.types.amazon_resource_name.AmazonResourceName",
    tags: "capo_chatbot.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncchatbotClientConfig] = None,
) -> "capo_chatbot.types.tag_resource_response.TagResourceResponse":
    """<p>Attaches a key-value pair to a resource, as identified by its Amazon Resource Name (ARN). Resources are users, servers, roles, and other entities.</p>

    Args:
        resource_arn: <p>The ARN of the configuration.</p>
        tags: <p>A list of tags to apply to the configuration.</p>

    Raises:
        capo_chatbot.errors.internal_service_error.InternalServiceError: <p>Unexpected error during processing of request.</p>
        capo_chatbot.errors.resource_not_found_exception.ResourceNotFoundException: <p>We were unable to find the resource for your request</p>
        capo_chatbot.errors.service_unavailable_exception.ServiceUnavailableException: <p>We can’t process your request right now because of a server issue. Try again later.</p>
        capo_chatbot.errors.too_many_tags_exception.TooManyTagsException: <p>The supplied list of tags contains too many tags.</p>
        capo_chatbot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chatbot.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_chatbot.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_chatbot._operations.wheatley_orchestration_20171011.tag_resource

        (
            output,
            http_response,
        ) = await capo_chatbot._operations.wheatley_orchestration_20171011.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_chatbot.types.tag_resource_request.TagResourceRequest = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output