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

import datetime as dt
import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .billing_limits import BillingLimits
from .billing_usage import BillingUsage
from .stripe_provider import StripeProvider
from .subscription import Subscription


class Billing(UncheckedBaseModel):
    provider: typing.Optional[StripeProvider] = None
    subscriptions: typing.Optional[typing.List[Subscription]] = None
    renewal_date: typing.Optional[dt.datetime] = None
    limits: typing.Optional[BillingLimits] = None
    usage: typing.Optional[BillingUsage] = None
    credits: typing.Optional[int] = 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
