# Generated by ariadne-codegen
# Source: metasrht/graphql/

from datetime import datetime
from typing import Annotated, Optional

from pydantic import BeforeValidator, Field
from srht.graphql import gql_time

from .base_model import BaseModel
from .enums import PaymentStatus
from .fragments import BillingAddress, Product


class GetBillingSetup(BaseModel):
    products: list["GetBillingSetupProducts"]
    user: "GetBillingSetupUser"


class GetBillingSetupProducts(Product):
    pass


class GetBillingSetupUser(BaseModel):
    payment_due: Optional[Annotated[datetime, BeforeValidator(gql_time)]] = Field(
        alias="paymentDue"
    )
    payment_status: PaymentStatus = Field(alias="paymentStatus")
    invoices: "GetBillingSetupUserInvoices"
    billing_address: Optional["GetBillingSetupUserBillingAddress"] = Field(
        alias="billingAddress"
    )


class GetBillingSetupUserInvoices(BaseModel):
    results: list["GetBillingSetupUserInvoicesResults"]


class GetBillingSetupUserInvoicesResults(BaseModel):
    id: int


class GetBillingSetupUserBillingAddress(BillingAddress):
    pass


GetBillingSetup.model_rebuild()
GetBillingSetupUser.model_rebuild()
GetBillingSetupUserInvoices.model_rebuild()
