# This file has been generated - DO NOT MODIFY
# API Version : 2.4.0

from __future__ import annotations

from datetime import datetime
from enum import Enum
from typing import Annotated, List, Optional, Protocol, Union, runtime_checkable
from uuid import UUID

import pandas as pd
from pydantic import BaseModel, Field, RootModel

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


class CreditsInfo(BaseModel):
    credits: Annotated[Optional[int], Field(title="Credits")] = None
    is_credit_enabled: Annotated[bool, Field(title="Is Credit Enabled")]


class FeatureScope(Enum):
    avatar_parameters = "avatar_parameters"
    single_table = "single_table"
    multi_table = "multi_table"
    time_series = "time_series"
    report = "report"
    geolocalization = "geolocalization"
    privacy_assessment = "privacy_assessment"
    differential_privacy = "differential_privacy"


class FeaturesInfo(BaseModel):
    feature_scopes: Annotated[List[FeatureScope], Field(title="Feature Scopes")]


class FileCredentials(BaseModel):
    access_key_id: Annotated[str, Field(title="Access Key Id")]
    secret_access_key: Annotated[str, Field(title="Secret Access Key")]
    jwt_token: Annotated[Optional[str], Field(title="Jwt Token")] = ""


class ForgottenPasswordRequest(BaseModel):
    email: Annotated[str, Field(title="Email")]


class JobCreateRequest(BaseModel):
    set_name: Annotated[UUID, Field(title="Set Name")]
    parameters_name: Annotated[str, Field(title="Parameters Name")]
    depends_on: Annotated[Optional[List[str]], Field(title="Depends On")] = []


class JobCreateResponse(BaseModel):
    name: Annotated[str, Field(title="Name")]
    Location: Annotated[str, Field(title="Location")]


class JobKind(Enum):
    standard = "standard"
    privacy_metrics = "privacy_metrics"
    signal_metrics = "signal_metrics"
    report = "report"
    advice = "advice"


class JobResponse(BaseModel):
    name: Annotated[str, Field(title="Name")]
    set_name: Annotated[str, Field(title="Set Name")]
    parameters_name: Annotated[str, Field(title="Parameters Name")]
    created_at: Annotated[datetime, Field(title="Created At")]
    kind: JobKind
    status: Annotated[str, Field(title="Status")]
    exception: Annotated[str, Field(title="Exception")]
    done: Annotated[bool, Field(title="Done")]
    progress: Annotated[Optional[float], Field(title="Progress")] = None


class JobResponseList(BaseModel):
    jobs: Annotated[List[JobResponse], Field(title="Jobs")]


class LoginResponse(BaseModel):
    access_token: Annotated[str, Field(title="Access Token")]
    refresh_token: Annotated[Optional[str], Field(title="Refresh Token")] = None
    token_type: Annotated[str, Field(title="Token Type")]


class ResetPasswordRequest(BaseModel):
    email: Annotated[str, Field(title="Email")]
    new_password: Annotated[str, Field(title="New Password")]
    new_password_repeated: Annotated[str, Field(title="New Password Repeated")]
    token: Annotated[UUID, Field(title="Token")]


class ResourceSetResponse(BaseModel):
    set_name: Annotated[UUID, Field(title="Set Name")]
    display_name: Annotated[str, Field(title="Display Name")]


class UserRole(Enum):
    admin = "admin"
    user = "user"


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


class GrantType(RootModel[str]):
    root: Annotated[str, Field(pattern="^password$", title="Grant Type")]


class Login(BaseModel):
    grant_type: Annotated[Optional[GrantType], Field(title="Grant Type")] = None
    username: Annotated[str, Field(title="Username")]
    password: Annotated[str, Field(title="Password")]
    scope: Annotated[Optional[str], Field(title="Scope")] = ""
    client_id: Annotated[Optional[str], Field(title="Client Id")] = None
    client_secret: Annotated[Optional[str], Field(title="Client Secret")] = None


class CreateDataset(BaseModel):
    file: Annotated[bytes, Field(title="File")]


class CreateUser(BaseModel):
    """
    Create a user, either with an email, or a username.

    The choice will depend on how your server is setup.
    """

    username: Annotated[Optional[str], Field(title="Username")] = None
    email: Annotated[Optional[str], Field(title="Email")] = None
    role: Optional[UserRole] = UserRole.user
    password: Annotated[Optional[str], Field(title="Password")] = None


class FileAccess(BaseModel):
    url: Annotated[str, Field(title="Url")]
    credentials: FileCredentials


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


class User(BaseModel):
    id: Annotated[UUID, Field(title="Id")]
    organization_id: Annotated[UUID, Field(title="Organization Id")]
    username: Annotated[Optional[str], Field(title="Username")] = None
    email: Annotated[Optional[str], Field(title="Email")] = None
    role: Optional[UserRole] = UserRole.user


@runtime_checkable
class Processor(Protocol):
    def preprocess(self, df: pd.DataFrame) -> pd.DataFrame: ...

    def postprocess(self, source: pd.DataFrame, dest: pd.DataFrame) -> pd.DataFrame: ...
