# 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 .application_detail_basic_info import ApplicationDetailBasicInfo
from .job_basic_info import JobBasicInfo
from .talent_basic_info_v2 import TalentBasicInfoV2
from .evaluation import Evaluation
from .interview_aggregation import InterviewAggregation
from .offer_info_v2 import OfferInfoV2
from .employee_v2 import EmployeeV2
from .agency_info import AgencyInfo
from .application_detail_portal_info import ApplicationDetailPortalInfo
from .referral_info_v2 import ReferralInfoV2


class ApplicationDetailInfo(object):
    _types = {
        "basic_info": ApplicationDetailBasicInfo,
        "job": JobBasicInfo,
        "talent": TalentBasicInfoV2,
        "evaluations": List[Evaluation],
        "interview_aggregation": InterviewAggregation,
        "offer": OfferInfoV2,
        "employee": EmployeeV2,
        "agency": AgencyInfo,
        "portal": ApplicationDetailPortalInfo,
        "referral": ReferralInfoV2,
    }

    def __init__(self, d=None):
        self.basic_info: Optional[ApplicationDetailBasicInfo] = None
        self.job: Optional[JobBasicInfo] = None
        self.talent: Optional[TalentBasicInfoV2] = None
        self.evaluations: Optional[List[Evaluation]] = None
        self.interview_aggregation: Optional[InterviewAggregation] = None
        self.offer: Optional[OfferInfoV2] = None
        self.employee: Optional[EmployeeV2] = None
        self.agency: Optional[AgencyInfo] = None
        self.portal: Optional[ApplicationDetailPortalInfo] = None
        self.referral: Optional[ReferralInfoV2] = None
        init(self, d, self._types)

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


class ApplicationDetailInfoBuilder(object):
    def __init__(self) -> None:
        self._application_detail_info = ApplicationDetailInfo()

    def basic_info(self, basic_info: ApplicationDetailBasicInfo) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.basic_info = basic_info
        return self

    def job(self, job: JobBasicInfo) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.job = job
        return self

    def talent(self, talent: TalentBasicInfoV2) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.talent = talent
        return self

    def evaluations(self, evaluations: List[Evaluation]) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.evaluations = evaluations
        return self

    def interview_aggregation(self, interview_aggregation: InterviewAggregation) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.interview_aggregation = interview_aggregation
        return self

    def offer(self, offer: OfferInfoV2) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.offer = offer
        return self

    def employee(self, employee: EmployeeV2) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.employee = employee
        return self

    def agency(self, agency: AgencyInfo) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.agency = agency
        return self

    def portal(self, portal: ApplicationDetailPortalInfo) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.portal = portal
        return self

    def referral(self, referral: ReferralInfoV2) -> "ApplicationDetailInfoBuilder":
        self._application_detail_info.referral = referral
        return self

    def build(self) -> "ApplicationDetailInfo":
        return self._application_detail_info
