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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .contacts_field import ContactsField
from .created_at import CreatedAt
from .file_content import FileContent
from .instrument import Instrument
from .is_root import IsRoot
from .org_parent_id import OrgParentId
from .org_parent_name import OrgParentName
from .orgaddress import Orgaddress
from .organization_query_record_services_item import OrganizationQueryRecordServicesItem
from .orgcity import Orgcity
from .orgcountry import Orgcountry
from .orgentryname import Orgentryname
from .orgid import Orgid
from .orgidstring import Orgidstring
from .orgname import Orgname
from .orgstate import Orgstate
from .orgtimezone import Orgtimezone
from .orgtype import Orgtype
from .orgwebsite import Orgwebsite
from .orgzip import Orgzip
from .recipient_email_notification import RecipientEmailNotification
from .reply_to_email import ReplyToEmail
from .resumable import Resumable
from .summary_org import SummaryOrg
from .user_query_record import UserQueryRecord


class OrganizationQueryRecord(UniversalBaseModel):
    services: typing.Optional[typing.List[OrganizationQueryRecordServicesItem]] = None
    billing_info: typing_extensions.Annotated[typing.Optional[Instrument], FieldMetadata(alias="billingInfo")] = None
    contacts: typing.Optional[ContactsField] = None
    created_at: typing_extensions.Annotated[typing.Optional[CreatedAt], FieldMetadata(alias="createdAt")] = None
    has_billing: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hasBilling")] = None
    has_residual: typing_extensions.Annotated[typing.Optional[bool], FieldMetadata(alias="hasResidual")] = None
    id_org: typing_extensions.Annotated[typing.Optional[Orgid], FieldMetadata(alias="idOrg")] = None
    is_root: typing_extensions.Annotated[typing.Optional[IsRoot], FieldMetadata(alias="isRoot")] = None
    org_address: typing_extensions.Annotated[typing.Optional[Orgaddress], FieldMetadata(alias="orgAddress")] = None
    org_city: typing_extensions.Annotated[typing.Optional[Orgcity], FieldMetadata(alias="orgCity")] = None
    org_country: typing_extensions.Annotated[typing.Optional[Orgcountry], FieldMetadata(alias="orgCountry")] = None
    org_entry_name: typing_extensions.Annotated[typing.Optional[Orgentryname], FieldMetadata(alias="orgEntryName")] = (
        None
    )
    org_id: typing_extensions.Annotated[typing.Optional[Orgidstring], FieldMetadata(alias="orgId")] = None
    org_logo: typing_extensions.Annotated[typing.Optional[FileContent], FieldMetadata(alias="orgLogo")] = None
    org_name: typing_extensions.Annotated[typing.Optional[Orgname], FieldMetadata(alias="orgName")] = None
    org_parent_id: typing_extensions.Annotated[typing.Optional[OrgParentId], FieldMetadata(alias="orgParentId")] = None
    org_parent_name: typing_extensions.Annotated[
        typing.Optional[OrgParentName], FieldMetadata(alias="orgParentName")
    ] = None
    org_state: typing_extensions.Annotated[typing.Optional[Orgstate], FieldMetadata(alias="orgState")] = None
    org_timezone: typing_extensions.Annotated[typing.Optional[Orgtimezone], FieldMetadata(alias="orgTimezone")] = None
    org_type: typing_extensions.Annotated[typing.Optional[Orgtype], FieldMetadata(alias="orgType")] = None
    org_website: typing_extensions.Annotated[typing.Optional[Orgwebsite], FieldMetadata(alias="orgWebsite")] = None
    org_zip: typing_extensions.Annotated[typing.Optional[Orgzip], FieldMetadata(alias="orgZip")] = None
    recipient_email_notification: typing_extensions.Annotated[
        typing.Optional[RecipientEmailNotification], FieldMetadata(alias="recipientEmailNotification")
    ] = None
    reply_to_email: typing_extensions.Annotated[typing.Optional[ReplyToEmail], FieldMetadata(alias="replyToEmail")] = (
        None
    )
    resumable: typing.Optional[Resumable] = None
    summary: typing.Optional[SummaryOrg] = None
    users: typing.Optional[typing.List[UserQueryRecord]] = None

    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
