# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .user_mail_entity import UserMailEntity
from .mail_address import MailAddress
from .mail_address import MailAddress
from .mail_address import MailAddress
from .mail_address import MailAddress
from .file_meta_info import FileMetaInfo
from .file_meta_info import FileMetaInfo


class MailLogMailInfo(object):
    _types = {
        "message_id": str,
        "owner": UserMailEntity,
        "event_types": List[str],
        "smtp_message_id": str,
        "date": int,
        "subject": str,
        "header_from": MailAddress,
        "to_recipients": List[MailAddress],
        "cc_recipients": List[MailAddress],
        "bcc_recipients": List[MailAddress],
        "attachment_num": int,
        "image_num": int,
        "attachments": List[FileMetaInfo],
        "images": List[FileMetaInfo],
    }

    def __init__(self, d=None):
        self.message_id: Optional[str] = None
        self.owner: Optional[UserMailEntity] = None
        self.event_types: Optional[List[str]] = None
        self.smtp_message_id: Optional[str] = None
        self.date: Optional[int] = None
        self.subject: Optional[str] = None
        self.header_from: Optional[MailAddress] = None
        self.to_recipients: Optional[List[MailAddress]] = None
        self.cc_recipients: Optional[List[MailAddress]] = None
        self.bcc_recipients: Optional[List[MailAddress]] = None
        self.attachment_num: Optional[int] = None
        self.image_num: Optional[int] = None
        self.attachments: Optional[List[FileMetaInfo]] = None
        self.images: Optional[List[FileMetaInfo]] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "MailLogMailInfoBuilder":
        return MailLogMailInfoBuilder()


class MailLogMailInfoBuilder(object):
    def __init__(self) -> None:
        self._mail_log_mail_info = MailLogMailInfo()

    def message_id(self, message_id: str) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.message_id = message_id
        return self

    def owner(self, owner: UserMailEntity) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.owner = owner
        return self

    def event_types(self, event_types: List[str]) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.event_types = event_types
        return self

    def smtp_message_id(self, smtp_message_id: str) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.smtp_message_id = smtp_message_id
        return self

    def date(self, date: int) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.date = date
        return self

    def subject(self, subject: str) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.subject = subject
        return self

    def header_from(self, header_from: MailAddress) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.header_from = header_from
        return self

    def to_recipients(self, to_recipients: List[MailAddress]) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.to_recipients = to_recipients
        return self

    def cc_recipients(self, cc_recipients: List[MailAddress]) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.cc_recipients = cc_recipients
        return self

    def bcc_recipients(self, bcc_recipients: List[MailAddress]) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.bcc_recipients = bcc_recipients
        return self

    def attachment_num(self, attachment_num: int) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.attachment_num = attachment_num
        return self

    def image_num(self, image_num: int) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.image_num = image_num
        return self

    def attachments(self, attachments: List[FileMetaInfo]) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.attachments = attachments
        return self

    def images(self, images: List[FileMetaInfo]) -> "MailLogMailInfoBuilder":
        self._mail_log_mail_info.images = images
        return self

    def build(self) -> "MailLogMailInfo":
        return self._mail_log_mail_info
