# generated by datamodel-codegen:
#   filename:  schema/entity/services/connections/database/trinoConnection.json
#   timestamp: 2022-08-23T15:52:10+00:00

from __future__ import annotations

from enum import Enum
from typing import Dict, Optional

from pydantic import BaseModel, Extra, Field, SecretStr

from .. import connectionBasicType


class TrinoType(Enum):
    Trino = 'Trino'


class TrinoScheme(Enum):
    trino = 'trino'


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

    type: Optional[TrinoType] = Field(
        TrinoType.Trino, description='Service Type', title='Service Type'
    )
    scheme: Optional[TrinoScheme] = Field(
        TrinoScheme.trino,
        description='SQLAlchemy driver scheme options.',
        title='Connection Scheme',
    )
    username: str = Field(
        ...,
        description='Username to connect to Trino. This user should have privileges to read all the metadata in Trino.',
        title='Username',
    )
    password: Optional[SecretStr] = Field(
        None, description='Password to connect to Trino.', title='Password'
    )
    hostPort: str = Field(
        ..., description='Host and port of the Trino service.', title='Host and Port'
    )
    catalog: str = Field(
        ..., description='Catalog of the data source.', title='Catalog'
    )
    databaseSchema: Optional[str] = Field(
        None,
        description='databaseSchema of the data source. This is optional parameter, if you would like to restrict the metadata reading to a single databaseSchema. When left blank, OpenMetadata Ingestion attempts to scan all the databaseSchema.',
        title='databaseSchema',
    )
    proxies: Optional[Dict[str, str]] = Field(
        None,
        description='Proxies for the connection to Trino data source',
        title='Proxies',
    )
    params: Optional[Dict[str, str]] = Field(
        None,
        description='URL parameters for connection to the Trino data source',
        title='URL Parameters',
    )
    connectionOptions: Optional[connectionBasicType.ConnectionOptions] = Field(
        None, title='Connection Options'
    )
    connectionArguments: Optional[connectionBasicType.ConnectionArguments] = Field(
        None, title='Connection Arguments'
    )
    supportsMetadataExtraction: Optional[
        connectionBasicType.SupportsMetadataExtraction
    ] = Field(None, title='Supports Metadata Extraction')
    supportsProfiler: Optional[connectionBasicType.SupportsProfiler] = Field(
        None, title='Supports Profiler'
    )
    supportsDatabase: Optional[connectionBasicType.SupportsDatabase] = Field(
        None, title='Supports Profiler'
    )
