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.
Files changed (93) hide show
  1. dub/_version.py +3 -3
  2. dub/basesdk.py +20 -6
  3. dub/{workspaces.py → bounties.py} +349 -69
  4. dub/models/components/__init__.py +114 -26
  5. dub/models/components/analyticsbrowsers.py +18 -1
  6. dub/models/components/analyticscities.py +18 -1
  7. dub/models/components/analyticscontinents.py +18 -1
  8. dub/models/components/analyticscount.py +18 -1
  9. dub/models/components/analyticscountries.py +20 -1
  10. dub/models/components/analyticsdevices.py +18 -1
  11. dub/models/components/analyticsos.py +18 -1
  12. dub/models/components/analyticsreferers.py +18 -1
  13. dub/models/components/analyticsrefererurls.py +18 -1
  14. dub/models/components/analyticsregions.py +18 -1
  15. dub/models/components/analyticstimeseries.py +18 -1
  16. dub/models/components/analyticstoplinks.py +16 -26
  17. dub/models/components/analyticstopurls.py +18 -1
  18. dub/models/components/analyticstriggers.py +18 -1
  19. dub/models/components/commissioncreatedevent.py +123 -63
  20. dub/models/components/domainschema.py +31 -50
  21. dub/models/components/folderschema.py +18 -19
  22. dub/models/components/leadcreatedevent.py +151 -134
  23. dub/models/components/linkclickedevent.py +57 -70
  24. dub/models/components/linkschema.py +63 -64
  25. dub/models/components/linkwebhookevent.py +43 -51
  26. dub/models/components/partneranalyticscount.py +18 -1
  27. dub/models/components/partneranalyticstimeseries.py +18 -1
  28. dub/models/components/partneranalyticstoplinks.py +16 -27
  29. dub/models/components/partnerapplicationsubmittedevent.py +42 -75
  30. dub/models/components/partnerenrolledevent.py +477 -83
  31. dub/models/components/salecreatedevent.py +152 -151
  32. dub/models/errors/badrequest.py +18 -1
  33. dub/models/errors/conflict.py +18 -1
  34. dub/models/errors/forbidden.py +18 -1
  35. dub/models/errors/internalservererror.py +18 -1
  36. dub/models/errors/inviteexpired.py +18 -1
  37. dub/models/errors/notfound.py +18 -1
  38. dub/models/errors/ratelimitexceeded.py +18 -1
  39. dub/models/errors/unauthorized.py +18 -1
  40. dub/models/errors/unprocessableentity.py +18 -1
  41. dub/models/operations/__init__.py +323 -19
  42. dub/models/operations/approvebountysubmission.py +211 -0
  43. dub/models/operations/banpartner.py +14 -19
  44. dub/models/operations/bulkcreatelinks.py +86 -87
  45. dub/models/operations/bulkupdatelinks.py +97 -82
  46. dub/models/operations/checkdomainstatus.py +1 -17
  47. dub/models/operations/createdomain.py +33 -34
  48. dub/models/operations/createfolder.py +18 -19
  49. dub/models/operations/createlink.py +86 -87
  50. dub/models/operations/createpartner.py +560 -168
  51. dub/models/operations/createpartnerlink.py +74 -85
  52. dub/models/operations/createreferralsembedtoken.py +99 -87
  53. dub/models/operations/createtag.py +18 -1
  54. dub/models/operations/deactivatepartner.py +65 -0
  55. dub/models/operations/getcustomer.py +106 -105
  56. dub/models/operations/getcustomers.py +123 -105
  57. dub/models/operations/getlinkinfo.py +18 -1
  58. dub/models/operations/getlinks.py +36 -1
  59. dub/models/operations/getlinkscount.py +32 -1
  60. dub/models/operations/getqrcode.py +29 -1
  61. dub/models/operations/gettags.py +20 -1
  62. dub/models/operations/listbountysubmissions.py +249 -0
  63. dub/models/operations/listcommissions.py +129 -64
  64. dub/models/operations/listdomains.py +18 -1
  65. dub/models/operations/listevents.py +414 -389
  66. dub/models/operations/listfolders.py +18 -1
  67. dub/models/operations/listpartners.py +510 -84
  68. dub/models/operations/registerdomain.py +1 -17
  69. dub/models/operations/rejectbountysubmission.py +219 -0
  70. dub/models/operations/retrieveanalytics.py +65 -66
  71. dub/models/operations/retrievelinks.py +30 -19
  72. dub/models/operations/retrievepartneranalytics.py +25 -28
  73. dub/models/operations/tracklead.py +38 -83
  74. dub/models/operations/tracksale.py +52 -95
  75. dub/models/operations/updatecommission.py +126 -64
  76. dub/models/operations/updatecustomer.py +122 -131
  77. dub/models/operations/updatedomain.py +50 -35
  78. dub/models/operations/updatefolder.py +34 -19
  79. dub/models/operations/updatelink.py +101 -86
  80. dub/models/operations/updatetag.py +34 -1
  81. dub/models/operations/upsertlink.py +86 -87
  82. dub/models/operations/upsertpartnerlink.py +77 -90
  83. dub/partners.py +288 -0
  84. dub/sdk.py +3 -3
  85. dub/utils/__init__.py +10 -1
  86. {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/METADATA +10 -8
  87. dub-0.35.0.dist-info/RECORD +143 -0
  88. dub/models/components/workspaceschema.py +0 -328
  89. dub/models/operations/getworkspace.py +0 -21
  90. dub/models/operations/updateworkspace.py +0 -78
  91. dub-0.34.0.dist-info/RECORD +0 -142
  92. {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
  93. {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,9 +1,10 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from dub.types import BaseModel
4
+ from dub.types import BaseModel, UNSET_SENTINEL
5
5
  from dub.utils import FieldMetadata, QueryParamMetadata
6
6
  import pydantic
7
+ from pydantic import model_serializer
7
8
  from typing import Optional
8
9
  from typing_extensions import Annotated, NotRequired, TypedDict
9
10
 
@@ -41,3 +42,19 @@ class GetLinkInfoRequest(BaseModel):
41
42
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
42
43
  ] = None
43
44
  r"""This is the ID of the link in the your database."""
45
+
46
+ @model_serializer(mode="wrap")
47
+ def serialize_model(self, handler):
48
+ optional_fields = set(["domain", "key", "linkId", "externalId"])
49
+ serialized = handler(self)
50
+ m = {}
51
+
52
+ for n, f in type(self).model_fields.items():
53
+ k = f.alias or n
54
+ val = serialized.get(k)
55
+
56
+ if val != UNSET_SENTINEL:
57
+ if val is not None or k not in optional_fields:
58
+ m[k] = val
59
+
60
+ return m
@@ -2,10 +2,11 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from dub.models.components import linkschema as components_linkschema
5
- from dub.types import BaseModel
5
+ from dub.types import BaseModel, UNSET_SENTINEL
6
6
  from dub.utils import FieldMetadata, QueryParamMetadata
7
7
  from enum import Enum
8
8
  import pydantic
9
+ from pydantic import model_serializer
9
10
  from typing import Callable, List, Optional, Union
10
11
  from typing_extensions import (
11
12
  Annotated,
@@ -199,6 +200,40 @@ class GetLinksRequest(BaseModel):
199
200
  ] = 100
200
201
  r"""The number of items per page."""
201
202
 
203
+ @model_serializer(mode="wrap")
204
+ def serialize_model(self, handler):
205
+ optional_fields = set(
206
+ [
207
+ "domain",
208
+ "tagId",
209
+ "tagIds",
210
+ "tagNames",
211
+ "folderId",
212
+ "search",
213
+ "userId",
214
+ "tenantId",
215
+ "showArchived",
216
+ "withTags",
217
+ "sortBy",
218
+ "sortOrder",
219
+ "sort",
220
+ "page",
221
+ "pageSize",
222
+ ]
223
+ )
224
+ serialized = handler(self)
225
+ m = {}
226
+
227
+ for n, f in type(self).model_fields.items():
228
+ k = f.alias or n
229
+ val = serialized.get(k)
230
+
231
+ if val != UNSET_SENTINEL:
232
+ if val is not None or k not in optional_fields:
233
+ m[k] = val
234
+
235
+ return m
236
+
202
237
 
203
238
  class GetLinksResponseTypedDict(TypedDict):
204
239
  result: List[components_linkschema.LinkSchemaTypedDict]
@@ -1,10 +1,11 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from dub.types import BaseModel
4
+ from dub.types import BaseModel, UNSET_SENTINEL
5
5
  from dub.utils import FieldMetadata, QueryParamMetadata
6
6
  from enum import Enum
7
7
  import pydantic
8
+ from pydantic import model_serializer
8
9
  from typing import List, Optional, Union
9
10
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
10
11
 
@@ -157,3 +158,33 @@ class GetLinksCountRequest(BaseModel):
157
158
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
158
159
  ] = None
159
160
  r"""The field to group the links by."""
161
+
162
+ @model_serializer(mode="wrap")
163
+ def serialize_model(self, handler):
164
+ optional_fields = set(
165
+ [
166
+ "domain",
167
+ "tagId",
168
+ "tagIds",
169
+ "tagNames",
170
+ "folderId",
171
+ "search",
172
+ "userId",
173
+ "tenantId",
174
+ "showArchived",
175
+ "withTags",
176
+ "groupBy",
177
+ ]
178
+ )
179
+ serialized = handler(self)
180
+ m = {}
181
+
182
+ for n, f in type(self).model_fields.items():
183
+ k = f.alias or n
184
+ val = serialized.get(k)
185
+
186
+ if val != UNSET_SENTINEL:
187
+ if val is not None or k not in optional_fields:
188
+ m[k] = val
189
+
190
+ return m
@@ -1,10 +1,11 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from dub.types import BaseModel
4
+ from dub.types import BaseModel, UNSET_SENTINEL
5
5
  from dub.utils import FieldMetadata, QueryParamMetadata
6
6
  from enum import Enum
7
7
  import pydantic
8
+ from pydantic import model_serializer
8
9
  from typing import Optional
9
10
  from typing_extensions import Annotated, NotRequired, TypedDict
10
11
 
@@ -96,3 +97,30 @@ class GetQRCodeRequest(BaseModel):
96
97
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
97
98
  ] = True
98
99
  r"""DEPRECATED: Margin is included by default. Use the `margin` prop to customize the margin size."""
100
+
101
+ @model_serializer(mode="wrap")
102
+ def serialize_model(self, handler):
103
+ optional_fields = set(
104
+ [
105
+ "logo",
106
+ "size",
107
+ "level",
108
+ "fgColor",
109
+ "bgColor",
110
+ "hideLogo",
111
+ "margin",
112
+ "includeMargin",
113
+ ]
114
+ )
115
+ serialized = handler(self)
116
+ m = {}
117
+
118
+ for n, f in type(self).model_fields.items():
119
+ k = f.alias or n
120
+ val = serialized.get(k)
121
+
122
+ if val != UNSET_SENTINEL:
123
+ if val is not None or k not in optional_fields:
124
+ m[k] = val
125
+
126
+ return m
@@ -1,10 +1,11 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from dub.types import BaseModel
4
+ from dub.types import BaseModel, UNSET_SENTINEL
5
5
  from dub.utils import FieldMetadata, QueryParamMetadata
6
6
  from enum import Enum
7
7
  import pydantic
8
+ from pydantic import model_serializer
8
9
  from typing import List, Optional, Union
9
10
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
10
11
 
@@ -85,3 +86,21 @@ class GetTagsRequest(BaseModel):
85
86
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
86
87
  ] = 100
87
88
  r"""The number of items per page."""
89
+
90
+ @model_serializer(mode="wrap")
91
+ def serialize_model(self, handler):
92
+ optional_fields = set(
93
+ ["sortBy", "sortOrder", "search", "ids", "page", "pageSize"]
94
+ )
95
+ serialized = handler(self)
96
+ m = {}
97
+
98
+ for n, f in type(self).model_fields.items():
99
+ k = f.alias or n
100
+ val = serialized.get(k)
101
+
102
+ if val != UNSET_SENTINEL:
103
+ if val is not None or k not in optional_fields:
104
+ m[k] = val
105
+
106
+ return m
@@ -0,0 +1,249 @@
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
+ r"""The ID of the bounty"""
39
+ status: NotRequired[ListBountySubmissionsQueryParamStatus]
40
+ r"""The status of the submissions to list."""
41
+ group_id: NotRequired[str]
42
+ r"""The ID of the group to list submissions for."""
43
+ partner_id: NotRequired[str]
44
+ r"""The ID of the partner to list submissions for."""
45
+ sort_by: NotRequired[ListBountySubmissionsQueryParamSortBy]
46
+ r"""The field to sort the submissions by."""
47
+ sort_order: NotRequired[ListBountySubmissionsQueryParamSortOrder]
48
+ r"""The order to sort the submissions by."""
49
+ page: NotRequired[float]
50
+ r"""The page number for pagination."""
51
+ page_size: NotRequired[float]
52
+ r"""The number of items per page."""
53
+
54
+
55
+ class ListBountySubmissionsRequest(BaseModel):
56
+ bounty_id: Annotated[
57
+ str,
58
+ pydantic.Field(alias="bountyId"),
59
+ FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
60
+ ]
61
+ r"""The ID of the bounty"""
62
+
63
+ status: Annotated[
64
+ Optional[ListBountySubmissionsQueryParamStatus],
65
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
66
+ ] = None
67
+ r"""The status of the submissions to list."""
68
+
69
+ group_id: Annotated[
70
+ Optional[str],
71
+ pydantic.Field(alias="groupId"),
72
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
73
+ ] = None
74
+ r"""The ID of the group to list submissions for."""
75
+
76
+ partner_id: Annotated[
77
+ Optional[str],
78
+ pydantic.Field(alias="partnerId"),
79
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
80
+ ] = None
81
+ r"""The ID of the partner to list submissions for."""
82
+
83
+ sort_by: Annotated[
84
+ Optional[ListBountySubmissionsQueryParamSortBy],
85
+ pydantic.Field(alias="sortBy"),
86
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
87
+ ] = ListBountySubmissionsQueryParamSortBy.COMPLETED_AT
88
+ r"""The field to sort the submissions by."""
89
+
90
+ sort_order: Annotated[
91
+ Optional[ListBountySubmissionsQueryParamSortOrder],
92
+ pydantic.Field(alias="sortOrder"),
93
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
94
+ ] = ListBountySubmissionsQueryParamSortOrder.ASC
95
+ r"""The order to sort the submissions by."""
96
+
97
+ page: Annotated[
98
+ Optional[float],
99
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
100
+ ] = 1
101
+ r"""The page number for pagination."""
102
+
103
+ page_size: Annotated[
104
+ Optional[float],
105
+ pydantic.Field(alias="pageSize"),
106
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
107
+ ] = 100
108
+ r"""The number of items per page."""
109
+
110
+ @model_serializer(mode="wrap")
111
+ def serialize_model(self, handler):
112
+ optional_fields = set(
113
+ [
114
+ "status",
115
+ "groupId",
116
+ "partnerId",
117
+ "sortBy",
118
+ "sortOrder",
119
+ "page",
120
+ "pageSize",
121
+ ]
122
+ )
123
+ serialized = handler(self)
124
+ m = {}
125
+
126
+ for n, f in type(self).model_fields.items():
127
+ k = f.alias or n
128
+ val = serialized.get(k)
129
+
130
+ if val != UNSET_SENTINEL:
131
+ if val is not None or k not in optional_fields:
132
+ m[k] = val
133
+
134
+ return m
135
+
136
+
137
+ class FilesTypedDict(TypedDict):
138
+ url: str
139
+ r"""The URL of the uploaded file."""
140
+ file_name: str
141
+ r"""The original file name."""
142
+ size: float
143
+ r"""The file size in bytes."""
144
+
145
+
146
+ class Files(BaseModel):
147
+ url: str
148
+ r"""The URL of the uploaded file."""
149
+
150
+ file_name: Annotated[str, pydantic.Field(alias="fileName")]
151
+ r"""The original file name."""
152
+
153
+ size: float
154
+ r"""The file size in bytes."""
155
+
156
+
157
+ class ListBountySubmissionsStatus(str, Enum):
158
+ r"""The status of the submission"""
159
+
160
+ DRAFT = "draft"
161
+ SUBMITTED = "submitted"
162
+ APPROVED = "approved"
163
+ REJECTED = "rejected"
164
+
165
+
166
+ class ListBountySubmissionsResponseBodyTypedDict(TypedDict):
167
+ id: str
168
+ r"""The ID of the bounty submission"""
169
+ bounty_id: str
170
+ r"""The ID of the bounty"""
171
+ partner_id: str
172
+ r"""The ID of the partner"""
173
+ description: Nullable[str]
174
+ r"""The description of the submission"""
175
+ urls: Nullable[List[str]]
176
+ r"""The URLs submitted for the submission"""
177
+ files: Nullable[List[FilesTypedDict]]
178
+ r"""The files uploaded for the submission"""
179
+ status: ListBountySubmissionsStatus
180
+ r"""The status of the submission"""
181
+ performance_count: Nullable[float]
182
+ r"""The performance count of the submission"""
183
+ created_at: str
184
+ r"""The date and time the submission was created"""
185
+ completed_at: Nullable[str]
186
+ r"""The date and time the submission was completed"""
187
+ reviewed_at: Nullable[str]
188
+ r"""The date and time the submission was reviewed"""
189
+ rejection_reason: Nullable[str]
190
+ r"""The reason for rejecting the submission"""
191
+ rejection_note: Nullable[str]
192
+ r"""The note for rejecting the submission"""
193
+
194
+
195
+ class ListBountySubmissionsResponseBody(BaseModel):
196
+ id: str
197
+ r"""The ID of the bounty submission"""
198
+
199
+ bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
200
+ r"""The ID of the bounty"""
201
+
202
+ partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
203
+ r"""The ID of the partner"""
204
+
205
+ description: Nullable[str]
206
+ r"""The description of the submission"""
207
+
208
+ urls: Nullable[List[str]]
209
+ r"""The URLs submitted for the submission"""
210
+
211
+ files: Nullable[List[Files]]
212
+ r"""The files uploaded for the submission"""
213
+
214
+ status: ListBountySubmissionsStatus
215
+ r"""The status of the submission"""
216
+
217
+ performance_count: Annotated[
218
+ Nullable[float], pydantic.Field(alias="performanceCount")
219
+ ]
220
+ r"""The performance count of the submission"""
221
+
222
+ created_at: Annotated[str, pydantic.Field(alias="createdAt")]
223
+ r"""The date and time the submission was created"""
224
+
225
+ completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
226
+ r"""The date and time the submission was completed"""
227
+
228
+ reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
229
+ r"""The date and time the submission was reviewed"""
230
+
231
+ rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
232
+ r"""The reason for rejecting the submission"""
233
+
234
+ rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
235
+ r"""The note for rejecting the submission"""
236
+
237
+ @model_serializer(mode="wrap")
238
+ def serialize_model(self, handler):
239
+ serialized = handler(self)
240
+ m = {}
241
+
242
+ for n, f in type(self).model_fields.items():
243
+ k = f.alias or n
244
+ val = serialized.get(k)
245
+
246
+ if val != UNSET_SENTINEL:
247
+ m[k] = val
248
+
249
+ return m