# 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 .billing_credit_expiry_type import BillingCreditExpiryType
from .billing_credit_expiry_unit import BillingCreditExpiryUnit
from .billing_plan_credit_grant_reset_cadence import BillingPlanCreditGrantResetCadence
from .billing_plan_credit_grant_reset_start import BillingPlanCreditGrantResetStart
from .billing_plan_credit_grant_reset_type import BillingPlanCreditGrantResetType


class BillingPlanCreditGrantResponseData(UniversalBaseModel):
    auto_topup_amount: typing.Optional[int] = None
    auto_topup_amount_type: typing.Optional[str] = None
    auto_topup_enabled: bool
    auto_topup_expiry_type: typing.Optional[BillingCreditExpiryType] = None
    auto_topup_expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None
    auto_topup_expiry_unit_count: typing.Optional[int] = None
    auto_topup_threshold_percent: typing.Optional[int] = None
    created_at: dt.datetime
    credit_amount: int
    credit_id: str
    credit_name: str
    credit_plural_name: typing.Optional[str] = None
    credit_singular_name: typing.Optional[str] = None
    expiry_type: typing.Optional[BillingCreditExpiryType] = None
    expiry_unit: typing.Optional[BillingCreditExpiryUnit] = None
    expiry_unit_count: typing.Optional[int] = None
    id: str
    plan_id: str
    plan_name: str
    reset_cadence: BillingPlanCreditGrantResetCadence
    reset_start: BillingPlanCreditGrantResetStart
    reset_type: typing.Optional[BillingPlanCreditGrantResetType] = None
    updated_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
