Skip to content

Commit 4ebf157

Browse files
authored
Merge pull request #116 from sQu4rks/issue-115
Add parentId to message model and messages.create
2 parents c0cdea6 + aef828c commit 4ebf157

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

webexteamssdk/api/messages.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def list(self, roomId, mentionedPeople=None, before=None,
137137

138138
def create(self, roomId=None, toPersonId=None, toPersonEmail=None,
139139
text=None, markdown=None, files=None, attachments=None,
140-
**request_parameters):
140+
parentId=None, **request_parameters):
141141
"""Post a message to a room.
142142
143143
The files parameter is a list, which accepts multiple values to allow
@@ -158,6 +158,8 @@ def create(self, roomId=None, toPersonId=None, toPersonEmail=None,
158158
be posted into the room. Only one file is allowed per message.
159159
attachments(list): Content attachments to attach to the message.
160160
See the Cards Guide for more information.
161+
parentId(basestring): The parent message to reply to. This will
162+
start or reply to a thread.
161163
**request_parameters: Additional request parameters (provides
162164
support for parameters that may be added in the future).
163165
@@ -179,6 +181,7 @@ def create(self, roomId=None, toPersonId=None, toPersonEmail=None,
179181
check_type(markdown, basestring, optional=True)
180182
check_type(files, list, optional=True)
181183
check_type(attachments, list, optional=True)
184+
check_type(parentId, basestring, optional=True)
182185

183186
if files:
184187
if len(files) > 1:
@@ -209,6 +212,7 @@ def create(self, roomId=None, toPersonId=None, toPersonEmail=None,
209212
markdown=markdown,
210213
files=files,
211214
attachments=attachments,
215+
parentId=parentId
212216
)
213217

214218
# API request

webexteamssdk/models/mixins/message.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ def mentionedGroups(self):
9898
"""Group names for the groups mentioned in the message."""
9999
return self._json_data.get('mentionedGroups')
100100

101+
@property
102+
def parentId(self):
103+
"""The unique identifier for the parent message."""
104+
return self._json_data.get('parentId')
105+
101106
@property
102107
def created(self):
103108
"""The date and time the message was created."""

0 commit comments

Comments
 (0)