# 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_product_price_response_data import BillingProductPriceResponseData


class CreditCompanyGrantView(UniversalBaseModel):
    billing_credit_bundle_id: typing.Optional[str] = None
    billing_credit_id: str
    company_id: str
    company_name: str
    created_at: dt.datetime
    credit_description: str
    credit_icon: typing.Optional[str] = None
    credit_name: str
    expires_at: typing.Optional[dt.datetime] = None
    expiry_type: typing.Optional[str] = None
    expiry_unit: typing.Optional[str] = None
    expiry_unit_count: typing.Optional[int] = None
    grant_reason: str
    id: str
    plan_id: typing.Optional[str] = None
    plan_name: typing.Optional[str] = None
    plural_name: typing.Optional[str] = None
    price: typing.Optional[BillingProductPriceResponseData] = None
    quantity: int
    quantity_remaining: float
    quantity_used: float
    singular_name: typing.Optional[str] = None
    source_label: str
    updated_at: dt.datetime
    valid_from: typing.Optional[dt.datetime] = None
    zeroed_out_date: typing.Optional[dt.datetime] = None
    zeroed_out_reason: typing.Optional[str] = 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
