Skip to content

Commit 0ffe1ef

Browse files
authored
Merge pull request #34 from mapswipe/feat/validate-image-tutorial
2 parents 329586d + 178b744 commit 0ffe1ef

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FbValidateImageTutorial:
4+
model: alias
5+
type:
6+
type: object
7+
fields:
8+
projectType:
9+
type:
10+
type: literal
11+
value: 10
12+
customOptions:
13+
optional: true
14+
type:
15+
type: list
16+
elementType: FbObjCustomOption
17+
18+
FbValidateImageTutorialTask:
19+
model: alias
20+
type:
21+
type: object
22+
fields:
23+
groupId:
24+
type: int
25+
projectId:
26+
type: string
27+
referenceAnswer:
28+
type: int
29+
screen:
30+
type: int
31+
geometry: # NOTE: initially empty string
32+
type: string
33+
taskId:
34+
type: string
35+
fileName:
36+
type: string
37+
url:
38+
type: string
39+
40+
width:
41+
type: int
42+
optional: true
43+
height:
44+
type: int
45+
optional: true
46+
annotationId:
47+
# NOTE: using string to handle large integers
48+
type: string
49+
optional: true
50+
bbox:
51+
type:
52+
type: list
53+
elementType: double
54+
optional: true
55+
segmentation:
56+
type:
57+
type: list
58+
elementType:
59+
type: list
60+
elementType: double
61+
optional: true

functions/generated/pyfirebase/pyfirebase_mapswipe/models.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,55 @@ def __setattr__(self, name: str, value: typing.Any) -> None:
957957
super().__setattr__(name, value)
958958

959959

960+
class FbValidateImageTutorial(TypesyncModel):
961+
projectType: typing.Literal[10]
962+
customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED
963+
964+
class Config:
965+
use_enum_values = False
966+
extra = "forbid"
967+
968+
@typing.override
969+
def __setattr__(self, name: str, value: typing.Any) -> None:
970+
if name == "customOptions" and value is None:
971+
raise ValueError("'customOptions' field cannot be set to None")
972+
super().__setattr__(name, value)
973+
974+
975+
class FbValidateImageTutorialTask(TypesyncModel):
976+
groupId: int
977+
projectId: str
978+
referenceAnswer: int
979+
screen: int
980+
geometry: str
981+
taskId: str
982+
fileName: str
983+
url: str
984+
width: int | TypesyncUndefined | None = UNDEFINED
985+
height: int | TypesyncUndefined | None = UNDEFINED
986+
annotationId: str | TypesyncUndefined | None = UNDEFINED
987+
bbox: list[float] | TypesyncUndefined | None = UNDEFINED
988+
segmentation: list[list[float]] | TypesyncUndefined | None = UNDEFINED
989+
990+
class Config:
991+
use_enum_values = False
992+
extra = "forbid"
993+
994+
@typing.override
995+
def __setattr__(self, name: str, value: typing.Any) -> None:
996+
if name == "width" and value is None:
997+
raise ValueError("'width' field cannot be set to None")
998+
if name == "height" and value is None:
999+
raise ValueError("'height' field cannot be set to None")
1000+
if name == "annotationId" and value is None:
1001+
raise ValueError("'annotationId' field cannot be set to None")
1002+
if name == "bbox" and value is None:
1003+
raise ValueError("'bbox' field cannot be set to None")
1004+
if name == "segmentation" and value is None:
1005+
raise ValueError("'segmentation' field cannot be set to None")
1006+
super().__setattr__(name, value)
1007+
1008+
9601009
class FbUserReadonlyType(TypesyncModel):
9611010
"""Represents user fields that cannot be updated from backend"""
9621011

0 commit comments

Comments
 (0)