# 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 Currency, PaymentStatus, SubscriptionStatus
from .fragments import Product


class GetProductSelection(BaseModel):
    me: "GetProductSelectionMe"
    products: list["GetProductSelectionProducts"]


class GetProductSelectionMe(BaseModel):
    payment_status: PaymentStatus = Field(alias="paymentStatus")
    payment_due: Optional[Annotated[datetime, BeforeValidator(gql_time)]] = Field(
        alias="paymentDue"
    )
    subscription: Optional["GetProductSelectionMeSubscription"]


class GetProductSelectionMeSubscription(BaseModel):
    autorenew: bool
    currency: Currency
    status: SubscriptionStatus
    updated: Annotated[datetime, BeforeValidator(gql_time)]
    product: "GetProductSelectionMeSubscriptionProduct"


class GetProductSelectionMeSubscriptionProduct(BaseModel):
    retired: bool


class GetProductSelectionProducts(Product):
    pass


GetProductSelection.model_rebuild()
GetProductSelectionMe.model_rebuild()
GetProductSelectionMeSubscription.model_rebuild()
