# generated by datamodel-codegen:
#   filename:  entity/teams/authN/ssoAuth.json
#   timestamp: 2022-10-04T14:49:18+00:00

from __future__ import annotations

from enum import Enum
from typing import Optional, Union

from pydantic import BaseModel, Extra, Field

from ....security.client import (
    auth0SSOClientConfig,
    azureSSOClientConfig,
    customOidcSSOClientConfig,
    googleSSOClientConfig,
    oktaSSOClientConfig,
)


class SsoServiceType(Enum):
    google = 'google'
    okta = 'okta'
    auth0 = 'auth0'
    custom_oidc = 'custom-oidc'
    azure = 'azure'
    basic = 'basic'


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

    ssoServiceType: Optional[SsoServiceType] = Field(
        None, description='Type of database service such as Amundsen, Atlas...'
    )
    authConfig: Optional[
        Union[
            googleSSOClientConfig.GoogleSSOClientConfig,
            oktaSSOClientConfig.OktaSSOClientConfig,
            auth0SSOClientConfig.Auth0SSOClientConfig,
            azureSSOClientConfig.AzureSSOClientConfig,
            customOidcSSOClientConfig.CustomOIDCSSOClientConfig,
        ]
    ] = Field(None, description='The authentication configuration used by the SSO')
