# 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 .meeting_agent_event_user import MeetingAgentEventUser


class ParticipantLeftItem(object):
    _types = {
        "participant": MeetingAgentEventUser,
        "leave_reason": int,
        "leave_time": str,
    }

    def __init__(self, d=None):
        self.participant: Optional[MeetingAgentEventUser] = None
        self.leave_reason: Optional[int] = None
        self.leave_time: Optional[str] = None
        init(self, d, self._types)

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


class ParticipantLeftItemBuilder(object):
    def __init__(self) -> None:
        self._participant_left_item = ParticipantLeftItem()

    def participant(self, participant: MeetingAgentEventUser) -> "ParticipantLeftItemBuilder":
        self._participant_left_item.participant = participant
        return self

    def leave_reason(self, leave_reason: int) -> "ParticipantLeftItemBuilder":
        self._participant_left_item.leave_reason = leave_reason
        return self

    def leave_time(self, leave_time: str) -> "ParticipantLeftItemBuilder":
        self._participant_left_item.leave_time = leave_time
        return self

    def build(self) -> "ParticipantLeftItem":
        return self._participant_left_item
