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

from __future__ import annotations

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

from pydantic import BaseModel, Field


class UpdateLegalTag(BaseModel):
    name: Optional[str] = Field(
        None, description="The name of the LegalTag", example="OSDU-Private-EHCData"
    )
    contractId: Optional[str] = Field(
        None,
        description="The Id of the physical contract associated with the data being ingested.",
        example="No Contract Related",
    )
    description: Optional[str] = Field(
        None,
        description="The optional description if the LegalTag to allow for easier discoverability of Legaltags overtime.",
    )
    expirationDate: Optional[datetime] = Field(
        None,
        description="The optional expiration date of the contract in the format YYYY-MM-DD",
    )
    extensionProperties: Optional[Dict[str, Dict[str, Any]]] = Field(
        None,
        description="The optional object field to attach any company specific attributes.",
    )


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


class Properties(BaseModel):
    countryOfOrigin: Optional[List[str]] = None
    contractId: Optional[str] = None
    expirationDate: Optional[datetime] = None
    originator: Optional[str] = None
    dataType: Optional[str] = None
    securityClassification: Optional[str] = None
    personalData: Optional[str] = None
    exportClassification: Optional[str] = None
    extensionProperties: Optional[Dict[str, Dict[str, Any]]] = None


class RequestLegalTags(BaseModel):
    names: List[str] = Field(
        ...,
        description="The name of all the LegalTags to retrieve.",
        max_items=25,
        min_items=1,
    )


class InvalidTagWithReason(BaseModel):
    name: Optional[str] = Field(None, description="The name of the LegalTag.")
    reason: Optional[str] = Field(
        None, description="The reason the LegalTag is currently invalid."
    )


class InvalidTagsWithReason(BaseModel):
    invalidLegalTags: Optional[List[InvalidTagWithReason]] = Field(
        None, description="A collection of invalid LegalTags"
    )


class SearchLegalTag(BaseModel):
    queryList: Optional[List[str]] = Field(None, description="Filter condition query")
    operatorList: Optional[List[str]] = Field(
        None,
        description="If there are multiple conditions need to be joined in by logical operators",
    )
    sortBy: Optional[str] = None
    sortOrder: Optional[str] = None
    limit: Optional[int] = None


class ReadablePropertyValues(BaseModel):
    countriesOfOrigin: Optional[Dict[str, str]] = Field(
        None,
        description="The values of all the allowed Countries of Origin with the ISO Alpha 2 code and country name.",
    )
    otherRelevantDataCountries: Optional[Dict[str, str]] = Field(
        None,
        description="The values of all the allowed Other Relevant Data Countries with the ISO Alpha 2 code and country name.",
    )
    securityClassifications: Optional[List[str]] = Field(
        None, description="The values of all the allowed Security Classifications."
    )
    exportClassificationControlNumbers: Optional[List[str]] = Field(
        None, description="The name of all the allowed Export Classifications."
    )
    personalDataTypes: Optional[List[str]] = Field(
        None, description="The name of all the allowed Personal Data Type values."
    )
    dataTypes: Optional[List[str]] = Field(
        None, description="The name of all the allowed Data Type values."
    )


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 LegalTagDto(BaseModel):
    name: Optional[str] = Field(
        None, description="The name of the LegalTag", example="OSDU-Private-EHCData"
    )
    description: Optional[str] = Field(
        None, description="The description of the LegalTag"
    )
    properties: Optional[Properties] = None


class LegalTagDtos(BaseModel):
    legalTags: Optional[List[LegalTagDto]] = Field(
        None, description="A collection of complete LegalTags"
    )
