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

from ...core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .counterparty_invoice_metrics_status_response import CounterpartyInvoiceMetricsStatusResponse
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class CounterpartyInvoiceMetricsResponse(UniversalBaseModel):
    """
    Examples
    --------
    from mercoa.entity_types import (
        CounterpartyInvoiceMetricsResponse,
        CounterpartyInvoiceMetricsStatusResponse,
    )

    CounterpartyInvoiceMetricsResponse(
        total_count=17,
        total_amount=1700.0,
        statuses=[
            CounterpartyInvoiceMetricsStatusResponse(
                status="PAID",
                total_count=10,
                total_amount=1000.0,
            ),
            CounterpartyInvoiceMetricsStatusResponse(
                status="PENDING",
                total_count=5,
                total_amount=500.0,
            ),
            CounterpartyInvoiceMetricsStatusResponse(
                status="APPROVED",
                total_count=2,
                total_amount=200.0,
            ),
        ],
    )
    """

    total_count: int = pydantic.Field(alias="totalCount")
    total_amount: float = pydantic.Field(alias="totalAmount")
    statuses: typing.List[CounterpartyInvoiceMetricsStatusResponse]

    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
