# generated by datamodel-codegen:
#   filename:  schema/api/services/ingestionPipelines/testServiceConnection.json
#   timestamp: 2022-06-23T06:27:50+00:00

from __future__ import annotations

from enum import Enum
from typing import Optional, Union

from pydantic import BaseModel, Extra, Field

from ....entity.services import dashboardService, databaseService, messagingService


class ConnectionType1(Enum):
    Database = 'Database'
    Dashboard = 'Dashboard'
    Messaging = 'Messaging'


class TestServiceConnectionRequest(BaseModel):
    class Config:
        extra = Extra.forbid

    connection: Optional[
        Union[
            databaseService.DatabaseConnection,
            dashboardService.DashboardConnection,
            messagingService.MessagingConnection,
        ]
    ] = Field(None, description='Database Connection.')
    connectionType: Optional[ConnectionType1] = Field(
        None,
        description='Type of database service such as MySQL, BigQuery, Snowflake, Redshift, Postgres...',
    )
