# This file has been generated - DO NOT MODIFY
# API Version : 2.64.0
# generated by datamodel-codegen:
# filename: input.json
from __future__ import annotations
from enum import Enum, IntEnum
from typing import Annotated, Any, Protocol, runtime_checkable
from uuid import UUID
import pandas as pd
from pydantic import AwareDatetime, BaseModel, Field, RootModel, SecretStr
[docs]
class ApiKey(BaseModel):
"""
Response model for an API key.
"""
id: Annotated[UUID, Field(title="Id")]
name: Annotated[str, Field(title="Name")]
created_at: Annotated[AwareDatetime, Field(title="Created At")]
expires_at: Annotated[AwareDatetime, Field(title="Expires At")]
revoked_at: Annotated[AwareDatetime | None, Field(title="Revoked At")] = None
last_used_at: Annotated[AwareDatetime | None, Field(title="Last Used At")] = None
[docs]
class ApiKeyWithPlaintext(BaseModel):
"""
API Key response model that includes the secret for creation.
"""
id: Annotated[UUID, Field(title="Id")]
name: Annotated[str, Field(title="Name")]
created_at: Annotated[AwareDatetime, Field(title="Created At")]
expires_at: Annotated[AwareDatetime, Field(title="Expires At")]
revoked_at: Annotated[AwareDatetime | None, Field(title="Revoked At")] = None
last_used_at: Annotated[AwareDatetime | None, Field(title="Last Used At")] = None
plaintext: Annotated[str, Field(title="Plaintext")]
[docs]
class BulkDeleteRequest(BaseModel):
"""
Request model for bulk job deletion.
"""
job_names: Annotated[list[str], Field(max_length=100, title="Job Names")]
[docs]
class CompatibilityStatus(Enum):
compatible = "compatible"
incompatible = "incompatible"
unknown = "unknown"
[docs]
class ExpirationDays(IntEnum):
"""
Expiration preset in days (choose from 30/60/120/365/3650)
"""
integer_30 = 30
integer_60 = 60
integer_120 = 120
integer_365 = 365
integer_3650 = 3650
[docs]
class CreateApiKeyRequest(BaseModel):
"""
Request body for creating an API key.
"""
name: Annotated[
str,
Field(
description="Human-readable label for the API key",
max_length=255,
min_length=1,
title="Name",
),
]
expiration_days: Annotated[
ExpirationDays,
Field(
description="Expiration preset in days (choose from 30/60/120/365/3650)",
title="Expiration Days",
),
]
[docs]
class CreateApiKeyResponse(BaseModel):
"""
Response for API key creation.
"""
api_key: ApiKeyWithPlaintext
message: Annotated[str, Field(title="Message")]
[docs]
class CreditsInfo(BaseModel):
credits: Annotated[int | None, Field(title="Credits")]
is_credit_enabled: Annotated[bool, Field(title="Is Credit Enabled")]
[docs]
class EnvironmentInfo(BaseModel):
"""
Resolved environment values for the current user.
"""
dataset_expiration_days: Annotated[
int,
Field(
description="Number of days before a dataset expires.",
title="Dataset Expiration Days",
),
]
max_allowed_dimensions_per_dataset: Annotated[
int,
Field(
description="Maximum number of dimensions (columns) allowed per dataset.",
title="Max Allowed Dimensions Per Dataset",
),
]
max_allowed_lines_per_dataset: Annotated[
int,
Field(
description="Maximum number of rows allowed per dataset.",
title="Max Allowed Lines Per Dataset",
),
]
[docs]
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"
[docs]
class FeaturesInfo(BaseModel):
feature_scopes: Annotated[list[FeatureScope], Field(title="Feature Scopes")]
[docs]
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[str | None, Field(title="Jwt Token")] = ""
[docs]
class ForgottenPasswordRequest(BaseModel):
email: Annotated[str, Field(title="Email")]
[docs]
class JobCreateRequest(BaseModel):
set_name: Annotated[UUID, Field(title="Set Name")]
parameters_name: Annotated[str, Field(title="Parameters Name")]
depends_on: Annotated[list[str] | None, Field(title="Depends On")] = []
[docs]
class JobCreateResponse(BaseModel):
name: Annotated[str, Field(title="Name")]
Location: Annotated[str, Field(title="Location")]
[docs]
class JobKind(Enum):
standard = "standard"
privacy_metrics = "privacy_metrics"
signal_metrics = "signal_metrics"
report = "report"
advice = "advice"
[docs]
class JobResponse(BaseModel):
name: Annotated[str, Field(title="Name")]
set_name: Annotated[UUID, Field(title="Set Name")]
parameters_name: Annotated[str, Field(title="Parameters Name")]
display_name: Annotated[str, Field(title="Display Name")]
created_at: Annotated[AwareDatetime, 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[float | None, Field(title="Progress")]
deleted_at: Annotated[AwareDatetime | None, Field(title="Deleted At")] = None
[docs]
class JobResponseList(BaseModel):
jobs: Annotated[list[JobResponse], Field(title="Jobs")]
[docs]
class LoginResponse(BaseModel):
access_token: Annotated[str, Field(title="Access Token")]
refresh_token: Annotated[str | None, Field(title="Refresh Token")] = None
token_type: Annotated[str, Field(title="Token Type")]
[docs]
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")]
[docs]
class ResourceSetResponse(BaseModel):
set_name: Annotated[UUID, Field(title="Set Name")]
display_name: Annotated[str, Field(title="Display Name")]
[docs]
class UserRole(Enum):
admin = "admin"
user = "user"
[docs]
class ValidationError(BaseModel):
loc: Annotated[list[str | int], Field(title="Location")]
msg: Annotated[str, Field(title="Message")]
type: Annotated[str, Field(title="Error Type")]
input: Annotated[Any | None, Field(title="Input")] = None
ctx: Annotated[dict[str, Any] | None, Field(title="Context")] = None
[docs]
class GrantType(RootModel[str]):
root: Annotated[str, Field(pattern="^password$", title="Grant Type")]
[docs]
class Login(BaseModel):
grant_type: Annotated[GrantType | None, Field(title="Grant Type")] = None
username: Annotated[str, Field(title="Username")]
password: Annotated[SecretStr, Field(title="Password")]
scope: Annotated[str | None, Field(title="Scope")] = ""
client_id: Annotated[str | None, Field(title="Client Id")] = None
client_secret: Annotated[SecretStr | None, Field(title="Client Secret")] = None
[docs]
class BulkDeleteResponse(BaseModel):
"""
Response model for bulk job deletion.
"""
deleted_jobs: Annotated[list[JobResponse], Field(title="Deleted Jobs")]
failed_jobs: Annotated[list[str], Field(title="Failed Jobs")]
[docs]
class CompatibilityResponse(BaseModel):
message: Annotated[str, Field(title="Message")]
most_recent_compatible_client: Annotated[
str | None, Field(title="Most Recent Compatible Client")
] = None
status: CompatibilityStatus
[docs]
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[str | None, Field(title="Username")] = None
email: Annotated[str | None, Field(title="Email")] = None
role: UserRole | None = UserRole.user
password: Annotated[str | None, Field(title="Password")] = None
[docs]
class FileAccess(BaseModel):
url: Annotated[str, Field(title="Url")]
credentials: FileCredentials
[docs]
class HTTPValidationError(BaseModel):
detail: Annotated[list[ValidationError] | None, Field(title="Detail")] = None
[docs]
class MeUser(BaseModel):
id: Annotated[UUID, Field(title="Id")]
organization_id: Annotated[UUID, Field(title="Organization Id")]
username: Annotated[str | None, Field(title="Username")] = None
email: Annotated[str | None, Field(title="Email")] = None
role: UserRole | None = UserRole.user
environment: EnvironmentInfo
[docs]
class User(BaseModel):
id: Annotated[UUID, Field(title="Id")]
organization_id: Annotated[UUID, Field(title="Organization Id")]
username: Annotated[str | None, Field(title="Username")] = None
email: Annotated[str | None, Field(title="Email")] = None
role: UserRole | None = UserRole.user
[docs]
@runtime_checkable
class Processor(Protocol):
[docs]
def preprocess(self, df: pd.DataFrame) -> pd.DataFrame: ...
[docs]
def postprocess(self, source: pd.DataFrame, dest: pd.DataFrame) -> pd.DataFrame: ...