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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ repos:
- id: ruff
types_or: [python, pyi, jupyter, toml]
args: [--fix, --exit-non-zero-on-fix]
exclude: ^.*uv\.lock$
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update this once rebased with develop.

# Formatter
- id: ruff-format
types_or: [python, pyi, jupyter, toml]
exclude: ^.*uv\.lock$

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.403
Expand Down
32 changes: 32 additions & 0 deletions functions/definition/project/project_types/locate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 25 additions & 0 deletions functions/generated/pyfirebase/pyfirebase_mapswipe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""

Expand Down
Loading