Skip to content

tag_resource async

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

Creates a tag for the specified resource.

Parameters:

  • resource_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the resource whose tags are returned.

  • tags (TagList) –

    A list of tags to add to the resource.>

Raises:

Source code in docs_src/capo_iotthingsgraph/_services/async_io_t_things_graph.py
async def tag_resource(
    self,
    resource_arn: "capo_iotthingsgraph.types.resource_arn.ResourceArn",
    tags: "capo_iotthingsgraph.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncIoTThingsGraphClientConfig] = None,
) -> "capo_iotthingsgraph.types.tag_resource_response.TagResourceResponse":
    """<p>Creates a tag for the specified resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource whose tags are returned.</p>
        tags: <p>A list of tags to add to the resource.></p>

    Raises:
        capo_iotthingsgraph.errors.internal_failure_exception.InternalFailureException: <p></p>
        capo_iotthingsgraph.errors.invalid_request_exception.InvalidRequestException: <p></p>
        capo_iotthingsgraph.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p></p>
        capo_iotthingsgraph.errors.throttling_exception.ThrottlingException: <p></p>
        capo_iotthingsgraph.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_iotthingsgraph._operations.iot_things_graph_front_end_service.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_iotthingsgraph.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