"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from fermisdk.types import BaseModel
import pydantic
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


TestConnectionRequestDatabaseType = Literal[
    "mysql",
    "postgresql",
    "mssql",
    "oracle",
    "mariadb",
]


class TestConnectionRequestConnectionTypedDict(TypedDict):
    __test__ = False  # pyright: ignore[reportGeneralTypeIssues]

    host: str
    port: int
    database: str
    username: str
    password: str
    use_ssl: NotRequired[bool]
    ssl_mode: NotRequired[str]


class TestConnectionRequestConnection(BaseModel):
    __test__ = False

    host: str

    port: int

    database: str

    username: str

    password: str

    use_ssl: Annotated[Optional[bool], pydantic.Field(alias="useSSL")] = None

    ssl_mode: Annotated[Optional[str], pydantic.Field(alias="sslMode")] = None


class TestConnectionRequestTypedDict(TypedDict):
    __test__ = False  # pyright: ignore[reportGeneralTypeIssues]

    database_type: TestConnectionRequestDatabaseType
    connection: TestConnectionRequestConnectionTypedDict


class TestConnectionRequest(BaseModel):
    __test__ = False

    database_type: Annotated[
        TestConnectionRequestDatabaseType, pydantic.Field(alias="databaseType")
    ]

    connection: TestConnectionRequestConnection
