# 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 ..core.pydantic_utilities import IS_PYDANTIC_V2


class SearchTeamMembersFilter(UncheckedBaseModel):
    """
    Represents a filter used in a search for `TeamMember` objects. `AND` logic is applied
    between the individual fields, and `OR` logic is applied within list-based fields.
    For example, setting this filter value:
    ```
    filter = (locations_ids = ["A", "B"], status = ACTIVE)
    ```
    returns only active team members assigned to either location "A" or "B".
    """

    location_ids: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    When present, filters by team members assigned to the specified locations.
    When empty, includes team members assigned to any location.
    """

    status: typing.Optional[TeamMemberStatus] = pydantic.Field(default=None)
    """
    When present, filters by team members who match the given status.
    When empty, includes team members of all statuses.
    See [TeamMemberStatus](#type-teammemberstatus) for possible values
    """

    is_owner: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When present and set to true, returns the team member who is the owner of the Square account.
    """

    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
