dub 0.34.1__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/models/components/__init__.py +108 -26
  4. dub/models/components/analyticsbrowsers.py +18 -1
  5. dub/models/components/analyticscities.py +18 -1
  6. dub/models/components/analyticscontinents.py +18 -1
  7. dub/models/components/analyticscount.py +18 -1
  8. dub/models/components/analyticscountries.py +20 -1
  9. dub/models/components/analyticsdevices.py +18 -1
  10. dub/models/components/analyticsos.py +18 -1
  11. dub/models/components/analyticsreferers.py +18 -1
  12. dub/models/components/analyticsrefererurls.py +18 -1
  13. dub/models/components/analyticsregions.py +18 -1
  14. dub/models/components/analyticstimeseries.py +18 -1
  15. dub/models/components/analyticstoplinks.py +16 -26
  16. dub/models/components/analyticstopurls.py +18 -1
  17. dub/models/components/analyticstriggers.py +18 -1
  18. dub/models/components/commissioncreatedevent.py +96 -64
  19. dub/models/components/domainschema.py +31 -50
  20. dub/models/components/folderschema.py +18 -19
  21. dub/models/components/leadcreatedevent.py +151 -134
  22. dub/models/components/linkclickedevent.py +57 -70
  23. dub/models/components/linkschema.py +63 -64
  24. dub/models/components/linkwebhookevent.py +43 -51
  25. dub/models/components/partneranalyticscount.py +18 -1
  26. dub/models/components/partneranalyticstimeseries.py +18 -1
  27. dub/models/components/partneranalyticstoplinks.py +16 -27
  28. dub/models/components/partnerapplicationsubmittedevent.py +42 -75
  29. dub/models/components/partnerenrolledevent.py +477 -83
  30. dub/models/components/salecreatedevent.py +152 -151
  31. dub/models/errors/badrequest.py +18 -1
  32. dub/models/errors/conflict.py +18 -1
  33. dub/models/errors/forbidden.py +18 -1
  34. dub/models/errors/internalservererror.py +18 -1
  35. dub/models/errors/inviteexpired.py +18 -1
  36. dub/models/errors/notfound.py +18 -1
  37. dub/models/errors/ratelimitexceeded.py +18 -1
  38. dub/models/errors/unauthorized.py +18 -1
  39. dub/models/errors/unprocessableentity.py +18 -1
  40. dub/models/operations/__init__.py +230 -19
  41. dub/models/operations/approvebountysubmission.py +71 -45
  42. dub/models/operations/banpartner.py +14 -19
  43. dub/models/operations/bulkcreatelinks.py +86 -87
  44. dub/models/operations/bulkupdatelinks.py +97 -82
  45. dub/models/operations/checkdomainstatus.py +1 -17
  46. dub/models/operations/createdomain.py +33 -34
  47. dub/models/operations/createfolder.py +18 -19
  48. dub/models/operations/createlink.py +86 -87
  49. dub/models/operations/createpartner.py +560 -168
  50. dub/models/operations/createpartnerlink.py +74 -85
  51. dub/models/operations/createreferralsembedtoken.py +99 -87
  52. dub/models/operations/createtag.py +18 -1
  53. dub/models/operations/deactivatepartner.py +65 -0
  54. dub/models/operations/getcustomer.py +106 -105
  55. dub/models/operations/getcustomers.py +123 -105
  56. dub/models/operations/getlinkinfo.py +18 -1
  57. dub/models/operations/getlinks.py +36 -1
  58. dub/models/operations/getlinkscount.py +32 -1
  59. dub/models/operations/getqrcode.py +29 -1
  60. dub/models/operations/gettags.py +20 -1
  61. dub/models/operations/listbountysubmissions.py +63 -26
  62. dub/models/operations/listcommissions.py +129 -64
  63. dub/models/operations/listdomains.py +18 -1
  64. dub/models/operations/listevents.py +414 -389
  65. dub/models/operations/listfolders.py +18 -1
  66. dub/models/operations/listpartners.py +510 -84
  67. dub/models/operations/registerdomain.py +1 -17
  68. dub/models/operations/rejectbountysubmission.py +71 -26
  69. dub/models/operations/retrieveanalytics.py +65 -66
  70. dub/models/operations/retrievelinks.py +30 -19
  71. dub/models/operations/retrievepartneranalytics.py +25 -28
  72. dub/models/operations/tracklead.py +38 -83
  73. dub/models/operations/tracksale.py +52 -95
  74. dub/models/operations/updatecommission.py +126 -64
  75. dub/models/operations/updatecustomer.py +122 -131
  76. dub/models/operations/updatedomain.py +50 -35
  77. dub/models/operations/updatefolder.py +34 -19
  78. dub/models/operations/updatelink.py +101 -86
  79. dub/models/operations/updatetag.py +34 -1
  80. dub/models/operations/upsertlink.py +86 -87
  81. dub/models/operations/upsertpartnerlink.py +72 -78
  82. dub/partners.py +288 -0
  83. dub/sdk.py +0 -3
  84. dub/utils/__init__.py +10 -1
  85. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/METADATA +4 -8
  86. dub-0.35.0.dist-info/RECORD +143 -0
  87. dub/models/components/workspaceschema.py +0 -328
  88. dub/models/operations/getworkspace.py +0 -21
  89. dub/models/operations/updateworkspace.py +0 -78
  90. dub/workspaces.py +0 -561
  91. dub-0.34.1.dist-info/RECORD +0 -146
  92. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
  93. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/licenses/LICENSE +0 -0
@@ -305,75 +305,74 @@ class LinkSchema(BaseModel):
305
305
 
306
306
  @model_serializer(mode="wrap")
307
307
  def serialize_model(self, handler):
308
- optional_fields = [
309
- "trackConversion",
310
- "archived",
311
- "proxy",
312
- "rewrite",
313
- "doIndex",
314
- "publicStats",
315
- "testVariants",
316
- "testStartedAt",
317
- "testCompletedAt",
318
- "clicks",
319
- "leads",
320
- "conversions",
321
- "sales",
322
- "saleAmount",
323
- ]
324
- nullable_fields = [
325
- "externalId",
326
- "tenantId",
327
- "programId",
328
- "partnerId",
329
- "expiresAt",
330
- "expiredUrl",
331
- "disabledAt",
332
- "password",
333
- "title",
334
- "description",
335
- "image",
336
- "video",
337
- "ios",
338
- "android",
339
- "geo",
340
- "tags",
341
- "folderId",
342
- "comments",
343
- "utm_source",
344
- "utm_medium",
345
- "utm_campaign",
346
- "utm_term",
347
- "utm_content",
348
- "testVariants",
349
- "testStartedAt",
350
- "testCompletedAt",
351
- "userId",
352
- "lastClicked",
353
- "tagId",
354
- ]
355
- null_default_fields = []
356
-
308
+ optional_fields = set(
309
+ [
310
+ "trackConversion",
311
+ "archived",
312
+ "proxy",
313
+ "rewrite",
314
+ "doIndex",
315
+ "publicStats",
316
+ "testVariants",
317
+ "testStartedAt",
318
+ "testCompletedAt",
319
+ "clicks",
320
+ "leads",
321
+ "conversions",
322
+ "sales",
323
+ "saleAmount",
324
+ ]
325
+ )
326
+ nullable_fields = set(
327
+ [
328
+ "externalId",
329
+ "tenantId",
330
+ "programId",
331
+ "partnerId",
332
+ "expiresAt",
333
+ "expiredUrl",
334
+ "disabledAt",
335
+ "password",
336
+ "title",
337
+ "description",
338
+ "image",
339
+ "video",
340
+ "ios",
341
+ "android",
342
+ "geo",
343
+ "tags",
344
+ "folderId",
345
+ "comments",
346
+ "utm_source",
347
+ "utm_medium",
348
+ "utm_campaign",
349
+ "utm_term",
350
+ "utm_content",
351
+ "testVariants",
352
+ "testStartedAt",
353
+ "testCompletedAt",
354
+ "userId",
355
+ "lastClicked",
356
+ "tagId",
357
+ ]
358
+ )
357
359
  serialized = handler(self)
358
-
359
360
  m = {}
360
361
 
361
362
  for n, f in type(self).model_fields.items():
362
363
  k = f.alias or n
363
364
  val = serialized.get(k)
364
- serialized.pop(k, None)
365
-
366
- optional_nullable = k in optional_fields and k in nullable_fields
367
- is_set = (
368
- self.__pydantic_fields_set__.intersection({n})
369
- or k in null_default_fields
370
- ) # pylint: disable=no-member
371
-
372
- if val is not None and val != UNSET_SENTINEL:
373
- m[k] = val
374
- elif val != UNSET_SENTINEL and (
375
- not k in optional_fields or (optional_nullable and is_set)
376
- ):
377
- m[k] = val
365
+ is_nullable_and_explicitly_set = (
366
+ k in nullable_fields
367
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
368
+ )
369
+
370
+ if val != UNSET_SENTINEL:
371
+ if (
372
+ val is not None
373
+ or k not in optional_fields
374
+ or is_nullable_and_explicitly_set
375
+ ):
376
+ m[k] = val
378
377
 
379
378
  return m
@@ -283,63 +283,55 @@ class Data(BaseModel):
283
283
 
284
284
  @model_serializer(mode="wrap")
285
285
  def serialize_model(self, handler):
286
- optional_fields = [
287
- "testVariants",
288
- "clicks",
289
- "leads",
290
- "conversions",
291
- "sales",
292
- "saleAmount",
293
- ]
294
- nullable_fields = [
295
- "externalId",
296
- "tenantId",
297
- "programId",
298
- "partnerId",
299
- "expiredUrl",
300
- "password",
301
- "title",
302
- "description",
303
- "image",
304
- "video",
305
- "ios",
306
- "android",
307
- "geo",
308
- "tags",
309
- "folderId",
310
- "comments",
311
- "utm_source",
312
- "utm_medium",
313
- "utm_campaign",
314
- "utm_term",
315
- "utm_content",
316
- "testVariants",
317
- "userId",
318
- "tagId",
319
- ]
320
- null_default_fields = []
321
-
286
+ optional_fields = set(
287
+ ["testVariants", "clicks", "leads", "conversions", "sales", "saleAmount"]
288
+ )
289
+ nullable_fields = set(
290
+ [
291
+ "externalId",
292
+ "tenantId",
293
+ "programId",
294
+ "partnerId",
295
+ "expiredUrl",
296
+ "password",
297
+ "title",
298
+ "description",
299
+ "image",
300
+ "video",
301
+ "ios",
302
+ "android",
303
+ "geo",
304
+ "tags",
305
+ "folderId",
306
+ "comments",
307
+ "utm_source",
308
+ "utm_medium",
309
+ "utm_campaign",
310
+ "utm_term",
311
+ "utm_content",
312
+ "testVariants",
313
+ "userId",
314
+ "tagId",
315
+ ]
316
+ )
322
317
  serialized = handler(self)
323
-
324
318
  m = {}
325
319
 
326
320
  for n, f in type(self).model_fields.items():
327
321
  k = f.alias or n
328
322
  val = serialized.get(k)
329
- serialized.pop(k, None)
330
-
331
- optional_nullable = k in optional_fields and k in nullable_fields
332
- is_set = (
333
- self.__pydantic_fields_set__.intersection({n})
334
- or k in null_default_fields
335
- ) # pylint: disable=no-member
336
-
337
- if val is not None and val != UNSET_SENTINEL:
338
- m[k] = val
339
- elif val != UNSET_SENTINEL and (
340
- not k in optional_fields or (optional_nullable and is_set)
341
- ):
342
- m[k] = val
323
+ is_nullable_and_explicitly_set = (
324
+ k in nullable_fields
325
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
326
+ )
327
+
328
+ if val != UNSET_SENTINEL:
329
+ if (
330
+ val is not None
331
+ or k not in optional_fields
332
+ or is_nullable_and_explicitly_set
333
+ ):
334
+ m[k] = val
343
335
 
344
336
  return m
345
337
 
@@ -1,8 +1,9 @@
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
  import pydantic
6
+ from pydantic import model_serializer
6
7
  from typing import Optional
7
8
  from typing_extensions import Annotated, NotRequired, TypedDict
8
9
 
@@ -33,3 +34,19 @@ class PartnerAnalyticsCount(BaseModel):
33
34
  r"""The total amount of sales, in cents"""
34
35
 
35
36
  earnings: Optional[float] = 0
37
+
38
+ @model_serializer(mode="wrap")
39
+ def serialize_model(self, handler):
40
+ optional_fields = set(["clicks", "leads", "sales", "saleAmount", "earnings"])
41
+ serialized = handler(self)
42
+ m = {}
43
+
44
+ for n, f in type(self).model_fields.items():
45
+ k = f.alias or n
46
+ val = serialized.get(k)
47
+
48
+ if val != UNSET_SENTINEL:
49
+ if val is not None or k not in optional_fields:
50
+ m[k] = val
51
+
52
+ return m
@@ -1,8 +1,9 @@
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
  import pydantic
6
+ from pydantic import model_serializer
6
7
  from typing import Optional
7
8
  from typing_extensions import Annotated, NotRequired, TypedDict
8
9
 
@@ -38,3 +39,19 @@ class PartnerAnalyticsTimeseries(BaseModel):
38
39
  r"""The total amount of sales in the interval, in cents"""
39
40
 
40
41
  earnings: Optional[float] = 0
42
+
43
+ @model_serializer(mode="wrap")
44
+ def serialize_model(self, handler):
45
+ optional_fields = set(["clicks", "leads", "sales", "saleAmount", "earnings"])
46
+ serialized = handler(self)
47
+ m = {}
48
+
49
+ for n, f in type(self).model_fields.items():
50
+ k = f.alias or n
51
+ val = serialized.get(k)
52
+
53
+ if val != UNSET_SENTINEL:
54
+ if val is not None or k not in optional_fields:
55
+ m[k] = val
56
+
57
+ return m
@@ -87,38 +87,27 @@ class PartnerAnalyticsTopLinks(BaseModel):
87
87
 
88
88
  @model_serializer(mode="wrap")
89
89
  def serialize_model(self, handler):
90
- optional_fields = [
91
- "comments",
92
- "title",
93
- "clicks",
94
- "leads",
95
- "sales",
96
- "saleAmount",
97
- "earnings",
98
- ]
99
- nullable_fields = ["comments", "title"]
100
- null_default_fields = []
101
-
90
+ optional_fields = set(
91
+ ["comments", "title", "clicks", "leads", "sales", "saleAmount", "earnings"]
92
+ )
93
+ nullable_fields = set(["comments", "title"])
102
94
  serialized = handler(self)
103
-
104
95
  m = {}
105
96
 
106
97
  for n, f in type(self).model_fields.items():
107
98
  k = f.alias or n
108
99
  val = serialized.get(k)
109
- serialized.pop(k, None)
110
-
111
- optional_nullable = k in optional_fields and k in nullable_fields
112
- is_set = (
113
- self.__pydantic_fields_set__.intersection({n})
114
- or k in null_default_fields
115
- ) # pylint: disable=no-member
116
-
117
- if val is not None and val != UNSET_SENTINEL:
118
- m[k] = val
119
- elif val != UNSET_SENTINEL and (
120
- not k in optional_fields or (optional_nullable and is_set)
121
- ):
122
- m[k] = val
100
+ is_nullable_and_explicitly_set = (
101
+ k in nullable_fields
102
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
103
+ )
104
+
105
+ if val != UNSET_SENTINEL:
106
+ if (
107
+ val is not None
108
+ or k not in optional_fields
109
+ or is_nullable_and_explicitly_set
110
+ ):
111
+ m[k] = val
123
112
 
124
113
  return m
@@ -107,53 +107,52 @@ class PartnerApplicationSubmittedEventPartner(BaseModel):
107
107
 
108
108
  @model_serializer(mode="wrap")
109
109
  def serialize_model(self, handler):
110
- optional_fields = [
111
- "description",
112
- "groupId",
113
- "website",
114
- "youtube",
115
- "twitter",
116
- "linkedin",
117
- "instagram",
118
- "tiktok",
119
- ]
120
- nullable_fields = [
121
- "companyName",
122
- "email",
123
- "image",
124
- "description",
125
- "country",
126
- "groupId",
127
- "website",
128
- "youtube",
129
- "twitter",
130
- "linkedin",
131
- "instagram",
132
- "tiktok",
133
- ]
134
- null_default_fields = []
135
-
110
+ optional_fields = set(
111
+ [
112
+ "description",
113
+ "groupId",
114
+ "website",
115
+ "youtube",
116
+ "twitter",
117
+ "linkedin",
118
+ "instagram",
119
+ "tiktok",
120
+ ]
121
+ )
122
+ nullable_fields = set(
123
+ [
124
+ "companyName",
125
+ "email",
126
+ "image",
127
+ "description",
128
+ "country",
129
+ "groupId",
130
+ "website",
131
+ "youtube",
132
+ "twitter",
133
+ "linkedin",
134
+ "instagram",
135
+ "tiktok",
136
+ ]
137
+ )
136
138
  serialized = handler(self)
137
-
138
139
  m = {}
139
140
 
140
141
  for n, f in type(self).model_fields.items():
141
142
  k = f.alias or n
142
143
  val = serialized.get(k)
143
- serialized.pop(k, None)
144
-
145
- optional_nullable = k in optional_fields and k in nullable_fields
146
- is_set = (
147
- self.__pydantic_fields_set__.intersection({n})
148
- or k in null_default_fields
149
- ) # pylint: disable=no-member
150
-
151
- if val is not None and val != UNSET_SENTINEL:
152
- m[k] = val
153
- elif val != UNSET_SENTINEL and (
154
- not k in optional_fields or (optional_nullable and is_set)
155
- ):
156
- m[k] = val
144
+ is_nullable_and_explicitly_set = (
145
+ k in nullable_fields
146
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
147
+ )
148
+
149
+ if val != UNSET_SENTINEL:
150
+ if (
151
+ val is not None
152
+ or k not in optional_fields
153
+ or is_nullable_and_explicitly_set
154
+ ):
155
+ m[k] = val
157
156
 
158
157
  return m
159
158
 
@@ -170,30 +169,14 @@ class ApplicationFormData(BaseModel):
170
169
 
171
170
  @model_serializer(mode="wrap")
172
171
  def serialize_model(self, handler):
173
- optional_fields = []
174
- nullable_fields = ["value"]
175
- null_default_fields = []
176
-
177
172
  serialized = handler(self)
178
-
179
173
  m = {}
180
174
 
181
175
  for n, f in type(self).model_fields.items():
182
176
  k = f.alias or n
183
177
  val = serialized.get(k)
184
- serialized.pop(k, None)
185
-
186
- optional_nullable = k in optional_fields and k in nullable_fields
187
- is_set = (
188
- self.__pydantic_fields_set__.intersection({n})
189
- or k in null_default_fields
190
- ) # pylint: disable=no-member
191
178
 
192
- if val is not None and val != UNSET_SENTINEL:
193
- m[k] = val
194
- elif val != UNSET_SENTINEL and (
195
- not k in optional_fields or (optional_nullable and is_set)
196
- ):
179
+ if val != UNSET_SENTINEL:
197
180
  m[k] = val
198
181
 
199
182
  return m
@@ -219,30 +202,14 @@ class PartnerApplicationSubmittedEventData(BaseModel):
219
202
 
220
203
  @model_serializer(mode="wrap")
221
204
  def serialize_model(self, handler):
222
- optional_fields = []
223
- nullable_fields = ["applicationFormData"]
224
- null_default_fields = []
225
-
226
205
  serialized = handler(self)
227
-
228
206
  m = {}
229
207
 
230
208
  for n, f in type(self).model_fields.items():
231
209
  k = f.alias or n
232
210
  val = serialized.get(k)
233
- serialized.pop(k, None)
234
-
235
- optional_nullable = k in optional_fields and k in nullable_fields
236
- is_set = (
237
- self.__pydantic_fields_set__.intersection({n})
238
- or k in null_default_fields
239
- ) # pylint: disable=no-member
240
211
 
241
- if val is not None and val != UNSET_SENTINEL:
242
- m[k] = val
243
- elif val != UNSET_SENTINEL and (
244
- not k in optional_fields or (optional_nullable and is_set)
245
- ):
212
+ if val != UNSET_SENTINEL:
246
213
  m[k] = val
247
214
 
248
215
  return m