Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions functions/definition/tutorial/validateImage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json

FbValidateImageTutorial:
model: alias
type:
type: object
fields:
projectType:
type:
type: literal
value: 10
customOptions:
optional: true
type:
type: list
elementType: FbObjCustomOption

FbValidateImageTutorialTask:
model: alias
type:
type: object
fields:
groupId:
type: int
projectId:
type: string
referenceAnswer:
type: int
screen:
type: int
geometry: # NOTE: initially empty string
type: string
taskId:
type: string
fileName:
type: string
url:
type: string

width:
type: int
optional: true
height:
type: int
optional: true
annotationId:
# NOTE: using string to handle large integers
type: string
optional: true
bbox:
type:
type: list
elementType: double
optional: true
segmentation:
type:
type: list
elementType:
type: list
elementType: double
optional: true
49 changes: 49 additions & 0 deletions functions/generated/pyfirebase/pyfirebase_mapswipe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,55 @@ def __setattr__(self, name: str, value: typing.Any) -> None:
super().__setattr__(name, value)


class FbValidateImageTutorial(TypesyncModel):
projectType: typing.Literal[10]
customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED

class Config:
use_enum_values = False
extra = "forbid"

@typing.override
def __setattr__(self, name: str, value: typing.Any) -> None:
if name == "customOptions" and value is None:
raise ValueError("'customOptions' field cannot be set to None")
super().__setattr__(name, value)


class FbValidateImageTutorialTask(TypesyncModel):
groupId: int
projectId: str
referenceAnswer: int
screen: int
geometry: str
taskId: str
fileName: str
url: str
width: int | TypesyncUndefined | None = UNDEFINED
height: int | TypesyncUndefined | None = UNDEFINED
annotationId: str | TypesyncUndefined | None = UNDEFINED
bbox: list[float] | TypesyncUndefined | None = UNDEFINED
segmentation: list[list[float]] | TypesyncUndefined | None = UNDEFINED

class Config:
use_enum_values = False
extra = "forbid"

@typing.override
def __setattr__(self, name: str, value: typing.Any) -> None:
if name == "width" and value is None:
raise ValueError("'width' field cannot be set to None")
if name == "height" and value is None:
raise ValueError("'height' field cannot be set to None")
if name == "annotationId" and value is None:
raise ValueError("'annotationId' field cannot be set to None")
if name == "bbox" and value is None:
raise ValueError("'bbox' field cannot be set to None")
if name == "segmentation" and value is None:
raise ValueError("'segmentation' field cannot be set to None")
super().__setattr__(name, value)


class FbUserReadonlyType(TypesyncModel):
"""Represents user fields that cannot be updated from backend"""

Expand Down