gitcode-api 1.3.1__py3-none-any.whl → 1.3.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gitcode_api/cli.py +2 -2
- gitcode_api/resources/account/orgs_resource_group.py +178 -18
- gitcode_api/resources/account/users_resource_group.py +65 -9
- gitcode_api/resources/collaboration/issues_resource_group.py +334 -26
- gitcode_api/resources/collaboration/milestones_resource_group.py +64 -6
- gitcode_api/resources/collaboration/pulls_resource_group.py +296 -36
- gitcode_api/resources/misc/releases_resource_group.py +8 -5
- gitcode_api/resources/misc/webhooks_resource_group.py +144 -17
- gitcode_api/resources/repositories/repos_resource_group.py +452 -73
- gitcode_api/version.txt +1 -1
- {gitcode_api-1.3.1.dist-info → gitcode_api-1.3.3.dist-info}/METADATA +11 -11
- {gitcode_api-1.3.1.dist-info → gitcode_api-1.3.3.dist-info}/RECORD +16 -16
- {gitcode_api-1.3.1.dist-info → gitcode_api-1.3.3.dist-info}/WHEEL +0 -0
- {gitcode_api-1.3.1.dist-info → gitcode_api-1.3.3.dist-info}/entry_points.txt +0 -0
- {gitcode_api-1.3.1.dist-info → gitcode_api-1.3.3.dist-info}/licenses/LICENSE +0 -0
- {gitcode_api-1.3.1.dist-info → gitcode_api-1.3.3.dist-info}/top_level.txt +0 -0
|
@@ -32,13 +32,34 @@ class AbstractWebhooksResource(ABC):
|
|
|
32
32
|
"""
|
|
33
33
|
|
|
34
34
|
@abstractmethod
|
|
35
|
-
def create(
|
|
35
|
+
def create(
|
|
36
|
+
self,
|
|
37
|
+
*,
|
|
38
|
+
url: str,
|
|
39
|
+
owner: Optional[str] = None,
|
|
40
|
+
repo: Optional[str] = None,
|
|
41
|
+
encryption_type: Optional[int] = None,
|
|
42
|
+
password: Optional[str] = None,
|
|
43
|
+
push_events: Optional[bool] = None,
|
|
44
|
+
tag_push_events: Optional[bool] = None,
|
|
45
|
+
issues_events: Optional[bool] = None,
|
|
46
|
+
note_events: Optional[bool] = None,
|
|
47
|
+
merge_requests_events: Optional[bool] = None,
|
|
48
|
+
**kwargs,
|
|
49
|
+
) -> Webhook:
|
|
36
50
|
"""Create a repository webhook.
|
|
37
51
|
|
|
38
52
|
:param url: Payload URL GitCode should POST events to.
|
|
39
53
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
40
54
|
:param repo: Repository path. Uses the client default when omitted.
|
|
41
|
-
:param
|
|
55
|
+
:param encryption_type: Encryption type: ``0`` (password), ``1`` (signature key).
|
|
56
|
+
:param password: Secret included in requests to prevent malicious calls.
|
|
57
|
+
:param push_events: Trigger on push events.
|
|
58
|
+
:param tag_push_events: Trigger on tag push events.
|
|
59
|
+
:param issues_events: Trigger on issue creation/closure events.
|
|
60
|
+
:param note_events: Trigger on comment events (issue/PR/commit).
|
|
61
|
+
:param merge_requests_events: Trigger on merge request events.
|
|
62
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
42
63
|
:returns: Created webhook.
|
|
43
64
|
"""
|
|
44
65
|
|
|
@@ -60,15 +81,29 @@ class AbstractWebhooksResource(ABC):
|
|
|
60
81
|
url: str,
|
|
61
82
|
owner: Optional[str] = None,
|
|
62
83
|
repo: Optional[str] = None,
|
|
63
|
-
|
|
84
|
+
encryption_type: Optional[int] = None,
|
|
85
|
+
password: Optional[str] = None,
|
|
86
|
+
push_events: Optional[bool] = None,
|
|
87
|
+
tag_push_events: Optional[bool] = None,
|
|
88
|
+
issues_events: Optional[bool] = None,
|
|
89
|
+
note_events: Optional[bool] = None,
|
|
90
|
+
merge_requests_events: Optional[bool] = None,
|
|
91
|
+
**kwargs,
|
|
64
92
|
) -> Webhook:
|
|
65
93
|
"""Update a repository webhook.
|
|
66
94
|
|
|
67
95
|
:param hook_id: Webhook id.
|
|
68
|
-
:param url: New payload URL
|
|
96
|
+
:param url: New payload URL GitCode should POST events to.
|
|
69
97
|
:param owner: Repository owner path. Uses the client default when omitted.
|
|
70
98
|
:param repo: Repository path. Uses the client default when omitted.
|
|
71
|
-
:param
|
|
99
|
+
:param encryption_type: Encryption type: ``0`` (password), ``1`` (signature key).
|
|
100
|
+
:param password: Secret included in requests to prevent malicious calls.
|
|
101
|
+
:param push_events: Trigger on push events.
|
|
102
|
+
:param tag_push_events: Trigger on tag push events.
|
|
103
|
+
:param issues_events: Trigger on issue creation/closure events.
|
|
104
|
+
:param note_events: Trigger on comment events (issue/PR/commit).
|
|
105
|
+
:param merge_requests_events: Trigger on merge request events.
|
|
106
|
+
:param kwargs: Additional arguments forwarded directly in request.
|
|
72
107
|
:returns: Updated webhook.
|
|
73
108
|
"""
|
|
74
109
|
|
|
@@ -109,9 +144,37 @@ class WebhooksResource(SyncResource, AbstractWebhooksResource):
|
|
|
109
144
|
params={"page": page, "per_page": per_page},
|
|
110
145
|
)
|
|
111
146
|
|
|
112
|
-
def create(
|
|
113
|
-
|
|
114
|
-
|
|
147
|
+
def create(
|
|
148
|
+
self,
|
|
149
|
+
*,
|
|
150
|
+
url: str,
|
|
151
|
+
owner: Optional[str] = None,
|
|
152
|
+
repo: Optional[str] = None,
|
|
153
|
+
encryption_type: Optional[int] = None,
|
|
154
|
+
password: Optional[str] = None,
|
|
155
|
+
push_events: Optional[bool] = None,
|
|
156
|
+
tag_push_events: Optional[bool] = None,
|
|
157
|
+
issues_events: Optional[bool] = None,
|
|
158
|
+
note_events: Optional[bool] = None,
|
|
159
|
+
merge_requests_events: Optional[bool] = None,
|
|
160
|
+
**kwargs,
|
|
161
|
+
) -> Webhook:
|
|
162
|
+
return self._model(
|
|
163
|
+
"POST",
|
|
164
|
+
self._client._repo_path("hooks", owner=owner, repo=repo),
|
|
165
|
+
Webhook,
|
|
166
|
+
json={
|
|
167
|
+
"url": url,
|
|
168
|
+
"encryption_type": encryption_type,
|
|
169
|
+
"password": password,
|
|
170
|
+
"push_events": push_events,
|
|
171
|
+
"tag_push_events": tag_push_events,
|
|
172
|
+
"issues_events": issues_events,
|
|
173
|
+
"note_events": note_events,
|
|
174
|
+
"merge_requests_events": merge_requests_events,
|
|
175
|
+
**kwargs,
|
|
176
|
+
},
|
|
177
|
+
)
|
|
115
178
|
|
|
116
179
|
def get(self, *, hook_id: Union[int, str], owner: Optional[str] = None, repo: Optional[str] = None) -> Webhook:
|
|
117
180
|
return self._model("GET", self._client._repo_path("hooks", hook_id, owner=owner, repo=repo), Webhook)
|
|
@@ -123,11 +186,30 @@ class WebhooksResource(SyncResource, AbstractWebhooksResource):
|
|
|
123
186
|
url: str,
|
|
124
187
|
owner: Optional[str] = None,
|
|
125
188
|
repo: Optional[str] = None,
|
|
126
|
-
|
|
189
|
+
encryption_type: Optional[int] = None,
|
|
190
|
+
password: Optional[str] = None,
|
|
191
|
+
push_events: Optional[bool] = None,
|
|
192
|
+
tag_push_events: Optional[bool] = None,
|
|
193
|
+
issues_events: Optional[bool] = None,
|
|
194
|
+
note_events: Optional[bool] = None,
|
|
195
|
+
merge_requests_events: Optional[bool] = None,
|
|
196
|
+
**kwargs,
|
|
127
197
|
) -> Webhook:
|
|
128
|
-
payload["url"] = url
|
|
129
198
|
return self._model(
|
|
130
|
-
"PATCH",
|
|
199
|
+
"PATCH",
|
|
200
|
+
self._client._repo_path("hooks", hook_id, owner=owner, repo=repo),
|
|
201
|
+
Webhook,
|
|
202
|
+
json={
|
|
203
|
+
"url": url,
|
|
204
|
+
"encryption_type": encryption_type,
|
|
205
|
+
"password": password,
|
|
206
|
+
"push_events": push_events,
|
|
207
|
+
"tag_push_events": tag_push_events,
|
|
208
|
+
"issues_events": issues_events,
|
|
209
|
+
"note_events": note_events,
|
|
210
|
+
"merge_requests_events": merge_requests_events,
|
|
211
|
+
**kwargs,
|
|
212
|
+
},
|
|
131
213
|
)
|
|
132
214
|
|
|
133
215
|
def delete(self, *, hook_id: Union[int, str], owner: Optional[str] = None, repo: Optional[str] = None) -> None:
|
|
@@ -158,10 +240,36 @@ class AsyncWebhooksResource(AsyncResource, AbstractWebhooksResource):
|
|
|
158
240
|
params={"page": page, "per_page": per_page},
|
|
159
241
|
)
|
|
160
242
|
|
|
161
|
-
async def create(
|
|
162
|
-
|
|
243
|
+
async def create(
|
|
244
|
+
self,
|
|
245
|
+
*,
|
|
246
|
+
url: str,
|
|
247
|
+
owner: Optional[str] = None,
|
|
248
|
+
repo: Optional[str] = None,
|
|
249
|
+
encryption_type: Optional[int] = None,
|
|
250
|
+
password: Optional[str] = None,
|
|
251
|
+
push_events: Optional[bool] = None,
|
|
252
|
+
tag_push_events: Optional[bool] = None,
|
|
253
|
+
issues_events: Optional[bool] = None,
|
|
254
|
+
note_events: Optional[bool] = None,
|
|
255
|
+
merge_requests_events: Optional[bool] = None,
|
|
256
|
+
**kwargs,
|
|
257
|
+
) -> Webhook:
|
|
163
258
|
return await self._model(
|
|
164
|
-
"POST",
|
|
259
|
+
"POST",
|
|
260
|
+
self._client._repo_path("hooks", owner=owner, repo=repo),
|
|
261
|
+
Webhook,
|
|
262
|
+
json={
|
|
263
|
+
"url": url,
|
|
264
|
+
"encryption_type": encryption_type,
|
|
265
|
+
"password": password,
|
|
266
|
+
"push_events": push_events,
|
|
267
|
+
"tag_push_events": tag_push_events,
|
|
268
|
+
"issues_events": issues_events,
|
|
269
|
+
"note_events": note_events,
|
|
270
|
+
"merge_requests_events": merge_requests_events,
|
|
271
|
+
**kwargs,
|
|
272
|
+
},
|
|
165
273
|
)
|
|
166
274
|
|
|
167
275
|
async def get(
|
|
@@ -176,11 +284,30 @@ class AsyncWebhooksResource(AsyncResource, AbstractWebhooksResource):
|
|
|
176
284
|
url: str,
|
|
177
285
|
owner: Optional[str] = None,
|
|
178
286
|
repo: Optional[str] = None,
|
|
179
|
-
|
|
287
|
+
encryption_type: Optional[int] = None,
|
|
288
|
+
password: Optional[str] = None,
|
|
289
|
+
push_events: Optional[bool] = None,
|
|
290
|
+
tag_push_events: Optional[bool] = None,
|
|
291
|
+
issues_events: Optional[bool] = None,
|
|
292
|
+
note_events: Optional[bool] = None,
|
|
293
|
+
merge_requests_events: Optional[bool] = None,
|
|
294
|
+
**kwargs,
|
|
180
295
|
) -> Webhook:
|
|
181
|
-
payload["url"] = url
|
|
182
296
|
return await self._model(
|
|
183
|
-
"PATCH",
|
|
297
|
+
"PATCH",
|
|
298
|
+
self._client._repo_path("hooks", hook_id, owner=owner, repo=repo),
|
|
299
|
+
Webhook,
|
|
300
|
+
json={
|
|
301
|
+
"url": url,
|
|
302
|
+
"encryption_type": encryption_type,
|
|
303
|
+
"password": password,
|
|
304
|
+
"push_events": push_events,
|
|
305
|
+
"tag_push_events": tag_push_events,
|
|
306
|
+
"issues_events": issues_events,
|
|
307
|
+
"note_events": note_events,
|
|
308
|
+
"merge_requests_events": merge_requests_events,
|
|
309
|
+
**kwargs,
|
|
310
|
+
},
|
|
184
311
|
)
|
|
185
312
|
|
|
186
313
|
async def delete(
|