Skip to content

tag_resource async

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

Adds a tag to a resource.

Parameters:

  • resource_arn (AmazonResourceName) –

    The ARN of the resource to add tags to.

  • tags (TagList) –

    Adds to or modifies the tags of the given resource. Tags are metadata that you can use to manage a resource.

Raises:

Source code in docs_src/capo_iot_wireless/_services/async_io_t_wireless.py
async def tag_resource(
    self,
    resource_arn: "capo_iot_wireless.types.amazon_resource_name.AmazonResourceName",
    tags: "capo_iot_wireless.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncIoTWirelessClientConfig] = None,
) -> "capo_iot_wireless.types.tag_resource_response.TagResourceResponse":
    """<p>Adds a tag to a resource.</p>

    Args:
        resource_arn: <p>The ARN of the resource to add tags to.</p>
        tags: <p>Adds to or modifies the tags of the given resource. Tags are metadata that you can use to manage a resource.</p>

    Raises:
        capo_iot_wireless.errors.conflict_exception.ConflictException: <p>Adding, updating, or deleting the resource can cause an inconsistent state.</p>
        capo_iot_wireless.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred while processing a request.</p>
        capo_iot_wireless.errors.resource_not_found_exception.ResourceNotFoundException: <p>Resource does not exist.</p>
        capo_iot_wireless.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded the allowed API request rate.</p>
        capo_iot_wireless.errors.too_many_tags_exception.TooManyTagsException: <p>The request was denied because the resource can't have any more tags.</p>
        capo_iot_wireless.errors.validation_exception.ValidationException: <p>The input did not meet the specified constraints.</p>
        capo_iot_wireless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_iot_wireless._operations.iotwireless.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_iot_wireless.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