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
@@ -273,98 +273,97 @@ class UpdateLinkRequestBody(BaseModel):
273
273
 
274
274
  @model_serializer(mode="wrap")
275
275
  def serialize_model(self, handler):
276
- optional_fields = [
277
- "url",
278
- "domain",
279
- "key",
280
- "externalId",
281
- "tenantId",
282
- "programId",
283
- "partnerId",
284
- "trackConversion",
285
- "archived",
286
- "tagIds",
287
- "tagNames",
288
- "folderId",
289
- "comments",
290
- "expiresAt",
291
- "expiredUrl",
292
- "password",
293
- "proxy",
294
- "title",
295
- "description",
296
- "image",
297
- "video",
298
- "rewrite",
299
- "ios",
300
- "android",
301
- "geo",
302
- "doIndex",
303
- "utm_source",
304
- "utm_medium",
305
- "utm_campaign",
306
- "utm_term",
307
- "utm_content",
308
- "ref",
309
- "webhookIds",
310
- "testVariants",
311
- "testStartedAt",
312
- "testCompletedAt",
313
- "publicStats",
314
- "tagId",
315
- ]
316
- nullable_fields = [
317
- "externalId",
318
- "tenantId",
319
- "programId",
320
- "partnerId",
321
- "folderId",
322
- "comments",
323
- "expiresAt",
324
- "expiredUrl",
325
- "password",
326
- "title",
327
- "description",
328
- "image",
329
- "video",
330
- "ios",
331
- "android",
332
- "geo",
333
- "utm_source",
334
- "utm_medium",
335
- "utm_campaign",
336
- "utm_term",
337
- "utm_content",
338
- "ref",
339
- "webhookIds",
340
- "testVariants",
341
- "testStartedAt",
342
- "testCompletedAt",
343
- "tagId",
344
- ]
345
- null_default_fields = []
346
-
276
+ optional_fields = set(
277
+ [
278
+ "url",
279
+ "domain",
280
+ "key",
281
+ "externalId",
282
+ "tenantId",
283
+ "programId",
284
+ "partnerId",
285
+ "trackConversion",
286
+ "archived",
287
+ "tagIds",
288
+ "tagNames",
289
+ "folderId",
290
+ "comments",
291
+ "expiresAt",
292
+ "expiredUrl",
293
+ "password",
294
+ "proxy",
295
+ "title",
296
+ "description",
297
+ "image",
298
+ "video",
299
+ "rewrite",
300
+ "ios",
301
+ "android",
302
+ "geo",
303
+ "doIndex",
304
+ "utm_source",
305
+ "utm_medium",
306
+ "utm_campaign",
307
+ "utm_term",
308
+ "utm_content",
309
+ "ref",
310
+ "webhookIds",
311
+ "testVariants",
312
+ "testStartedAt",
313
+ "testCompletedAt",
314
+ "publicStats",
315
+ "tagId",
316
+ ]
317
+ )
318
+ nullable_fields = set(
319
+ [
320
+ "externalId",
321
+ "tenantId",
322
+ "programId",
323
+ "partnerId",
324
+ "folderId",
325
+ "comments",
326
+ "expiresAt",
327
+ "expiredUrl",
328
+ "password",
329
+ "title",
330
+ "description",
331
+ "image",
332
+ "video",
333
+ "ios",
334
+ "android",
335
+ "geo",
336
+ "utm_source",
337
+ "utm_medium",
338
+ "utm_campaign",
339
+ "utm_term",
340
+ "utm_content",
341
+ "ref",
342
+ "webhookIds",
343
+ "testVariants",
344
+ "testStartedAt",
345
+ "testCompletedAt",
346
+ "tagId",
347
+ ]
348
+ )
347
349
  serialized = handler(self)
348
-
349
350
  m = {}
350
351
 
351
352
  for n, f in type(self).model_fields.items():
352
353
  k = f.alias or n
353
354
  val = serialized.get(k)
354
- serialized.pop(k, None)
355
-
356
- optional_nullable = k in optional_fields and k in nullable_fields
357
- is_set = (
358
- self.__pydantic_fields_set__.intersection({n})
359
- or k in null_default_fields
360
- ) # pylint: disable=no-member
361
-
362
- if val is not None and val != UNSET_SENTINEL:
363
- m[k] = val
364
- elif val != UNSET_SENTINEL and (
365
- not k in optional_fields or (optional_nullable and is_set)
366
- ):
367
- m[k] = val
355
+ is_nullable_and_explicitly_set = (
356
+ k in nullable_fields
357
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
358
+ )
359
+
360
+ if val != UNSET_SENTINEL:
361
+ if (
362
+ val is not None
363
+ or k not in optional_fields
364
+ or is_nullable_and_explicitly_set
365
+ ):
366
+ m[k] = val
368
367
 
369
368
  return m
370
369
 
@@ -387,3 +386,19 @@ class UpdateLinkRequest(BaseModel):
387
386
  Optional[UpdateLinkRequestBody],
388
387
  FieldMetadata(request=RequestMetadata(media_type="application/json")),
389
388
  ] = None
389
+
390
+ @model_serializer(mode="wrap")
391
+ def serialize_model(self, handler):
392
+ optional_fields = set(["RequestBody"])
393
+ serialized = handler(self)
394
+ m = {}
395
+
396
+ for n, f in type(self).model_fields.items():
397
+ k = f.alias or n
398
+ val = serialized.get(k)
399
+
400
+ if val != UNSET_SENTINEL:
401
+ if val is not None or k not in optional_fields:
402
+ m[k] = val
403
+
404
+ 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, PathParamMetadata, RequestMetadata
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
 
@@ -45,6 +46,22 @@ class UpdateTagRequestBody(BaseModel):
45
46
  ] = None
46
47
  r"""The name of the tag to create."""
47
48
 
49
+ @model_serializer(mode="wrap")
50
+ def serialize_model(self, handler):
51
+ optional_fields = set(["name", "color", "tag"])
52
+ serialized = handler(self)
53
+ m = {}
54
+
55
+ for n, f in type(self).model_fields.items():
56
+ k = f.alias or n
57
+ val = serialized.get(k)
58
+
59
+ if val != UNSET_SENTINEL:
60
+ if val is not None or k not in optional_fields:
61
+ m[k] = val
62
+
63
+ return m
64
+
48
65
 
49
66
  class UpdateTagRequestTypedDict(TypedDict):
50
67
  id: str
@@ -62,3 +79,19 @@ class UpdateTagRequest(BaseModel):
62
79
  Optional[UpdateTagRequestBody],
63
80
  FieldMetadata(request=RequestMetadata(media_type="application/json")),
64
81
  ] = None
82
+
83
+ @model_serializer(mode="wrap")
84
+ def serialize_model(self, handler):
85
+ optional_fields = set(["RequestBody"])
86
+ serialized = handler(self)
87
+ m = {}
88
+
89
+ for n, f in type(self).model_fields.items():
90
+ k = f.alias or n
91
+ val = serialized.get(k)
92
+
93
+ if val != UNSET_SENTINEL:
94
+ if val is not None or k not in optional_fields:
95
+ m[k] = val
96
+
97
+ return m
@@ -286,98 +286,97 @@ class UpsertLinkRequestBody(BaseModel):
286
286
 
287
287
  @model_serializer(mode="wrap")
288
288
  def serialize_model(self, handler):
289
- optional_fields = [
290
- "domain",
291
- "key",
292
- "keyLength",
293
- "externalId",
294
- "tenantId",
295
- "programId",
296
- "partnerId",
297
- "prefix",
298
- "trackConversion",
299
- "archived",
300
- "tagIds",
301
- "tagNames",
302
- "folderId",
303
- "comments",
304
- "expiresAt",
305
- "expiredUrl",
306
- "password",
307
- "proxy",
308
- "title",
309
- "description",
310
- "image",
311
- "video",
312
- "rewrite",
313
- "ios",
314
- "android",
315
- "geo",
316
- "doIndex",
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
- "publicStats",
328
- "tagId",
329
- ]
330
- nullable_fields = [
331
- "externalId",
332
- "tenantId",
333
- "programId",
334
- "partnerId",
335
- "folderId",
336
- "comments",
337
- "expiresAt",
338
- "expiredUrl",
339
- "password",
340
- "title",
341
- "description",
342
- "image",
343
- "video",
344
- "ios",
345
- "android",
346
- "geo",
347
- "utm_source",
348
- "utm_medium",
349
- "utm_campaign",
350
- "utm_term",
351
- "utm_content",
352
- "ref",
353
- "webhookIds",
354
- "testVariants",
355
- "testStartedAt",
356
- "testCompletedAt",
357
- "tagId",
358
- ]
359
- null_default_fields = []
360
-
289
+ optional_fields = set(
290
+ [
291
+ "domain",
292
+ "key",
293
+ "keyLength",
294
+ "externalId",
295
+ "tenantId",
296
+ "programId",
297
+ "partnerId",
298
+ "prefix",
299
+ "trackConversion",
300
+ "archived",
301
+ "tagIds",
302
+ "tagNames",
303
+ "folderId",
304
+ "comments",
305
+ "expiresAt",
306
+ "expiredUrl",
307
+ "password",
308
+ "proxy",
309
+ "title",
310
+ "description",
311
+ "image",
312
+ "video",
313
+ "rewrite",
314
+ "ios",
315
+ "android",
316
+ "geo",
317
+ "doIndex",
318
+ "utm_source",
319
+ "utm_medium",
320
+ "utm_campaign",
321
+ "utm_term",
322
+ "utm_content",
323
+ "ref",
324
+ "webhookIds",
325
+ "testVariants",
326
+ "testStartedAt",
327
+ "testCompletedAt",
328
+ "publicStats",
329
+ "tagId",
330
+ ]
331
+ )
332
+ nullable_fields = set(
333
+ [
334
+ "externalId",
335
+ "tenantId",
336
+ "programId",
337
+ "partnerId",
338
+ "folderId",
339
+ "comments",
340
+ "expiresAt",
341
+ "expiredUrl",
342
+ "password",
343
+ "title",
344
+ "description",
345
+ "image",
346
+ "video",
347
+ "ios",
348
+ "android",
349
+ "geo",
350
+ "utm_source",
351
+ "utm_medium",
352
+ "utm_campaign",
353
+ "utm_term",
354
+ "utm_content",
355
+ "ref",
356
+ "webhookIds",
357
+ "testVariants",
358
+ "testStartedAt",
359
+ "testCompletedAt",
360
+ "tagId",
361
+ ]
362
+ )
361
363
  serialized = handler(self)
362
-
363
364
  m = {}
364
365
 
365
366
  for n, f in type(self).model_fields.items():
366
367
  k = f.alias or n
367
368
  val = serialized.get(k)
368
- serialized.pop(k, None)
369
-
370
- optional_nullable = k in optional_fields and k in nullable_fields
371
- is_set = (
372
- self.__pydantic_fields_set__.intersection({n})
373
- or k in null_default_fields
374
- ) # pylint: disable=no-member
375
-
376
- if val is not None and val != UNSET_SENTINEL:
377
- m[k] = val
378
- elif val != UNSET_SENTINEL and (
379
- not k in optional_fields or (optional_nullable and is_set)
380
- ):
381
- m[k] = val
369
+ is_nullable_and_explicitly_set = (
370
+ k in nullable_fields
371
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
372
+ )
373
+
374
+ if val != UNSET_SENTINEL:
375
+ if (
376
+ val is not None
377
+ or k not in optional_fields
378
+ or is_nullable_and_explicitly_set
379
+ ):
380
+ m[k] = val
382
381
 
383
382
  return m