# generated by datamodel-codegen:
#   filename:  schema/entity/services/connections/dashboard/powerBIConnection.json
#   timestamp: 2022-06-14T09:18:33+00:00

from __future__ import annotations

from enum import Enum
from typing import List, Optional

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

from .. import connectionBasicType


class PowerBiType(Enum):
    PowerBI = 'PowerBI'


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

    type: Optional[PowerBiType] = Field(
        PowerBiType.PowerBI, description='Service Type', title='Service Type'
    )
    clientId: str = Field(..., description='client_id for PowerBI.', title='Client ID')
    clientSecret: SecretStr = Field(
        ..., description='clientSecret for PowerBI.', title='Client Secret'
    )
    tenantId: str = Field(..., description='Tenant ID for PowerBI.', title='Tenant ID')
    authorityURI: Optional[str] = Field(
        'https://login.microsoftonline.com/',
        description='Authority URI for the PowerBI service.',
        title='Authority URI',
    )
    hostPort: Optional[AnyUrl] = Field(
        'https://analysis.windows.net/powerbi',
        description='Dashboard URL for PowerBI service.',
        title='Host and Port',
    )
    scope: Optional[List[str]] = Field(
        ['https://analysis.windows.net/powerbi/api/.default'],
        description='PowerBI secrets.',
        title='Scope',
    )
    supportsMetadataExtraction: Optional[
        connectionBasicType.SupportsMetadataExtraction
    ] = Field(None, title='Supports Metadata Extraction')
