# Generated by ariadne-codegen
# Source: openhexa/graphql/queries.graphql

from typing import List, Literal, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import UpdateConnectionError


class UpdateConnection(BaseModel):
    update_connection: "UpdateConnectionUpdateConnection" = Field(
        alias="updateConnection"
    )


class UpdateConnectionUpdateConnection(BaseModel):
    success: bool
    errors: List[UpdateConnectionError]
    connection: Optional["UpdateConnectionUpdateConnectionConnection"]


class UpdateConnectionUpdateConnectionConnection(BaseModel):
    typename__: Literal[
        "Connection",
        "CustomConnection",
        "DHIS2Connection",
        "GCSConnection",
        "IASOConnection",
        "PostgreSQLConnection",
        "S3Connection",
    ] = Field(alias="__typename")
    id: str
    name: str
    slug: str
    description: Optional[str]
    fields: List["UpdateConnectionUpdateConnectionConnectionFields"]


class UpdateConnectionUpdateConnectionConnectionFields(BaseModel):
    code: str
    value: Optional[str]
    secret: bool


UpdateConnection.model_rebuild()
UpdateConnectionUpdateConnection.model_rebuild()
UpdateConnectionUpdateConnectionConnection.model_rebuild()
