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

from typing import Literal, Optional, Union

from pydantic import Field

from .base_model import BaseModel


class GetOAuthClient(BaseModel):
    client: Optional["GetOAuthClientClient"]


class GetOAuthClientClient(BaseModel):
    description: Optional[str]
    name: str
    redirect_url: str = Field(alias="redirectUrl")
    url: Optional[str]
    uuid: str
    owner: Union["GetOAuthClientClientOwnerEntity", "GetOAuthClientClientOwnerUser"] = (
        Field(discriminator="typename__")
    )


class GetOAuthClientClientOwnerEntity(BaseModel):
    typename__: Literal["Entity"] = Field(alias="__typename")
    canonical_name: str = Field(alias="canonicalName")


class GetOAuthClientClientOwnerUser(BaseModel):
    typename__: Literal["User"] = Field(alias="__typename")
    canonical_name: str = Field(alias="canonicalName")
    username: str


GetOAuthClient.model_rebuild()
GetOAuthClientClient.model_rebuild()
