From f352c00839b06254cd2b0cdfd0e40f07600219cd Mon Sep 17 00:00:00 2001 From: ofritz Date: Tue, 18 Nov 2025 10:50:42 +0100 Subject: [PATCH 1/7] feat(street): change type of taskId to string to allow Panoramax image ids --- functions/definition/project/project_types/street.yaml | 2 +- functions/generated/pyfirebase/pyfirebase_mapswipe/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/definition/project/project_types/street.yaml b/functions/definition/project/project_types/street.yaml index 36d384e..374ede9 100644 --- a/functions/definition/project/project_types/street.yaml +++ b/functions/definition/project/project_types/street.yaml @@ -30,6 +30,6 @@ FbMappingTaskStreetCreateOnlyInput: type: object fields: taskId: - type: int + type: string groupId: type: string diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index dc92a83..dbac2bb 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -390,7 +390,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbMappingTaskStreetCreateOnlyInput(TypesyncModel): """Represents STREET mapping task fields that are valid while creating a task""" - taskId: int + taskId: str groupId: str class Config: From fd352d42bdd99d68b84f559cf051e1dd1a8e076a Mon Sep 17 00:00:00 2001 From: ofritz Date: Tue, 17 Feb 2026 14:59:41 +0100 Subject: [PATCH 2/7] feat(street): add image provider in definitions --- functions/definition/project/imageProvider.yaml | 12 ++++++++++++ .../definition/project/project_types/street.yaml | 3 +++ .../definition/tutorial/project_types/street.yaml | 3 +++ 3 files changed, 18 insertions(+) create mode 100644 functions/definition/project/imageProvider.yaml diff --git a/functions/definition/project/imageProvider.yaml b/functions/definition/project/imageProvider.yaml new file mode 100644 index 0000000..e99ac6c --- /dev/null +++ b/functions/definition/project/imageProvider.yaml @@ -0,0 +1,12 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/toggle-corp/typesync/refs/tags/v1.0.0/schema.local.json + +FbObjImageProvider: + model: alias + docs: Represents an street level image provider for a project + type: + type: object + fields: + name: + type: string + url: + type: string diff --git a/functions/definition/project/project_types/street.yaml b/functions/definition/project/project_types/street.yaml index 374ede9..3087e27 100644 --- a/functions/definition/project/project_types/street.yaml +++ b/functions/definition/project/project_types/street.yaml @@ -11,6 +11,9 @@ FbProjectStreetCreateOnlyInput: type: type: list elementType: FbObjCustomOption + imageProvider: + optional: true + type: FbObjImageProvider numberOfGroups: type: int diff --git a/functions/definition/tutorial/project_types/street.yaml b/functions/definition/tutorial/project_types/street.yaml index c75d965..8e0bd20 100644 --- a/functions/definition/tutorial/project_types/street.yaml +++ b/functions/definition/tutorial/project_types/street.yaml @@ -14,6 +14,9 @@ FbStreetTutorial: type: type: list elementType: FbObjCustomOption + imageProvider: + optional: true + type: FbObjImageProvider FbStreetTutorialTask: model: alias From c7feb4ffd3911aa35b156c08153cdf549a0d76ab Mon Sep 17 00:00:00 2001 From: ofritz Date: Tue, 17 Feb 2026 15:01:22 +0100 Subject: [PATCH 3/7] feat(street): add generated --- .../pyfirebase/pyfirebase_mapswipe/models.py | 181 +++--------------- 1 file changed, 27 insertions(+), 154 deletions(-) diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index dbac2bb..e70b6a0 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -10,14 +10,11 @@ class TypesyncUndefined: """Do not use this class in your code. Use the `UNDEFINED` sentinel instead.""" - _instance = None def __init__(self): if TypesyncUndefined._instance is not None: - raise RuntimeError( - "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead.", - ) + raise RuntimeError("TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead.") TypesyncUndefined._instance = self @classmethod @@ -30,11 +27,9 @@ def validate(cls, value: typing.Any, info) -> TypesyncUndefined: raise ValueError("Undefined field type is not valid") return value - UNDEFINED = TypesyncUndefined() """A sentinel value that can be used to indicate that a value should be undefined. During serialization all values that are marked as undefined will be removed. The difference between `UNDEFINED` and `None` is that values that are set to `None` will serialize to explicit null.""" - class TypesyncModel(pydantic.BaseModel): def model_dump(self, **kwargs) -> dict[str, typing.Any]: processed = {} @@ -42,32 +37,19 @@ def model_dump(self, **kwargs) -> dict[str, typing.Any]: if isinstance(field_value, pydantic.BaseModel): processed[field_name] = field_value.model_dump(**kwargs) elif isinstance(field_value, list): - processed[field_name] = [ - item.model_dump(**kwargs) - if isinstance(item, pydantic.BaseModel) - else item - for item in field_value - ] + processed[field_name] = [item.model_dump(**kwargs) if isinstance(item, pydantic.BaseModel) else item for item in field_value] elif isinstance(field_value, dict): - processed[field_name] = { - key: value.model_dump(**kwargs) - if isinstance(value, pydantic.BaseModel) - else value - for key, value in field_value.items() - } + processed[field_name] = {key: value.model_dump(**kwargs) if isinstance(value, pydantic.BaseModel) else value for key, value in field_value.items()} elif field_value is UNDEFINED: continue else: processed[field_name] = field_value return processed - # Model Definitions - class FbAnnouncement(TypesyncModel): """Represents app announcements for the contributors.""" - url: str text: str @@ -79,10 +61,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbOrganisation(TypesyncModel): """Represents the requesting organisation.""" - name: str description: str | TypesyncUndefined | None = UNDEFINED nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] @@ -101,10 +81,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'abbreviation' field cannot be set to None") super().__setattr__(name, value) - class FbEnumProjectStatus(enum.Enum): """Represents project status""" - ACTIVE = "active" INACTIVE = "inactive" PRIVATE_INACTIVE = "private_inactive" @@ -112,10 +90,8 @@ class FbEnumProjectStatus(enum.Enum): FINISHED = "finished" PRIVATE_FINISHED = "private_finished" - class FbEnumProjectType(enum.Enum): """Represents project type""" - FIND = 1 VALIDATE = 2 VALIDATE_IMAGE = 10 @@ -123,10 +99,8 @@ class FbEnumProjectType(enum.Enum): COMPLETENESS = 4 STREET = 7 - class FbProjectReadonlyType(TypesyncModel): """Represents project fields that cannot be updated from backend""" - resultCount: int class Config: @@ -137,10 +111,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbProjectUpdateStatsInput(TypesyncModel): """Represents project fields that are valid while updating a project stats""" - contributorCount: int progress: int @@ -152,10 +124,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbProjectUpdateInput(TypesyncModel): """Represents project fields that are valid while updating a project""" - image: str | TypesyncUndefined | None = UNDEFINED isFeatured: bool lookFor: str | TypesyncUndefined | None = UNDEFINED @@ -196,10 +166,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'maxTasksPerUser' field cannot be set to None") super().__setattr__(name, value) - class FbProjectCreateOnlyInput(TypesyncModel): """Represents project fields that are valid while creating a project""" - created: datetime.datetime createdBy: str groupMaxSize: int @@ -217,10 +185,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingGroupReadonlyType(TypesyncModel): """Represents mapping group fields that cannot be updated from backend""" - finishedCount: int progress: int @@ -232,10 +198,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingGroupCreateOnlyInput(TypesyncModel): """Represents mapping group fields that are valid while creating a mapping group""" - projectId: str numberOfTasks: int requiredCount: int @@ -248,10 +212,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingTaskCreateOnlyInput(TypesyncModel): """Represents mapping task fields that are valid while creating a task""" - projectId: str class Config: @@ -262,10 +224,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingResult(TypesyncModel): """Represents a mapswipe project""" - appVersion: str clientType: str | TypesyncUndefined | None = UNDEFINED endTime: datetime.datetime @@ -287,10 +247,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'usergroups' field cannot be set to None") super().__setattr__(name, value) - class FbBaseObjCustomSubOption(TypesyncModel): """Represents a custom sub-option""" - value: int description: str @@ -302,10 +260,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbObjCustomOption(TypesyncModel): """Represents a custom option""" - value: int title: str description: str @@ -323,10 +279,21 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'subOptions' field cannot be set to None") super().__setattr__(name, value) +class FbObjImageProvider(TypesyncModel): + """Represents an street level image provider for a project""" + name: str + url: str + + class Config: + use_enum_values = False + extra = "forbid" + + @typing.override + def __setattr__(self, name: str, value: typing.Any) -> None: + super().__setattr__(name, value) class FbMappingTaskCompareCreateOnlyInput(TypesyncModel): """Represents COMPARE mapping task fields that are valid while creating a task""" - groupId: str taskId: str taskX: int | TypesyncUndefined | None = UNDEFINED @@ -350,16 +317,14 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'urlB' field cannot be set to None") super().__setattr__(name, value) - class FbEnumOverlayTileServerType(enum.Enum): RASTER = "raster" VECTOR = "vector" - class FbProjectStreetCreateOnlyInput(TypesyncModel): """Represents STREET project fields that are valid while creating a project""" - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + imageProvider: FbObjImageProvider | TypesyncUndefined | None = UNDEFINED numberOfGroups: int class Config: @@ -370,12 +335,12 @@ class Config: 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") + if name == "imageProvider" and value is None: + raise ValueError("'imageProvider' field cannot be set to None") super().__setattr__(name, value) - class FbMappingGroupStreetCreateOnlyInput(TypesyncModel): """Represents STREET mapping group fields that are valid while creating a mapping group""" - groupId: str class Config: @@ -386,10 +351,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingTaskStreetCreateOnlyInput(TypesyncModel): """Represents STREET mapping task fields that are valid while creating a task""" - taskId: str groupId: str @@ -401,10 +364,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingGroupTileMapServiceCreateOnlyInput(TypesyncModel): """Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group""" - groupId: str xMax: int xMin: int @@ -419,16 +380,13 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbEnumValidateInputType(enum.Enum): AOI_FILE = "aoi_file" LINK = "link" TMID = "TMId" - class FbMappingGroupValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE mapping group fields that are valid while creating a mapping group""" - groupId: str class Config: @@ -439,10 +397,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingTaskValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE mapping task fields that are valid while creating a task""" - taskId: str geojson: dict[str, typing.Any] @@ -454,15 +410,12 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbEnumValidateImageInputType(enum.Enum): DIRECT_IMAGES = "direct_images" DATASET_FILE = "dataset_file" - class FbProjectValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE project fields that are valid while creating a project""" - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED class Config: @@ -475,10 +428,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'customOptions' field cannot be set to None") super().__setattr__(name, value) - class FbMappingGroupValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE mapping group fields that are valid while creating a mapping group""" - groupId: str class Config: @@ -489,10 +440,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbMappingTaskValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task""" - taskId: str url: str fileName: str @@ -520,10 +469,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'segmentation' field cannot be set to None") super().__setattr__(name, value) - class FbEnumRasterTileServerName(enum.Enum): """Represents supported raster tile server""" - CUSTOM = "custom" BING = "bing" MAPBOX = "mapbox" @@ -532,15 +479,10 @@ class FbEnumRasterTileServerName(enum.Enum): ESRI = "esri" ESRI_BETA = "esriBeta" - class FbObjRasterTileServer(TypesyncModel): """Represents a raster tile server configuration""" - apiKey: str | TypesyncUndefined | None = UNDEFINED - wmtsLayerName: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), - ] = UNDEFINED + wmtsLayerName: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED credits: str name: FbEnumRasterTileServerName url: str @@ -557,10 +499,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'wmtsLayerName' field cannot be set to None") super().__setattr__(name, value) - class FbProjectCompareCreateOnlyInput(TypesyncModel): """Represents COMPARE project fields that are valid while creating a project""" - zoomLevel: int tileServer: FbObjRasterTileServer tileServerB: FbObjRasterTileServer @@ -573,10 +513,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbProjectFindCreateOnlyInput(TypesyncModel): """Represents FIND project fields that are valid while creating a project""" - zoomLevel: int tileServer: FbObjRasterTileServer @@ -588,10 +526,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbProjectValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE project fields that are valid while creating a project""" - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED tileServer: FbObjRasterTileServer inputType: FbEnumValidateInputType @@ -612,10 +548,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'TMId' field cannot be set to None") super().__setattr__(name, value) - class FbObjRasterTileServerOverlay(TypesyncModel): """Represents an overlay layer for raster layer""" - tileServer: FbObjRasterTileServer opacity: float @@ -627,19 +561,15 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbEnumVectorTileServerName(enum.Enum): """Represents supported vector tile server""" - CUSTOM = "custom" OPEN_STREET_MAP = "openStreetMap" OPEN_FREE_MAP = "openFreeMap" VERSATILES = "versatiles" - class FbObjVectorTileServer(TypesyncModel): """Represents a vector tile server configuration""" - credits: str name: FbEnumVectorTileServerName sourceLayer: str @@ -655,10 +585,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbObjVectorTileServerOverlay(TypesyncModel): """Represents an overlay layer for vector layer""" - tileServer: FbObjVectorTileServer fillColor: str fillOpacity: float @@ -678,10 +606,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbObjUnifiedOverlayTileServer(TypesyncModel): """Represents an overlay layer""" - type: FbEnumOverlayTileServerType raster: FbObjRasterTileServerOverlay | TypesyncUndefined | None = UNDEFINED vector: FbObjVectorTileServerOverlay | TypesyncUndefined | None = UNDEFINED @@ -698,10 +624,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'vector' field cannot be set to None") super().__setattr__(name, value) - class FbProjectCompletenessCreateOnlyInput(TypesyncModel): """Represents COMPLETNESS project fields that are valid while creating a project""" - zoomLevel: int tileServer: FbObjRasterTileServer tileServerB: FbObjRasterTileServer @@ -715,10 +639,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbTeam(TypesyncModel): """Represents a team to limit project visibility.""" - teamName: str teamToken: str isArchived: bool @@ -731,12 +653,10 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbEnumInformationPageBlockType(enum.Enum): TEXT = "text" IMAGE = "image" - class FbInformationPageBlock(TypesyncModel): blockNumber: int blockType: FbEnumInformationPageBlockType @@ -755,7 +675,6 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'image' field cannot be set to None") super().__setattr__(name, value) - class FbInformationPage(TypesyncModel): pageNumber: int title: str @@ -771,7 +690,6 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'blocks' field cannot be set to None") super().__setattr__(name, value) - class FbScreenBlock(TypesyncModel): title: str description: str @@ -785,7 +703,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbScreen(TypesyncModel): hint: FbScreenBlock instructions: FbScreenBlock @@ -799,16 +716,9 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbBaseTutorial(TypesyncModel): - exampleImage1: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), - ] = UNDEFINED - exampleImage2: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), - ] = UNDEFINED + exampleImage1: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED + exampleImage2: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED contributorCount: int informationPages: list[FbInformationPage] | TypesyncUndefined | None = UNDEFINED lookFor: str | TypesyncUndefined | None = UNDEFINED @@ -839,7 +749,6 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'screens' field cannot be set to None") super().__setattr__(name, value) - class FbBaseTutorialGroup(TypesyncModel): finishedCount: int groupId: int @@ -856,7 +765,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbCompareTutorial(TypesyncModel): projectType: typing.Literal[3] tileServer: FbObjRasterTileServer @@ -871,7 +779,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbCompareTutorialTask(TypesyncModel): url: str urlB: str @@ -884,7 +791,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbCompletenessTutorial(TypesyncModel): projectType: typing.Literal[4] tileServer: FbObjRasterTileServer @@ -900,7 +806,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbCompletenessTutorialTask(TypesyncModel): url: str urlB: str @@ -913,7 +818,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbFindTutorial(TypesyncModel): projectType: typing.Literal[1] tileServer: FbObjRasterTileServer @@ -927,7 +831,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbFindTutorialTask(TypesyncModel): url: str @@ -939,10 +842,10 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbStreetTutorial(TypesyncModel): projectType: typing.Literal[7] customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + imageProvider: FbObjImageProvider | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -952,9 +855,10 @@ class Config: 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") + if name == "imageProvider" and value is None: + raise ValueError("'imageProvider' field cannot be set to None") super().__setattr__(name, value) - class FbStreetTutorialTask(TypesyncModel): projectId: str groupId: int @@ -971,7 +875,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbTileMapServiceTutorialGroup(TypesyncModel): xMax: int xMin: int @@ -986,7 +889,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbTileMapServiceTutorialTask(TypesyncModel): geometry: str groupId: int @@ -1006,7 +908,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbValidateTutorial(TypesyncModel): inputGeometries: typing.Annotated[str, pydantic.Field(deprecated=True)] projectType: typing.Literal[2] @@ -1024,7 +925,6 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'customOptions' field cannot be set to None") super().__setattr__(name, value) - class FbValidateTutorialTaskProperties(TypesyncModel): id: int screen: int @@ -1038,7 +938,6 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbValidateTutorialTask(TypesyncModel): taskId: str geojson: typing.Any @@ -1053,7 +952,6 @@ class Config: 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 @@ -1068,7 +966,6 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'customOptions' field cannot be set to None") super().__setattr__(name, value) - class FbValidateImageTutorialTask(TypesyncModel): groupId: int projectId: str @@ -1102,20 +999,12 @@ def __setattr__(self, name: str, value: typing.Any) -> 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""" - created: datetime.datetime lastAppUse: datetime.datetime | TypesyncUndefined | None = UNDEFINED - userName: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), - ] = UNDEFINED - userNameKey: typing.Annotated[ - str | TypesyncUndefined | None, - pydantic.Field(deprecated=True), - ] = UNDEFINED + userName: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED + userNameKey: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED username: str | TypesyncUndefined | None = UNDEFINED usernameKey: str | TypesyncUndefined | None = UNDEFINED accessibility: bool | TypesyncUndefined | None = UNDEFINED @@ -1155,10 +1044,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'projectContributionCount' field cannot be set to None") super().__setattr__(name, value) - class FbUserUpdateInput(TypesyncModel): """Represents a user""" - teamId: str | TypesyncUndefined | None = UNDEFINED class Config: @@ -1171,10 +1058,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'teamId' field cannot be set to None") super().__setattr__(name, value) - class FbUserContribution(TypesyncModel): """Represents a user contribution""" - endTime: datetime.datetime startTime: datetime.datetime timestamp: datetime.datetime @@ -1187,15 +1072,12 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbEnumUserGroupMembershipAction(enum.Enum): JOIN = "join" LEAVE = "leave" - class FbUserGroupReadOnlyType(TypesyncModel): """Represents a usergroup""" - users: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED class Config: @@ -1208,10 +1090,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'users' field cannot be set to None") super().__setattr__(name, value) - class FbUserGroupCreateOnlyInput(TypesyncModel): """Represents a usergroup""" - createdAt: int createdBy: str @@ -1223,10 +1103,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbUserGroupUpdateInput(TypesyncModel): """Represents a usergroup""" - description: str name: str nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] @@ -1245,10 +1123,8 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'archivedBy' field cannot be set to None") super().__setattr__(name, value) - class FbUserGroupObsolete(TypesyncModel): """Represents a usergroup""" - name: str description: str @@ -1260,10 +1136,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbUserGroupMembership(TypesyncModel): """Represents a user contribution""" - action: FbEnumUserGroupMembershipAction timestamp: int userGroupId: str @@ -1277,10 +1151,8 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) - class FbBackendWait(TypesyncModel): """Represents if to wait for firebase.""" - ok: bool timestamp: datetime.datetime @@ -1291,3 +1163,4 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + From 75aadc01de216216dc46dfe44d3f843869b4fb65 Mon Sep 17 00:00:00 2001 From: ofritz Date: Thu, 19 Feb 2026 17:50:55 +0100 Subject: [PATCH 4/7] feat(street): make image provider url optional --- .../definition/project/imageProvider.yaml | 1 + .../pyfirebase/pyfirebase_mapswipe/models.py | 270 +++++++++--------- 2 files changed, 137 insertions(+), 134 deletions(-) diff --git a/functions/definition/project/imageProvider.yaml b/functions/definition/project/imageProvider.yaml index e99ac6c..fe15a19 100644 --- a/functions/definition/project/imageProvider.yaml +++ b/functions/definition/project/imageProvider.yaml @@ -10,3 +10,4 @@ FbObjImageProvider: type: string url: type: string + optional: true diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index e70b6a0..f3060e2 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -1,12 +1,11 @@ from __future__ import annotations +import typing import datetime import enum -import typing - import pydantic from pydantic_core import core_schema - +from typing_extensions import Annotated class TypesyncUndefined: """Do not use this class in your code. Use the `UNDEFINED` sentinel instead.""" @@ -15,7 +14,8 @@ class TypesyncUndefined: def __init__(self): if TypesyncUndefined._instance is not None: raise RuntimeError("TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead.") - TypesyncUndefined._instance = self + else: + TypesyncUndefined._instance = self @classmethod def __get_pydantic_core_schema__(cls, source, handler) -> core_schema.CoreSchema: @@ -31,7 +31,7 @@ def validate(cls, value: typing.Any, info) -> TypesyncUndefined: """A sentinel value that can be used to indicate that a value should be undefined. During serialization all values that are marked as undefined will be removed. The difference between `UNDEFINED` and `None` is that values that are set to `None` will serialize to explicit null.""" class TypesyncModel(pydantic.BaseModel): - def model_dump(self, **kwargs) -> dict[str, typing.Any]: + def model_dump(self, **kwargs) -> typing.Dict[str, typing.Any]: processed = {} for field_name, field_value in dict(self).items(): if isinstance(field_value, pydantic.BaseModel): @@ -55,7 +55,7 @@ class FbAnnouncement(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -64,14 +64,14 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbOrganisation(TypesyncModel): """Represents the requesting organisation.""" name: str - description: str | TypesyncUndefined | None = UNDEFINED + description: typing.Union[str, TypesyncUndefined, None] = UNDEFINED nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] - abbreviation: str | TypesyncUndefined | None = UNDEFINED + abbreviation: typing.Union[str, TypesyncUndefined, None] = UNDEFINED isArchived: bool class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -105,7 +105,7 @@ class FbProjectReadonlyType(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -118,7 +118,7 @@ class FbProjectUpdateStatsInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -126,10 +126,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbProjectUpdateInput(TypesyncModel): """Represents project fields that are valid while updating a project""" - image: str | TypesyncUndefined | None = UNDEFINED + image: typing.Union[str, TypesyncUndefined, None] = UNDEFINED isFeatured: bool - lookFor: str | TypesyncUndefined | None = UNDEFINED - projectInstruction: str | TypesyncUndefined | None = UNDEFINED + lookFor: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + projectInstruction: typing.Union[str, TypesyncUndefined, None] = UNDEFINED name: str projectDetails: str projectNumber: int @@ -139,16 +139,16 @@ class FbProjectUpdateInput(TypesyncModel): requestingOrganisation: str tutorialId: str language: str - manualUrl: str | TypesyncUndefined | None = UNDEFINED - teamId: str | TypesyncUndefined | None = UNDEFINED + manualUrl: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + teamId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED status: FbEnumProjectStatus - maxTasksPerUser: int | TypesyncUndefined | None = UNDEFINED + maxTasksPerUser: typing.Union[int, TypesyncUndefined, None] = UNDEFINED contributorCount: int progress: int class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -179,7 +179,7 @@ class FbProjectCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -192,7 +192,7 @@ class FbMappingGroupReadonlyType(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -206,7 +206,7 @@ class FbMappingGroupCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -218,7 +218,7 @@ class FbMappingTaskCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -227,15 +227,15 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbMappingResult(TypesyncModel): """Represents a mapswipe project""" appVersion: str - clientType: str | TypesyncUndefined | None = UNDEFINED + clientType: typing.Union[str, TypesyncUndefined, None] = UNDEFINED endTime: datetime.datetime startTime: datetime.datetime - results: dict[str, int] | TypesyncUndefined | None = UNDEFINED - usergroups: dict[str, bool] | TypesyncUndefined | None = UNDEFINED + results: typing.Union[typing.Dict[str, int], TypesyncUndefined, None] = UNDEFINED + usergroups: typing.Union[typing.Dict[str, bool], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -254,7 +254,7 @@ class FbBaseObjCustomSubOption(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -267,11 +267,11 @@ class FbObjCustomOption(TypesyncModel): description: str icon: str iconColor: str - subOptions: list[FbBaseObjCustomSubOption] | TypesyncUndefined | None = UNDEFINED + subOptions: typing.Union[typing.List[FbBaseObjCustomSubOption], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -282,28 +282,30 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbObjImageProvider(TypesyncModel): """Represents an street level image provider for a project""" name: str - url: str + url: typing.Union[str, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: + if name == "url" and value is None: + raise ValueError("'url' field cannot be set to None") super().__setattr__(name, value) class FbMappingTaskCompareCreateOnlyInput(TypesyncModel): """Represents COMPARE mapping task fields that are valid while creating a task""" groupId: str taskId: str - taskX: int | TypesyncUndefined | None = UNDEFINED - taskY: int | TypesyncUndefined | None = UNDEFINED - url: str | TypesyncUndefined | None = UNDEFINED - urlB: str | TypesyncUndefined | None = UNDEFINED + taskX: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + taskY: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + url: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + urlB: typing.Union[str, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -323,13 +325,13 @@ class FbEnumOverlayTileServerType(enum.Enum): class FbProjectStreetCreateOnlyInput(TypesyncModel): """Represents STREET project fields that are valid while creating a project""" - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED - imageProvider: FbObjImageProvider | TypesyncUndefined | None = UNDEFINED + customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED + imageProvider: typing.Union[FbObjImageProvider, TypesyncUndefined, None] = UNDEFINED numberOfGroups: int class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -345,7 +347,7 @@ class FbMappingGroupStreetCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -358,7 +360,7 @@ class FbMappingTaskStreetCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -374,7 +376,7 @@ class FbMappingGroupTileMapServiceCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -391,7 +393,7 @@ class FbMappingGroupValidateCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -400,11 +402,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbMappingTaskValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE mapping task fields that are valid while creating a task""" taskId: str - geojson: dict[str, typing.Any] + geojson: typing.Dict[str, typing.Any] class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -416,11 +418,11 @@ class FbEnumValidateImageInputType(enum.Enum): class FbProjectValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE project fields that are valid while creating a project""" - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -434,7 +436,7 @@ class FbMappingGroupValidateImageCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -445,15 +447,15 @@ class FbMappingTaskValidateImageCreateOnlyInput(TypesyncModel): taskId: str url: str fileName: 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 + width: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + height: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + annotationId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + bbox: typing.Union[typing.List[float], TypesyncUndefined, None] = UNDEFINED + segmentation: typing.Union[typing.List[typing.List[float]], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -481,15 +483,15 @@ class FbEnumRasterTileServerName(enum.Enum): class FbObjRasterTileServer(TypesyncModel): """Represents a raster tile server configuration""" - apiKey: str | TypesyncUndefined | None = UNDEFINED - wmtsLayerName: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED + apiKey: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + wmtsLayerName: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED credits: str name: FbEnumRasterTileServerName url: str class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -507,7 +509,7 @@ class FbProjectCompareCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -520,7 +522,7 @@ class FbProjectFindCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -528,15 +530,15 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbProjectValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE project fields that are valid while creating a project""" - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED tileServer: FbObjRasterTileServer inputType: FbEnumValidateInputType - filter: str | TypesyncUndefined | None = UNDEFINED - TMId: str | TypesyncUndefined | None = UNDEFINED + filter: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + TMId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -555,7 +557,7 @@ class FbObjRasterTileServerOverlay(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -579,7 +581,7 @@ class FbObjVectorTileServer(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -593,14 +595,14 @@ class FbObjVectorTileServerOverlay(TypesyncModel): lineColor: str lineOpacity: float lineWidth: float - lineDasharray: list[int] + lineDasharray: typing.List[int] circleColor: str circleOpacity: float circleRadius: float class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -609,12 +611,12 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbObjUnifiedOverlayTileServer(TypesyncModel): """Represents an overlay layer""" type: FbEnumOverlayTileServerType - raster: FbObjRasterTileServerOverlay | TypesyncUndefined | None = UNDEFINED - vector: FbObjVectorTileServerOverlay | TypesyncUndefined | None = UNDEFINED + raster: typing.Union[FbObjRasterTileServerOverlay, TypesyncUndefined, None] = UNDEFINED + vector: typing.Union[FbObjVectorTileServerOverlay, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -633,7 +635,7 @@ class FbProjectCompletenessCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -647,7 +649,7 @@ class FbTeam(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -660,12 +662,12 @@ class FbEnumInformationPageBlockType(enum.Enum): class FbInformationPageBlock(TypesyncModel): blockNumber: int blockType: FbEnumInformationPageBlockType - textDescription: str | TypesyncUndefined | None = UNDEFINED - image: str | TypesyncUndefined | None = UNDEFINED + textDescription: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + image: typing.Union[str, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -678,11 +680,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbInformationPage(TypesyncModel): pageNumber: int title: str - blocks: list[FbInformationPageBlock] | TypesyncUndefined | None = UNDEFINED + blocks: typing.Union[typing.List[FbInformationPageBlock], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -697,7 +699,7 @@ class FbScreenBlock(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -710,18 +712,18 @@ class FbScreen(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) class FbBaseTutorial(TypesyncModel): - exampleImage1: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED - exampleImage2: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED + exampleImage1: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED + exampleImage2: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED contributorCount: int - informationPages: list[FbInformationPage] | TypesyncUndefined | None = UNDEFINED - lookFor: str | TypesyncUndefined | None = UNDEFINED + informationPages: typing.Union[typing.List[FbInformationPage], TypesyncUndefined, None] = UNDEFINED + lookFor: typing.Union[str, TypesyncUndefined, None] = UNDEFINED name: str progress: int projectDetails: str @@ -729,11 +731,11 @@ class FbBaseTutorial(TypesyncModel): projectTopicKey: typing.Annotated[str, pydantic.Field(deprecated=True)] status: typing.Literal["tutorial"] tutorialDraftId: typing.Annotated[str, pydantic.Field(deprecated=True)] - screens: list[FbScreen] | TypesyncUndefined | None = UNDEFINED + screens: typing.Union[typing.List[FbScreen], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -759,7 +761,7 @@ class FbBaseTutorialGroup(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -773,7 +775,7 @@ class FbCompareTutorial(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -785,7 +787,7 @@ class FbCompareTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -800,7 +802,7 @@ class FbCompletenessTutorial(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -812,7 +814,7 @@ class FbCompletenessTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -825,7 +827,7 @@ class FbFindTutorial(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -836,7 +838,7 @@ class FbFindTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -844,12 +846,12 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbStreetTutorial(TypesyncModel): projectType: typing.Literal[7] - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED - imageProvider: FbObjImageProvider | TypesyncUndefined | None = UNDEFINED + customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED + imageProvider: typing.Union[FbObjImageProvider, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -869,7 +871,7 @@ class FbStreetTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -883,7 +885,7 @@ class FbTileMapServiceTutorialGroup(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -902,7 +904,7 @@ class FbTileMapServiceTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -913,11 +915,11 @@ class FbValidateTutorial(TypesyncModel): projectType: typing.Literal[2] tileServer: FbObjRasterTileServer zoomLevel: typing.Annotated[int, pydantic.Field(deprecated=True)] - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -932,7 +934,7 @@ class FbValidateTutorialTaskProperties(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -946,7 +948,7 @@ class FbValidateTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -954,11 +956,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbValidateImageTutorial(TypesyncModel): projectType: typing.Literal[10] - customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -975,15 +977,15 @@ class FbValidateImageTutorialTask(TypesyncModel): 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 + width: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + height: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + annotationId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + bbox: typing.Union[typing.List[float], TypesyncUndefined, None] = UNDEFINED + segmentation: typing.Union[typing.List[typing.List[float]], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1002,21 +1004,21 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbUserReadonlyType(TypesyncModel): """Represents user fields that cannot be updated from backend""" created: datetime.datetime - lastAppUse: datetime.datetime | TypesyncUndefined | None = UNDEFINED - userName: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED - userNameKey: typing.Annotated[str | TypesyncUndefined | None, pydantic.Field(deprecated=True)] = UNDEFINED - username: str | TypesyncUndefined | None = UNDEFINED - usernameKey: str | TypesyncUndefined | None = UNDEFINED - accessibility: bool | TypesyncUndefined | None = UNDEFINED - userGroups: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED - contributions: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED - taskContributionCount: int | TypesyncUndefined | None = UNDEFINED - groupContributionCount: int | TypesyncUndefined | None = UNDEFINED - projectContributionCount: int | TypesyncUndefined | None = UNDEFINED + lastAppUse: typing.Union[datetime.datetime, TypesyncUndefined, None] = UNDEFINED + userName: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED + userNameKey: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED + username: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + usernameKey: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + accessibility: typing.Union[bool, TypesyncUndefined, None] = UNDEFINED + userGroups: typing.Union[typing.Dict[str, typing.Any], TypesyncUndefined, None] = UNDEFINED + contributions: typing.Union[typing.Dict[str, typing.Any], TypesyncUndefined, None] = UNDEFINED + taskContributionCount: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + groupContributionCount: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + projectContributionCount: typing.Union[int, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1046,11 +1048,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbUserUpdateInput(TypesyncModel): """Represents a user""" - teamId: str | TypesyncUndefined | None = UNDEFINED + teamId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1066,7 +1068,7 @@ class FbUserContribution(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1078,11 +1080,11 @@ class FbEnumUserGroupMembershipAction(enum.Enum): class FbUserGroupReadOnlyType(TypesyncModel): """Represents a usergroup""" - users: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED + users: typing.Union[typing.Dict[str, typing.Any], TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1097,7 +1099,7 @@ class FbUserGroupCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1108,12 +1110,12 @@ class FbUserGroupUpdateInput(TypesyncModel): description: str name: str nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] - archivedAt: int | TypesyncUndefined | None = UNDEFINED - archivedBy: str | TypesyncUndefined | None = UNDEFINED + archivedAt: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + archivedBy: typing.Union[str, TypesyncUndefined, None] = UNDEFINED class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1130,7 +1132,7 @@ class FbUserGroupObsolete(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1145,7 +1147,7 @@ class FbUserGroupMembership(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1158,7 +1160,7 @@ class FbBackendWait(TypesyncModel): class Config: use_enum_values = False - extra = "forbid" + extra = 'forbid' @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: From 27b8f83bb5f0d065d601a82416e6714c6c92238c Mon Sep 17 00:00:00 2001 From: ofritz Date: Tue, 24 Feb 2026 18:15:20 +0100 Subject: [PATCH 5/7] feat(street): ruff --- .../pyfirebase/pyfirebase_mapswipe/models.py | 316 ++++++++++++------ 1 file changed, 208 insertions(+), 108 deletions(-) diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index f3060e2..df8247b 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -1,21 +1,24 @@ from __future__ import annotations -import typing import datetime import enum +import typing + import pydantic from pydantic_core import core_schema -from typing_extensions import Annotated + class TypesyncUndefined: """Do not use this class in your code. Use the `UNDEFINED` sentinel instead.""" + _instance = None def __init__(self): if TypesyncUndefined._instance is not None: - raise RuntimeError("TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead.") - else: - TypesyncUndefined._instance = self + raise RuntimeError( + "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead." + ) + TypesyncUndefined._instance = self @classmethod def __get_pydantic_core_schema__(cls, source, handler) -> core_schema.CoreSchema: @@ -27,51 +30,68 @@ def validate(cls, value: typing.Any, info) -> TypesyncUndefined: raise ValueError("Undefined field type is not valid") return value + UNDEFINED = TypesyncUndefined() """A sentinel value that can be used to indicate that a value should be undefined. During serialization all values that are marked as undefined will be removed. The difference between `UNDEFINED` and `None` is that values that are set to `None` will serialize to explicit null.""" + class TypesyncModel(pydantic.BaseModel): - def model_dump(self, **kwargs) -> typing.Dict[str, typing.Any]: + def model_dump(self, **kwargs) -> dict[str, typing.Any]: processed = {} for field_name, field_value in dict(self).items(): if isinstance(field_value, pydantic.BaseModel): processed[field_name] = field_value.model_dump(**kwargs) elif isinstance(field_value, list): - processed[field_name] = [item.model_dump(**kwargs) if isinstance(item, pydantic.BaseModel) else item for item in field_value] + processed[field_name] = [ + item.model_dump(**kwargs) + if isinstance(item, pydantic.BaseModel) + else item + for item in field_value + ] elif isinstance(field_value, dict): - processed[field_name] = {key: value.model_dump(**kwargs) if isinstance(value, pydantic.BaseModel) else value for key, value in field_value.items()} + processed[field_name] = { + key: value.model_dump(**kwargs) + if isinstance(value, pydantic.BaseModel) + else value + for key, value in field_value.items() + } elif field_value is UNDEFINED: continue else: processed[field_name] = field_value return processed + # Model Definitions + class FbAnnouncement(TypesyncModel): """Represents app announcements for the contributors.""" + url: str text: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbOrganisation(TypesyncModel): """Represents the requesting organisation.""" + name: str - description: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + description: str | TypesyncUndefined | None = UNDEFINED nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] - abbreviation: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + abbreviation: str | TypesyncUndefined | None = UNDEFINED isArchived: bool class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -81,8 +101,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'abbreviation' field cannot be set to None") super().__setattr__(name, value) + class FbEnumProjectStatus(enum.Enum): """Represents project status""" + ACTIVE = "active" INACTIVE = "inactive" PRIVATE_INACTIVE = "private_inactive" @@ -90,8 +112,10 @@ class FbEnumProjectStatus(enum.Enum): FINISHED = "finished" PRIVATE_FINISHED = "private_finished" + class FbEnumProjectType(enum.Enum): """Represents project type""" + FIND = 1 VALIDATE = 2 VALIDATE_IMAGE = 10 @@ -99,37 +123,43 @@ class FbEnumProjectType(enum.Enum): COMPLETENESS = 4 STREET = 7 + class FbProjectReadonlyType(TypesyncModel): """Represents project fields that cannot be updated from backend""" + resultCount: int class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbProjectUpdateStatsInput(TypesyncModel): """Represents project fields that are valid while updating a project stats""" + contributorCount: int progress: int class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbProjectUpdateInput(TypesyncModel): """Represents project fields that are valid while updating a project""" - image: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + + image: str | TypesyncUndefined | None = UNDEFINED isFeatured: bool - lookFor: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - projectInstruction: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + lookFor: str | TypesyncUndefined | None = UNDEFINED + projectInstruction: str | TypesyncUndefined | None = UNDEFINED name: str projectDetails: str projectNumber: int @@ -139,16 +169,16 @@ class FbProjectUpdateInput(TypesyncModel): requestingOrganisation: str tutorialId: str language: str - manualUrl: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - teamId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + manualUrl: str | TypesyncUndefined | None = UNDEFINED + teamId: str | TypesyncUndefined | None = UNDEFINED status: FbEnumProjectStatus - maxTasksPerUser: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + maxTasksPerUser: int | TypesyncUndefined | None = UNDEFINED contributorCount: int progress: int class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -166,8 +196,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'maxTasksPerUser' field cannot be set to None") super().__setattr__(name, value) + class FbProjectCreateOnlyInput(TypesyncModel): """Represents project fields that are valid while creating a project""" + created: datetime.datetime createdBy: str groupMaxSize: int @@ -179,63 +211,71 @@ class FbProjectCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingGroupReadonlyType(TypesyncModel): """Represents mapping group fields that cannot be updated from backend""" + finishedCount: int progress: int class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingGroupCreateOnlyInput(TypesyncModel): """Represents mapping group fields that are valid while creating a mapping group""" + projectId: str numberOfTasks: int requiredCount: int class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingTaskCreateOnlyInput(TypesyncModel): """Represents mapping task fields that are valid while creating a task""" + projectId: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingResult(TypesyncModel): """Represents a mapswipe project""" + appVersion: str - clientType: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + clientType: str | TypesyncUndefined | None = UNDEFINED endTime: datetime.datetime startTime: datetime.datetime - results: typing.Union[typing.Dict[str, int], TypesyncUndefined, None] = UNDEFINED - usergroups: typing.Union[typing.Dict[str, bool], TypesyncUndefined, None] = UNDEFINED + results: dict[str, int] | TypesyncUndefined | None = UNDEFINED + usergroups: dict[str, bool] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -247,31 +287,35 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'usergroups' field cannot be set to None") super().__setattr__(name, value) + class FbBaseObjCustomSubOption(TypesyncModel): """Represents a custom sub-option""" + value: int description: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbObjCustomOption(TypesyncModel): """Represents a custom option""" + value: int title: str description: str icon: str iconColor: str - subOptions: typing.Union[typing.List[FbBaseObjCustomSubOption], TypesyncUndefined, None] = UNDEFINED + subOptions: list[FbBaseObjCustomSubOption] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -279,14 +323,16 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'subOptions' field cannot be set to None") super().__setattr__(name, value) + class FbObjImageProvider(TypesyncModel): """Represents an street level image provider for a project""" + name: str - url: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + url: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -294,18 +340,20 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'url' field cannot be set to None") super().__setattr__(name, value) + class FbMappingTaskCompareCreateOnlyInput(TypesyncModel): """Represents COMPARE mapping task fields that are valid while creating a task""" + groupId: str taskId: str - taskX: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - taskY: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - url: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - urlB: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + taskX: int | TypesyncUndefined | None = UNDEFINED + taskY: int | TypesyncUndefined | None = UNDEFINED + url: str | TypesyncUndefined | None = UNDEFINED + urlB: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -319,19 +367,22 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'urlB' field cannot be set to None") super().__setattr__(name, value) + class FbEnumOverlayTileServerType(enum.Enum): RASTER = "raster" VECTOR = "vector" + class FbProjectStreetCreateOnlyInput(TypesyncModel): """Represents STREET project fields that are valid while creating a project""" - customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED - imageProvider: typing.Union[FbObjImageProvider, TypesyncUndefined, None] = UNDEFINED + + customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + imageProvider: FbObjImageProvider | TypesyncUndefined | None = UNDEFINED numberOfGroups: int class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -341,33 +392,39 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'imageProvider' field cannot be set to None") super().__setattr__(name, value) + class FbMappingGroupStreetCreateOnlyInput(TypesyncModel): """Represents STREET mapping group fields that are valid while creating a mapping group""" + groupId: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingTaskStreetCreateOnlyInput(TypesyncModel): """Represents STREET mapping task fields that are valid while creating a task""" + taskId: str groupId: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingGroupTileMapServiceCreateOnlyInput(TypesyncModel): """Represents TILE_MAP_SERVICE mapping group fields that are valid while creating a mapping group""" + groupId: str xMax: int xMin: int @@ -376,53 +433,61 @@ class FbMappingGroupTileMapServiceCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbEnumValidateInputType(enum.Enum): AOI_FILE = "aoi_file" LINK = "link" TMID = "TMId" + class FbMappingGroupValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE mapping group fields that are valid while creating a mapping group""" + groupId: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingTaskValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE mapping task fields that are valid while creating a task""" + taskId: str - geojson: typing.Dict[str, typing.Any] + geojson: dict[str, typing.Any] class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbEnumValidateImageInputType(enum.Enum): DIRECT_IMAGES = "direct_images" DATASET_FILE = "dataset_file" + class FbProjectValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE project fields that are valid while creating a project""" - customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED + + customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -430,32 +495,36 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'customOptions' field cannot be set to None") super().__setattr__(name, value) + class FbMappingGroupValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE mapping group fields that are valid while creating a mapping group""" + groupId: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbMappingTaskValidateImageCreateOnlyInput(TypesyncModel): """Represents VALIDATE_IMAGE mapping task fields that are valid while creating a task""" + taskId: str url: str fileName: str - width: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - height: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - annotationId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - bbox: typing.Union[typing.List[float], TypesyncUndefined, None] = UNDEFINED - segmentation: typing.Union[typing.List[typing.List[float]], TypesyncUndefined, None] = UNDEFINED + 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' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -471,8 +540,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'segmentation' field cannot be set to None") super().__setattr__(name, value) + class FbEnumRasterTileServerName(enum.Enum): """Represents supported raster tile server""" + CUSTOM = "custom" BING = "bing" MAPBOX = "mapbox" @@ -481,17 +552,21 @@ class FbEnumRasterTileServerName(enum.Enum): ESRI = "esri" ESRI_BETA = "esriBeta" + class FbObjRasterTileServer(TypesyncModel): """Represents a raster tile server configuration""" - apiKey: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - wmtsLayerName: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED + + apiKey: str | TypesyncUndefined | None = UNDEFINED + wmtsLayerName: typing.Annotated[ + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + ] = UNDEFINED credits: str name: FbEnumRasterTileServerName url: str class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -501,44 +576,50 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'wmtsLayerName' field cannot be set to None") super().__setattr__(name, value) + class FbProjectCompareCreateOnlyInput(TypesyncModel): """Represents COMPARE project fields that are valid while creating a project""" + zoomLevel: int tileServer: FbObjRasterTileServer tileServerB: FbObjRasterTileServer class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbProjectFindCreateOnlyInput(TypesyncModel): """Represents FIND project fields that are valid while creating a project""" + zoomLevel: int tileServer: FbObjRasterTileServer class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbProjectValidateCreateOnlyInput(TypesyncModel): """Represents VALIDATE project fields that are valid while creating a project""" - customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED + + customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED tileServer: FbObjRasterTileServer inputType: FbEnumValidateInputType - filter: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - TMId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + filter: str | TypesyncUndefined | None = UNDEFINED + TMId: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -550,28 +631,34 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'TMId' field cannot be set to None") super().__setattr__(name, value) + class FbObjRasterTileServerOverlay(TypesyncModel): """Represents an overlay layer for raster layer""" + tileServer: FbObjRasterTileServer opacity: float class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbEnumVectorTileServerName(enum.Enum): """Represents supported vector tile server""" + CUSTOM = "custom" OPEN_STREET_MAP = "openStreetMap" OPEN_FREE_MAP = "openFreeMap" VERSATILES = "versatiles" + class FbObjVectorTileServer(TypesyncModel): """Represents a vector tile server configuration""" + credits: str name: FbEnumVectorTileServerName sourceLayer: str @@ -581,42 +668,46 @@ class FbObjVectorTileServer(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbObjVectorTileServerOverlay(TypesyncModel): """Represents an overlay layer for vector layer""" + tileServer: FbObjVectorTileServer fillColor: str fillOpacity: float lineColor: str lineOpacity: float lineWidth: float - lineDasharray: typing.List[int] + lineDasharray: list[int] circleColor: str circleOpacity: float circleRadius: float class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbObjUnifiedOverlayTileServer(TypesyncModel): """Represents an overlay layer""" + type: FbEnumOverlayTileServerType - raster: typing.Union[FbObjRasterTileServerOverlay, TypesyncUndefined, None] = UNDEFINED - vector: typing.Union[FbObjVectorTileServerOverlay, TypesyncUndefined, None] = UNDEFINED + raster: FbObjRasterTileServerOverlay | TypesyncUndefined | None = UNDEFINED + vector: FbObjVectorTileServerOverlay | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -626,8 +717,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'vector' field cannot be set to None") super().__setattr__(name, value) + class FbProjectCompletenessCreateOnlyInput(TypesyncModel): """Represents COMPLETNESS project fields that are valid while creating a project""" + zoomLevel: int tileServer: FbObjRasterTileServer tileServerB: FbObjRasterTileServer @@ -635,39 +728,43 @@ class FbProjectCompletenessCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbTeam(TypesyncModel): """Represents a team to limit project visibility.""" + teamName: str teamToken: str isArchived: bool class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbEnumInformationPageBlockType(enum.Enum): TEXT = "text" IMAGE = "image" + class FbInformationPageBlock(TypesyncModel): blockNumber: int blockType: FbEnumInformationPageBlockType - textDescription: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - image: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + textDescription: str | TypesyncUndefined | None = UNDEFINED + image: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -677,14 +774,15 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'image' field cannot be set to None") super().__setattr__(name, value) + class FbInformationPage(TypesyncModel): pageNumber: int title: str - blocks: typing.Union[typing.List[FbInformationPageBlock], TypesyncUndefined, None] = UNDEFINED + blocks: list[FbInformationPageBlock] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -692,6 +790,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'blocks' field cannot be set to None") super().__setattr__(name, value) + class FbScreenBlock(TypesyncModel): title: str description: str @@ -699,12 +798,13 @@ class FbScreenBlock(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbScreen(TypesyncModel): hint: FbScreenBlock instructions: FbScreenBlock @@ -712,7 +812,7 @@ class FbScreen(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -735,7 +835,7 @@ class FbBaseTutorial(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -761,7 +861,7 @@ class FbBaseTutorialGroup(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -775,7 +875,7 @@ class FbCompareTutorial(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -787,7 +887,7 @@ class FbCompareTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -802,7 +902,7 @@ class FbCompletenessTutorial(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -814,7 +914,7 @@ class FbCompletenessTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -827,7 +927,7 @@ class FbFindTutorial(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -838,7 +938,7 @@ class FbFindTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -851,7 +951,7 @@ class FbStreetTutorial(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -871,7 +971,7 @@ class FbStreetTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -885,7 +985,7 @@ class FbTileMapServiceTutorialGroup(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -904,7 +1004,7 @@ class FbTileMapServiceTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -919,7 +1019,7 @@ class FbValidateTutorial(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -934,7 +1034,7 @@ class FbValidateTutorialTaskProperties(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -948,7 +1048,7 @@ class FbValidateTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -960,7 +1060,7 @@ class FbValidateImageTutorial(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -985,7 +1085,7 @@ class FbValidateImageTutorialTask(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1018,7 +1118,7 @@ class FbUserReadonlyType(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1052,7 +1152,7 @@ class FbUserUpdateInput(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1068,7 +1168,7 @@ class FbUserContribution(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1084,7 +1184,7 @@ class FbUserGroupReadOnlyType(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1099,7 +1199,7 @@ class FbUserGroupCreateOnlyInput(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1115,7 +1215,7 @@ class FbUserGroupUpdateInput(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1132,7 +1232,7 @@ class FbUserGroupObsolete(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1147,7 +1247,7 @@ class FbUserGroupMembership(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: @@ -1160,7 +1260,7 @@ class FbBackendWait(TypesyncModel): class Config: use_enum_values = False - extra = 'forbid' + extra = "forbid" @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: From 6b54b7a6b5df5cc5599c26948f56dcdec11b6696 Mon Sep 17 00:00:00 2001 From: ofritz Date: Tue, 24 Feb 2026 18:27:10 +0100 Subject: [PATCH 6/7] feat(street): ruff --- .../pyfirebase/pyfirebase_mapswipe/models.py | 107 +++++++++++++----- 1 file changed, 76 insertions(+), 31 deletions(-) diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index df8247b..e8efffa 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -16,7 +16,7 @@ class TypesyncUndefined: def __init__(self): if TypesyncUndefined._instance is not None: raise RuntimeError( - "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead." + "TypesyncUndefined instances cannot be created directly. Import and use the UNDEFINED sentinel instead.", ) TypesyncUndefined._instance = self @@ -558,7 +558,8 @@ class FbObjRasterTileServer(TypesyncModel): apiKey: str | TypesyncUndefined | None = UNDEFINED wmtsLayerName: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED credits: str name: FbEnumRasterTileServerName @@ -818,12 +819,17 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbBaseTutorial(TypesyncModel): - exampleImage1: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED - exampleImage2: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED + exampleImage1: typing.Annotated[ + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + ] = UNDEFINED + exampleImage2: typing.Annotated[ + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + ] = UNDEFINED contributorCount: int - informationPages: typing.Union[typing.List[FbInformationPage], TypesyncUndefined, None] = UNDEFINED - lookFor: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + informationPages: list[FbInformationPage] | TypesyncUndefined | None = UNDEFINED + lookFor: str | TypesyncUndefined | None = UNDEFINED name: str progress: int projectDetails: str @@ -831,7 +837,7 @@ class FbBaseTutorial(TypesyncModel): projectTopicKey: typing.Annotated[str, pydantic.Field(deprecated=True)] status: typing.Literal["tutorial"] tutorialDraftId: typing.Annotated[str, pydantic.Field(deprecated=True)] - screens: typing.Union[typing.List[FbScreen], TypesyncUndefined, None] = UNDEFINED + screens: list[FbScreen] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -851,6 +857,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'screens' field cannot be set to None") super().__setattr__(name, value) + class FbBaseTutorialGroup(TypesyncModel): finishedCount: int groupId: int @@ -867,6 +874,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbCompareTutorial(TypesyncModel): projectType: typing.Literal[3] tileServer: FbObjRasterTileServer @@ -881,6 +889,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbCompareTutorialTask(TypesyncModel): url: str urlB: str @@ -893,6 +902,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbCompletenessTutorial(TypesyncModel): projectType: typing.Literal[4] tileServer: FbObjRasterTileServer @@ -908,6 +918,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbCompletenessTutorialTask(TypesyncModel): url: str urlB: str @@ -920,6 +931,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbFindTutorial(TypesyncModel): projectType: typing.Literal[1] tileServer: FbObjRasterTileServer @@ -933,6 +945,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbFindTutorialTask(TypesyncModel): url: str @@ -944,10 +957,11 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbStreetTutorial(TypesyncModel): projectType: typing.Literal[7] - customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED - imageProvider: typing.Union[FbObjImageProvider, TypesyncUndefined, None] = UNDEFINED + customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED + imageProvider: FbObjImageProvider | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -961,6 +975,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'imageProvider' field cannot be set to None") super().__setattr__(name, value) + class FbStreetTutorialTask(TypesyncModel): projectId: str groupId: int @@ -977,6 +992,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbTileMapServiceTutorialGroup(TypesyncModel): xMax: int xMin: int @@ -991,6 +1007,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbTileMapServiceTutorialTask(TypesyncModel): geometry: str groupId: int @@ -1010,12 +1027,13 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbValidateTutorial(TypesyncModel): inputGeometries: typing.Annotated[str, pydantic.Field(deprecated=True)] projectType: typing.Literal[2] tileServer: FbObjRasterTileServer zoomLevel: typing.Annotated[int, pydantic.Field(deprecated=True)] - customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED + customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -1027,6 +1045,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'customOptions' field cannot be set to None") super().__setattr__(name, value) + class FbValidateTutorialTaskProperties(TypesyncModel): id: int screen: int @@ -1040,6 +1059,7 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbValidateTutorialTask(TypesyncModel): taskId: str geojson: typing.Any @@ -1054,9 +1074,10 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbValidateImageTutorial(TypesyncModel): projectType: typing.Literal[10] - customOptions: typing.Union[typing.List[FbObjCustomOption], TypesyncUndefined, None] = UNDEFINED + customOptions: list[FbObjCustomOption] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -1068,6 +1089,7 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'customOptions' field cannot be set to None") super().__setattr__(name, value) + class FbValidateImageTutorialTask(TypesyncModel): groupId: int projectId: str @@ -1077,11 +1099,11 @@ class FbValidateImageTutorialTask(TypesyncModel): taskId: str fileName: str url: str - width: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - height: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - annotationId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - bbox: typing.Union[typing.List[float], TypesyncUndefined, None] = UNDEFINED - segmentation: typing.Union[typing.List[typing.List[float]], TypesyncUndefined, None] = UNDEFINED + 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 @@ -1101,20 +1123,26 @@ def __setattr__(self, name: str, value: typing.Any) -> 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""" + created: datetime.datetime - lastAppUse: typing.Union[datetime.datetime, TypesyncUndefined, None] = UNDEFINED - userName: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED - userNameKey: typing.Annotated[typing.Union[str, TypesyncUndefined, None], pydantic.Field(deprecated=True)] = UNDEFINED - username: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - usernameKey: typing.Union[str, TypesyncUndefined, None] = UNDEFINED - accessibility: typing.Union[bool, TypesyncUndefined, None] = UNDEFINED - userGroups: typing.Union[typing.Dict[str, typing.Any], TypesyncUndefined, None] = UNDEFINED - contributions: typing.Union[typing.Dict[str, typing.Any], TypesyncUndefined, None] = UNDEFINED - taskContributionCount: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - groupContributionCount: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - projectContributionCount: typing.Union[int, TypesyncUndefined, None] = UNDEFINED + lastAppUse: datetime.datetime | TypesyncUndefined | None = UNDEFINED + userName: typing.Annotated[ + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + ] = UNDEFINED + userNameKey: typing.Annotated[ + str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + ] = UNDEFINED + username: str | TypesyncUndefined | None = UNDEFINED + usernameKey: str | TypesyncUndefined | None = UNDEFINED + accessibility: bool | TypesyncUndefined | None = UNDEFINED + userGroups: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED + contributions: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED + taskContributionCount: int | TypesyncUndefined | None = UNDEFINED + groupContributionCount: int | TypesyncUndefined | None = UNDEFINED + projectContributionCount: int | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -1146,9 +1174,11 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'projectContributionCount' field cannot be set to None") super().__setattr__(name, value) + class FbUserUpdateInput(TypesyncModel): """Represents a user""" - teamId: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + + teamId: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -1160,8 +1190,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'teamId' field cannot be set to None") super().__setattr__(name, value) + class FbUserContribution(TypesyncModel): """Represents a user contribution""" + endTime: datetime.datetime startTime: datetime.datetime timestamp: datetime.datetime @@ -1174,13 +1206,16 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbEnumUserGroupMembershipAction(enum.Enum): JOIN = "join" LEAVE = "leave" + class FbUserGroupReadOnlyType(TypesyncModel): """Represents a usergroup""" - users: typing.Union[typing.Dict[str, typing.Any], TypesyncUndefined, None] = UNDEFINED + + users: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -1192,8 +1227,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'users' field cannot be set to None") super().__setattr__(name, value) + class FbUserGroupCreateOnlyInput(TypesyncModel): """Represents a usergroup""" + createdAt: int createdBy: str @@ -1205,13 +1242,15 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbUserGroupUpdateInput(TypesyncModel): """Represents a usergroup""" + description: str name: str nameKey: typing.Annotated[str, pydantic.Field(deprecated=True)] - archivedAt: typing.Union[int, TypesyncUndefined, None] = UNDEFINED - archivedBy: typing.Union[str, TypesyncUndefined, None] = UNDEFINED + archivedAt: int | TypesyncUndefined | None = UNDEFINED + archivedBy: str | TypesyncUndefined | None = UNDEFINED class Config: use_enum_values = False @@ -1225,8 +1264,10 @@ def __setattr__(self, name: str, value: typing.Any) -> None: raise ValueError("'archivedBy' field cannot be set to None") super().__setattr__(name, value) + class FbUserGroupObsolete(TypesyncModel): """Represents a usergroup""" + name: str description: str @@ -1238,8 +1279,10 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbUserGroupMembership(TypesyncModel): """Represents a user contribution""" + action: FbEnumUserGroupMembershipAction timestamp: int userGroupId: str @@ -1253,8 +1296,10 @@ class Config: def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) + class FbBackendWait(TypesyncModel): """Represents if to wait for firebase.""" + ok: bool timestamp: datetime.datetime From 913410565fea5b03fdb6598671eed1b7878b6ddf Mon Sep 17 00:00:00 2001 From: ofritz Date: Tue, 24 Feb 2026 18:31:29 +0100 Subject: [PATCH 7/7] feat(street): format --- .../pyfirebase/pyfirebase_mapswipe/models.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index e8efffa..3821153 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -822,10 +822,12 @@ def __setattr__(self, name: str, value: typing.Any) -> None: class FbBaseTutorial(TypesyncModel): exampleImage1: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED exampleImage2: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED contributorCount: int informationPages: list[FbInformationPage] | TypesyncUndefined | None = UNDEFINED @@ -1130,10 +1132,12 @@ class FbUserReadonlyType(TypesyncModel): created: datetime.datetime lastAppUse: datetime.datetime | TypesyncUndefined | None = UNDEFINED userName: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED userNameKey: typing.Annotated[ - str | TypesyncUndefined | None, pydantic.Field(deprecated=True) + str | TypesyncUndefined | None, + pydantic.Field(deprecated=True), ] = UNDEFINED username: str | TypesyncUndefined | None = UNDEFINED usernameKey: str | TypesyncUndefined | None = UNDEFINED @@ -1310,4 +1314,3 @@ class Config: @typing.override def __setattr__(self, name: str, value: typing.Any) -> None: super().__setattr__(name, value) -