# Generated by ariadne-codegen
# Source: operations.graphql

from typing import Annotated, List, Literal, Optional, Union

from pydantic import Field

from .base_model import BaseModel
from .enums import EntitlementsStateAccessDeniedReason
from .fragments import (
    CreditEntitlementFragment,
    EntitlementFragment,
    FeatureEntitlementFragment,
)


class GetEntitlementsState(BaseModel):
    entitlements_state: "GetEntitlementsStateEntitlementsState" = Field(
        alias="entitlementsState"
    )


class GetEntitlementsStateEntitlementsState(BaseModel):
    typename__: Literal["EntitlementsState"] = Field(alias="__typename")
    entitlements: List["GetEntitlementsStateEntitlementsStateEntitlements"]
    entitlements_v_2: List[
        Annotated[
            Union[
                "GetEntitlementsStateEntitlementsStateEntitlementsV2CreditEntitlement",
                "GetEntitlementsStateEntitlementsStateEntitlementsV2FeatureEntitlement",
            ],
            Field(discriminator="typename__"),
        ]
    ] = Field(alias="entitlementsV2")
    access_denied_reason: Optional[EntitlementsStateAccessDeniedReason] = Field(
        alias="accessDeniedReason"
    )


class GetEntitlementsStateEntitlementsStateEntitlements(EntitlementFragment):
    pass


class GetEntitlementsStateEntitlementsStateEntitlementsV2CreditEntitlement(
    CreditEntitlementFragment
):
    typename__: Literal["CreditEntitlement"] = Field(alias="__typename")


class GetEntitlementsStateEntitlementsStateEntitlementsV2FeatureEntitlement(
    FeatureEntitlementFragment
):
    typename__: Literal["FeatureEntitlement"] = Field(alias="__typename")


GetEntitlementsState.model_rebuild()
GetEntitlementsStateEntitlementsState.model_rebuild()
