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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
from .company_entity_type import CompanyEntityType
import datetime as dt
from .company_status import CompanyStatus
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Company(UniversalBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Unique identifier for the company
    """

    external_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    External identifier for the company
    """

    legal_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Legal name of the company
    """

    tin: typing.Optional[str] = pydantic.Field(default=None)
    """
    Tax identification number
    """

    us_state: typing.Optional[str] = pydantic.Field(default=None)
    """
    US state where the company is registered
    """

    entity_type: typing.Optional[CompanyEntityType] = pydantic.Field(default=None)
    """
    Type of business entity
    """

    phone_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    Contact phone number
    """

    developer_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the developer who created this company
    """

    date_created: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Date when the company was created
    """

    google_auth_token: typing.Optional[str] = pydantic.Field(default=None)
    """
    Google authentication token
    """

    admin_user_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    ID of the admin user
    """

    address_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    ID of the company's address
    """

    phone: typing.Optional[str] = pydantic.Field(default=None)
    """
    Alternative phone number
    """

    website: typing.Optional[str] = pydantic.Field(default=None)
    """
    Company website URL
    """

    logo_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL to company logo
    """

    status: typing.Optional[CompanyStatus] = pydantic.Field(default=None)
    """
    Current status of the company
    """

    subscription_plan: typing.Optional[str] = pydantic.Field(default=None)
    """
    Subscription plan of the company
    """

    billing_information: typing.Optional[str] = pydantic.Field(default=None)
    """
    Billing information for the company
    """

    settings_id: typing.Optional[int] = pydantic.Field(default=None)
    """
    ID of the company settings
    """

    new: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Whether the company is newly created
    """

    ledger: typing.Optional[str] = pydantic.Field(default=None)
    """
    Ledger information
    """

    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
