# 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 .national_id_for_update import NationalIdForUpdate
from .phone_for_update import PhoneForUpdate
from .address_for_update import AddressForUpdate
from .file import File
from .object_field_data import ObjectFieldData


class DependentForUpdate(object):
    _types = {
        "relationship": str,
        "gender": str,
        "date_of_birth": str,
        "national_ids": List[NationalIdForUpdate],
        "spouses_working_status": str,
        "is_this_person_covered_by_health_insurance": bool,
        "is_this_person_allowed_for_tax_deduction": bool,
        "dependent_name": str,
        "employer": str,
        "job": str,
        "phone": PhoneForUpdate,
        "address": AddressForUpdate,
        "birth_certificate_of_children": List[File],
        "custom_fields": List[ObjectFieldData],
    }

    def __init__(self, d=None):
        self.relationship: Optional[str] = None
        self.gender: Optional[str] = None
        self.date_of_birth: Optional[str] = None
        self.national_ids: Optional[List[NationalIdForUpdate]] = None
        self.spouses_working_status: Optional[str] = None
        self.is_this_person_covered_by_health_insurance: Optional[bool] = None
        self.is_this_person_allowed_for_tax_deduction: Optional[bool] = None
        self.dependent_name: Optional[str] = None
        self.employer: Optional[str] = None
        self.job: Optional[str] = None
        self.phone: Optional[PhoneForUpdate] = None
        self.address: Optional[AddressForUpdate] = None
        self.birth_certificate_of_children: Optional[List[File]] = None
        self.custom_fields: Optional[List[ObjectFieldData]] = None
        init(self, d, self._types)

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


class DependentForUpdateBuilder(object):
    def __init__(self) -> None:
        self._dependent_for_update = DependentForUpdate()

    def relationship(self, relationship: str) -> "DependentForUpdateBuilder":
        self._dependent_for_update.relationship = relationship
        return self

    def gender(self, gender: str) -> "DependentForUpdateBuilder":
        self._dependent_for_update.gender = gender
        return self

    def date_of_birth(self, date_of_birth: str) -> "DependentForUpdateBuilder":
        self._dependent_for_update.date_of_birth = date_of_birth
        return self

    def national_ids(self, national_ids: List[NationalIdForUpdate]) -> "DependentForUpdateBuilder":
        self._dependent_for_update.national_ids = national_ids
        return self

    def spouses_working_status(self, spouses_working_status: str) -> "DependentForUpdateBuilder":
        self._dependent_for_update.spouses_working_status = spouses_working_status
        return self

    def is_this_person_covered_by_health_insurance(self,
                                                   is_this_person_covered_by_health_insurance: bool) -> "DependentForUpdateBuilder":
        self._dependent_for_update.is_this_person_covered_by_health_insurance = is_this_person_covered_by_health_insurance
        return self

    def is_this_person_allowed_for_tax_deduction(self,
                                                 is_this_person_allowed_for_tax_deduction: bool) -> "DependentForUpdateBuilder":
        self._dependent_for_update.is_this_person_allowed_for_tax_deduction = is_this_person_allowed_for_tax_deduction
        return self

    def dependent_name(self, dependent_name: str) -> "DependentForUpdateBuilder":
        self._dependent_for_update.dependent_name = dependent_name
        return self

    def employer(self, employer: str) -> "DependentForUpdateBuilder":
        self._dependent_for_update.employer = employer
        return self

    def job(self, job: str) -> "DependentForUpdateBuilder":
        self._dependent_for_update.job = job
        return self

    def phone(self, phone: PhoneForUpdate) -> "DependentForUpdateBuilder":
        self._dependent_for_update.phone = phone
        return self

    def address(self, address: AddressForUpdate) -> "DependentForUpdateBuilder":
        self._dependent_for_update.address = address
        return self

    def birth_certificate_of_children(self, birth_certificate_of_children: List[File]) -> "DependentForUpdateBuilder":
        self._dependent_for_update.birth_certificate_of_children = birth_certificate_of_children
        return self

    def custom_fields(self, custom_fields: List[ObjectFieldData]) -> "DependentForUpdateBuilder":
        self._dependent_for_update.custom_fields = custom_fields
        return self

    def build(self) -> "DependentForUpdate":
        return self._dependent_for_update
