async def tag_resource(
self,
resource_arn: "capo_artifact.types.long_string_attribute.LongStringAttribute",
tags: "capo_artifact.types.tags_map.TagsMap",
*,
config_overrides: Optional[AsyncArtifactClientConfig] = None,
) -> "capo_artifact.types.tag_resource_response.TagResourceResponse":
"""<p>Add tags to a resource.</p>
Args:
resource_arn: <p>The Amazon Resource Name (ARN) of the resource.</p>
tags: <p>Tags to add to the resource.</p>
Raises:
capo_artifact.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
capo_artifact.errors.internal_server_exception.InternalServerException: <p>An unknown server exception has occurred.</p>
capo_artifact.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
capo_artifact.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
capo_artifact.errors.validation_exception.ValidationException: <p>Request fails to satisfy the constraints specified by an AWS service.</p>
capo_artifact.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_artifact.types.tag_resource_request.TagResourceRequest]",
) -> AsyncOperationResponse[
"capo_artifact.types.tag_resource_response.TagResourceResponse"
]:
import capo_artifact._operations.artifact.tag_resource
(
output,
http_response,
) = await capo_artifact._operations.artifact.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_artifact.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