# 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, UniversalBaseModel
from .plan_tier import PlanTier


class BillingStateResponse(UniversalBaseModel):
    billing_id: str
    organization_id: str
    plan_tier: PlanTier
    current_period_start: typing.Optional[dt.datetime] = None
    current_period_end: typing.Optional[dt.datetime] = None
    included_credits_this_period: int
    credits_consumed_this_period: int
    cached_credits_consumed_this_period: int
    overage_enabled: bool
    browser_uptime_seconds_consumed: int
    topup_credits_total: int
    topup_credits_used: int
    topup_credits_remaining: int
    credits_remaining: int
    cancel_at_period_end: typing.Optional[bool] = None
    created_at: dt.datetime
    modified_at: dt.datetime

    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
