diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f124bf..451ca82 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,9 +36,11 @@ repos: - id: ruff types_or: [python, pyi, jupyter, toml] args: [--fix, --exit-non-zero-on-fix] + exclude: ^.*uv\.lock$ # Formatter - id: ruff-format types_or: [python, pyi, jupyter, toml] + exclude: ^.*uv\.lock$ - repo: https://github.com/RobertCraigie/pyright-python rev: v1.1.403 diff --git a/functions/definition/project/project_types/locate.yaml b/functions/definition/project/project_types/locate.yaml index 0388f7a..b27970d 100644 --- a/functions/definition/project/project_types/locate.yaml +++ b/functions/definition/project/project_types/locate.yaml @@ -34,3 +34,35 @@ FbProjectLocateCreateOnlyInput: type: string exportMetaValue: type: string + + +FbProjectLocateMappingResult: + model: alias + docs: Represents LOCATE mapswipe project results + # path: results/{projectId}/{groupId}/{userId} + type: + type: object + fields: + appVersion: + type: string + clientType: + # FIXME: this is an enum + type: string + optional: true + endTime: + type: timestamp + startTime: + type: timestamp + results: + optional: true + type: + type: map + valueType: + type: list + elementType: int + usergroups: + optional: true + type: + # NOTE: The key is usergroupId + type: map + valueType: boolean diff --git a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py index 81eb479..2cb28c7 100644 --- a/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py +++ b/functions/generated/pyfirebase/pyfirebase_mapswipe/models.py @@ -363,6 +363,31 @@ class FBEnumSubGridSize(enum.Enum): SIZE_8X8 = "8x8" +class FbProjectLocateMappingResult(TypesyncModel): + """Represents LOCATE mapswipe project results""" + + appVersion: str + clientType: str | TypesyncUndefined | None = UNDEFINED + endTime: datetime.datetime + startTime: datetime.datetime + results: dict[str, list[int]] | TypesyncUndefined | None = UNDEFINED + usergroups: dict[str, bool] | TypesyncUndefined | None = UNDEFINED + + class Config: + use_enum_values = False + extra = "forbid" + + @typing.override + def __setattr__(self, name: str, value: typing.Any) -> None: + if name == "clientType" and value is None: + raise ValueError("'clientType' field cannot be set to None") + if name == "results" and value is None: + raise ValueError("'results' field cannot be set to None") + if name == "usergroups" and value is None: + raise ValueError("'usergroups' field cannot be set to None") + super().__setattr__(name, value) + + class FbProjectStreetCreateOnlyInput(TypesyncModel): """Represents STREET project fields that are valid while creating a project"""