Skip to content

Commit dec49b7

Browse files
authored
Merge pull request #39 from mapswipe/fix/user-model
2 parents 363a6fc + 42ee9d5 commit dec49b7

File tree

2 files changed

+52
-4
lines changed

2 files changed

+52
-4
lines changed

functions/definition/user.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,23 @@ FbUserReadonlyType:
88
fields:
99
created:
1010
type: timestamp
11+
lastAppUse:
12+
type: timestamp
13+
optional: true
1114
userName:
1215
type: string
16+
deprecated: true
17+
optional: true
1318
userNameKey:
1419
type: string
1520
deprecated: true
21+
optional: true
1622
username:
1723
type: string
1824
usernameKey:
25+
# NOTE: web does not set usernameKey
1926
type: string
20-
deprecated: true
27+
optional: true
2128
accessibility:
2229
optional: true
2330
type: boolean
@@ -26,6 +33,20 @@ FbUserReadonlyType:
2633
type:
2734
type: map
2835
valueType: unknown
36+
contributions:
37+
optional: true
38+
type:
39+
type: map
40+
valueType: unknown
41+
taskContributionCount:
42+
optional: true
43+
type: int
44+
groupContributionCount:
45+
optional: true
46+
type: int
47+
projectContributionCount:
48+
optional: true
49+
type: int
2950

3051
FbUserUpdateInput:
3152
model: alias

functions/generated/pyfirebase/pyfirebase_mapswipe/models.py

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,23 +1012,50 @@ class FbUserReadonlyType(TypesyncModel):
10121012
"""Represents user fields that cannot be updated from backend"""
10131013

10141014
created: datetime.datetime
1015-
userName: str
1016-
userNameKey: typing.Annotated[str, pydantic.Field(deprecated=True)]
1015+
lastAppUse: datetime.datetime | TypesyncUndefined | None = UNDEFINED
1016+
userName: typing.Annotated[
1017+
str | TypesyncUndefined | None,
1018+
pydantic.Field(deprecated=True),
1019+
] = UNDEFINED
1020+
userNameKey: typing.Annotated[
1021+
str | TypesyncUndefined | None,
1022+
pydantic.Field(deprecated=True),
1023+
] = UNDEFINED
10171024
username: str
1018-
usernameKey: typing.Annotated[str, pydantic.Field(deprecated=True)]
1025+
usernameKey: str | TypesyncUndefined | None = UNDEFINED
10191026
accessibility: bool | TypesyncUndefined | None = UNDEFINED
10201027
userGroups: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED
1028+
contributions: dict[str, typing.Any] | TypesyncUndefined | None = UNDEFINED
1029+
taskContributionCount: int | TypesyncUndefined | None = UNDEFINED
1030+
groupContributionCount: int | TypesyncUndefined | None = UNDEFINED
1031+
projectContributionCount: int | TypesyncUndefined | None = UNDEFINED
10211032

10221033
class Config:
10231034
use_enum_values = False
10241035
extra = "forbid"
10251036

10261037
@typing.override
10271038
def __setattr__(self, name: str, value: typing.Any) -> None:
1039+
if name == "lastAppUse" and value is None:
1040+
raise ValueError("'lastAppUse' field cannot be set to None")
1041+
if name == "userName" and value is None:
1042+
raise ValueError("'userName' field cannot be set to None")
1043+
if name == "userNameKey" and value is None:
1044+
raise ValueError("'userNameKey' field cannot be set to None")
1045+
if name == "usernameKey" and value is None:
1046+
raise ValueError("'usernameKey' field cannot be set to None")
10281047
if name == "accessibility" and value is None:
10291048
raise ValueError("'accessibility' field cannot be set to None")
10301049
if name == "userGroups" and value is None:
10311050
raise ValueError("'userGroups' field cannot be set to None")
1051+
if name == "contributions" and value is None:
1052+
raise ValueError("'contributions' field cannot be set to None")
1053+
if name == "taskContributionCount" and value is None:
1054+
raise ValueError("'taskContributionCount' field cannot be set to None")
1055+
if name == "groupContributionCount" and value is None:
1056+
raise ValueError("'groupContributionCount' field cannot be set to None")
1057+
if name == "projectContributionCount" and value is None:
1058+
raise ValueError("'projectContributionCount' field cannot be set to None")
10321059
super().__setattr__(name, value)
10331060

10341061

0 commit comments

Comments
 (0)