# generated by datamodel-codegen:
#   filename:  schema/entity/services/connections/dashboard/redashConnection.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

from .. import connectionBasicType


class RedashType(Enum):
    Redash = 'Redash'


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

    type: Optional[RedashType] = Field('Redash', description='Service Type')
    username: str = Field(..., description='username for the Redash')
    hostPort: AnyUrl = Field(..., description='URL for the redash instance')
    apiKey: str = Field(..., description='API key of the redash instance to access.')
    supportsMetadataExtraction: Optional[
        connectionBasicType.SupportsMetadataExtraction
    ] = None
