# 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 .leave_request_created_error_message import LeaveRequestCreatedErrorMessage
from .leave_request import LeaveRequest


class LeaveRequestCreatedResult(object):
    _types = {
        "error_messages": List[LeaveRequestCreatedErrorMessage],
        "leave_request_results": List[LeaveRequest],
    }

    def __init__(self, d=None):
        self.error_messages: Optional[List[LeaveRequestCreatedErrorMessage]] = None
        self.leave_request_results: Optional[List[LeaveRequest]] = None
        init(self, d, self._types)

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


class LeaveRequestCreatedResultBuilder(object):
    def __init__(self) -> None:
        self._leave_request_created_result = LeaveRequestCreatedResult()

    def error_messages(self,
                       error_messages: List[LeaveRequestCreatedErrorMessage]) -> "LeaveRequestCreatedResultBuilder":
        self._leave_request_created_result.error_messages = error_messages
        return self

    def leave_request_results(self, leave_request_results: List[LeaveRequest]) -> "LeaveRequestCreatedResultBuilder":
        self._leave_request_created_result.leave_request_results = leave_request_results
        return self

    def build(self) -> "LeaveRequestCreatedResult":
        return self._leave_request_created_result
