2023-11-07 16:03:50 +03:00
|
|
|
from uuid import UUID
|
|
|
|
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
2023-11-08 18:07:21 +03:00
|
|
|
class ApiBrainDefinitionSchemaProperty(BaseModel):
|
|
|
|
type: str
|
|
|
|
description: str
|
|
|
|
enum: list
|
|
|
|
name: str
|
|
|
|
required: bool
|
|
|
|
|
|
|
|
|
|
|
|
class ApiBrainDefinitionSchema(BaseModel):
|
|
|
|
properties: list[ApiBrainDefinitionSchemaProperty]
|
|
|
|
required: list[str]
|
|
|
|
|
|
|
|
|
|
|
|
class ApiBrainDefinitionSecret(BaseModel):
|
|
|
|
name: str
|
|
|
|
type: str
|
|
|
|
|
|
|
|
|
2023-11-07 16:03:50 +03:00
|
|
|
class ApiBrainDefinition(BaseModel):
|
|
|
|
brain_id: UUID
|
|
|
|
method: str
|
|
|
|
url: str
|
2023-11-08 18:07:21 +03:00
|
|
|
params: ApiBrainDefinitionSchema
|
|
|
|
search_params: ApiBrainDefinitionSchema
|
|
|
|
secrets: list[ApiBrainDefinitionSecret]
|