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

import datetime as dt
import typing

from ..core.datetime_utils import serialize_datetime
from .client_facing_api_key import ClientFacingApiKey
from .delegated_flow_type import DelegatedFlowType
from .team_config import TeamConfig

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class ClientFacingTeam(pydantic.BaseModel):
    """
    [Deprecated] GET /v2/team is in the process of being removed.
    Neither customers nor Dashboard should retrieve team settings and metadata directly.

    All must migrate to the Team endpoints of the Org Management API.
    """

    id: str
    org_id: str
    name: str
    svix_app_id: typing.Optional[str]
    client_id: typing.Optional[str]
    client_secret: typing.Optional[str]
    airtable_api_key: typing.Optional[str]
    airtable_base_id: typing.Optional[str]
    webhook_secret: typing.Optional[str]
    api_key: typing.Optional[str]
    api_keys: typing.Optional[typing.List[ClientFacingApiKey]]
    configuration: typing.Optional[TeamConfig]
    testkits_texts_enabled: bool
    lab_tests_patient_communication_enabled: bool
    lab_tests_patient_sms_communication_enabled: bool
    lab_tests_patient_email_communication_enabled: bool
    logo_url: typing.Optional[str]
    delegated_flow: DelegatedFlowType

    def json(self, **kwargs: typing.Any) -> str:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().json(**kwargs_with_defaults)

    def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
        kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
        return super().dict(**kwargs_with_defaults)

    class Config:
        frozen = True
        smart_union = True
        json_encoders = {dt.datetime: serialize_datetime}
