dub 0.34.0__py3-none-any.whl → 0.35.0__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.
- dub/_version.py +3 -3
- dub/basesdk.py +20 -6
- dub/{workspaces.py → bounties.py} +349 -69
- dub/models/components/__init__.py +114 -26
- dub/models/components/analyticsbrowsers.py +18 -1
- dub/models/components/analyticscities.py +18 -1
- dub/models/components/analyticscontinents.py +18 -1
- dub/models/components/analyticscount.py +18 -1
- dub/models/components/analyticscountries.py +20 -1
- dub/models/components/analyticsdevices.py +18 -1
- dub/models/components/analyticsos.py +18 -1
- dub/models/components/analyticsreferers.py +18 -1
- dub/models/components/analyticsrefererurls.py +18 -1
- dub/models/components/analyticsregions.py +18 -1
- dub/models/components/analyticstimeseries.py +18 -1
- dub/models/components/analyticstoplinks.py +16 -26
- dub/models/components/analyticstopurls.py +18 -1
- dub/models/components/analyticstriggers.py +18 -1
- dub/models/components/commissioncreatedevent.py +123 -63
- dub/models/components/domainschema.py +31 -50
- dub/models/components/folderschema.py +18 -19
- dub/models/components/leadcreatedevent.py +151 -134
- dub/models/components/linkclickedevent.py +57 -70
- dub/models/components/linkschema.py +63 -64
- dub/models/components/linkwebhookevent.py +43 -51
- dub/models/components/partneranalyticscount.py +18 -1
- dub/models/components/partneranalyticstimeseries.py +18 -1
- dub/models/components/partneranalyticstoplinks.py +16 -27
- dub/models/components/partnerapplicationsubmittedevent.py +42 -75
- dub/models/components/partnerenrolledevent.py +477 -83
- dub/models/components/salecreatedevent.py +152 -151
- dub/models/errors/badrequest.py +18 -1
- dub/models/errors/conflict.py +18 -1
- dub/models/errors/forbidden.py +18 -1
- dub/models/errors/internalservererror.py +18 -1
- dub/models/errors/inviteexpired.py +18 -1
- dub/models/errors/notfound.py +18 -1
- dub/models/errors/ratelimitexceeded.py +18 -1
- dub/models/errors/unauthorized.py +18 -1
- dub/models/errors/unprocessableentity.py +18 -1
- dub/models/operations/__init__.py +323 -19
- dub/models/operations/approvebountysubmission.py +211 -0
- dub/models/operations/banpartner.py +14 -19
- dub/models/operations/bulkcreatelinks.py +86 -87
- dub/models/operations/bulkupdatelinks.py +97 -82
- dub/models/operations/checkdomainstatus.py +1 -17
- dub/models/operations/createdomain.py +33 -34
- dub/models/operations/createfolder.py +18 -19
- dub/models/operations/createlink.py +86 -87
- dub/models/operations/createpartner.py +560 -168
- dub/models/operations/createpartnerlink.py +74 -85
- dub/models/operations/createreferralsembedtoken.py +99 -87
- dub/models/operations/createtag.py +18 -1
- dub/models/operations/deactivatepartner.py +65 -0
- dub/models/operations/getcustomer.py +106 -105
- dub/models/operations/getcustomers.py +123 -105
- dub/models/operations/getlinkinfo.py +18 -1
- dub/models/operations/getlinks.py +36 -1
- dub/models/operations/getlinkscount.py +32 -1
- dub/models/operations/getqrcode.py +29 -1
- dub/models/operations/gettags.py +20 -1
- dub/models/operations/listbountysubmissions.py +249 -0
- dub/models/operations/listcommissions.py +129 -64
- dub/models/operations/listdomains.py +18 -1
- dub/models/operations/listevents.py +414 -389
- dub/models/operations/listfolders.py +18 -1
- dub/models/operations/listpartners.py +510 -84
- dub/models/operations/registerdomain.py +1 -17
- dub/models/operations/rejectbountysubmission.py +219 -0
- dub/models/operations/retrieveanalytics.py +65 -66
- dub/models/operations/retrievelinks.py +30 -19
- dub/models/operations/retrievepartneranalytics.py +25 -28
- dub/models/operations/tracklead.py +38 -83
- dub/models/operations/tracksale.py +52 -95
- dub/models/operations/updatecommission.py +126 -64
- dub/models/operations/updatecustomer.py +122 -131
- dub/models/operations/updatedomain.py +50 -35
- dub/models/operations/updatefolder.py +34 -19
- dub/models/operations/updatelink.py +101 -86
- dub/models/operations/updatetag.py +34 -1
- dub/models/operations/upsertlink.py +86 -87
- dub/models/operations/upsertpartnerlink.py +77 -90
- dub/partners.py +288 -0
- dub/sdk.py +3 -3
- dub/utils/__init__.py +10 -1
- {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/METADATA +10 -8
- dub-0.35.0.dist-info/RECORD +143 -0
- dub/models/components/workspaceschema.py +0 -328
- dub/models/operations/getworkspace.py +0 -21
- dub/models/operations/updateworkspace.py +0 -78
- dub-0.34.0.dist-info/RECORD +0 -142
- {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
- {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/licenses/LICENSE +0 -0
dub/_version.py
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import importlib.metadata
|
|
4
4
|
|
|
5
5
|
__title__: str = "dub"
|
|
6
|
-
__version__: str = "0.
|
|
6
|
+
__version__: str = "0.35.0"
|
|
7
7
|
__openapi_doc_version__: str = "0.0.1"
|
|
8
|
-
__gen_version__: str = "2.
|
|
9
|
-
__user_agent__: str = "speakeasy-sdk/python 0.
|
|
8
|
+
__gen_version__: str = "2.803.3"
|
|
9
|
+
__user_agent__: str = "speakeasy-sdk/python 0.35.0 2.803.3 0.0.1 dub"
|
|
10
10
|
|
|
11
11
|
try:
|
|
12
12
|
if __package__ is not None:
|
dub/basesdk.py
CHANGED
|
@@ -4,7 +4,12 @@ from .sdkconfiguration import SDKConfiguration
|
|
|
4
4
|
from dub import utils
|
|
5
5
|
from dub._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext
|
|
6
6
|
from dub.models import errors
|
|
7
|
-
from dub.utils import
|
|
7
|
+
from dub.utils import (
|
|
8
|
+
RetryConfig,
|
|
9
|
+
SerializedRequestBody,
|
|
10
|
+
get_body_content,
|
|
11
|
+
run_sync_in_thread,
|
|
12
|
+
)
|
|
8
13
|
import httpx
|
|
9
14
|
from typing import Callable, List, Mapping, Optional, Tuple
|
|
10
15
|
from urllib.parse import parse_qs, urlparse
|
|
@@ -308,7 +313,10 @@ class BaseSDK:
|
|
|
308
313
|
async def do():
|
|
309
314
|
http_res = None
|
|
310
315
|
try:
|
|
311
|
-
req =
|
|
316
|
+
req = await run_sync_in_thread(
|
|
317
|
+
hooks.before_request, BeforeRequestContext(hook_ctx), request
|
|
318
|
+
)
|
|
319
|
+
|
|
312
320
|
logger.debug(
|
|
313
321
|
"Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
|
|
314
322
|
req.method,
|
|
@@ -322,7 +330,10 @@ class BaseSDK:
|
|
|
322
330
|
|
|
323
331
|
http_res = await client.send(req, stream=stream)
|
|
324
332
|
except Exception as e:
|
|
325
|
-
_, e =
|
|
333
|
+
_, e = await run_sync_in_thread(
|
|
334
|
+
hooks.after_error, AfterErrorContext(hook_ctx), None, e
|
|
335
|
+
)
|
|
336
|
+
|
|
326
337
|
if e is not None:
|
|
327
338
|
logger.debug("Request Exception", exc_info=True)
|
|
328
339
|
raise e
|
|
@@ -340,9 +351,10 @@ class BaseSDK:
|
|
|
340
351
|
)
|
|
341
352
|
|
|
342
353
|
if utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
343
|
-
result, err =
|
|
344
|
-
AfterErrorContext(hook_ctx), http_res, None
|
|
354
|
+
result, err = await run_sync_in_thread(
|
|
355
|
+
hooks.after_error, AfterErrorContext(hook_ctx), http_res, None
|
|
345
356
|
)
|
|
357
|
+
|
|
346
358
|
if err is not None:
|
|
347
359
|
logger.debug("Request Exception", exc_info=True)
|
|
348
360
|
raise err
|
|
@@ -362,6 +374,8 @@ class BaseSDK:
|
|
|
362
374
|
http_res = await do()
|
|
363
375
|
|
|
364
376
|
if not utils.match_status_codes(error_status_codes, http_res.status_code):
|
|
365
|
-
http_res =
|
|
377
|
+
http_res = await run_sync_in_thread(
|
|
378
|
+
hooks.after_success, AfterSuccessContext(hook_ctx), http_res
|
|
379
|
+
)
|
|
366
380
|
|
|
367
381
|
return http_res
|
|
@@ -3,27 +3,28 @@
|
|
|
3
3
|
from .basesdk import BaseSDK
|
|
4
4
|
from dub import utils
|
|
5
5
|
from dub._hooks import HookContext
|
|
6
|
-
from dub.models import
|
|
6
|
+
from dub.models import errors, operations
|
|
7
7
|
from dub.types import BaseModel, OptionalNullable, UNSET
|
|
8
8
|
from dub.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
-
from typing import Any, Mapping, Optional, Union, cast
|
|
9
|
+
from typing import Any, List, Mapping, Optional, Union, cast
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
class
|
|
13
|
-
def
|
|
12
|
+
class Bounties(BaseSDK):
|
|
13
|
+
def list_submissions(
|
|
14
14
|
self,
|
|
15
15
|
*,
|
|
16
16
|
request: Union[
|
|
17
|
-
operations.
|
|
17
|
+
operations.ListBountySubmissionsRequest,
|
|
18
|
+
operations.ListBountySubmissionsRequestTypedDict,
|
|
18
19
|
],
|
|
19
20
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
20
21
|
server_url: Optional[str] = None,
|
|
21
22
|
timeout_ms: Optional[int] = None,
|
|
22
23
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
23
|
-
) ->
|
|
24
|
-
r"""
|
|
24
|
+
) -> List[operations.ListBountySubmissionsResponseBody]:
|
|
25
|
+
r"""List bounty submissions
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
List all submissions for a specific bounty.
|
|
27
28
|
|
|
28
29
|
:param request: The request object to send.
|
|
29
30
|
:param retries: Override the default retry configuration for this method
|
|
@@ -42,12 +43,12 @@ class Workspaces(BaseSDK):
|
|
|
42
43
|
base_url = self._get_url(base_url, url_variables)
|
|
43
44
|
|
|
44
45
|
if not isinstance(request, BaseModel):
|
|
45
|
-
request = utils.unmarshal(request, operations.
|
|
46
|
-
request = cast(operations.
|
|
46
|
+
request = utils.unmarshal(request, operations.ListBountySubmissionsRequest)
|
|
47
|
+
request = cast(operations.ListBountySubmissionsRequest, request)
|
|
47
48
|
|
|
48
49
|
req = self._build_request(
|
|
49
50
|
method="GET",
|
|
50
|
-
path="/
|
|
51
|
+
path="/bounties/{bountyId}/submissions",
|
|
51
52
|
base_url=base_url,
|
|
52
53
|
url_variables=url_variables,
|
|
53
54
|
request=request,
|
|
@@ -74,7 +75,7 @@ class Workspaces(BaseSDK):
|
|
|
74
75
|
hook_ctx=HookContext(
|
|
75
76
|
config=self.sdk_configuration,
|
|
76
77
|
base_url=base_url or "",
|
|
77
|
-
operation_id="
|
|
78
|
+
operation_id="listBountySubmissions",
|
|
78
79
|
oauth2_scopes=None,
|
|
79
80
|
security_source=self.sdk_configuration.security,
|
|
80
81
|
),
|
|
@@ -97,7 +98,9 @@ class Workspaces(BaseSDK):
|
|
|
97
98
|
|
|
98
99
|
response_data: Any = None
|
|
99
100
|
if utils.match_response(http_res, "200", "application/json"):
|
|
100
|
-
return unmarshal_json_response(
|
|
101
|
+
return unmarshal_json_response(
|
|
102
|
+
List[operations.ListBountySubmissionsResponseBody], http_res
|
|
103
|
+
)
|
|
101
104
|
if utils.match_response(http_res, "400", "application/json"):
|
|
102
105
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
103
106
|
raise errors.BadRequest(response_data, http_res)
|
|
@@ -140,20 +143,21 @@ class Workspaces(BaseSDK):
|
|
|
140
143
|
|
|
141
144
|
raise errors.SDKError("Unexpected response received", http_res)
|
|
142
145
|
|
|
143
|
-
async def
|
|
146
|
+
async def list_submissions_async(
|
|
144
147
|
self,
|
|
145
148
|
*,
|
|
146
149
|
request: Union[
|
|
147
|
-
operations.
|
|
150
|
+
operations.ListBountySubmissionsRequest,
|
|
151
|
+
operations.ListBountySubmissionsRequestTypedDict,
|
|
148
152
|
],
|
|
149
153
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
150
154
|
server_url: Optional[str] = None,
|
|
151
155
|
timeout_ms: Optional[int] = None,
|
|
152
156
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
153
|
-
) ->
|
|
154
|
-
r"""
|
|
157
|
+
) -> List[operations.ListBountySubmissionsResponseBody]:
|
|
158
|
+
r"""List bounty submissions
|
|
155
159
|
|
|
156
|
-
|
|
160
|
+
List all submissions for a specific bounty.
|
|
157
161
|
|
|
158
162
|
:param request: The request object to send.
|
|
159
163
|
:param retries: Override the default retry configuration for this method
|
|
@@ -172,12 +176,12 @@ class Workspaces(BaseSDK):
|
|
|
172
176
|
base_url = self._get_url(base_url, url_variables)
|
|
173
177
|
|
|
174
178
|
if not isinstance(request, BaseModel):
|
|
175
|
-
request = utils.unmarshal(request, operations.
|
|
176
|
-
request = cast(operations.
|
|
179
|
+
request = utils.unmarshal(request, operations.ListBountySubmissionsRequest)
|
|
180
|
+
request = cast(operations.ListBountySubmissionsRequest, request)
|
|
177
181
|
|
|
178
182
|
req = self._build_request_async(
|
|
179
183
|
method="GET",
|
|
180
|
-
path="/
|
|
184
|
+
path="/bounties/{bountyId}/submissions",
|
|
181
185
|
base_url=base_url,
|
|
182
186
|
url_variables=url_variables,
|
|
183
187
|
request=request,
|
|
@@ -204,7 +208,7 @@ class Workspaces(BaseSDK):
|
|
|
204
208
|
hook_ctx=HookContext(
|
|
205
209
|
config=self.sdk_configuration,
|
|
206
210
|
base_url=base_url or "",
|
|
207
|
-
operation_id="
|
|
211
|
+
operation_id="listBountySubmissions",
|
|
208
212
|
oauth2_scopes=None,
|
|
209
213
|
security_source=self.sdk_configuration.security,
|
|
210
214
|
),
|
|
@@ -227,7 +231,9 @@ class Workspaces(BaseSDK):
|
|
|
227
231
|
|
|
228
232
|
response_data: Any = None
|
|
229
233
|
if utils.match_response(http_res, "200", "application/json"):
|
|
230
|
-
return unmarshal_json_response(
|
|
234
|
+
return unmarshal_json_response(
|
|
235
|
+
List[operations.ListBountySubmissionsResponseBody], http_res
|
|
236
|
+
)
|
|
231
237
|
if utils.match_response(http_res, "400", "application/json"):
|
|
232
238
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
233
239
|
raise errors.BadRequest(response_data, http_res)
|
|
@@ -270,27 +276,23 @@ class Workspaces(BaseSDK):
|
|
|
270
276
|
|
|
271
277
|
raise errors.SDKError("Unexpected response received", http_res)
|
|
272
278
|
|
|
273
|
-
def
|
|
279
|
+
def approve_submission(
|
|
274
280
|
self,
|
|
275
281
|
*,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
operations.UpdateWorkspaceRequestBodyTypedDict,
|
|
281
|
-
]
|
|
282
|
-
] = None,
|
|
282
|
+
request: Union[
|
|
283
|
+
operations.ApproveBountySubmissionRequest,
|
|
284
|
+
operations.ApproveBountySubmissionRequestTypedDict,
|
|
285
|
+
],
|
|
283
286
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
284
287
|
server_url: Optional[str] = None,
|
|
285
288
|
timeout_ms: Optional[int] = None,
|
|
286
289
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
287
|
-
) ->
|
|
288
|
-
r"""
|
|
290
|
+
) -> operations.ApproveBountySubmissionResponseBody:
|
|
291
|
+
r"""Approve a bounty submission
|
|
289
292
|
|
|
290
|
-
|
|
293
|
+
Approve a bounty submission. Optionally specify a custom reward amount.
|
|
291
294
|
|
|
292
|
-
:param
|
|
293
|
-
:param request_body:
|
|
295
|
+
:param request: The request object to send.
|
|
294
296
|
:param retries: Override the default retry configuration for this method
|
|
295
297
|
:param server_url: Override the default server URL for this method
|
|
296
298
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -306,16 +308,15 @@ class Workspaces(BaseSDK):
|
|
|
306
308
|
else:
|
|
307
309
|
base_url = self._get_url(base_url, url_variables)
|
|
308
310
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
)
|
|
311
|
+
if not isinstance(request, BaseModel):
|
|
312
|
+
request = utils.unmarshal(
|
|
313
|
+
request, operations.ApproveBountySubmissionRequest
|
|
314
|
+
)
|
|
315
|
+
request = cast(operations.ApproveBountySubmissionRequest, request)
|
|
315
316
|
|
|
316
317
|
req = self._build_request(
|
|
317
|
-
method="
|
|
318
|
-
path="/
|
|
318
|
+
method="POST",
|
|
319
|
+
path="/bounties/{bountyId}/submissions/{submissionId}/approve",
|
|
319
320
|
base_url=base_url,
|
|
320
321
|
url_variables=url_variables,
|
|
321
322
|
request=request,
|
|
@@ -331,7 +332,7 @@ class Workspaces(BaseSDK):
|
|
|
331
332
|
False,
|
|
332
333
|
True,
|
|
333
334
|
"json",
|
|
334
|
-
Optional[operations.
|
|
335
|
+
Optional[operations.ApproveBountySubmissionRequestBody],
|
|
335
336
|
),
|
|
336
337
|
allow_empty_value=None,
|
|
337
338
|
timeout_ms=timeout_ms,
|
|
@@ -349,7 +350,7 @@ class Workspaces(BaseSDK):
|
|
|
349
350
|
hook_ctx=HookContext(
|
|
350
351
|
config=self.sdk_configuration,
|
|
351
352
|
base_url=base_url or "",
|
|
352
|
-
operation_id="
|
|
353
|
+
operation_id="approveBountySubmission",
|
|
353
354
|
oauth2_scopes=None,
|
|
354
355
|
security_source=self.sdk_configuration.security,
|
|
355
356
|
),
|
|
@@ -372,7 +373,9 @@ class Workspaces(BaseSDK):
|
|
|
372
373
|
|
|
373
374
|
response_data: Any = None
|
|
374
375
|
if utils.match_response(http_res, "200", "application/json"):
|
|
375
|
-
return unmarshal_json_response(
|
|
376
|
+
return unmarshal_json_response(
|
|
377
|
+
operations.ApproveBountySubmissionResponseBody, http_res
|
|
378
|
+
)
|
|
376
379
|
if utils.match_response(http_res, "400", "application/json"):
|
|
377
380
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
378
381
|
raise errors.BadRequest(response_data, http_res)
|
|
@@ -415,27 +418,165 @@ class Workspaces(BaseSDK):
|
|
|
415
418
|
|
|
416
419
|
raise errors.SDKError("Unexpected response received", http_res)
|
|
417
420
|
|
|
418
|
-
async def
|
|
421
|
+
async def approve_submission_async(
|
|
422
|
+
self,
|
|
423
|
+
*,
|
|
424
|
+
request: Union[
|
|
425
|
+
operations.ApproveBountySubmissionRequest,
|
|
426
|
+
operations.ApproveBountySubmissionRequestTypedDict,
|
|
427
|
+
],
|
|
428
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
429
|
+
server_url: Optional[str] = None,
|
|
430
|
+
timeout_ms: Optional[int] = None,
|
|
431
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
432
|
+
) -> operations.ApproveBountySubmissionResponseBody:
|
|
433
|
+
r"""Approve a bounty submission
|
|
434
|
+
|
|
435
|
+
Approve a bounty submission. Optionally specify a custom reward amount.
|
|
436
|
+
|
|
437
|
+
:param request: The request object to send.
|
|
438
|
+
:param retries: Override the default retry configuration for this method
|
|
439
|
+
:param server_url: Override the default server URL for this method
|
|
440
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
441
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
442
|
+
"""
|
|
443
|
+
base_url = None
|
|
444
|
+
url_variables = None
|
|
445
|
+
if timeout_ms is None:
|
|
446
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
447
|
+
|
|
448
|
+
if server_url is not None:
|
|
449
|
+
base_url = server_url
|
|
450
|
+
else:
|
|
451
|
+
base_url = self._get_url(base_url, url_variables)
|
|
452
|
+
|
|
453
|
+
if not isinstance(request, BaseModel):
|
|
454
|
+
request = utils.unmarshal(
|
|
455
|
+
request, operations.ApproveBountySubmissionRequest
|
|
456
|
+
)
|
|
457
|
+
request = cast(operations.ApproveBountySubmissionRequest, request)
|
|
458
|
+
|
|
459
|
+
req = self._build_request_async(
|
|
460
|
+
method="POST",
|
|
461
|
+
path="/bounties/{bountyId}/submissions/{submissionId}/approve",
|
|
462
|
+
base_url=base_url,
|
|
463
|
+
url_variables=url_variables,
|
|
464
|
+
request=request,
|
|
465
|
+
request_body_required=False,
|
|
466
|
+
request_has_path_params=True,
|
|
467
|
+
request_has_query_params=True,
|
|
468
|
+
user_agent_header="user-agent",
|
|
469
|
+
accept_header_value="application/json",
|
|
470
|
+
http_headers=http_headers,
|
|
471
|
+
security=self.sdk_configuration.security,
|
|
472
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
473
|
+
request.request_body,
|
|
474
|
+
False,
|
|
475
|
+
True,
|
|
476
|
+
"json",
|
|
477
|
+
Optional[operations.ApproveBountySubmissionRequestBody],
|
|
478
|
+
),
|
|
479
|
+
allow_empty_value=None,
|
|
480
|
+
timeout_ms=timeout_ms,
|
|
481
|
+
)
|
|
482
|
+
|
|
483
|
+
if retries == UNSET:
|
|
484
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
485
|
+
retries = self.sdk_configuration.retry_config
|
|
486
|
+
|
|
487
|
+
retry_config = None
|
|
488
|
+
if isinstance(retries, utils.RetryConfig):
|
|
489
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
490
|
+
|
|
491
|
+
http_res = await self.do_request_async(
|
|
492
|
+
hook_ctx=HookContext(
|
|
493
|
+
config=self.sdk_configuration,
|
|
494
|
+
base_url=base_url or "",
|
|
495
|
+
operation_id="approveBountySubmission",
|
|
496
|
+
oauth2_scopes=None,
|
|
497
|
+
security_source=self.sdk_configuration.security,
|
|
498
|
+
),
|
|
499
|
+
request=req,
|
|
500
|
+
error_status_codes=[
|
|
501
|
+
"400",
|
|
502
|
+
"401",
|
|
503
|
+
"403",
|
|
504
|
+
"404",
|
|
505
|
+
"409",
|
|
506
|
+
"410",
|
|
507
|
+
"422",
|
|
508
|
+
"429",
|
|
509
|
+
"4XX",
|
|
510
|
+
"500",
|
|
511
|
+
"5XX",
|
|
512
|
+
],
|
|
513
|
+
retry_config=retry_config,
|
|
514
|
+
)
|
|
515
|
+
|
|
516
|
+
response_data: Any = None
|
|
517
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
518
|
+
return unmarshal_json_response(
|
|
519
|
+
operations.ApproveBountySubmissionResponseBody, http_res
|
|
520
|
+
)
|
|
521
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
522
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
523
|
+
raise errors.BadRequest(response_data, http_res)
|
|
524
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
525
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
526
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
527
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
528
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
529
|
+
raise errors.Forbidden(response_data, http_res)
|
|
530
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
531
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
532
|
+
raise errors.NotFound(response_data, http_res)
|
|
533
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
534
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
535
|
+
raise errors.Conflict(response_data, http_res)
|
|
536
|
+
if utils.match_response(http_res, "410", "application/json"):
|
|
537
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
538
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
539
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
540
|
+
response_data = unmarshal_json_response(
|
|
541
|
+
errors.UnprocessableEntityData, http_res
|
|
542
|
+
)
|
|
543
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
544
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
545
|
+
response_data = unmarshal_json_response(
|
|
546
|
+
errors.RateLimitExceededData, http_res
|
|
547
|
+
)
|
|
548
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
549
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
550
|
+
response_data = unmarshal_json_response(
|
|
551
|
+
errors.InternalServerErrorData, http_res
|
|
552
|
+
)
|
|
553
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
554
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
555
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
556
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
557
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
558
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
559
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
560
|
+
|
|
561
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
562
|
+
|
|
563
|
+
def reject_submission(
|
|
419
564
|
self,
|
|
420
565
|
*,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
operations.UpdateWorkspaceRequestBodyTypedDict,
|
|
426
|
-
]
|
|
427
|
-
] = None,
|
|
566
|
+
request: Union[
|
|
567
|
+
operations.RejectBountySubmissionRequest,
|
|
568
|
+
operations.RejectBountySubmissionRequestTypedDict,
|
|
569
|
+
],
|
|
428
570
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
429
571
|
server_url: Optional[str] = None,
|
|
430
572
|
timeout_ms: Optional[int] = None,
|
|
431
573
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
432
|
-
) ->
|
|
433
|
-
r"""
|
|
574
|
+
) -> operations.RejectBountySubmissionResponseBody:
|
|
575
|
+
r"""Reject a bounty submission
|
|
434
576
|
|
|
435
|
-
|
|
577
|
+
Reject a bounty submission with a specified reason and optional note.
|
|
436
578
|
|
|
437
|
-
:param
|
|
438
|
-
:param request_body:
|
|
579
|
+
:param request: The request object to send.
|
|
439
580
|
:param retries: Override the default retry configuration for this method
|
|
440
581
|
:param server_url: Override the default server URL for this method
|
|
441
582
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
@@ -451,16 +592,153 @@ class Workspaces(BaseSDK):
|
|
|
451
592
|
else:
|
|
452
593
|
base_url = self._get_url(base_url, url_variables)
|
|
453
594
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
595
|
+
if not isinstance(request, BaseModel):
|
|
596
|
+
request = utils.unmarshal(request, operations.RejectBountySubmissionRequest)
|
|
597
|
+
request = cast(operations.RejectBountySubmissionRequest, request)
|
|
598
|
+
|
|
599
|
+
req = self._build_request(
|
|
600
|
+
method="POST",
|
|
601
|
+
path="/bounties/{bountyId}/submissions/{submissionId}/reject",
|
|
602
|
+
base_url=base_url,
|
|
603
|
+
url_variables=url_variables,
|
|
604
|
+
request=request,
|
|
605
|
+
request_body_required=False,
|
|
606
|
+
request_has_path_params=True,
|
|
607
|
+
request_has_query_params=True,
|
|
608
|
+
user_agent_header="user-agent",
|
|
609
|
+
accept_header_value="application/json",
|
|
610
|
+
http_headers=http_headers,
|
|
611
|
+
security=self.sdk_configuration.security,
|
|
612
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
613
|
+
request.request_body,
|
|
614
|
+
False,
|
|
615
|
+
True,
|
|
616
|
+
"json",
|
|
617
|
+
Optional[operations.RejectBountySubmissionRequestBody],
|
|
458
618
|
),
|
|
619
|
+
allow_empty_value=None,
|
|
620
|
+
timeout_ms=timeout_ms,
|
|
459
621
|
)
|
|
460
622
|
|
|
623
|
+
if retries == UNSET:
|
|
624
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
625
|
+
retries = self.sdk_configuration.retry_config
|
|
626
|
+
|
|
627
|
+
retry_config = None
|
|
628
|
+
if isinstance(retries, utils.RetryConfig):
|
|
629
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
630
|
+
|
|
631
|
+
http_res = self.do_request(
|
|
632
|
+
hook_ctx=HookContext(
|
|
633
|
+
config=self.sdk_configuration,
|
|
634
|
+
base_url=base_url or "",
|
|
635
|
+
operation_id="rejectBountySubmission",
|
|
636
|
+
oauth2_scopes=None,
|
|
637
|
+
security_source=self.sdk_configuration.security,
|
|
638
|
+
),
|
|
639
|
+
request=req,
|
|
640
|
+
error_status_codes=[
|
|
641
|
+
"400",
|
|
642
|
+
"401",
|
|
643
|
+
"403",
|
|
644
|
+
"404",
|
|
645
|
+
"409",
|
|
646
|
+
"410",
|
|
647
|
+
"422",
|
|
648
|
+
"429",
|
|
649
|
+
"4XX",
|
|
650
|
+
"500",
|
|
651
|
+
"5XX",
|
|
652
|
+
],
|
|
653
|
+
retry_config=retry_config,
|
|
654
|
+
)
|
|
655
|
+
|
|
656
|
+
response_data: Any = None
|
|
657
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
658
|
+
return unmarshal_json_response(
|
|
659
|
+
operations.RejectBountySubmissionResponseBody, http_res
|
|
660
|
+
)
|
|
661
|
+
if utils.match_response(http_res, "400", "application/json"):
|
|
662
|
+
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
663
|
+
raise errors.BadRequest(response_data, http_res)
|
|
664
|
+
if utils.match_response(http_res, "401", "application/json"):
|
|
665
|
+
response_data = unmarshal_json_response(errors.UnauthorizedData, http_res)
|
|
666
|
+
raise errors.Unauthorized(response_data, http_res)
|
|
667
|
+
if utils.match_response(http_res, "403", "application/json"):
|
|
668
|
+
response_data = unmarshal_json_response(errors.ForbiddenData, http_res)
|
|
669
|
+
raise errors.Forbidden(response_data, http_res)
|
|
670
|
+
if utils.match_response(http_res, "404", "application/json"):
|
|
671
|
+
response_data = unmarshal_json_response(errors.NotFoundData, http_res)
|
|
672
|
+
raise errors.NotFound(response_data, http_res)
|
|
673
|
+
if utils.match_response(http_res, "409", "application/json"):
|
|
674
|
+
response_data = unmarshal_json_response(errors.ConflictData, http_res)
|
|
675
|
+
raise errors.Conflict(response_data, http_res)
|
|
676
|
+
if utils.match_response(http_res, "410", "application/json"):
|
|
677
|
+
response_data = unmarshal_json_response(errors.InviteExpiredData, http_res)
|
|
678
|
+
raise errors.InviteExpired(response_data, http_res)
|
|
679
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
680
|
+
response_data = unmarshal_json_response(
|
|
681
|
+
errors.UnprocessableEntityData, http_res
|
|
682
|
+
)
|
|
683
|
+
raise errors.UnprocessableEntity(response_data, http_res)
|
|
684
|
+
if utils.match_response(http_res, "429", "application/json"):
|
|
685
|
+
response_data = unmarshal_json_response(
|
|
686
|
+
errors.RateLimitExceededData, http_res
|
|
687
|
+
)
|
|
688
|
+
raise errors.RateLimitExceeded(response_data, http_res)
|
|
689
|
+
if utils.match_response(http_res, "500", "application/json"):
|
|
690
|
+
response_data = unmarshal_json_response(
|
|
691
|
+
errors.InternalServerErrorData, http_res
|
|
692
|
+
)
|
|
693
|
+
raise errors.InternalServerError(response_data, http_res)
|
|
694
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
695
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
696
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
697
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
698
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
699
|
+
raise errors.SDKError("API error occurred", http_res, http_res_text)
|
|
700
|
+
|
|
701
|
+
raise errors.SDKError("Unexpected response received", http_res)
|
|
702
|
+
|
|
703
|
+
async def reject_submission_async(
|
|
704
|
+
self,
|
|
705
|
+
*,
|
|
706
|
+
request: Union[
|
|
707
|
+
operations.RejectBountySubmissionRequest,
|
|
708
|
+
operations.RejectBountySubmissionRequestTypedDict,
|
|
709
|
+
],
|
|
710
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
711
|
+
server_url: Optional[str] = None,
|
|
712
|
+
timeout_ms: Optional[int] = None,
|
|
713
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
714
|
+
) -> operations.RejectBountySubmissionResponseBody:
|
|
715
|
+
r"""Reject a bounty submission
|
|
716
|
+
|
|
717
|
+
Reject a bounty submission with a specified reason and optional note.
|
|
718
|
+
|
|
719
|
+
:param request: The request object to send.
|
|
720
|
+
:param retries: Override the default retry configuration for this method
|
|
721
|
+
:param server_url: Override the default server URL for this method
|
|
722
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
723
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
724
|
+
"""
|
|
725
|
+
base_url = None
|
|
726
|
+
url_variables = None
|
|
727
|
+
if timeout_ms is None:
|
|
728
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
729
|
+
|
|
730
|
+
if server_url is not None:
|
|
731
|
+
base_url = server_url
|
|
732
|
+
else:
|
|
733
|
+
base_url = self._get_url(base_url, url_variables)
|
|
734
|
+
|
|
735
|
+
if not isinstance(request, BaseModel):
|
|
736
|
+
request = utils.unmarshal(request, operations.RejectBountySubmissionRequest)
|
|
737
|
+
request = cast(operations.RejectBountySubmissionRequest, request)
|
|
738
|
+
|
|
461
739
|
req = self._build_request_async(
|
|
462
|
-
method="
|
|
463
|
-
path="/
|
|
740
|
+
method="POST",
|
|
741
|
+
path="/bounties/{bountyId}/submissions/{submissionId}/reject",
|
|
464
742
|
base_url=base_url,
|
|
465
743
|
url_variables=url_variables,
|
|
466
744
|
request=request,
|
|
@@ -476,7 +754,7 @@ class Workspaces(BaseSDK):
|
|
|
476
754
|
False,
|
|
477
755
|
True,
|
|
478
756
|
"json",
|
|
479
|
-
Optional[operations.
|
|
757
|
+
Optional[operations.RejectBountySubmissionRequestBody],
|
|
480
758
|
),
|
|
481
759
|
allow_empty_value=None,
|
|
482
760
|
timeout_ms=timeout_ms,
|
|
@@ -494,7 +772,7 @@ class Workspaces(BaseSDK):
|
|
|
494
772
|
hook_ctx=HookContext(
|
|
495
773
|
config=self.sdk_configuration,
|
|
496
774
|
base_url=base_url or "",
|
|
497
|
-
operation_id="
|
|
775
|
+
operation_id="rejectBountySubmission",
|
|
498
776
|
oauth2_scopes=None,
|
|
499
777
|
security_source=self.sdk_configuration.security,
|
|
500
778
|
),
|
|
@@ -517,7 +795,9 @@ class Workspaces(BaseSDK):
|
|
|
517
795
|
|
|
518
796
|
response_data: Any = None
|
|
519
797
|
if utils.match_response(http_res, "200", "application/json"):
|
|
520
|
-
return unmarshal_json_response(
|
|
798
|
+
return unmarshal_json_response(
|
|
799
|
+
operations.RejectBountySubmissionResponseBody, http_res
|
|
800
|
+
)
|
|
521
801
|
if utils.match_response(http_res, "400", "application/json"):
|
|
522
802
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
523
803
|
raise errors.BadRequest(response_data, http_res)
|