# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .team_member_status import TeamMemberStatus
from .team_member_assigned_locations import TeamMemberAssignedLocations
from .wage_setting import WageSetting
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class TeamMember(UncheckedBaseModel):
    """
    A record representing an individual team member for a business.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique ID for the team member.
    """

    reference_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    A second ID used to associate the team member with an entity in another system.
    """

    is_owner: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the team member is the owner of the Square account.
    """

    status: typing.Optional[TeamMemberStatus] = pydantic.Field(default=None)
    """
    Describes the status of the team member.
    See [TeamMemberStatus](#type-teammemberstatus) for possible values
    """

    given_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The given name (that is, the first name) associated with the team member.
    """

    family_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The family name (that is, the last name) associated with the team member.
    """

    email_address: typing.Optional[str] = pydantic.Field(default=None)
    """
    The email address associated with the team member. After accepting the invitation
    from Square, only the team member can change this value.
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    The team member's phone number, in E.164 format. For example:
    +14155552671 - the country code is 1 for US
    +551155256325 - the country code is 55 for BR
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp when the team member was created, in RFC 3339 format.
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp when the team member was last updated, in RFC 3339 format.
    """

    assigned_locations: typing.Optional[TeamMemberAssignedLocations] = pydantic.Field(default=None)
    """
    Describes the team member's assigned locations.
    """

    wage_setting: typing.Optional[WageSetting] = pydantic.Field(default=None)
    """
    Information about the team member's overtime exemption status, job assignments, and compensation.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
