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