# generated by datamodel-codegen:
#   filename:  schema/entity/services/connections/serviceConnection.json
#   timestamp: 2022-06-23T06:27:50+00:00

from __future__ import annotations

from typing import Optional, Union

from pydantic import BaseModel, Extra, Field

from .. import dashboardService, databaseService, messagingService, metadataService


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

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


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

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