# generated by datamodel-codegen:
#   filename:  swagger.yaml
#   timestamp: 2024-07-12T07:32:24+00:00

from __future__ import annotations

from typing import Any, Dict, List, Optional, Union

from pydantic import BaseModel, Field


class Acl(BaseModel):
    viewers: List[str] = Field(..., title="Viewers")
    owners: List[str] = Field(..., title="Owners")


class InfoResponse(BaseModel):
    name: Optional[str] = Field(None, title="Name")
    app_version: Optional[str] = Field(None, title="App Version")
    build_time: Optional[str] = Field(None, title="Build Time")
    branch: Optional[str] = Field(None, title="Branch")
    commit_id: Optional[str] = Field(None, title="Commit Id")
    commit_message: Optional[str] = Field(None, title="Commit Message")
    release_version: Optional[str] = Field(None, title="Release Version")


class Legal(BaseModel):
    legaltags: List[str] = Field(..., title="Legaltags")
    otherRelevantDataCountries: List[str] = Field(
        ..., title="Otherrelevantdatacountries"
    )
    status: Optional[str] = Field(None, title="Status")


class OsduStorageRecord(BaseModel):
    id: Optional[str] = Field(None, title="Id")
    kind: str = Field(..., title="Kind")
    acl: Acl
    legal: Legal
    data: Dict[str, Any] = Field(..., title="Data")
    meta: Optional[List] = Field(None, title="Meta")
    ancestry: Optional[Dict[str, Any]] = Field(None, title="Ancestry")
    tags: Optional[Dict[str, Any]] = Field(None, title="Tags")
    version: Optional[int] = Field(None, title="Version")
    createUser: Optional[str] = Field(None, title="Createuser")
    createTime: Optional[str] = Field(None, title="Createtime")
    modifyUser: Optional[str] = Field(None, title="Modifyuser")
    modifyTime: Optional[str] = Field(None, title="Modifytime")


class StorageUpsertResponse(BaseModel):
    record_count: int = Field(..., title="Record Count")
    record_id_versions: List[str] = Field(..., title="Record Id Versions")
    skipped_record_count: int = Field(..., title="Skipped Record Count")


class ValidationError(BaseModel):
    loc: List[Union[str, int]]
    msg: str
    type: str


class HTTPValidationError(BaseModel):
    errors: Optional[List[ValidationError]] = None
