Skip to content

Commit 329586d

Browse files
authored
Merge pull request #31 from mapswipe/feature/validate-image
2 parents f966bf8 + cb56c25 commit 329586d

File tree

2 files changed

+56
-4
lines changed

2 files changed

+56
-4
lines changed

functions/definition/models.yaml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ FbEnumOverlayTileServerType:
1212
- label: 'VECTOR'
1313
value: 'vector'
1414

15+
FbEnumValidateImageInputType:
16+
model: alias
17+
type:
18+
type: enum
19+
members:
20+
- label: 'DIRECT_IMAGES'
21+
value: 'direct_images'
22+
- label: 'DATASET_FILE'
23+
value: 'dataset_file'
24+
1525
FbEnumValidateInputType:
1626
model: alias
1727
type:
@@ -488,9 +498,32 @@ FbMappingTaskValidateImageCreateOnlyInput:
488498
fields:
489499
taskId:
490500
type: string
491-
question:
501+
url:
502+
type: string
503+
fileName:
504+
type: string
505+
width:
506+
type: int
507+
optional: true
508+
height:
509+
type: int
510+
optional: true
511+
annotationId:
512+
# NOTE: using string to handle large integers
492513
type: string
493514
optional: true
515+
bbox:
516+
type:
517+
type: list
518+
elementType: double
519+
optional: true
520+
segmentation:
521+
type:
522+
type: list
523+
elementType:
524+
type: list
525+
elementType: double
526+
optional: true
494527

495528
FbMappingTaskCompareCreateOnlyInput:
496529
model: alias

functions/generated/pyfirebase/pyfirebase_mapswipe/models.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ class FbEnumOverlayTileServerType(enum.Enum):
8585
VECTOR = "vector"
8686

8787

88+
class FbEnumValidateImageInputType(enum.Enum):
89+
DIRECT_IMAGES = "direct_images"
90+
DATASET_FILE = "dataset_file"
91+
92+
8893
class FbEnumValidateInputType(enum.Enum):
8994
AOI_FILE = "aoi_file"
9095
LINK = "link"
@@ -547,16 +552,30 @@ class FbMappingTaskValidateImageCreateOnlyInput(TypesyncModel):
547552
"""Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task"""
548553

549554
taskId: str
550-
question: str | TypesyncUndefined | None = UNDEFINED
555+
url: str
556+
fileName: str
557+
width: int | TypesyncUndefined | None = UNDEFINED
558+
height: int | TypesyncUndefined | None = UNDEFINED
559+
annotationId: str | TypesyncUndefined | None = UNDEFINED
560+
bbox: list[float] | TypesyncUndefined | None = UNDEFINED
561+
segmentation: list[list[float]] | TypesyncUndefined | None = UNDEFINED
551562

552563
class Config:
553564
use_enum_values = False
554565
extra = "forbid"
555566

556567
@typing.override
557568
def __setattr__(self, name: str, value: typing.Any) -> None:
558-
if name == "question" and value is None:
559-
raise ValueError("'question' field cannot be set to None")
569+
if name == "width" and value is None:
570+
raise ValueError("'width' field cannot be set to None")
571+
if name == "height" and value is None:
572+
raise ValueError("'height' field cannot be set to None")
573+
if name == "annotationId" and value is None:
574+
raise ValueError("'annotationId' field cannot be set to None")
575+
if name == "bbox" and value is None:
576+
raise ValueError("'bbox' field cannot be set to None")
577+
if name == "segmentation" and value is None:
578+
raise ValueError("'segmentation' field cannot be set to None")
560579
super().__setattr__(name, value)
561580

562581

0 commit comments

Comments
 (0)