# generated by datamodel-codegen:
#   filename:  DataAsset.json

from __future__ import annotations

from enum import Enum
from typing import Any, Literal, Optional, Union

from pydantic import BaseModel, ConfigDict


class Status(Enum):
    pending = 'pending'
    in_progress = 'in-progress'
    done = 'done'
    blocked = 'blocked'


class TodoItem(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    description: str
    status: Status
    owner: Optional[str] = None
    tags: Optional[list[str]] = None
    link: Optional[str] = None


class Metadata(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    name: str
    intent: str
    tags: Optional[list[str]] = None
    todo: Optional[list[TodoItem]] = None


class Contract(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    type: str
    backed_by: Optional[str] = None
    table: Optional[str] = None
    format: Optional[dict[str, Any]] = None


class Severity(Enum):
    critical = 'critical'
    warning = 'warning'
    info = 'info'


class QualityTest(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    name: str
    expect: str
    severity: Optional[Severity] = None


class Override(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    name: str
    expect: str
    severity: Optional[Severity] = None


class Test(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    name: str
    expect: str
    severity: Optional[Severity] = None


class QualityTests(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    extends: Optional[Union[str, list[str]]] = None
    overrides: Optional[list[Override]] = None
    tests: Optional[list[Test]] = None


class DataAsset(BaseModel):
    model_config = ConfigDict(
        extra='forbid',
    )
    kind: Literal['DataAsset']
    schema_version: str
    metadata: Metadata
    contract: Contract
    quality_tests: Optional[Union[list[QualityTest], QualityTests]] = None
    versions: Optional[dict[str, Any]] = None
