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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .channel_status import ChannelStatus
from .reference import Reference


class Channel(UncheckedBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The channel's unique ID.
    """

    merchant_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The unique ID of the merchant this channel belongs to.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the channel.
    """

    version: typing.Optional[int] = pydantic.Field(default=None)
    """
    The version number which is incremented each time an update is made to the channel.
    """

    reference: typing.Optional[Reference] = pydantic.Field(default=None)
    """
    Represents an entity the channel is associated with.
    """

    status: typing.Optional[ChannelStatus] = pydantic.Field(default=None)
    """
    Status of the channel.
    See [Status](#type-status) for possible values
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp for when the channel was created, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z").
    For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp for when the channel was last updated, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z").
    For more information, see [Working with Dates](https://developer.squareup.com/docs/build-basics/working-with-dates).
    """

    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
