# Code generated by Lark OpenAPI.

from typing import Optional, List

from lark_oapi.core.construct import init
from .ticket_message import TicketMessage


class ListTicketMessageResponseBody(object):
    _types = {
        "messages": List[TicketMessage],
        "total": int,
    }

    def __init__(self, d=None):
        self.messages: Optional[List[TicketMessage]] = None
        self.total: Optional[int] = None
        init(self, d, self._types)

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


class ListTicketMessageResponseBodyBuilder(object):
    def __init__(self) -> None:
        self._list_ticket_message_response_body = ListTicketMessageResponseBody()

    def messages(self, messages: List[TicketMessage]) -> "ListTicketMessageResponseBodyBuilder":
        self._list_ticket_message_response_body.messages = messages
        return self

    def total(self, total: int) -> "ListTicketMessageResponseBodyBuilder":
        self._list_ticket_message_response_body.total = total
        return self

    def build(self) -> "ListTicketMessageResponseBody":
        return self._list_ticket_message_response_body
