Source code for luna_lambda_tools.public.clients

"""
Module contains luna3 clients adapted for usage in lambda
"""
from dataclasses import dataclass

from ..exceptions import UserTaskLambdaException
from .events import Events
from .faces import Faces
from .lis import LIS
from .lpm import LPM
from .lrs import LRS
from .sender import Sender


[docs] @dataclass class Clients: """Luna services clients""" faces: Faces events: Events matcher: LPM faceSamplesStore: LIS bodySamplesStore: LIS imageOriginStore: LIS sdk: LRS sender: Sender def __getattribute__(self, item): try: client = super().__getattribute__(item) client.getAddress() return client except Exception: try: txt = client.__doc__.split(" ")[0] except: raise UserTaskLambdaException(f"{item.capitalize()} service is disabled. Client was not initialized") raise UserTaskLambdaException(f"{txt} service is disabled. Client was not initialized")