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
@@ -261,94 +261,93 @@ class Data(BaseModel):
261
261
 
262
262
  @model_serializer(mode="wrap")
263
263
  def serialize_model(self, handler):
264
- optional_fields = [
265
- "url",
266
- "tenantId",
267
- "programId",
268
- "partnerId",
269
- "trackConversion",
270
- "archived",
271
- "tagIds",
272
- "tagNames",
273
- "folderId",
274
- "comments",
275
- "expiresAt",
276
- "expiredUrl",
277
- "password",
278
- "proxy",
279
- "title",
280
- "description",
281
- "image",
282
- "video",
283
- "rewrite",
284
- "ios",
285
- "android",
286
- "geo",
287
- "doIndex",
288
- "utm_source",
289
- "utm_medium",
290
- "utm_campaign",
291
- "utm_term",
292
- "utm_content",
293
- "ref",
294
- "webhookIds",
295
- "testVariants",
296
- "testStartedAt",
297
- "testCompletedAt",
298
- "publicStats",
299
- "tagId",
300
- ]
301
- nullable_fields = [
302
- "tenantId",
303
- "programId",
304
- "partnerId",
305
- "folderId",
306
- "comments",
307
- "expiresAt",
308
- "expiredUrl",
309
- "password",
310
- "title",
311
- "description",
312
- "image",
313
- "video",
314
- "ios",
315
- "android",
316
- "geo",
317
- "utm_source",
318
- "utm_medium",
319
- "utm_campaign",
320
- "utm_term",
321
- "utm_content",
322
- "ref",
323
- "webhookIds",
324
- "testVariants",
325
- "testStartedAt",
326
- "testCompletedAt",
327
- "tagId",
328
- ]
329
- null_default_fields = []
330
-
264
+ optional_fields = set(
265
+ [
266
+ "url",
267
+ "tenantId",
268
+ "programId",
269
+ "partnerId",
270
+ "trackConversion",
271
+ "archived",
272
+ "tagIds",
273
+ "tagNames",
274
+ "folderId",
275
+ "comments",
276
+ "expiresAt",
277
+ "expiredUrl",
278
+ "password",
279
+ "proxy",
280
+ "title",
281
+ "description",
282
+ "image",
283
+ "video",
284
+ "rewrite",
285
+ "ios",
286
+ "android",
287
+ "geo",
288
+ "doIndex",
289
+ "utm_source",
290
+ "utm_medium",
291
+ "utm_campaign",
292
+ "utm_term",
293
+ "utm_content",
294
+ "ref",
295
+ "webhookIds",
296
+ "testVariants",
297
+ "testStartedAt",
298
+ "testCompletedAt",
299
+ "publicStats",
300
+ "tagId",
301
+ ]
302
+ )
303
+ nullable_fields = set(
304
+ [
305
+ "tenantId",
306
+ "programId",
307
+ "partnerId",
308
+ "folderId",
309
+ "comments",
310
+ "expiresAt",
311
+ "expiredUrl",
312
+ "password",
313
+ "title",
314
+ "description",
315
+ "image",
316
+ "video",
317
+ "ios",
318
+ "android",
319
+ "geo",
320
+ "utm_source",
321
+ "utm_medium",
322
+ "utm_campaign",
323
+ "utm_term",
324
+ "utm_content",
325
+ "ref",
326
+ "webhookIds",
327
+ "testVariants",
328
+ "testStartedAt",
329
+ "testCompletedAt",
330
+ "tagId",
331
+ ]
332
+ )
331
333
  serialized = handler(self)
332
-
333
334
  m = {}
334
335
 
335
336
  for n, f in type(self).model_fields.items():
336
337
  k = f.alias or n
337
338
  val = serialized.get(k)
338
- serialized.pop(k, None)
339
-
340
- optional_nullable = k in optional_fields and k in nullable_fields
341
- is_set = (
342
- self.__pydantic_fields_set__.intersection({n})
343
- or k in null_default_fields
344
- ) # pylint: disable=no-member
345
-
346
- if val is not None and val != UNSET_SENTINEL:
347
- m[k] = val
348
- elif val != UNSET_SENTINEL and (
349
- not k in optional_fields or (optional_nullable and is_set)
350
- ):
351
- m[k] = val
339
+ is_nullable_and_explicitly_set = (
340
+ k in nullable_fields
341
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
342
+ )
343
+
344
+ if val != UNSET_SENTINEL:
345
+ if (
346
+ val is not None
347
+ or k not in optional_fields
348
+ or is_nullable_and_explicitly_set
349
+ ):
350
+ m[k] = val
352
351
 
353
352
  return m
354
353
 
@@ -371,3 +370,19 @@ class BulkUpdateLinksRequestBody(BaseModel):
371
370
  Optional[List[str]], pydantic.Field(alias="externalIds")
372
371
  ] = None
373
372
  r"""The external IDs of the links to update as stored in your database."""
373
+
374
+ @model_serializer(mode="wrap")
375
+ def serialize_model(self, handler):
376
+ optional_fields = set(["linkIds", "externalIds"])
377
+ serialized = handler(self)
378
+ m = {}
379
+
380
+ for n, f in type(self).model_fields.items():
381
+ k = f.alias or n
382
+ val = serialized.get(k)
383
+
384
+ if val != UNSET_SENTINEL:
385
+ if val is not None or k not in optional_fields:
386
+ m[k] = val
387
+
388
+ return m
@@ -54,30 +54,14 @@ class CheckDomainStatusResponseBody(BaseModel):
54
54
 
55
55
  @model_serializer(mode="wrap")
56
56
  def serialize_model(self, handler):
57
- optional_fields = []
58
- nullable_fields = ["price", "premium"]
59
- null_default_fields = []
60
-
61
57
  serialized = handler(self)
62
-
63
58
  m = {}
64
59
 
65
60
  for n, f in type(self).model_fields.items():
66
61
  k = f.alias or n
67
62
  val = serialized.get(k)
68
- serialized.pop(k, None)
69
63
 
70
- optional_nullable = k in optional_fields and k in nullable_fields
71
- is_set = (
72
- self.__pydantic_fields_set__.intersection({n})
73
- or k in null_default_fields
74
- ) # pylint: disable=no-member
75
-
76
- if val is not None and val != UNSET_SENTINEL:
77
- m[k] = val
78
- elif val != UNSET_SENTINEL and (
79
- not k in optional_fields or (optional_nullable and is_set)
80
- ):
64
+ if val != UNSET_SENTINEL:
81
65
  m[k] = val
82
66
 
83
67
  return m
@@ -62,45 +62,44 @@ class CreateDomainRequestBody(BaseModel):
62
62
 
63
63
  @model_serializer(mode="wrap")
64
64
  def serialize_model(self, handler):
65
- optional_fields = [
66
- "expiredUrl",
67
- "notFoundUrl",
68
- "archived",
69
- "placeholder",
70
- "logo",
71
- "assetLinks",
72
- "appleAppSiteAssociation",
73
- ]
74
- nullable_fields = [
75
- "expiredUrl",
76
- "notFoundUrl",
77
- "placeholder",
78
- "logo",
79
- "assetLinks",
80
- "appleAppSiteAssociation",
81
- ]
82
- null_default_fields = []
83
-
65
+ optional_fields = set(
66
+ [
67
+ "expiredUrl",
68
+ "notFoundUrl",
69
+ "archived",
70
+ "placeholder",
71
+ "logo",
72
+ "assetLinks",
73
+ "appleAppSiteAssociation",
74
+ ]
75
+ )
76
+ nullable_fields = set(
77
+ [
78
+ "expiredUrl",
79
+ "notFoundUrl",
80
+ "placeholder",
81
+ "logo",
82
+ "assetLinks",
83
+ "appleAppSiteAssociation",
84
+ ]
85
+ )
84
86
  serialized = handler(self)
85
-
86
87
  m = {}
87
88
 
88
89
  for n, f in type(self).model_fields.items():
89
90
  k = f.alias or n
90
91
  val = serialized.get(k)
91
- serialized.pop(k, None)
92
-
93
- optional_nullable = k in optional_fields and k in nullable_fields
94
- is_set = (
95
- self.__pydantic_fields_set__.intersection({n})
96
- or k in null_default_fields
97
- ) # pylint: disable=no-member
98
-
99
- if val is not None and val != UNSET_SENTINEL:
100
- m[k] = val
101
- elif val != UNSET_SENTINEL and (
102
- not k in optional_fields or (optional_nullable and is_set)
103
- ):
104
- m[k] = val
92
+ is_nullable_and_explicitly_set = (
93
+ k in nullable_fields
94
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
95
+ )
96
+
97
+ if val != UNSET_SENTINEL:
98
+ if (
99
+ val is not None
100
+ or k not in optional_fields
101
+ or is_nullable_and_explicitly_set
102
+ ):
103
+ m[k] = val
105
104
 
106
105
  return m
@@ -38,30 +38,29 @@ class CreateFolderRequestBody(BaseModel):
38
38
 
39
39
  @model_serializer(mode="wrap")
40
40
  def serialize_model(self, handler):
41
- optional_fields = ["description", "accessLevel"]
42
- nullable_fields = ["description", "accessLevel"]
43
- null_default_fields = ["accessLevel"]
44
-
41
+ optional_fields = set(["description", "accessLevel"])
42
+ nullable_fields = set(["description", "accessLevel"])
43
+ null_default_fields = set(["accessLevel"])
45
44
  serialized = handler(self)
46
-
47
45
  m = {}
48
46
 
49
47
  for n, f in type(self).model_fields.items():
50
48
  k = f.alias or n
51
49
  val = serialized.get(k)
52
- serialized.pop(k, None)
53
-
54
- optional_nullable = k in optional_fields and k in nullable_fields
55
- is_set = (
56
- self.__pydantic_fields_set__.intersection({n})
57
- or k in null_default_fields
58
- ) # pylint: disable=no-member
59
-
60
- if val is not None and val != UNSET_SENTINEL:
61
- m[k] = val
62
- elif val != UNSET_SENTINEL and (
63
- not k in optional_fields or (optional_nullable and is_set)
64
- ):
65
- m[k] = val
50
+ is_nullable_and_explicitly_set = (
51
+ k in nullable_fields
52
+ and (
53
+ self.__pydantic_fields_set__.intersection({n})
54
+ or k in null_default_fields
55
+ ) # pylint: disable=no-member
56
+ )
57
+
58
+ if val != UNSET_SENTINEL:
59
+ if (
60
+ val is not None
61
+ or k not in optional_fields
62
+ or is_nullable_and_explicitly_set
63
+ ):
64
+ m[k] = val
66
65
 
67
66
  return m
@@ -281,98 +281,97 @@ class CreateLinkRequestBody(BaseModel):
281
281
 
282
282
  @model_serializer(mode="wrap")
283
283
  def serialize_model(self, handler):
284
- optional_fields = [
285
- "domain",
286
- "key",
287
- "keyLength",
288
- "externalId",
289
- "tenantId",
290
- "programId",
291
- "partnerId",
292
- "prefix",
293
- "trackConversion",
294
- "archived",
295
- "tagIds",
296
- "tagNames",
297
- "folderId",
298
- "comments",
299
- "expiresAt",
300
- "expiredUrl",
301
- "password",
302
- "proxy",
303
- "title",
304
- "description",
305
- "image",
306
- "video",
307
- "rewrite",
308
- "ios",
309
- "android",
310
- "geo",
311
- "doIndex",
312
- "utm_source",
313
- "utm_medium",
314
- "utm_campaign",
315
- "utm_term",
316
- "utm_content",
317
- "ref",
318
- "webhookIds",
319
- "testVariants",
320
- "testStartedAt",
321
- "testCompletedAt",
322
- "publicStats",
323
- "tagId",
324
- ]
325
- nullable_fields = [
326
- "externalId",
327
- "tenantId",
328
- "programId",
329
- "partnerId",
330
- "folderId",
331
- "comments",
332
- "expiresAt",
333
- "expiredUrl",
334
- "password",
335
- "title",
336
- "description",
337
- "image",
338
- "video",
339
- "ios",
340
- "android",
341
- "geo",
342
- "utm_source",
343
- "utm_medium",
344
- "utm_campaign",
345
- "utm_term",
346
- "utm_content",
347
- "ref",
348
- "webhookIds",
349
- "testVariants",
350
- "testStartedAt",
351
- "testCompletedAt",
352
- "tagId",
353
- ]
354
- null_default_fields = []
355
-
284
+ optional_fields = set(
285
+ [
286
+ "domain",
287
+ "key",
288
+ "keyLength",
289
+ "externalId",
290
+ "tenantId",
291
+ "programId",
292
+ "partnerId",
293
+ "prefix",
294
+ "trackConversion",
295
+ "archived",
296
+ "tagIds",
297
+ "tagNames",
298
+ "folderId",
299
+ "comments",
300
+ "expiresAt",
301
+ "expiredUrl",
302
+ "password",
303
+ "proxy",
304
+ "title",
305
+ "description",
306
+ "image",
307
+ "video",
308
+ "rewrite",
309
+ "ios",
310
+ "android",
311
+ "geo",
312
+ "doIndex",
313
+ "utm_source",
314
+ "utm_medium",
315
+ "utm_campaign",
316
+ "utm_term",
317
+ "utm_content",
318
+ "ref",
319
+ "webhookIds",
320
+ "testVariants",
321
+ "testStartedAt",
322
+ "testCompletedAt",
323
+ "publicStats",
324
+ "tagId",
325
+ ]
326
+ )
327
+ nullable_fields = set(
328
+ [
329
+ "externalId",
330
+ "tenantId",
331
+ "programId",
332
+ "partnerId",
333
+ "folderId",
334
+ "comments",
335
+ "expiresAt",
336
+ "expiredUrl",
337
+ "password",
338
+ "title",
339
+ "description",
340
+ "image",
341
+ "video",
342
+ "ios",
343
+ "android",
344
+ "geo",
345
+ "utm_source",
346
+ "utm_medium",
347
+ "utm_campaign",
348
+ "utm_term",
349
+ "utm_content",
350
+ "ref",
351
+ "webhookIds",
352
+ "testVariants",
353
+ "testStartedAt",
354
+ "testCompletedAt",
355
+ "tagId",
356
+ ]
357
+ )
356
358
  serialized = handler(self)
357
-
358
359
  m = {}
359
360
 
360
361
  for n, f in type(self).model_fields.items():
361
362
  k = f.alias or n
362
363
  val = serialized.get(k)
363
- serialized.pop(k, None)
364
-
365
- optional_nullable = k in optional_fields and k in nullable_fields
366
- is_set = (
367
- self.__pydantic_fields_set__.intersection({n})
368
- or k in null_default_fields
369
- ) # pylint: disable=no-member
370
-
371
- if val is not None and val != UNSET_SENTINEL:
372
- m[k] = val
373
- elif val != UNSET_SENTINEL and (
374
- not k in optional_fields or (optional_nullable and is_set)
375
- ):
376
- m[k] = val
364
+ is_nullable_and_explicitly_set = (
365
+ k in nullable_fields
366
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
367
+ )
368
+
369
+ if val != UNSET_SENTINEL:
370
+ if (
371
+ val is not None
372
+ or k not in optional_fields
373
+ or is_nullable_and_explicitly_set
374
+ ):
375
+ m[k] = val
377
376
 
378
377
  return m