Skip to content

tag_resource async

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

Add a user-specifed key and value tag to a data store.

Parameters:

  • resource_arn (AmazonResourceName) –

    The Amazon Resource Name (ARN) that grants access to the data store tags are being added to.

  • tags (TagList) –

    The user-specified key and value pair tags being added to a data store.

Raises:

Source code in docs_src/capo_healthlake/_services/async_health_lake.py
async def tag_resource(
    self,
    resource_arn: "capo_healthlake.types.amazon_resource_name.AmazonResourceName",
    tags: "capo_healthlake.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncHealthLakeClientConfig] = None,
) -> "capo_healthlake.types.tag_resource_response.TagResourceResponse":
    """<p>Add a user-specifed key and value tag to a data store.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) that grants access to the data store tags are being added to.</p>
        tags: <p>The user-specified key and value pair tags being added to a data store.</p>

    Raises:
        capo_healthlake.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested data store was not found.</p>
        capo_healthlake.errors.validation_exception.ValidationException: <p>The user input parameter was invalid.</p>
        capo_healthlake.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_healthlake._operations.health_lake.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_healthlake.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