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

from __future__ import annotations

from enum import Enum
from typing import Optional

from pydantic import AnyUrl, BaseModel, Extra, Field, SecretStr

from .. import connectionBasicType


class LookerType(Enum):
    Looker = 'Looker'


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

    type: Optional[LookerType] = Field('Looker', description='Service Type')
    username: str = Field(
        ...,
        description='username to connect  to the Looker. This user should have privileges to read all the metadata in Looker.',
    )
    password: Optional[SecretStr] = Field(
        None, description='password to connect  to the Looker.'
    )
    hostPort: AnyUrl = Field(..., description='URL to Looker instance.')
    env: Optional[str] = Field(None, description='Looker Environment')
    supportsMetadataExtraction: Optional[
        connectionBasicType.SupportsMetadataExtraction
    ] = None
