-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathparameters.py
More file actions
47 lines (40 loc) · 1.29 KB
/
parameters.py
File metadata and controls
47 lines (40 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from enum import Enum
from typing import Any
from pydantic import BaseModel, Field
from app.schemas.enum import ProcessTypeEnum
from app.schemas.unit_job import ServiceDetails
class ParamTypeEnum(str, Enum):
DATE_INTERVAL = "date-interval"
BOUNDING_BOX = "bounding-box"
BOOLEAN = "boolean"
STRING = "string"
class ParamRequest(BaseModel):
label: ProcessTypeEnum = Field(
...,
description="Label representing the type of the service",
)
service: ServiceDetails = Field(
..., description="Details of the service for which to retrieve the parameters"
)
class Parameter(BaseModel):
name: str = Field(..., description="Name of the parameter", examples=["param1"])
type: ParamTypeEnum = Field(
...,
description="Data type of the parameter",
examples=[ParamTypeEnum.DATE_INTERVAL],
)
optional: bool = Field(
...,
description="Indicates whether the parameter is optional",
examples=[False],
)
description: str = Field(
...,
description="Description of the parameter",
examples=["This parameter specifies the ..."],
)
default: Any = Field(
None,
description="Default value of the parameter, if any",
examples=["default_value"],
)