@@ -338,3 +338,36 @@ def delete(self, messageId):
338338
339339 # API request
340340 self ._session .delete (API_ENDPOINT + '/' + messageId )
341+
342+ def edit (self , messageId = None , roomId = None , text = None , markdown = None ):
343+ """Edit a message.
344+
345+ Args:
346+ messageId(basestring): The ID of the message to be edit.
347+ roomId(basestring): The room ID.
348+ text(basestring): The message, in plain text. If `markdown` is
349+ specified this parameter may be optionally used to provide
350+ alternate text for UI clients that do not support rich text.
351+ markdown(basestring): The message, in markdown format.
352+
353+ Raises:
354+ TypeError: If the parameter types are incorrect.
355+ ApiError: If the Webex Teams cloud returns an error.
356+
357+ """
358+ check_type (messageId , basestring )
359+ check_type (roomId , basestring , optional = True )
360+ check_type (text , basestring , optional = True )
361+ check_type (markdown , basestring , optional = True )
362+
363+ put_data = dict_from_items_with_values (
364+ roomId = roomId ,
365+ text = text ,
366+ markdown = markdown ,
367+ )
368+
369+ # API request
370+ json_data = self ._session .put (API_ENDPOINT + '/' + messageId , json = put_data )
371+
372+ # Return a message object created from the response JSON data
373+ return self ._object_factory (OBJECT_TYPE , json_data )
0 commit comments