1# coding=utf-8
2#####################################################
3# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT #
4#####################################################
5# noqa: E128,E201
6from ..client import BaseClient
7from ..client import createApiClient
8from ..client import config
9from ..client import createTemporaryCredentials
10from ..client import createSession
11_defaultConfig = config
12
13
14class Notify(BaseClient):
15    """
16    The notification service listens for tasks with associated notifications
17    and handles requests to send emails and post pulse messages.
18    """
19
20    classOptions = {
21    }
22    serviceName = 'notify'
23    apiVersion = 'v1'
24
25    def ping(self, *args, **kwargs):
26        """
27        Ping Server
28
29        Respond without doing anything.
30        This endpoint is used to check that the service is up.
31
32        This method is ``stable``
33        """
34
35        return self._makeApiCall(self.funcinfo["ping"], *args, **kwargs)
36
37    def email(self, *args, **kwargs):
38        """
39        Send an Email
40
41        Send an email to `address`. The content is markdown and will be rendered
42        to HTML, but both the HTML and raw markdown text will be sent in the
43        email. If a link is included, it will be rendered to a nice button in the
44        HTML version of the email
45
46        This method is ``experimental``
47        """
48
49        return self._makeApiCall(self.funcinfo["email"], *args, **kwargs)
50
51    def pulse(self, *args, **kwargs):
52        """
53        Publish a Pulse Message
54
55        Publish a message on pulse with the given `routingKey`.
56
57        This method is ``experimental``
58        """
59
60        return self._makeApiCall(self.funcinfo["pulse"], *args, **kwargs)
61
62    def matrix(self, *args, **kwargs):
63        """
64        Post Matrix Message
65
66        Post a message to a room in Matrix. Optionally includes formatted message.
67
68        The `roomId` in the scopes is a fully formed `roomId` with leading `!` such
69        as `!foo:bar.com`.
70
71        Note that the matrix client used by taskcluster must be invited to a room before
72        it can post there!
73
74        This method is ``experimental``
75        """
76
77        return self._makeApiCall(self.funcinfo["matrix"], *args, **kwargs)
78
79    def slack(self, *args, **kwargs):
80        """
81        Post Slack Message
82
83        Post a message to a Slack channel.
84
85        The `channelId` in the scopes is a Slack channel ID, starting with a capital C.
86
87        The Slack app can post into public channels by default but will need to be added
88        to private channels before it can post messages there.
89
90        This method is ``experimental``
91        """
92
93        return self._makeApiCall(self.funcinfo["slack"], *args, **kwargs)
94
95    def addDenylistAddress(self, *args, **kwargs):
96        """
97        Denylist Given Address
98
99        Add the given address to the notification denylist. Addresses in the denylist will be ignored
100        by the notification service.
101
102        This method is ``experimental``
103        """
104
105        return self._makeApiCall(self.funcinfo["addDenylistAddress"], *args, **kwargs)
106
107    def deleteDenylistAddress(self, *args, **kwargs):
108        """
109        Delete Denylisted Address
110
111        Delete the specified address from the notification denylist.
112
113        This method is ``experimental``
114        """
115
116        return self._makeApiCall(self.funcinfo["deleteDenylistAddress"], *args, **kwargs)
117
118    def listDenylist(self, *args, **kwargs):
119        """
120        List Denylisted Notifications
121
122        Lists all the denylisted addresses.
123
124        By default this end-point will try to return up to 1000 addresses in one
125        request. But it **may return less**, even if more tasks are available.
126        It may also return a `continuationToken` even though there are no more
127        results. However, you can only be sure to have seen all results if you
128        keep calling `list` with the last `continuationToken` until you
129        get a result without a `continuationToken`.
130
131        If you are not interested in listing all the members at once, you may
132        use the query-string option `limit` to return fewer.
133
134        This method is ``experimental``
135        """
136
137        return self._makeApiCall(self.funcinfo["listDenylist"], *args, **kwargs)
138
139    funcinfo = {
140        "addDenylistAddress": {
141            'args': [],
142            'input': 'v1/notification-address.json#',
143            'method': 'post',
144            'name': 'addDenylistAddress',
145            'route': '/denylist/add',
146            'stability': 'experimental',
147        },
148        "deleteDenylistAddress": {
149            'args': [],
150            'input': 'v1/notification-address.json#',
151            'method': 'delete',
152            'name': 'deleteDenylistAddress',
153            'route': '/denylist/delete',
154            'stability': 'experimental',
155        },
156        "email": {
157            'args': [],
158            'input': 'v1/email-request.json#',
159            'method': 'post',
160            'name': 'email',
161            'route': '/email',
162            'stability': 'experimental',
163        },
164        "listDenylist": {
165            'args': [],
166            'method': 'get',
167            'name': 'listDenylist',
168            'output': 'v1/notification-address-list.json#',
169            'query': ['continuationToken', 'limit'],
170            'route': '/denylist/list',
171            'stability': 'experimental',
172        },
173        "matrix": {
174            'args': [],
175            'input': 'v1/matrix-request.json#',
176            'method': 'post',
177            'name': 'matrix',
178            'route': '/matrix',
179            'stability': 'experimental',
180        },
181        "ping": {
182            'args': [],
183            'method': 'get',
184            'name': 'ping',
185            'route': '/ping',
186            'stability': 'stable',
187        },
188        "pulse": {
189            'args': [],
190            'input': 'v1/pulse-request.json#',
191            'method': 'post',
192            'name': 'pulse',
193            'route': '/pulse',
194            'stability': 'experimental',
195        },
196        "slack": {
197            'args': [],
198            'input': 'v1/slack-request.json#',
199            'method': 'post',
200            'name': 'slack',
201            'route': '/slack',
202            'stability': 'experimental',
203        },
204    }
205
206
207__all__ = ['createTemporaryCredentials', 'config', '_defaultConfig', 'createApiClient', 'createSession', 'Notify']
208