# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-06-29T04:59:29+00:00
from __future__ import annotations
from typing import Any, List, Optional
from pydantic import BaseModel, Field, RootModel
class IndexesPostRequest(BaseModel):
primaryKey: Optional[str] = Field(None, examples=['number'])
uid: Optional[str] = Field(None, examples=['books'])
class IndexesBooksPatchRequest(BaseModel):
primaryKey: Optional[str] = Field(None, examples=['title'])
class IndexesBooksDocumentsPostRequestItem(BaseModel):
author: Optional[str] = Field(None, examples=['Jane Austen'])
genre: Optional[str] = Field(None, examples=['romance'])
id: Optional[float] = Field(None, examples=[2])
price: Optional[float] = Field(None, examples=[3.5])
title: Optional[str] = Field(None, examples=['Pride and Prejudice'])
class IndexesBooksDocumentsPostRequest(
RootModel[List[IndexesBooksDocumentsPostRequestItem]]
):
root: List[IndexesBooksDocumentsPostRequestItem] = Field(
...,
examples=[
[
{
'author': 'Jane Austen',
'genre': 'romance',
'id': 2,
'price': 3.5,
'title': 'Pride and Prejudice',
},
{
'author': 'Antoine de Saint-Exupéry',
'genre': 'adventure',
'id': 456,
'price': 10,
'title': 'Le Petit Prince',
},
{
'author': 'Lewis Carroll',
'genre': 'fantasy',
'id': 1,
'price': 25.99,
'title': 'Alice In Wonderland',
},
{
'author': 'J. R. R. Tolkien',
'genre': 'fantasy',
'id': 1344,
'title': 'The Hobbit',
},
{
'author': 'J. K. Rowling',
'genre': 'fantasy',
'id': 4,
'title': 'Harry Potter and the Half-Blood Prince',
},
{
'author': 'Douglas Adams',
'id': 42,
'title': "The Hitchhiker's Guide to the Galaxy",
},
]
],
)
class IndexesBooksDocumentsPutRequestItem(BaseModel):
author: Optional[str] = Field(None, examples=['J. Austen'])
date: Optional[str] = Field(None, examples=['1813'])
id: Optional[float] = Field(None, examples=[2])
class IndexesBooksDocumentsPutRequest(
RootModel[List[IndexesBooksDocumentsPutRequestItem]]
):
root: List[IndexesBooksDocumentsPutRequestItem] = Field(
..., examples=[[{'author': 'J. Austen', 'date': '1813', 'id': 2}]]
)
class IndexesBooksDocumentsDeleteBatchPostRequest(RootModel[List[float]]):
root: List[float] = Field(..., examples=[[1, 2]])
class IndexesBooksSearchPostRequest(BaseModel):
attributesToHighlight: Optional[List[str]] = Field(None, examples=[['title']])
q: Optional[str] = Field(None, examples=[''])
class IndexesBooksSettingsPatchRequest(BaseModel):
displayedAttributes: Optional[List[str]] = Field(
None, examples=[['title', 'author', 'genre', 'price']]
)
filterableAttributes: Optional[List[str]] = Field(
None, examples=[['genre', 'price']]
)
searchableAttributes: Optional[List[str]] = Field(
None, examples=[['title', 'author']]
)
sortableAttributes: Optional[List[str]] = Field(None, examples=[['price']])
stopWords: Optional[List[str]] = Field(None, examples=[['of', 'the']])
class IndexesBooksSettingsDisplayedAttributesPutRequest(RootModel[List[str]]):
root: List[str] = Field(..., examples=[['title']])
class IndexesBooksSettingsFacetingPatchRequest(BaseModel):
maxValuesPerFacet: Optional[float] = Field(None, examples=[3000])
class IndexesBooksSettingsFilterableAttributesPutRequest(RootModel[List[str]]):
root: List[str] = Field(..., examples=[['genre']])
class IndexesBooksSettingsPaginationPatchRequest(BaseModel):
maxTotalHits: Optional[float] = Field(None, examples=[2000])
class IndexesBooksSettingsRankingRulesPutRequest(RootModel[List[str]]):
root: List[str] = Field(..., examples=[['typo']])
class IndexesBooksSettingsSearchableAttributesPutRequest(RootModel[List[str]]):
root: List[str] = Field(..., examples=[['title', 'author']])
class IndexesBooksSettingsSortableAttributesPutRequest(RootModel[List[str]]):
root: List[str] = Field(..., examples=[['price']])
class IndexesBooksSettingsStopWordsGetRequest(RootModel[List[str]]):
root: List[str] = Field(..., examples=[['the']])
class IndexesBooksSettingsStopWordsPutRequest(RootModel[List[str]]):
root: List[str] = Field(..., examples=[['the', 'of']])
class IndexesBooksSettingsSynonymsPutRequest(BaseModel):
harry_potter: Optional[List[str]] = Field(
None, alias='harry potter', examples=[['hp']]
)
hp: Optional[List[str]] = Field(None, examples=[['harry potter']])
class MinWordSizeForTypos(BaseModel):
oneTypo: Optional[float] = Field(None, examples=[2])
twoTypos: Optional[float] = Field(None, examples=[11])
class IndexesBooksSettingsTypoTolerancePatchRequest(BaseModel):
disableOnAttributes: Optional[List[str]] = Field(None, examples=[['genre']])
disableOnWords: Optional[List[str]] = Field(None, examples=[['Prince']])
minWordSizeForTypos: Optional[MinWordSizeForTypos] = None
class IndexesSwapIndexesPostRequestItem(BaseModel):
indexes: Optional[List[str]] = Field(None, examples=[['books', 'books_temp']])
class IndexesSwapIndexesPostRequest(RootModel[List[IndexesSwapIndexesPostRequestItem]]):
root: List[IndexesSwapIndexesPostRequestItem] = Field(
..., examples=[[{'indexes': ['books', 'books_temp']}]]
)
class KeysPostRequest(BaseModel):
actions: Optional[List[str]] = Field(
None, examples=[['documents.add', 'documents.delete']]
)
description: Optional[str] = Field(
None, examples=['Key to add and delete documents, in `books` index.']
)
expiresAt: Optional[Any] = Field(None, examples=[None])
indexes: Optional[List[str]] = Field(None, examples=[['books']])
name: Optional[str] = Field(None, examples=['docs-key'])
class KeysWYZjGJyBcdb0621b97999c233246a8ec0a35d0fcd9a6417ef8ccee0c8978b64b123af2ddPatchRequest(
BaseModel
):
description: Optional[str] = Field(
None,
examples=[
'Key to add and delete documents, but also to create indexes, in `book` index.'
],
)