# generated by datamodel-codegen:
#   filename:  schema/entity/services/connections/dashboard/metabaseConnection.json
#   timestamp: 2022-04-20T15:52:56+00:00

from __future__ import annotations

from enum import Enum
from typing import Any, Optional

from pydantic import BaseModel, Extra, Field, SecretStr

from .. import connectionBasicType


class MetabaseType(Enum):
    Metabase = 'Metabase'


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

    type: Optional[MetabaseType] = Field('Metabase', description='Service Type')
    username: str = Field(
        ...,
        description='username to connect  to the Metabase. This user should have privileges to read all the metadata in Metabase.',
    )
    password: Optional[SecretStr] = Field(
        None, description='password to connect  to the Metabase.'
    )
    hostPort: Any = Field(..., description='Host and Port of Metabase instance.')
    dbServiceName: Optional[str] = Field(
        None, description='Database Service Name for creation of lineage'
    )
    supportsMetadataExtraction: Optional[
        connectionBasicType.SupportsMetadataExtraction
    ] = None
