# 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 .profile_setting_phone import ProfileSettingPhone
from .profile_setting_address import ProfileSettingAddress
from .profile_setting_custom_field import ProfileSettingCustomField


class ProfileSettingEmergencyContact(object):
    _types = {
        "legal_name": str,
        "relationship": str,
        "is_primary": bool,
        "phone": ProfileSettingPhone,
        "email": str,
        "address": ProfileSettingAddress,
        "custom_fields": List[ProfileSettingCustomField],
    }

    def __init__(self, d=None):
        self.legal_name: Optional[str] = None
        self.relationship: Optional[str] = None
        self.is_primary: Optional[bool] = None
        self.phone: Optional[ProfileSettingPhone] = None
        self.email: Optional[str] = None
        self.address: Optional[ProfileSettingAddress] = None
        self.custom_fields: Optional[List[ProfileSettingCustomField]] = None
        init(self, d, self._types)

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


class ProfileSettingEmergencyContactBuilder(object):
    def __init__(self) -> None:
        self._profile_setting_emergency_contact = ProfileSettingEmergencyContact()

    def legal_name(self, legal_name: str) -> "ProfileSettingEmergencyContactBuilder":
        self._profile_setting_emergency_contact.legal_name = legal_name
        return self

    def relationship(self, relationship: str) -> "ProfileSettingEmergencyContactBuilder":
        self._profile_setting_emergency_contact.relationship = relationship
        return self

    def is_primary(self, is_primary: bool) -> "ProfileSettingEmergencyContactBuilder":
        self._profile_setting_emergency_contact.is_primary = is_primary
        return self

    def phone(self, phone: ProfileSettingPhone) -> "ProfileSettingEmergencyContactBuilder":
        self._profile_setting_emergency_contact.phone = phone
        return self

    def email(self, email: str) -> "ProfileSettingEmergencyContactBuilder":
        self._profile_setting_emergency_contact.email = email
        return self

    def address(self, address: ProfileSettingAddress) -> "ProfileSettingEmergencyContactBuilder":
        self._profile_setting_emergency_contact.address = address
        return self

    def custom_fields(self, custom_fields: List[ProfileSettingCustomField]) -> "ProfileSettingEmergencyContactBuilder":
        self._profile_setting_emergency_contact.custom_fields = custom_fields
        return self

    def build(self) -> "ProfileSettingEmergencyContact":
        return self._profile_setting_emergency_contact
