Conditions | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
1 | # From https://www.reamaze.com/api/post_messages |
||
13 | def run(self, slug, message, visibility='internal', |
||
14 | suppress_notification=False): |
||
15 | |||
16 | payload = { |
||
17 | 'message': { |
||
18 | 'body': message, |
||
19 | 'visibility': CreateMessage.VISIBILITY[visibility] |
||
20 | } |
||
21 | } |
||
22 | |||
23 | if suppress_notification: |
||
24 | params['suppress_notificiaton'] = True |
||
25 | |||
26 | endpoint = '/conversations/{}/messages'.format(slug) |
||
27 | response = self._api_post(endpoint, json=payload) |
||
28 | |||
29 | return response |
||
30 |