async def tag_resource(
self,
resource_arn: "capo_migrationhuborchestrator.types.resource_arn.ResourceArn",
tags: "capo_migrationhuborchestrator.types.tag_map.TagMap",
*,
config_overrides: Optional[AsyncMigrationHubOrchestratorClientConfig] = None,
) -> (
"capo_migrationhuborchestrator.types.tag_resource_response.TagResourceResponse"
):
"""<p>Tag a resource by specifying its Amazon Resource Name (ARN).</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource to which you want to add tags.</p>
tags: <p>A collection of labels, in the form of key:value pairs, that apply to this resource.</p>
Raises:
capo_migrationhuborchestrator.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource is not available.</p>
capo_migrationhuborchestrator.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
capo_migrationhuborchestrator.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_migrationhuborchestrator.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_migrationhuborchestrator.types.tag_resource_response.TagResourceResponse"
]:
import capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.tag_resource
(
output,
http_response,
) = await capo_migrationhuborchestrator._operations.aws_migration_hub_orchestrator.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_migrationhuborchestrator.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