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

from typing import Literal, Optional, Union

from pydantic import Field

from .base_model import BaseModel
from .enums import Currency, PaymentInterval, PaymentStatus
from .fragments import BillingAddress


class CreateRenewalPaymentIntent(BaseModel):
    intent: Union[
        "CreateRenewalPaymentIntentIntentPaymentIntent",
        "CreateRenewalPaymentIntentIntentStripePaymentIntent",
    ] = Field(discriminator="typename__")


class CreateRenewalPaymentIntentIntentPaymentIntent(BaseModel):
    typename__: Literal["PaymentIntent"] = Field(alias="__typename")
    subscription: "CreateRenewalPaymentIntentIntentPaymentIntentSubscription"
    billing_address: "CreateRenewalPaymentIntentIntentPaymentIntentBillingAddress" = (
        Field(alias="billingAddress")
    )
    idempotency_key: str = Field(alias="idempotencyKey")
    tax_rate: Optional[float] = Field(alias="taxRate")
    tax_due: int = Field(alias="taxDue")
    total_due: int = Field(alias="totalDue")


class CreateRenewalPaymentIntentIntentPaymentIntentSubscription(BaseModel):
    user: "CreateRenewalPaymentIntentIntentPaymentIntentSubscriptionUser"
    currency: Currency
    interval: PaymentInterval
    product: "CreateRenewalPaymentIntentIntentPaymentIntentSubscriptionProduct"
    price: "CreateRenewalPaymentIntentIntentPaymentIntentSubscriptionPrice"
    subtotal: int


class CreateRenewalPaymentIntentIntentPaymentIntentSubscriptionUser(BaseModel):
    payment_status: PaymentStatus = Field(alias="paymentStatus")


class CreateRenewalPaymentIntentIntentPaymentIntentSubscriptionProduct(BaseModel):
    id: int
    name: str


class CreateRenewalPaymentIntentIntentPaymentIntentSubscriptionPrice(BaseModel):
    currency: Currency
    amount: int


class CreateRenewalPaymentIntentIntentPaymentIntentBillingAddress(BillingAddress):
    pass


class CreateRenewalPaymentIntentIntentStripePaymentIntent(BaseModel):
    typename__: Literal["StripePaymentIntent"] = Field(alias="__typename")
    subscription: "CreateRenewalPaymentIntentIntentStripePaymentIntentSubscription"
    billing_address: (
        "CreateRenewalPaymentIntentIntentStripePaymentIntentBillingAddress"
    ) = Field(alias="billingAddress")
    idempotency_key: str = Field(alias="idempotencyKey")
    tax_rate: Optional[float] = Field(alias="taxRate")
    tax_due: int = Field(alias="taxDue")
    total_due: int = Field(alias="totalDue")
    public_key: Optional[str] = Field(alias="publicKey")
    client_secret: Optional[str] = Field(alias="clientSecret")


class CreateRenewalPaymentIntentIntentStripePaymentIntentSubscription(BaseModel):
    user: "CreateRenewalPaymentIntentIntentStripePaymentIntentSubscriptionUser"
    currency: Currency
    interval: PaymentInterval
    product: "CreateRenewalPaymentIntentIntentStripePaymentIntentSubscriptionProduct"
    price: "CreateRenewalPaymentIntentIntentStripePaymentIntentSubscriptionPrice"
    subtotal: int


class CreateRenewalPaymentIntentIntentStripePaymentIntentSubscriptionUser(BaseModel):
    payment_status: PaymentStatus = Field(alias="paymentStatus")


class CreateRenewalPaymentIntentIntentStripePaymentIntentSubscriptionProduct(BaseModel):
    id: int
    name: str


class CreateRenewalPaymentIntentIntentStripePaymentIntentSubscriptionPrice(BaseModel):
    currency: Currency
    amount: int


class CreateRenewalPaymentIntentIntentStripePaymentIntentBillingAddress(BillingAddress):
    pass


CreateRenewalPaymentIntent.model_rebuild()
CreateRenewalPaymentIntentIntentPaymentIntent.model_rebuild()
CreateRenewalPaymentIntentIntentPaymentIntentSubscription.model_rebuild()
CreateRenewalPaymentIntentIntentStripePaymentIntent.model_rebuild()
CreateRenewalPaymentIntentIntentStripePaymentIntentSubscription.model_rebuild()
