Skip to content

Commit 3b5081a

Browse files
authored
Merge pull request #50 from mapswipe/feature/locate-project-type
Feat/Locate feature Schema
2 parents 8b0d683 + 3d079b6 commit 3b5081a

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

functions/definition/project/common.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ FbEnumProjectType:
4040
value: 4
4141
- label: 'STREET'
4242
value: 7
43+
- label: 'LOCATE'
44+
value: 9
4345

4446
FbProjectReadonlyType:
4547
model: alias
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json
2+
3+
FBEnumSubGridSize:
4+
model: alias
5+
type:
6+
type: enum
7+
members:
8+
- label: 'SIZE_2X2'
9+
value: '2x2'
10+
- label: 'SIZE_4X4'
11+
value: '4x4'
12+
- label: 'SIZE_8X8'
13+
value: '8x8'
14+
15+
16+
FbProjectLocateCreateOnlyInput:
17+
model: alias
18+
docs: Represents LOCATE project fields that are valid while creating a project
19+
type:
20+
type: object
21+
fields:
22+
zoomLevel:
23+
type: int
24+
tileServer:
25+
type: FbObjRasterTileServer
26+
subGridSize:
27+
type: FBEnumSubGridSize
28+
customOptions:
29+
optional: true
30+
type:
31+
type: list
32+
elementType: FbObjCustomOption
33+
exportMetaKey:
34+
type: string
35+
exportMetaValue:
36+
type: string

functions/generated/pyfirebase/pyfirebase_mapswipe/models.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ class FbEnumProjectType(enum.Enum):
122122
COMPARE = 3
123123
COMPLETENESS = 4
124124
STREET = 7
125+
LOCATE = 9
125126

126127

127128
class FbProjectReadonlyType(TypesyncModel):
@@ -356,6 +357,12 @@ class FbEnumOverlayTileServerType(enum.Enum):
356357
VECTOR = "vector"
357358

358359

360+
class FBEnumSubGridSize(enum.Enum):
361+
SIZE_2X2 = "2x2"
362+
SIZE_4X4 = "4x4"
363+
SIZE_8X8 = "8x8"
364+
365+
359366
class FbProjectStreetCreateOnlyInput(TypesyncModel):
360367
"""Represents STREET project fields that are valid while creating a project"""
361368

@@ -589,6 +596,27 @@ def __setattr__(self, name: str, value: typing.Any) -> None:
589596
super().__setattr__(name, value)
590597

591598

599+
class FbProjectLocateCreateOnlyInput(TypesyncModel):
600+
"""Represents LOCATE project fields that are valid while creating a project"""
601+
602+
zoomLevel: int
603+
tileServer: FbObjRasterTileServer
604+
subGridSize: FBEnumSubGridSize
605+
customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED
606+
exportMetaKey: str
607+
exportMetaValue: str
608+
609+
class Config:
610+
use_enum_values = False
611+
extra = "forbid"
612+
613+
@typing.override
614+
def __setattr__(self, name: str, value: typing.Any) -> None:
615+
if name == "customOptions" and value is None:
616+
raise ValueError("'customOptions' field cannot be set to None")
617+
super().__setattr__(name, value)
618+
619+
592620
class FbProjectValidateCreateOnlyInput(TypesyncModel):
593621
"""Represents VALIDATE project fields that are valid while creating a project"""
594622

0 commit comments

Comments
 (0)