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

from __future__ import annotations

from enum import Enum
from typing import Any, Dict, List, Optional

from pydantic import BaseModel, Field, constr


class Acl(BaseModel):
    viewers: Optional[List[str]] = None
    owners: Optional[List[str]] = None


class Status(Enum):
    compliant = "compliant"
    incompliant = "incompliant"


class Legal(BaseModel):
    legaltags: Optional[List[str]] = Field(None)
    otherRelevantDataCountries: List[str] = Field(...)
    status: Optional[Status] = None


class RecordAncestry(BaseModel):
    parents: Optional[List[str]] = Field(None)


class AppError(BaseModel):
    code: Optional[int] = None
    reason: Optional[str] = None
    message: Optional[str] = None


class GetDatasetStorageInstructionsResponse(BaseModel):
    storageLocation: Optional[Dict[str, Dict[str, Any]]] = None
    providerKey: Optional[str] = None


class GetDatasetRegistryRequest(BaseModel):
    datasetRegistryIds: List[str] = Field(..., max_items=20, min_items=1)


class DatasetRetrievalProperties(BaseModel):
    datasetRegistryId: Optional[str] = None
    retrievalProperties: Optional[Dict[str, Dict[str, Any]]] = None
    providerKey: Optional[str] = None


class RetrievalInstructionsResponse(BaseModel):
    datasets: Optional[List[DatasetRetrievalProperties]] = None


class ConnectedOuterService(BaseModel):
    name: Optional[str] = None
    version: Optional[str] = None


class VersionInfo(BaseModel):
    groupId: Optional[str] = None
    artifactId: Optional[str] = None
    version: Optional[str] = None
    buildTime: Optional[str] = None
    branch: Optional[str] = None
    commitId: Optional[str] = None
    commitMessage: Optional[str] = None
    connectedOuterServices: Optional[List[ConnectedOuterService]] = None


class Record(BaseModel):
    id: Optional[constr(pattern=r"^[\w\-\.]+:[\w\-\.]+:[\w\-\.\:\%]+$")] = None
    version: Optional[int] = None
    kind: Optional[str] = None
    acl: Acl
    legal: Optional[Legal] = None
    data: Dict[str, Dict[str, Any]]
    ancestry: Optional[RecordAncestry] = None
    meta: Optional[List[Dict[str, Dict[str, Any]]]] = None
    tags: Optional[Dict[str, str]] = None


class GetCreateUpdateDatasetRegistryResponse(BaseModel):
    datasetRegistries: Optional[List[Record]] = None


class CreateDatasetRegistryRequest(BaseModel):
    datasetRegistries: List[Record] = Field(..., max_items=20, min_items=1)
