Skip to content

Commit caf316e

Browse files
committed
Update Webex Teams object properties and docstrings
Review the object properties documented on https://developer.webex.com and ensure the mixin properties are up-to-date. Also update the docstrings with the documention's updated descriptions.
1 parent 739583d commit caf316e

File tree

13 files changed

+269
-106
lines changed

13 files changed

+269
-106
lines changed

webexteamssdk/models/immutable.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ class AccessToken(ImmutableData, AccessTokenBasicPropertiesMixin):
180180
class Event(ImmutableData, EventBasicPropertiesMixin):
181181
"""Webex Teams Event data model."""
182182

183+
@property
184+
def data(self):
185+
"""The event’s data representation.
186+
187+
This object will contain the event's resource, such as memberships or
188+
messages, at the time the event took place.
189+
"""
190+
return ImmutableData(self._json_data.get('data'))
191+
183192

184193
class License(ImmutableData, LicenseBasicPropertiesMixin):
185194
"""Webex Teams License data model."""

webexteamssdk/models/mixins/event.py

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,48 @@ class EventBasicPropertiesMixin(object):
4040

4141
@property
4242
def id(self):
43-
"""Event ID."""
43+
"""The unique identifier for the event."""
4444
return self._json_data.get('id')
4545

4646
@property
4747
def resource(self):
48-
"""The event resource type (`messages`, `memberships`)."""
48+
"""The type of resource in the event.
49+
50+
Event Resource Enum:
51+
`messages`
52+
`memberships`
53+
"""
4954
return self._json_data.get('resource')
5055

5156
@property
5257
def type(self):
53-
"""The event type (`created`, `updated`, `deleted`)."""
58+
"""The action which took place in the event.
59+
60+
Event Type Enum:
61+
`created`
62+
`updated`
63+
`deleted`
64+
"""
5465
return self._json_data.get('type')
5566

67+
@property
68+
def appId(self):
69+
"""The ID of the application for the event."""
70+
return self._json_data.get('appId')
71+
5672
@property
5773
def actorId(self):
58-
"""The ID of the person that performed this event."""
74+
"""The ID of the person who performed the action."""
5975
return self._json_data.get('actorId')
6076

77+
@property
78+
def orgId(self):
79+
"""The ID of the organization for the event."""
80+
return self._json_data.get('orgId')
81+
6182
@property
6283
def created(self):
63-
"""The date and time the event was performed."""
84+
"""The date and time of the event."""
6485
created = self._json_data.get('created')
6586
if created:
6687
return WebexTeamsDateTime.strptime(created)

webexteamssdk/models/mixins/license.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ class LicenseBasicPropertiesMixin(object):
3838

3939
@property
4040
def id(self):
41-
"""The unique ID for the License."""
41+
"""A unique identifier for the license."""
4242
return self._json_data.get('id')
4343

4444
@property
4545
def name(self):
46-
"""The name of the License."""
46+
"""Name of the licensed feature."""
4747
return self._json_data.get('name')
4848

4949
@property
5050
def totalUnits(self):
51-
"""The total number of license units."""
51+
"""Total number of license units allocated."""
5252
return self._json_data.get('totalUnits')
5353

5454
@property
5555
def consumedUnits(self):
56-
"""The total number of license units consumed."""
56+
"""Total number of license units consumed."""
5757
return self._json_data.get('consumedUnits')

webexteamssdk/models/mixins/membership.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
from builtins import *
3434

35+
import warnings
36+
3537
from webexteamssdk.utils import WebexTeamsDateTime
3638

3739

@@ -40,17 +42,17 @@ class MembershipBasicPropertiesMixin(object):
4042

4143
@property
4244
def id(self):
43-
"""The membership's unique ID."""
45+
"""A unique identifier for the membership."""
4446
return self._json_data.get('id')
4547

4648
@property
4749
def roomId(self):
48-
"""The ID of the room."""
50+
"""The room ID."""
4951
return self._json_data.get('roomId')
5052

5153
@property
5254
def personId(self):
53-
"""The ID of the person."""
55+
"""The person ID."""
5456
return self._json_data.get('personId')
5557

5658
@property
@@ -65,22 +67,26 @@ def personDisplayName(self):
6567

6668
@property
6769
def personOrgId(self):
68-
"""The ID of the organization that the person is associated with."""
70+
"""The organization ID of the person."""
6971
return self._json_data.get('personOrgId')
7072

7173
@property
7274
def isModerator(self):
73-
"""Person is a moderator for the room."""
75+
"""Whether or not the participant is a room moderator."""
7476
return self._json_data.get('isModerator')
7577

7678
@property
7779
def isMonitor(self):
78-
"""Person is a monitor for the room."""
80+
"""Whether or not the participant is a monitoring bot (deprecated)."""
81+
warnings.warn(
82+
"The `isMonitor` attribute has been deprecated.",
83+
DeprecationWarning,
84+
)
7985
return self._json_data.get('isMonitor')
8086

8187
@property
8288
def created(self):
83-
"""The date and time the membership was created."""
89+
"""The date and time when the membership was created."""
8490
created = self._json_data.get('created')
8591
if created:
8692
return WebexTeamsDateTime.strptime(created)

webexteamssdk/models/mixins/message.py

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,53 +40,64 @@ class MessageBasicPropertiesMixin(object):
4040

4141
@property
4242
def id(self):
43-
"""The message's unique ID."""
43+
"""The unique identifier for the message."""
4444
return self._json_data.get('id')
4545

4646
@property
4747
def roomId(self):
48-
"""The ID of the room."""
48+
"""The room ID of the message."""
4949
return self._json_data.get('roomId')
5050

5151
@property
5252
def roomType(self):
53-
"""The type of room (i.e. 'group', 'direct' etc.)."""
53+
"""The type of room.
54+
55+
Room Type Enum:
56+
`direct`: 1:1 room
57+
`group`: Group room
58+
"""
5459
return self._json_data.get('roomType')
5560

5661
@property
5762
def text(self):
5863
"""The message, in plain text."""
5964
return self._json_data.get('text')
6065

66+
@property
67+
def markdown(self):
68+
"""The message, in Markdown format."""
69+
return self._json_data.get('markdown')
70+
71+
@property
72+
def html(self):
73+
"""The message, in HTML format."""
74+
return self._json_data.get('html')
75+
6176
@property
6277
def files(self):
63-
"""Files attached to the the message (list of URLs)."""
78+
"""Public URLs for files attached to the message."""
6479
return self._json_data.get('files')
6580

6681
@property
6782
def personId(self):
68-
"""The person ID of the sender."""
83+
"""The person ID of the message author."""
6984
return self._json_data.get('personId')
7085

7186
@property
7287
def personEmail(self):
73-
"""The email address of the sender."""
88+
"""The email address of the message author."""
7489
return self._json_data.get('personEmail')
7590

76-
@property
77-
def markdown(self):
78-
"""The message, in markdown format."""
79-
return self._json_data.get('markdown')
80-
81-
@property
82-
def html(self):
83-
"""The message, in HTML format."""
84-
return self._json_data.get('html')
8591

8692
@property
8793
def mentionedPeople(self):
88-
"""The list of IDs of people mentioned in the message."""
94+
"""People IDs for anyone mentioned in the message."""
8995
return self._json_data.get('mentionedPeople')
96+
97+
@property
98+
def mentionedGroups(self):
99+
"""Group names for the groups mentioned in the message."""
100+
return self._json_data.get('mentionedGroups')
90101

91102
@property
92103
def created(self):

webexteamssdk/models/mixins/organization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ class OrganizationBasicPropertiesMixin(object):
4040

4141
@property
4242
def id(self):
43-
"""The unique ID for the Organization."""
43+
"""A unique identifier for the organization."""
4444
return self._json_data.get('id')
4545

4646
@property
4747
def displayName(self):
48-
"""The human-friendly display name of the Organization."""
48+
"""Full name of the organization."""
4949
return self._json_data.get('displayName')
5050

5151
@property
5252
def created(self):
53-
"""Creation date and time in ISO8601 format."""
53+
"""The date and time the organization was created."""
5454
created = self._json_data.get('created')
5555
if created:
5656
return WebexTeamsDateTime.strptime(created)

0 commit comments

Comments
 (0)