summaryrefslogtreecommitdiffstats
path: root/third_party/python/taskcluster/taskcluster/generated/hooks.py
blob: efaaf4b831362005c4d91a15fad55e43ba8c01a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
# coding=utf-8
#####################################################
# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT #
#####################################################
# noqa: E128,E201
from ..client import BaseClient
from ..client import createApiClient
from ..client import config
from ..client import createTemporaryCredentials
from ..client import createSession
_defaultConfig = config


class Hooks(BaseClient):
    """
    The hooks service provides a mechanism for creating tasks in response to events.

    """

    classOptions = {
    }
    serviceName = 'hooks'
    apiVersion = 'v1'

    def ping(self, *args, **kwargs):
        """
        Ping Server

        Respond without doing anything.
        This endpoint is used to check that the service is up.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["ping"], *args, **kwargs)

    def listHookGroups(self, *args, **kwargs):
        """
        List hook groups

        This endpoint will return a list of all hook groups with at least one hook.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["listHookGroups"], *args, **kwargs)

    def listHooks(self, *args, **kwargs):
        """
        List hooks in a given group

        This endpoint will return a list of all the hook definitions within a
        given hook group.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["listHooks"], *args, **kwargs)

    def hook(self, *args, **kwargs):
        """
        Get hook definition

        This endpoint will return the hook definition for the given `hookGroupId`
        and hookId.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["hook"], *args, **kwargs)

    def getHookStatus(self, *args, **kwargs):
        """
        Get hook status

        This endpoint will return the current status of the hook.  This represents a
        snapshot in time and may vary from one call to the next.

        This method is deprecated in favor of listLastFires.

        This method is ``deprecated``
        """

        return self._makeApiCall(self.funcinfo["getHookStatus"], *args, **kwargs)

    def createHook(self, *args, **kwargs):
        """
        Create a hook

        This endpoint will create a new hook.

        The caller's credentials must include the role that will be used to
        create the task.  That role must satisfy task.scopes as well as the
        necessary scopes to add the task to the queue.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["createHook"], *args, **kwargs)

    def updateHook(self, *args, **kwargs):
        """
        Update a hook

        This endpoint will update an existing hook.  All fields except
        `hookGroupId` and `hookId` can be modified.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["updateHook"], *args, **kwargs)

    def removeHook(self, *args, **kwargs):
        """
        Delete a hook

        This endpoint will remove a hook definition.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["removeHook"], *args, **kwargs)

    def triggerHook(self, *args, **kwargs):
        """
        Trigger a hook

        This endpoint will trigger the creation of a task from a hook definition.

        The HTTP payload must match the hooks `triggerSchema`.  If it does, it is
        provided as the `payload` property of the JSON-e context used to render the
        task template.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["triggerHook"], *args, **kwargs)

    def getTriggerToken(self, *args, **kwargs):
        """
        Get a trigger token

        Retrieve a unique secret token for triggering the specified hook. This
        token can be deactivated with `resetTriggerToken`.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["getTriggerToken"], *args, **kwargs)

    def resetTriggerToken(self, *args, **kwargs):
        """
        Reset a trigger token

        Reset the token for triggering a given hook. This invalidates token that
        may have been issued via getTriggerToken with a new token.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["resetTriggerToken"], *args, **kwargs)

    def triggerHookWithToken(self, *args, **kwargs):
        """
        Trigger a hook with a token

        This endpoint triggers a defined hook with a valid token.

        The HTTP payload must match the hooks `triggerSchema`.  If it does, it is
        provided as the `payload` property of the JSON-e context used to render the
        task template.

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["triggerHookWithToken"], *args, **kwargs)

    def listLastFires(self, *args, **kwargs):
        """
        Get information about recent hook fires

        This endpoint will return information about the the last few times this hook has been
        fired, including whether the hook was fired successfully or not

        This method is ``stable``
        """

        return self._makeApiCall(self.funcinfo["listLastFires"], *args, **kwargs)

    funcinfo = {
        "createHook": {
            'args': ['hookGroupId', 'hookId'],
            'input': 'v1/create-hook-request.json#',
            'method': 'put',
            'name': 'createHook',
            'output': 'v1/hook-definition.json#',
            'route': '/hooks/<hookGroupId>/<hookId>',
            'stability': 'stable',
        },
        "getHookStatus": {
            'args': ['hookGroupId', 'hookId'],
            'method': 'get',
            'name': 'getHookStatus',
            'output': 'v1/hook-status.json#',
            'route': '/hooks/<hookGroupId>/<hookId>/status',
            'stability': 'deprecated',
        },
        "getTriggerToken": {
            'args': ['hookGroupId', 'hookId'],
            'method': 'get',
            'name': 'getTriggerToken',
            'output': 'v1/trigger-token-response.json#',
            'route': '/hooks/<hookGroupId>/<hookId>/token',
            'stability': 'stable',
        },
        "hook": {
            'args': ['hookGroupId', 'hookId'],
            'method': 'get',
            'name': 'hook',
            'output': 'v1/hook-definition.json#',
            'route': '/hooks/<hookGroupId>/<hookId>',
            'stability': 'stable',
        },
        "listHookGroups": {
            'args': [],
            'method': 'get',
            'name': 'listHookGroups',
            'output': 'v1/list-hook-groups-response.json#',
            'route': '/hooks',
            'stability': 'stable',
        },
        "listHooks": {
            'args': ['hookGroupId'],
            'method': 'get',
            'name': 'listHooks',
            'output': 'v1/list-hooks-response.json#',
            'route': '/hooks/<hookGroupId>',
            'stability': 'stable',
        },
        "listLastFires": {
            'args': ['hookGroupId', 'hookId'],
            'method': 'get',
            'name': 'listLastFires',
            'output': 'v1/list-lastFires-response.json#',
            'route': '/hooks/<hookGroupId>/<hookId>/last-fires',
            'stability': 'stable',
        },
        "ping": {
            'args': [],
            'method': 'get',
            'name': 'ping',
            'route': '/ping',
            'stability': 'stable',
        },
        "removeHook": {
            'args': ['hookGroupId', 'hookId'],
            'method': 'delete',
            'name': 'removeHook',
            'route': '/hooks/<hookGroupId>/<hookId>',
            'stability': 'stable',
        },
        "resetTriggerToken": {
            'args': ['hookGroupId', 'hookId'],
            'method': 'post',
            'name': 'resetTriggerToken',
            'output': 'v1/trigger-token-response.json#',
            'route': '/hooks/<hookGroupId>/<hookId>/token',
            'stability': 'stable',
        },
        "triggerHook": {
            'args': ['hookGroupId', 'hookId'],
            'input': 'v1/trigger-hook.json#',
            'method': 'post',
            'name': 'triggerHook',
            'output': 'v1/trigger-hook-response.json#',
            'route': '/hooks/<hookGroupId>/<hookId>/trigger',
            'stability': 'stable',
        },
        "triggerHookWithToken": {
            'args': ['hookGroupId', 'hookId', 'token'],
            'input': 'v1/trigger-hook.json#',
            'method': 'post',
            'name': 'triggerHookWithToken',
            'output': 'v1/trigger-hook-response.json#',
            'route': '/hooks/<hookGroupId>/<hookId>/trigger/<token>',
            'stability': 'stable',
        },
        "updateHook": {
            'args': ['hookGroupId', 'hookId'],
            'input': 'v1/create-hook-request.json#',
            'method': 'post',
            'name': 'updateHook',
            'output': 'v1/hook-definition.json#',
            'route': '/hooks/<hookGroupId>/<hookId>',
            'stability': 'stable',
        },
    }


__all__ = ['createTemporaryCredentials', 'config', '_defaultConfig', 'createApiClient', 'createSession', 'Hooks']