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

from ...common.types.base import Base
from ...organization_base.types.organization_id import OrganizationId
import pydantic
from .billing_month import BillingMonth
import datetime as dt
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import typing


class Billing(Base):
    """
    Billing report covering total usage for a specific month.
    """

    organization_id: OrganizationId = pydantic.Field()
    """
    Organization being billed.
    """

    month: BillingMonth = pydantic.Field()
    """
    Billing report month. Full reports are available for the previous 12 months and a partial report for the current month-to-date.
    """

    report_date: dt.datetime = pydantic.Field()
    """
    Billing report generation date
    """

    csv_data: str = pydantic.Field()
    """
    Total usage for all Accounts and Integrations within the Organization, exported in comma-separated values (CSV) format. Columns include Organization name, Account names, Integration names, Environment, successful and failed requests, and total ingress and egress amounts in bytes.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow
