from typing import List from apollo_utils.job.clients.base.client import BaseApiClient from juno_email_messages.clients.base_config import ApiConfig from juno_email_messages.constants import Service class NotificationsClientConfig(ApiConfig): service = Service.NOTIFICATIONS _loaded_attrs = (("hostname", "host"),) class NotificationsClient(NotificationsClientConfig, BaseApiClient): def set_token(self, token: str): self._apikey = f"Bearer {token}" if self._session: self._add_header(self._session, self._get_header()) def send_email(self, email_list: List[dict]): if not email_list: return {} return self.send_request("api/v1/email/send", method="POST", data=email_list, get_json=True)