# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init


class EmergencyContact(object):
    _types = {
        "name": str,
        "relationship": int,
        "mobile": str,
    }

    def __init__(self, d=None):
        self.name: Optional[str] = None
        self.relationship: Optional[int] = None
        self.mobile: Optional[str] = None
        init(self, d, self._types)

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


class EmergencyContactBuilder(object):
    def __init__(self) -> None:
        self._emergency_contact = EmergencyContact()

    def name(self, name: str) -> "EmergencyContactBuilder":
        self._emergency_contact.name = name
        return self

    def relationship(self, relationship: int) -> "EmergencyContactBuilder":
        self._emergency_contact.relationship = relationship
        return self

    def mobile(self, mobile: str) -> "EmergencyContactBuilder":
        self._emergency_contact.mobile = mobile
        return self

    def build(self) -> "EmergencyContact":
        return self._emergency_contact
