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

from __future__ import annotations

from enum import Enum
from typing import List, Optional, Union

from pydantic import BaseModel, Field


class BodyCompilePartiallyEvaluateAQueryApiPolicyV1CompilePost(BaseModel):
    file: bytes = Field(..., title="File")


class BodyCreateOrUpdatePartitionPolicyApiPolicyV1PoliciesOsduPartitionDataPartitionPolicyIdPut(
    BaseModel
):
    file: bytes = Field(..., title="File")


class BodyEvaluatePolicyApiPolicyV1EvaluationsQueryPost(BaseModel):
    file: bytes = Field(..., title="File")


class BodyValidatePolicyApiPolicyV1ValidatePolicyIdPut(BaseModel):
    file: bytes = Field(..., title="File")


class Operation(Enum):
    view = "view"
    create = "create"
    update = "update"
    delete = "delete"
    purge = "purge"


class Input(BaseModel):
    operation: Operation = Field(..., title="Operation")
    groups: Optional[List[str]] = Field([""], title="Groups")
    xuserid: Optional[str] = Field("", title="Xuserid")
    token: Optional[str] = Field("", title="Token")
    datapartitionid: Optional[str] = Field("", title="Datapartitionid")


class ServiceDetail(BaseModel):
    version: Optional[str] = Field(..., title="Version")


class Services(BaseModel):
    opa: ServiceDetail


class TranslateItem(BaseModel):
    query: str = Field(..., title="Query")
    input: Input
    unknowns: List[str] = Field(..., title="Unknowns")


class ValidationError(BaseModel):
    loc: List[Union[str, int]] = Field(..., title="Location")
    msg: str = Field(..., title="Message")
    type: str = Field(..., title="Error Type")


class HTTPValidationError(BaseModel):
    detail: Optional[List[ValidationError]] = Field(None, title="Detail")


class InfoOut(BaseModel):
    version: str = Field(..., title="Version")
    artifactId: Optional[str] = Field(..., title="Artifactid")
    name: Optional[str] = Field(..., title="Name")
    groupId: Optional[str] = Field(..., title="Groupid")
    buildTime: Optional[str] = Field(..., title="Buildtime")
    branch: Optional[str] = Field(..., title="Branch")
    commitId: Optional[str] = Field(..., title="Commitid")
    commitMessage: Optional[str] = Field(..., title="Commitmessage")
    connectedOuterServices: Services
