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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
from .product import Product
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class SourceApplication(UncheckedBaseModel):
    """
    Represents information about the application used to generate a change.
    """

    product: typing.Optional[Product] = pydantic.Field(default=None)
    """
    __Read only__ The [product](entity:Product) type of the application.
    See [Product](#type-product) for possible values
    """

    application_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    __Read only__ The Square-assigned ID of the application. This field is used only if the
    [product](entity:Product) type is `EXTERNAL_API`.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    __Read only__ The display name of the application
    (for example, `"Custom Application"` or `"Square POS 4.74 for Android"`).
    """

    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
