dub 0.34.0__py3-none-any.whl → 0.34.1__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/bounties.py +841 -0
- dub/models/components/__init__.py +6 -0
- dub/models/components/commissioncreatedevent.py +29 -1
- dub/models/operations/__init__.py +93 -0
- dub/models/operations/approvebountysubmission.py +185 -0
- dub/models/operations/listbountysubmissions.py +212 -0
- dub/models/operations/rejectbountysubmission.py +174 -0
- dub/models/operations/upsertpartnerlink.py +7 -14
- dub/sdk.py +3 -0
- {dub-0.34.0.dist-info → dub-0.34.1.dist-info}/METADATA +7 -1
- {dub-0.34.0.dist-info → dub-0.34.1.dist-info}/RECORD +14 -10
- {dub-0.34.0.dist-info → dub-0.34.1.dist-info}/WHEEL +0 -0
- {dub-0.34.0.dist-info → dub-0.34.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -47,6 +47,8 @@ if TYPE_CHECKING:
|
|
|
47
47
|
CommissionCreatedEventData,
|
|
48
48
|
CommissionCreatedEventDataTypedDict,
|
|
49
49
|
CommissionCreatedEventEvent,
|
|
50
|
+
CommissionCreatedEventLink,
|
|
51
|
+
CommissionCreatedEventLinkTypedDict,
|
|
50
52
|
CommissionCreatedEventPartner,
|
|
51
53
|
CommissionCreatedEventPartnerTypedDict,
|
|
52
54
|
CommissionCreatedEventStatus,
|
|
@@ -228,6 +230,8 @@ __all__ = [
|
|
|
228
230
|
"CommissionCreatedEventData",
|
|
229
231
|
"CommissionCreatedEventDataTypedDict",
|
|
230
232
|
"CommissionCreatedEventEvent",
|
|
233
|
+
"CommissionCreatedEventLink",
|
|
234
|
+
"CommissionCreatedEventLinkTypedDict",
|
|
231
235
|
"CommissionCreatedEventPartner",
|
|
232
236
|
"CommissionCreatedEventPartnerTypedDict",
|
|
233
237
|
"CommissionCreatedEventStatus",
|
|
@@ -382,6 +386,8 @@ _dynamic_imports: dict[str, str] = {
|
|
|
382
386
|
"CommissionCreatedEventData": ".commissioncreatedevent",
|
|
383
387
|
"CommissionCreatedEventDataTypedDict": ".commissioncreatedevent",
|
|
384
388
|
"CommissionCreatedEventEvent": ".commissioncreatedevent",
|
|
389
|
+
"CommissionCreatedEventLink": ".commissioncreatedevent",
|
|
390
|
+
"CommissionCreatedEventLinkTypedDict": ".commissioncreatedevent",
|
|
385
391
|
"CommissionCreatedEventPartner": ".commissioncreatedevent",
|
|
386
392
|
"CommissionCreatedEventPartnerTypedDict": ".commissioncreatedevent",
|
|
387
393
|
"CommissionCreatedEventStatus": ".commissioncreatedevent",
|
|
@@ -200,6 +200,31 @@ class CommissionCreatedEventCustomer(BaseModel):
|
|
|
200
200
|
return m
|
|
201
201
|
|
|
202
202
|
|
|
203
|
+
class CommissionCreatedEventLinkTypedDict(TypedDict):
|
|
204
|
+
id: str
|
|
205
|
+
r"""The unique ID of the short link."""
|
|
206
|
+
short_link: str
|
|
207
|
+
r"""The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."""
|
|
208
|
+
domain: str
|
|
209
|
+
r"""The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
|
|
210
|
+
key: str
|
|
211
|
+
r"""The short link slug. If not provided, a random 7-character slug will be generated."""
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
class CommissionCreatedEventLink(BaseModel):
|
|
215
|
+
id: str
|
|
216
|
+
r"""The unique ID of the short link."""
|
|
217
|
+
|
|
218
|
+
short_link: Annotated[str, pydantic.Field(alias="shortLink")]
|
|
219
|
+
r"""The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."""
|
|
220
|
+
|
|
221
|
+
domain: str
|
|
222
|
+
r"""The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
|
|
223
|
+
|
|
224
|
+
key: str
|
|
225
|
+
r"""The short link slug. If not provided, a random 7-character slug will be generated."""
|
|
226
|
+
|
|
227
|
+
|
|
203
228
|
class CommissionCreatedEventDataTypedDict(TypedDict):
|
|
204
229
|
id: str
|
|
205
230
|
r"""The commission's unique ID on Dub."""
|
|
@@ -213,6 +238,7 @@ class CommissionCreatedEventDataTypedDict(TypedDict):
|
|
|
213
238
|
created_at: str
|
|
214
239
|
updated_at: str
|
|
215
240
|
partner: CommissionCreatedEventPartnerTypedDict
|
|
241
|
+
link: Nullable[CommissionCreatedEventLinkTypedDict]
|
|
216
242
|
type: NotRequired[CommissionCreatedEventType]
|
|
217
243
|
user_id: NotRequired[Nullable[str]]
|
|
218
244
|
r"""The user who created the manual commission."""
|
|
@@ -243,6 +269,8 @@ class CommissionCreatedEventData(BaseModel):
|
|
|
243
269
|
|
|
244
270
|
partner: CommissionCreatedEventPartner
|
|
245
271
|
|
|
272
|
+
link: Nullable[CommissionCreatedEventLink]
|
|
273
|
+
|
|
246
274
|
type: Optional[CommissionCreatedEventType] = None
|
|
247
275
|
|
|
248
276
|
user_id: Annotated[OptionalNullable[str], pydantic.Field(alias="userId")] = UNSET
|
|
@@ -253,7 +281,7 @@ class CommissionCreatedEventData(BaseModel):
|
|
|
253
281
|
@model_serializer(mode="wrap")
|
|
254
282
|
def serialize_model(self, handler):
|
|
255
283
|
optional_fields = ["type", "userId", "customer"]
|
|
256
|
-
nullable_fields = ["invoiceId", "description", "userId", "customer"]
|
|
284
|
+
nullable_fields = ["invoiceId", "description", "userId", "customer", "link"]
|
|
257
285
|
null_default_fields = []
|
|
258
286
|
|
|
259
287
|
serialized = handler(self)
|
|
@@ -6,6 +6,17 @@ import builtins
|
|
|
6
6
|
import sys
|
|
7
7
|
|
|
8
8
|
if TYPE_CHECKING:
|
|
9
|
+
from .approvebountysubmission import (
|
|
10
|
+
ApproveBountySubmissionFiles,
|
|
11
|
+
ApproveBountySubmissionFilesTypedDict,
|
|
12
|
+
ApproveBountySubmissionRequest,
|
|
13
|
+
ApproveBountySubmissionRequestBody,
|
|
14
|
+
ApproveBountySubmissionRequestBodyTypedDict,
|
|
15
|
+
ApproveBountySubmissionRequestTypedDict,
|
|
16
|
+
ApproveBountySubmissionResponseBody,
|
|
17
|
+
ApproveBountySubmissionResponseBodyTypedDict,
|
|
18
|
+
ApproveBountySubmissionStatus,
|
|
19
|
+
)
|
|
9
20
|
from .banpartner import (
|
|
10
21
|
BanPartnerRequestBody,
|
|
11
22
|
BanPartnerRequestBodyTypedDict,
|
|
@@ -210,6 +221,18 @@ if TYPE_CHECKING:
|
|
|
210
221
|
IdsTypedDict,
|
|
211
222
|
)
|
|
212
223
|
from .getworkspace import GetWorkspaceRequest, GetWorkspaceRequestTypedDict
|
|
224
|
+
from .listbountysubmissions import (
|
|
225
|
+
Files,
|
|
226
|
+
FilesTypedDict,
|
|
227
|
+
ListBountySubmissionsQueryParamSortBy,
|
|
228
|
+
ListBountySubmissionsQueryParamSortOrder,
|
|
229
|
+
ListBountySubmissionsQueryParamStatus,
|
|
230
|
+
ListBountySubmissionsRequest,
|
|
231
|
+
ListBountySubmissionsRequestTypedDict,
|
|
232
|
+
ListBountySubmissionsResponseBody,
|
|
233
|
+
ListBountySubmissionsResponseBodyTypedDict,
|
|
234
|
+
ListBountySubmissionsStatus,
|
|
235
|
+
)
|
|
213
236
|
from .listcommissions import (
|
|
214
237
|
ListCommissionsCustomer,
|
|
215
238
|
ListCommissionsCustomerTypedDict,
|
|
@@ -303,6 +326,18 @@ if TYPE_CHECKING:
|
|
|
303
326
|
RegisterDomainResponseBody,
|
|
304
327
|
RegisterDomainResponseBodyTypedDict,
|
|
305
328
|
)
|
|
329
|
+
from .rejectbountysubmission import (
|
|
330
|
+
RejectBountySubmissionFiles,
|
|
331
|
+
RejectBountySubmissionFilesTypedDict,
|
|
332
|
+
RejectBountySubmissionRequest,
|
|
333
|
+
RejectBountySubmissionRequestBody,
|
|
334
|
+
RejectBountySubmissionRequestBodyTypedDict,
|
|
335
|
+
RejectBountySubmissionRequestTypedDict,
|
|
336
|
+
RejectBountySubmissionResponseBody,
|
|
337
|
+
RejectBountySubmissionResponseBodyTypedDict,
|
|
338
|
+
RejectBountySubmissionStatus,
|
|
339
|
+
RejectionReason,
|
|
340
|
+
)
|
|
306
341
|
from .retrieveanalytics import (
|
|
307
342
|
Continent,
|
|
308
343
|
Event,
|
|
@@ -448,6 +483,15 @@ if TYPE_CHECKING:
|
|
|
448
483
|
|
|
449
484
|
__all__ = [
|
|
450
485
|
"AccessLevel",
|
|
486
|
+
"ApproveBountySubmissionFiles",
|
|
487
|
+
"ApproveBountySubmissionFilesTypedDict",
|
|
488
|
+
"ApproveBountySubmissionRequest",
|
|
489
|
+
"ApproveBountySubmissionRequestBody",
|
|
490
|
+
"ApproveBountySubmissionRequestBodyTypedDict",
|
|
491
|
+
"ApproveBountySubmissionRequestTypedDict",
|
|
492
|
+
"ApproveBountySubmissionResponseBody",
|
|
493
|
+
"ApproveBountySubmissionResponseBodyTypedDict",
|
|
494
|
+
"ApproveBountySubmissionStatus",
|
|
451
495
|
"BanPartnerRequestBody",
|
|
452
496
|
"BanPartnerRequestBodyTypedDict",
|
|
453
497
|
"BanPartnerResponseBody",
|
|
@@ -551,6 +595,8 @@ __all__ = [
|
|
|
551
595
|
"Domains",
|
|
552
596
|
"DomainsTypedDict",
|
|
553
597
|
"Event",
|
|
598
|
+
"Files",
|
|
599
|
+
"FilesTypedDict",
|
|
554
600
|
"Four",
|
|
555
601
|
"GetCustomerDiscount",
|
|
556
602
|
"GetCustomerDiscountTypedDict",
|
|
@@ -608,6 +654,14 @@ __all__ = [
|
|
|
608
654
|
"LinkTypedDict",
|
|
609
655
|
"Links",
|
|
610
656
|
"LinksTypedDict",
|
|
657
|
+
"ListBountySubmissionsQueryParamSortBy",
|
|
658
|
+
"ListBountySubmissionsQueryParamSortOrder",
|
|
659
|
+
"ListBountySubmissionsQueryParamStatus",
|
|
660
|
+
"ListBountySubmissionsRequest",
|
|
661
|
+
"ListBountySubmissionsRequestTypedDict",
|
|
662
|
+
"ListBountySubmissionsResponseBody",
|
|
663
|
+
"ListBountySubmissionsResponseBodyTypedDict",
|
|
664
|
+
"ListBountySubmissionsStatus",
|
|
611
665
|
"ListCommissionsCustomer",
|
|
612
666
|
"ListCommissionsCustomerTypedDict",
|
|
613
667
|
"ListCommissionsPartner",
|
|
@@ -684,6 +738,16 @@ __all__ = [
|
|
|
684
738
|
"RegisterDomainRequestBodyTypedDict",
|
|
685
739
|
"RegisterDomainResponseBody",
|
|
686
740
|
"RegisterDomainResponseBodyTypedDict",
|
|
741
|
+
"RejectBountySubmissionFiles",
|
|
742
|
+
"RejectBountySubmissionFilesTypedDict",
|
|
743
|
+
"RejectBountySubmissionRequest",
|
|
744
|
+
"RejectBountySubmissionRequestBody",
|
|
745
|
+
"RejectBountySubmissionRequestBodyTypedDict",
|
|
746
|
+
"RejectBountySubmissionRequestTypedDict",
|
|
747
|
+
"RejectBountySubmissionResponseBody",
|
|
748
|
+
"RejectBountySubmissionResponseBodyTypedDict",
|
|
749
|
+
"RejectBountySubmissionStatus",
|
|
750
|
+
"RejectionReason",
|
|
687
751
|
"RequestBody",
|
|
688
752
|
"RequestBodyTypedDict",
|
|
689
753
|
"ResponseBody",
|
|
@@ -819,6 +883,15 @@ __all__ = [
|
|
|
819
883
|
]
|
|
820
884
|
|
|
821
885
|
_dynamic_imports: dict[str, str] = {
|
|
886
|
+
"ApproveBountySubmissionFiles": ".approvebountysubmission",
|
|
887
|
+
"ApproveBountySubmissionFilesTypedDict": ".approvebountysubmission",
|
|
888
|
+
"ApproveBountySubmissionRequest": ".approvebountysubmission",
|
|
889
|
+
"ApproveBountySubmissionRequestBody": ".approvebountysubmission",
|
|
890
|
+
"ApproveBountySubmissionRequestBodyTypedDict": ".approvebountysubmission",
|
|
891
|
+
"ApproveBountySubmissionRequestTypedDict": ".approvebountysubmission",
|
|
892
|
+
"ApproveBountySubmissionResponseBody": ".approvebountysubmission",
|
|
893
|
+
"ApproveBountySubmissionResponseBodyTypedDict": ".approvebountysubmission",
|
|
894
|
+
"ApproveBountySubmissionStatus": ".approvebountysubmission",
|
|
822
895
|
"BanPartnerRequestBody": ".banpartner",
|
|
823
896
|
"BanPartnerRequestBodyTypedDict": ".banpartner",
|
|
824
897
|
"BanPartnerResponseBody": ".banpartner",
|
|
@@ -990,6 +1063,16 @@ _dynamic_imports: dict[str, str] = {
|
|
|
990
1063
|
"IdsTypedDict": ".gettags",
|
|
991
1064
|
"GetWorkspaceRequest": ".getworkspace",
|
|
992
1065
|
"GetWorkspaceRequestTypedDict": ".getworkspace",
|
|
1066
|
+
"Files": ".listbountysubmissions",
|
|
1067
|
+
"FilesTypedDict": ".listbountysubmissions",
|
|
1068
|
+
"ListBountySubmissionsQueryParamSortBy": ".listbountysubmissions",
|
|
1069
|
+
"ListBountySubmissionsQueryParamSortOrder": ".listbountysubmissions",
|
|
1070
|
+
"ListBountySubmissionsQueryParamStatus": ".listbountysubmissions",
|
|
1071
|
+
"ListBountySubmissionsRequest": ".listbountysubmissions",
|
|
1072
|
+
"ListBountySubmissionsRequestTypedDict": ".listbountysubmissions",
|
|
1073
|
+
"ListBountySubmissionsResponseBody": ".listbountysubmissions",
|
|
1074
|
+
"ListBountySubmissionsResponseBodyTypedDict": ".listbountysubmissions",
|
|
1075
|
+
"ListBountySubmissionsStatus": ".listbountysubmissions",
|
|
993
1076
|
"ListCommissionsCustomer": ".listcommissions",
|
|
994
1077
|
"ListCommissionsCustomerTypedDict": ".listcommissions",
|
|
995
1078
|
"ListCommissionsPartner": ".listcommissions",
|
|
@@ -1074,6 +1157,16 @@ _dynamic_imports: dict[str, str] = {
|
|
|
1074
1157
|
"RegisterDomainRequestBodyTypedDict": ".registerdomain",
|
|
1075
1158
|
"RegisterDomainResponseBody": ".registerdomain",
|
|
1076
1159
|
"RegisterDomainResponseBodyTypedDict": ".registerdomain",
|
|
1160
|
+
"RejectBountySubmissionFiles": ".rejectbountysubmission",
|
|
1161
|
+
"RejectBountySubmissionFilesTypedDict": ".rejectbountysubmission",
|
|
1162
|
+
"RejectBountySubmissionRequest": ".rejectbountysubmission",
|
|
1163
|
+
"RejectBountySubmissionRequestBody": ".rejectbountysubmission",
|
|
1164
|
+
"RejectBountySubmissionRequestBodyTypedDict": ".rejectbountysubmission",
|
|
1165
|
+
"RejectBountySubmissionRequestTypedDict": ".rejectbountysubmission",
|
|
1166
|
+
"RejectBountySubmissionResponseBody": ".rejectbountysubmission",
|
|
1167
|
+
"RejectBountySubmissionResponseBodyTypedDict": ".rejectbountysubmission",
|
|
1168
|
+
"RejectBountySubmissionStatus": ".rejectbountysubmission",
|
|
1169
|
+
"RejectionReason": ".rejectbountysubmission",
|
|
1077
1170
|
"Continent": ".retrieveanalytics",
|
|
1078
1171
|
"Event": ".retrieveanalytics",
|
|
1079
1172
|
"Interval": ".retrieveanalytics",
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
5
|
+
from dub.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
6
|
+
from enum import Enum
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic import model_serializer
|
|
9
|
+
from typing import List, Optional
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ApproveBountySubmissionRequestBodyTypedDict(TypedDict):
|
|
14
|
+
reward_amount: NotRequired[Nullable[float]]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ApproveBountySubmissionRequestBody(BaseModel):
|
|
18
|
+
reward_amount: Annotated[
|
|
19
|
+
OptionalNullable[float], pydantic.Field(alias="rewardAmount")
|
|
20
|
+
] = UNSET
|
|
21
|
+
|
|
22
|
+
@model_serializer(mode="wrap")
|
|
23
|
+
def serialize_model(self, handler):
|
|
24
|
+
optional_fields = ["rewardAmount"]
|
|
25
|
+
nullable_fields = ["rewardAmount"]
|
|
26
|
+
null_default_fields = []
|
|
27
|
+
|
|
28
|
+
serialized = handler(self)
|
|
29
|
+
|
|
30
|
+
m = {}
|
|
31
|
+
|
|
32
|
+
for n, f in type(self).model_fields.items():
|
|
33
|
+
k = f.alias or n
|
|
34
|
+
val = serialized.get(k)
|
|
35
|
+
serialized.pop(k, None)
|
|
36
|
+
|
|
37
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
38
|
+
is_set = (
|
|
39
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
40
|
+
or k in null_default_fields
|
|
41
|
+
) # pylint: disable=no-member
|
|
42
|
+
|
|
43
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
44
|
+
m[k] = val
|
|
45
|
+
elif val != UNSET_SENTINEL and (
|
|
46
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
47
|
+
):
|
|
48
|
+
m[k] = val
|
|
49
|
+
|
|
50
|
+
return m
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class ApproveBountySubmissionRequestTypedDict(TypedDict):
|
|
54
|
+
bounty_id: str
|
|
55
|
+
submission_id: str
|
|
56
|
+
request_body: NotRequired[ApproveBountySubmissionRequestBodyTypedDict]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class ApproveBountySubmissionRequest(BaseModel):
|
|
60
|
+
bounty_id: Annotated[
|
|
61
|
+
str,
|
|
62
|
+
pydantic.Field(alias="bountyId"),
|
|
63
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
submission_id: Annotated[
|
|
67
|
+
str,
|
|
68
|
+
pydantic.Field(alias="submissionId"),
|
|
69
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
request_body: Annotated[
|
|
73
|
+
Optional[ApproveBountySubmissionRequestBody],
|
|
74
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
75
|
+
] = None
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class ApproveBountySubmissionFilesTypedDict(TypedDict):
|
|
79
|
+
url: str
|
|
80
|
+
file_name: str
|
|
81
|
+
size: float
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
class ApproveBountySubmissionFiles(BaseModel):
|
|
85
|
+
url: str
|
|
86
|
+
|
|
87
|
+
file_name: Annotated[str, pydantic.Field(alias="fileName")]
|
|
88
|
+
|
|
89
|
+
size: float
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class ApproveBountySubmissionStatus(str, Enum):
|
|
93
|
+
DRAFT = "draft"
|
|
94
|
+
SUBMITTED = "submitted"
|
|
95
|
+
APPROVED = "approved"
|
|
96
|
+
REJECTED = "rejected"
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class ApproveBountySubmissionResponseBodyTypedDict(TypedDict):
|
|
100
|
+
r"""The approved bounty submission."""
|
|
101
|
+
|
|
102
|
+
id: str
|
|
103
|
+
bounty_id: str
|
|
104
|
+
partner_id: str
|
|
105
|
+
description: Nullable[str]
|
|
106
|
+
urls: Nullable[List[str]]
|
|
107
|
+
files: Nullable[List[ApproveBountySubmissionFilesTypedDict]]
|
|
108
|
+
status: ApproveBountySubmissionStatus
|
|
109
|
+
performance_count: Nullable[float]
|
|
110
|
+
created_at: str
|
|
111
|
+
completed_at: Nullable[str]
|
|
112
|
+
reviewed_at: Nullable[str]
|
|
113
|
+
rejection_reason: Nullable[str]
|
|
114
|
+
rejection_note: Nullable[str]
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class ApproveBountySubmissionResponseBody(BaseModel):
|
|
118
|
+
r"""The approved bounty submission."""
|
|
119
|
+
|
|
120
|
+
id: str
|
|
121
|
+
|
|
122
|
+
bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
|
|
123
|
+
|
|
124
|
+
partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
|
|
125
|
+
|
|
126
|
+
description: Nullable[str]
|
|
127
|
+
|
|
128
|
+
urls: Nullable[List[str]]
|
|
129
|
+
|
|
130
|
+
files: Nullable[List[ApproveBountySubmissionFiles]]
|
|
131
|
+
|
|
132
|
+
status: ApproveBountySubmissionStatus
|
|
133
|
+
|
|
134
|
+
performance_count: Annotated[
|
|
135
|
+
Nullable[float], pydantic.Field(alias="performanceCount")
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
139
|
+
|
|
140
|
+
completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
|
|
141
|
+
|
|
142
|
+
reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
|
|
143
|
+
|
|
144
|
+
rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
|
|
145
|
+
|
|
146
|
+
rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
|
|
147
|
+
|
|
148
|
+
@model_serializer(mode="wrap")
|
|
149
|
+
def serialize_model(self, handler):
|
|
150
|
+
optional_fields = []
|
|
151
|
+
nullable_fields = [
|
|
152
|
+
"description",
|
|
153
|
+
"urls",
|
|
154
|
+
"files",
|
|
155
|
+
"performanceCount",
|
|
156
|
+
"completedAt",
|
|
157
|
+
"reviewedAt",
|
|
158
|
+
"rejectionReason",
|
|
159
|
+
"rejectionNote",
|
|
160
|
+
]
|
|
161
|
+
null_default_fields = []
|
|
162
|
+
|
|
163
|
+
serialized = handler(self)
|
|
164
|
+
|
|
165
|
+
m = {}
|
|
166
|
+
|
|
167
|
+
for n, f in type(self).model_fields.items():
|
|
168
|
+
k = f.alias or n
|
|
169
|
+
val = serialized.get(k)
|
|
170
|
+
serialized.pop(k, None)
|
|
171
|
+
|
|
172
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
173
|
+
is_set = (
|
|
174
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
175
|
+
or k in null_default_fields
|
|
176
|
+
) # pylint: disable=no-member
|
|
177
|
+
|
|
178
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
179
|
+
m[k] = val
|
|
180
|
+
elif val != UNSET_SENTINEL and (
|
|
181
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
182
|
+
):
|
|
183
|
+
m[k] = val
|
|
184
|
+
|
|
185
|
+
return m
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from dub.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
5
|
+
from dub.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
|
|
6
|
+
from enum import Enum
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic import model_serializer
|
|
9
|
+
from typing import List, Optional
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ListBountySubmissionsQueryParamStatus(str, Enum):
|
|
14
|
+
r"""The status of the submissions to list."""
|
|
15
|
+
|
|
16
|
+
DRAFT = "draft"
|
|
17
|
+
SUBMITTED = "submitted"
|
|
18
|
+
APPROVED = "approved"
|
|
19
|
+
REJECTED = "rejected"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ListBountySubmissionsQueryParamSortBy(str, Enum):
|
|
23
|
+
r"""The field to sort the submissions by."""
|
|
24
|
+
|
|
25
|
+
COMPLETED_AT = "completedAt"
|
|
26
|
+
PERFORMANCE_COUNT = "performanceCount"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ListBountySubmissionsQueryParamSortOrder(str, Enum):
|
|
30
|
+
r"""The order to sort the submissions by."""
|
|
31
|
+
|
|
32
|
+
ASC = "asc"
|
|
33
|
+
DESC = "desc"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class ListBountySubmissionsRequestTypedDict(TypedDict):
|
|
37
|
+
bounty_id: str
|
|
38
|
+
status: NotRequired[ListBountySubmissionsQueryParamStatus]
|
|
39
|
+
r"""The status of the submissions to list."""
|
|
40
|
+
group_id: NotRequired[str]
|
|
41
|
+
r"""The ID of the group to list submissions for."""
|
|
42
|
+
partner_id: NotRequired[str]
|
|
43
|
+
r"""The ID of the partner to list submissions for."""
|
|
44
|
+
sort_by: NotRequired[ListBountySubmissionsQueryParamSortBy]
|
|
45
|
+
r"""The field to sort the submissions by."""
|
|
46
|
+
sort_order: NotRequired[ListBountySubmissionsQueryParamSortOrder]
|
|
47
|
+
r"""The order to sort the submissions by."""
|
|
48
|
+
page: NotRequired[float]
|
|
49
|
+
r"""The page number for pagination."""
|
|
50
|
+
page_size: NotRequired[float]
|
|
51
|
+
r"""The number of items per page."""
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class ListBountySubmissionsRequest(BaseModel):
|
|
55
|
+
bounty_id: Annotated[
|
|
56
|
+
str,
|
|
57
|
+
pydantic.Field(alias="bountyId"),
|
|
58
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
status: Annotated[
|
|
62
|
+
Optional[ListBountySubmissionsQueryParamStatus],
|
|
63
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
64
|
+
] = None
|
|
65
|
+
r"""The status of the submissions to list."""
|
|
66
|
+
|
|
67
|
+
group_id: Annotated[
|
|
68
|
+
Optional[str],
|
|
69
|
+
pydantic.Field(alias="groupId"),
|
|
70
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
71
|
+
] = None
|
|
72
|
+
r"""The ID of the group to list submissions for."""
|
|
73
|
+
|
|
74
|
+
partner_id: Annotated[
|
|
75
|
+
Optional[str],
|
|
76
|
+
pydantic.Field(alias="partnerId"),
|
|
77
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
78
|
+
] = None
|
|
79
|
+
r"""The ID of the partner to list submissions for."""
|
|
80
|
+
|
|
81
|
+
sort_by: Annotated[
|
|
82
|
+
Optional[ListBountySubmissionsQueryParamSortBy],
|
|
83
|
+
pydantic.Field(alias="sortBy"),
|
|
84
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
85
|
+
] = ListBountySubmissionsQueryParamSortBy.COMPLETED_AT
|
|
86
|
+
r"""The field to sort the submissions by."""
|
|
87
|
+
|
|
88
|
+
sort_order: Annotated[
|
|
89
|
+
Optional[ListBountySubmissionsQueryParamSortOrder],
|
|
90
|
+
pydantic.Field(alias="sortOrder"),
|
|
91
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
92
|
+
] = ListBountySubmissionsQueryParamSortOrder.ASC
|
|
93
|
+
r"""The order to sort the submissions by."""
|
|
94
|
+
|
|
95
|
+
page: Annotated[
|
|
96
|
+
Optional[float],
|
|
97
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
98
|
+
] = 1
|
|
99
|
+
r"""The page number for pagination."""
|
|
100
|
+
|
|
101
|
+
page_size: Annotated[
|
|
102
|
+
Optional[float],
|
|
103
|
+
pydantic.Field(alias="pageSize"),
|
|
104
|
+
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
|
105
|
+
] = 100
|
|
106
|
+
r"""The number of items per page."""
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
class FilesTypedDict(TypedDict):
|
|
110
|
+
url: str
|
|
111
|
+
file_name: str
|
|
112
|
+
size: float
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
class Files(BaseModel):
|
|
116
|
+
url: str
|
|
117
|
+
|
|
118
|
+
file_name: Annotated[str, pydantic.Field(alias="fileName")]
|
|
119
|
+
|
|
120
|
+
size: float
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class ListBountySubmissionsStatus(str, Enum):
|
|
124
|
+
DRAFT = "draft"
|
|
125
|
+
SUBMITTED = "submitted"
|
|
126
|
+
APPROVED = "approved"
|
|
127
|
+
REJECTED = "rejected"
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class ListBountySubmissionsResponseBodyTypedDict(TypedDict):
|
|
131
|
+
id: str
|
|
132
|
+
bounty_id: str
|
|
133
|
+
partner_id: str
|
|
134
|
+
description: Nullable[str]
|
|
135
|
+
urls: Nullable[List[str]]
|
|
136
|
+
files: Nullable[List[FilesTypedDict]]
|
|
137
|
+
status: ListBountySubmissionsStatus
|
|
138
|
+
performance_count: Nullable[float]
|
|
139
|
+
created_at: str
|
|
140
|
+
completed_at: Nullable[str]
|
|
141
|
+
reviewed_at: Nullable[str]
|
|
142
|
+
rejection_reason: Nullable[str]
|
|
143
|
+
rejection_note: Nullable[str]
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class ListBountySubmissionsResponseBody(BaseModel):
|
|
147
|
+
id: str
|
|
148
|
+
|
|
149
|
+
bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
|
|
150
|
+
|
|
151
|
+
partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
|
|
152
|
+
|
|
153
|
+
description: Nullable[str]
|
|
154
|
+
|
|
155
|
+
urls: Nullable[List[str]]
|
|
156
|
+
|
|
157
|
+
files: Nullable[List[Files]]
|
|
158
|
+
|
|
159
|
+
status: ListBountySubmissionsStatus
|
|
160
|
+
|
|
161
|
+
performance_count: Annotated[
|
|
162
|
+
Nullable[float], pydantic.Field(alias="performanceCount")
|
|
163
|
+
]
|
|
164
|
+
|
|
165
|
+
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
166
|
+
|
|
167
|
+
completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
|
|
168
|
+
|
|
169
|
+
reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
|
|
170
|
+
|
|
171
|
+
rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
|
|
172
|
+
|
|
173
|
+
rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
|
|
174
|
+
|
|
175
|
+
@model_serializer(mode="wrap")
|
|
176
|
+
def serialize_model(self, handler):
|
|
177
|
+
optional_fields = []
|
|
178
|
+
nullable_fields = [
|
|
179
|
+
"description",
|
|
180
|
+
"urls",
|
|
181
|
+
"files",
|
|
182
|
+
"performanceCount",
|
|
183
|
+
"completedAt",
|
|
184
|
+
"reviewedAt",
|
|
185
|
+
"rejectionReason",
|
|
186
|
+
"rejectionNote",
|
|
187
|
+
]
|
|
188
|
+
null_default_fields = []
|
|
189
|
+
|
|
190
|
+
serialized = handler(self)
|
|
191
|
+
|
|
192
|
+
m = {}
|
|
193
|
+
|
|
194
|
+
for n, f in type(self).model_fields.items():
|
|
195
|
+
k = f.alias or n
|
|
196
|
+
val = serialized.get(k)
|
|
197
|
+
serialized.pop(k, None)
|
|
198
|
+
|
|
199
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
200
|
+
is_set = (
|
|
201
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
202
|
+
or k in null_default_fields
|
|
203
|
+
) # pylint: disable=no-member
|
|
204
|
+
|
|
205
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
206
|
+
m[k] = val
|
|
207
|
+
elif val != UNSET_SENTINEL and (
|
|
208
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
209
|
+
):
|
|
210
|
+
m[k] = val
|
|
211
|
+
|
|
212
|
+
return m
|