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/io_t_things_graph.py
| def tag_resource(
self,
resource_arn: "capo_iotthingsgraph.types.resource_arn.ResourceArn",
tags: "capo_iotthingsgraph.types.tag_list.TagList",
*,
config_overrides: Optional[IoTThingsGraphClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_iotthingsgraph.types.tag_resource_request.TagResourceRequest]",
) -> OperationResponse[
"capo_iotthingsgraph.types.tag_resource_response.TagResourceResponse"
]:
import capo_iotthingsgraph._operations.iot_things_graph_front_end_service.tag_resource
output, http_response = (
capo_iotthingsgraph._operations.iot_things_graph_front_end_service.tag_resource.tag_resource(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|