Skip to content

Commit

Permalink
api_types: Add RealmUserEvent and RealmUserEventPerson.
Browse files Browse the repository at this point in the history
This commit contains types for RealmUserEvent and RealmUserEventPerson added to
api_types.

Like a few other fields, custom_profile_field data may be sent and will be
updated for the user. It is commented out since we will want to implement this,
and we want to ensure this is done correctly, and may need a special case.
  • Loading branch information
mounilKshah authored and neiljp committed Sep 25, 2022
1 parent 2af592b commit 8571383
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions zulipterminal/api_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,39 @@ class ReactionEvent(TypedDict):
message_id: int


class RealmUserEventPerson(TypedDict):
user_id: int

full_name: str

avatar_url: str
avatar_source: str
avatar_url_medium: str
avatar_version: int

# NOTE: This field will be removed in future as it is redundant with the user_id
# email: str
timezone: str

bot_owner_id: int

role: int

is_billing_admin: bool # New in ZFL 73 (Zulip 5.0)

delivery_email: str # NOTE: Only sent to admins

# custom_profile_field: Dict # TODO: Requires checking before implementation

new_email: str


class RealmUserEvent(TypedDict):
type: Literal["realm_user"]
op: Literal["update"]
person: RealmUserEventPerson


class SubscriptionEvent(TypedDict):
type: Literal["subscription"]
op: str
Expand Down Expand Up @@ -249,4 +282,5 @@ class UpdateGlobalNotificationsEvent(TypedDict):
UpdateRealmEmojiEvent,
UpdateUserSettingsEvent,
UpdateGlobalNotificationsEvent,
RealmUserEvent,
]

0 comments on commit 8571383

Please sign in to comment.