Skip to content

tag_resource async

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

Adds to or modifies the tags of the given resource. Tags are metadata which can be used to manage a resource.

Parameters:

  • resource_arn (AmazonResourceName) –

    The ARN of the resource.

  • tags (TagList) –

    The new or modified tags for the resource.

Raises:

Source code in docs_src/capo_iotfleetwise/_services/async_io_t_fleet_wise.py
async def tag_resource(
    self,
    resource_arn: "capo_iotfleetwise.types.amazon_resource_name.AmazonResourceName",
    tags: "capo_iotfleetwise.types.tag_list.TagList",
    *,
    config_overrides: Optional[AsyncIoTFleetWiseClientConfig] = None,
) -> "capo_iotfleetwise.types.tag_resource_response.TagResourceResponse":
    """<p>Adds to or modifies the tags of the given resource. Tags are metadata which can be used to manage a resource.</p>

    Args:
        resource_arn: <p>The ARN of the resource.</p>
        tags: <p>The new or modified tags for the resource.</p>

    Raises:
        capo_iotfleetwise.errors.internal_server_exception.InternalServerException: <p>The request couldn't be completed because the server temporarily failed.</p>
        capo_iotfleetwise.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permission to perform this action.</p>
        capo_iotfleetwise.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource wasn't found.</p>
        capo_iotfleetwise.errors.throttling_exception.ThrottlingException: <p>The request couldn't be completed due to throttling.</p>
        capo_iotfleetwise.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_iotfleetwise.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_iotfleetwise._operations.io_t_autobahn_control_plane.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_iotfleetwise.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