# 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 .phone_for_update import PhoneForUpdate
from .address_for_update import AddressForUpdate
from .email_for_update import EmailForUpdate
from .object_field_data import ObjectFieldData


class EmergencyContactForUpdate(object):
    _types = {
        "legal_name": str,
        "relationship": str,
        "phones": List[PhoneForUpdate],
        "address": AddressForUpdate,
        "email": EmailForUpdate,
        "is_primary": bool,
        "custom_fields": List[ObjectFieldData],
    }

    def __init__(self, d=None):
        self.legal_name: Optional[str] = None
        self.relationship: Optional[str] = None
        self.phones: Optional[List[PhoneForUpdate]] = None
        self.address: Optional[AddressForUpdate] = None
        self.email: Optional[EmailForUpdate] = None
        self.is_primary: Optional[bool] = None
        self.custom_fields: Optional[List[ObjectFieldData]] = None
        init(self, d, self._types)

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


class EmergencyContactForUpdateBuilder(object):
    def __init__(self) -> None:
        self._emergency_contact_for_update = EmergencyContactForUpdate()

    def legal_name(self, legal_name: str) -> "EmergencyContactForUpdateBuilder":
        self._emergency_contact_for_update.legal_name = legal_name
        return self

    def relationship(self, relationship: str) -> "EmergencyContactForUpdateBuilder":
        self._emergency_contact_for_update.relationship = relationship
        return self

    def phones(self, phones: List[PhoneForUpdate]) -> "EmergencyContactForUpdateBuilder":
        self._emergency_contact_for_update.phones = phones
        return self

    def address(self, address: AddressForUpdate) -> "EmergencyContactForUpdateBuilder":
        self._emergency_contact_for_update.address = address
        return self

    def email(self, email: EmailForUpdate) -> "EmergencyContactForUpdateBuilder":
        self._emergency_contact_for_update.email = email
        return self

    def is_primary(self, is_primary: bool) -> "EmergencyContactForUpdateBuilder":
        self._emergency_contact_for_update.is_primary = is_primary
        return self

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

    def build(self) -> "EmergencyContactForUpdate":
        return self._emergency_contact_for_update
