# 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


class BillingCouponResponseData(UniversalBaseModel):
    account_id: str
    amount_off: typing.Optional[int] = None
    currency: typing.Optional[str] = None
    duration: typing.Optional[str] = None
    duration_in_months: typing.Optional[int] = None
    environment_id: str
    external_id: str
    id: str
    is_active: bool
    max_redemptions: typing.Optional[int] = None
    metadata: typing.Dict[str, typing.Optional[typing.Any]]
    name: str
    percent_off: typing.Optional[float] = None
    times_redeemed: int
    valid_from: typing.Optional[dt.datetime] = None
    valid_until: typing.Optional[dt.datetime] = 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
