# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class EventLog(object):
    _types = {
        "mail_from": str,
        "rcpt_to": str,
        "smtp_message_id": str,
        "event_type": int,
        "timestamp": int,
    }

    def __init__(self, d=None):
        self.mail_from: Optional[str] = None
        self.rcpt_to: Optional[str] = None
        self.smtp_message_id: Optional[str] = None
        self.event_type: Optional[int] = None
        self.timestamp: Optional[int] = None
        init(self, d, self._types)

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


class EventLogBuilder(object):
    def __init__(self) -> None:
        self._event_log = EventLog()

    def mail_from(self, mail_from: str) -> "EventLogBuilder":
        self._event_log.mail_from = mail_from
        return self

    def rcpt_to(self, rcpt_to: str) -> "EventLogBuilder":
        self._event_log.rcpt_to = rcpt_to
        return self

    def smtp_message_id(self, smtp_message_id: str) -> "EventLogBuilder":
        self._event_log.smtp_message_id = smtp_message_id
        return self

    def event_type(self, event_type: int) -> "EventLogBuilder":
        self._event_log.event_type = event_type
        return self

    def timestamp(self, timestamp: int) -> "EventLogBuilder":
        self._event_log.timestamp = timestamp
        return self

    def build(self) -> "EventLog":
        return self._event_log
