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
23 changes: 22 additions & 1 deletion functions/definition/user.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,23 @@ FbUserReadonlyType:
fields:
created:
type: timestamp
lastAppUse:
type: timestamp
optional: true
userName:
type: string
deprecated: true
optional: true
userNameKey:
type: string
deprecated: true
optional: true
username:
type: string
usernameKey:
# NOTE: web does not set usernameKey
type: string
deprecated: true
optional: true
accessibility:
optional: true
type: boolean
Expand All @@ -26,6 +33,20 @@ FbUserReadonlyType:
type:
type: map
valueType: unknown
contributions:
optional: true
type:
type: map
valueType: unknown
taskContributionCount:
optional: true
type: int
groupContributionCount:
optional: true
type: int
projectContributionCount:
optional: true
type: int

FbUserUpdateInput:
model: alias
Expand Down
33 changes: 30 additions & 3 deletions functions/generated/pyfirebase/pyfirebase_mapswipe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1012,23 +1012,50 @@ class FbUserReadonlyType(TypesyncModel):
"""Represents user fields that cannot be updated from backend"""

created: datetime.datetime
userName: str
userNameKey: typing.Annotated[str, pydantic.Field(deprecated=True)]
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
usernameKey: typing.Annotated[str, pydantic.Field(deprecated=True)]
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
extra = "forbid"

@typing.override
def __setattr__(self, name: str, value: typing.Any) -> None:
if name == "lastAppUse" and value is None:
raise ValueError("'lastAppUse' field cannot be set to None")
if name == "userName" and value is None:
raise ValueError("'userName' field cannot be set to None")
if name == "userNameKey" and value is None:
raise ValueError("'userNameKey' field cannot be set to None")
if name == "usernameKey" and value is None:
raise ValueError("'usernameKey' field cannot be set to None")
if name == "accessibility" and value is None:
raise ValueError("'accessibility' field cannot be set to None")
if name == "userGroups" and value is None:
raise ValueError("'userGroups' field cannot be set to None")
if name == "contributions" and value is None:
raise ValueError("'contributions' field cannot be set to None")
if name == "taskContributionCount" and value is None:
raise ValueError("'taskContributionCount' field cannot be set to None")
if name == "groupContributionCount" and value is None:
raise ValueError("'groupContributionCount' field cannot be set to None")
if name == "projectContributionCount" and value is None:
raise ValueError("'projectContributionCount' field cannot be set to None")
super().__setattr__(name, value)


Expand Down