# generated by datamodel-codegen:
#   filename:  schema/entity/services/connections/serviceConnection.json
#   timestamp: 2022-06-14T09:18:33+00:00

from __future__ import annotations

from typing import Optional, Union

from pydantic import BaseModel, Extra, Field

from .. import (
    dashboardService,
    databaseService,
    messagingService,
    metadataService,
    pipelineService,
)


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

    __root__: Union[
        dashboardService.DashboardConnection,
        databaseService.DatabaseConnection,
        messagingService.MessagingConnection,
        metadataService.MetadataConnection,
        pipelineService.PipelineConnection,
    ] = Field(..., description='Supported services')


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

    serviceConnection: Optional[ServiceConnection] = Field(
        None, description='Service Connection.'
    )
