Skip to content

Commit 38ffc10

Browse files
authored
Merge pull request #19 from mapswipe/feat/team-edit-input
2 parents 27ce623 + 24c7c0c commit 38ffc10

File tree

6 files changed

+215
-183
lines changed

6 files changed

+215
-183
lines changed

functions/definition/models.yaml

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -542,99 +542,3 @@ FbMappingResult:
542542
# NOTE: The key is usergroupId
543543
type: map
544544
valueType: boolean
545-
546-
# USER AND USER GROUP
547-
548-
FbUserGroup:
549-
model: alias
550-
# path: userGroups/{userGroupId}
551-
docs: Represents a usergroup
552-
type:
553-
type: object
554-
fields:
555-
# TODO: this is an enum
556-
createdAt:
557-
type: int
558-
createdBy:
559-
type: string
560-
description:
561-
type: string
562-
name:
563-
type: string
564-
# NOTE: We can remove this @deprecated
565-
nameKey:
566-
type: string
567-
users:
568-
type:
569-
type: map
570-
valueType: unknown
571-
572-
FbUserGroupObsolete:
573-
model: alias
574-
# path: user_groups/{userGroupId}
575-
docs: Represents a usergroup
576-
type:
577-
type: object
578-
fields:
579-
name:
580-
type: string
581-
description:
582-
type: string
583-
584-
FbUserGroupMembership:
585-
model: alias
586-
# path: userGroupMembershipLogs/{userGroupId}
587-
docs: Represents a user contribution
588-
type:
589-
type: object
590-
fields:
591-
action:
592-
type: FbEnumUserGroupMembershipAction
593-
timestamp:
594-
type: timestamp
595-
userGroupId:
596-
type: string
597-
userId:
598-
type: string
599-
600-
FbUser:
601-
model: alias
602-
# path: users/{userId}
603-
docs: Represents a user
604-
type:
605-
type: object
606-
fields:
607-
created:
608-
type: timestamp
609-
userName:
610-
type: string
611-
# NOTE: We can remove this @deprecated
612-
userNameKey:
613-
type: string
614-
username:
615-
type: string
616-
# NOTE: We can remove this @deprecated
617-
usernameKey:
618-
type: string
619-
accessibility:
620-
optional: true
621-
type: boolean
622-
userGroups:
623-
optional: true
624-
type:
625-
type: map
626-
valueType: unknown
627-
628-
FbUserContribution:
629-
model: alias
630-
# path: userContributions/{userId}/{projectId}/{groupId}
631-
docs: Represents a user contribution
632-
type:
633-
type: object
634-
fields:
635-
endTime:
636-
type: timestamp
637-
startTime:
638-
type: timestamp
639-
timestamp:
640-
type: timestamp

functions/definition/user.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FbUserReadonlyType:
2+
model: alias
3+
docs: Represents user fields that cannot be updated from backend
4+
type:
5+
type: object
6+
fields:
7+
created:
8+
type: timestamp
9+
userName:
10+
type: string
11+
# NOTE: We can remove this @deprecated
12+
userNameKey:
13+
type: string
14+
username:
15+
type: string
16+
# NOTE: We can remove this @deprecated
17+
usernameKey:
18+
type: string
19+
accessibility:
20+
optional: true
21+
type: boolean
22+
userGroups:
23+
optional: true
24+
type:
25+
type: map
26+
valueType: unknown
27+
28+
FbUserUpdateInput:
29+
model: alias
30+
# path: users/{userId}
31+
docs: Represents a user
32+
type:
33+
type: object
34+
fields:
35+
teamId:
36+
type: string
37+
optional: true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FbUserContribution:
2+
model: alias
3+
# path: userContributions/{userId}/{projectId}/{groupId}
4+
docs: Represents a user contribution
5+
type:
6+
type: object
7+
fields:
8+
endTime:
9+
type: timestamp
10+
startTime:
11+
type: timestamp
12+
timestamp:
13+
type: timestamp
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
FbUserGroup:
2+
model: alias
3+
# path: userGroups/{userGroupId}
4+
docs: Represents a usergroup
5+
type:
6+
type: object
7+
fields:
8+
# TODO: this is an enum
9+
createdAt:
10+
type: int
11+
createdBy:
12+
type: string
13+
description:
14+
type: string
15+
name:
16+
type: string
17+
# NOTE: We can remove this @deprecated
18+
nameKey:
19+
type: string
20+
users:
21+
type:
22+
type: map
23+
valueType: unknown
24+
25+
FbUserGroupObsolete:
26+
model: alias
27+
# path: user_groups/{userGroupId}
28+
docs: Represents a usergroup
29+
type:
30+
type: object
31+
fields:
32+
name:
33+
type: string
34+
description:
35+
type: string
36+
37+
FbUserGroupMembership:
38+
model: alias
39+
# path: userGroupMembershipLogs/{userGroupId}
40+
docs: Represents a user contribution
41+
type:
42+
type: object
43+
fields:
44+
action:
45+
type: FbEnumUserGroupMembershipAction
46+
timestamp:
47+
type: timestamp
48+
userGroupId:
49+
type: string
50+
userId:
51+
type: string

functions/generated/pyfirebase/pyfirebase_mapswipe/extended_models.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class FbProject(
1414
class Config: # type: ignore[reportIncompatibleVariableOverride]
1515
use_enum_values = True
1616
frozen = True
17-
extra = "forbid"
17+
# NOTE: We need to allow extra fields as FbProject
18+
# is not a complete project representation
19+
extra = "allow"
1820

1921

2022
class FbMappingGroup(
@@ -25,3 +27,13 @@ class Config: # type: ignore[reportIncompatibleVariableOverride]
2527
use_enum_values = True
2628
frozen = True
2729
extra = "forbid"
30+
31+
32+
class FbUser(
33+
models.FbUserUpdateInput,
34+
models.FbUserReadonlyType,
35+
):
36+
class Config: # type: ignore[reportIncompatibleVariableOverride]
37+
use_enum_values = True
38+
frozen = True
39+
extra = "forbid"

0 commit comments

Comments
 (0)