dub 0.27.1__tar.gz → 0.27.2__tar.gz

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 (148) hide show
  1. {dub-0.27.1 → dub-0.27.2}/PKG-INFO +2 -1
  2. {dub-0.27.1 → dub-0.27.2}/README-PYPI.md +1 -0
  3. {dub-0.27.1 → dub-0.27.2}/pyproject.toml +1 -1
  4. {dub-0.27.1 → dub-0.27.2}/src/dub/_version.py +3 -3
  5. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/__init__.py +38 -0
  6. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticstriggers.py +2 -0
  7. dub-0.27.2/src/dub/models/components/commissioncreatedevent.py +281 -0
  8. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/partnerenrolledevent.py +201 -74
  9. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/saleevent.py +1 -0
  10. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/webhookevent.py +6 -0
  11. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/__init__.py +68 -0
  12. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createpartner.py +201 -74
  13. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/listcommissions.py +169 -8
  14. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/listevents.py +19 -0
  15. dub-0.27.2/src/dub/models/operations/listpartners.py +516 -0
  16. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/retrieveanalytics.py +19 -0
  17. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/tracksale.py +1 -0
  18. dub-0.27.2/src/dub/models/operations/updatecommission.py +315 -0
  19. {dub-0.27.1 → dub-0.27.2}/src/dub/partners.py +262 -0
  20. dub-0.27.1/src/dub/models/operations/updatecommission.py +0 -154
  21. {dub-0.27.1 → dub-0.27.2}/LICENSE +0 -0
  22. {dub-0.27.1 → dub-0.27.2}/py.typed +0 -0
  23. {dub-0.27.1 → dub-0.27.2}/src/dub/__init__.py +0 -0
  24. {dub-0.27.1 → dub-0.27.2}/src/dub/_hooks/__init__.py +0 -0
  25. {dub-0.27.1 → dub-0.27.2}/src/dub/_hooks/registration.py +0 -0
  26. {dub-0.27.1 → dub-0.27.2}/src/dub/_hooks/sdkhooks.py +0 -0
  27. {dub-0.27.1 → dub-0.27.2}/src/dub/_hooks/types.py +0 -0
  28. {dub-0.27.1 → dub-0.27.2}/src/dub/analytics.py +0 -0
  29. {dub-0.27.1 → dub-0.27.2}/src/dub/basesdk.py +0 -0
  30. {dub-0.27.1 → dub-0.27.2}/src/dub/commissions.py +0 -0
  31. {dub-0.27.1 → dub-0.27.2}/src/dub/customers.py +0 -0
  32. {dub-0.27.1 → dub-0.27.2}/src/dub/domains.py +0 -0
  33. {dub-0.27.1 → dub-0.27.2}/src/dub/embed_tokens.py +0 -0
  34. {dub-0.27.1 → dub-0.27.2}/src/dub/events.py +0 -0
  35. {dub-0.27.1 → dub-0.27.2}/src/dub/folders.py +0 -0
  36. {dub-0.27.1 → dub-0.27.2}/src/dub/httpclient.py +0 -0
  37. {dub-0.27.1 → dub-0.27.2}/src/dub/links.py +0 -0
  38. {dub-0.27.1 → dub-0.27.2}/src/dub/models/__init__.py +0 -0
  39. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticsbrowsers.py +0 -0
  40. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticscities.py +0 -0
  41. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticscontinents.py +0 -0
  42. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticscount.py +0 -0
  43. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticscountries.py +0 -0
  44. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticsdevices.py +0 -0
  45. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticsos.py +0 -0
  46. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticsreferers.py +0 -0
  47. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticsrefererurls.py +0 -0
  48. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticsregions.py +0 -0
  49. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticstimeseries.py +0 -0
  50. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticstoplinks.py +0 -0
  51. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/analyticstopurls.py +0 -0
  52. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/clickevent.py +0 -0
  53. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/continentcode.py +0 -0
  54. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/countrycode.py +0 -0
  55. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/domainschema.py +0 -0
  56. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/folderschema.py +0 -0
  57. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/leadcreatedevent.py +0 -0
  58. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/leadevent.py +0 -0
  59. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/linkclickedevent.py +0 -0
  60. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/linkerrorschema.py +0 -0
  61. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/linkgeotargeting.py +0 -0
  62. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/linkschema.py +0 -0
  63. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/linkwebhookevent.py +0 -0
  64. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/partneranalyticscount.py +0 -0
  65. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/partneranalyticstimeseries.py +0 -0
  66. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/partneranalyticstoplinks.py +0 -0
  67. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/salecreatedevent.py +0 -0
  68. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/security.py +0 -0
  69. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/tagschema.py +0 -0
  70. {dub-0.27.1 → dub-0.27.2}/src/dub/models/components/workspaceschema.py +0 -0
  71. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/__init__.py +0 -0
  72. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/badrequest.py +0 -0
  73. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/conflict.py +0 -0
  74. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/duberror.py +0 -0
  75. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/forbidden.py +0 -0
  76. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/internalservererror.py +0 -0
  77. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/inviteexpired.py +0 -0
  78. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/no_response_error.py +0 -0
  79. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/notfound.py +0 -0
  80. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/ratelimitexceeded.py +0 -0
  81. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/responsevalidationerror.py +0 -0
  82. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/sdkerror.py +0 -0
  83. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/unauthorized.py +0 -0
  84. {dub-0.27.1 → dub-0.27.2}/src/dub/models/errors/unprocessableentity.py +0 -0
  85. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/bulkcreatelinks.py +0 -0
  86. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/bulkdeletelinks.py +0 -0
  87. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/bulkupdatelinks.py +0 -0
  88. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/checkdomainstatus.py +0 -0
  89. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createcustomer.py +0 -0
  90. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createdomain.py +0 -0
  91. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createfolder.py +0 -0
  92. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createlink.py +0 -0
  93. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createpartnerlink.py +0 -0
  94. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createreferralsembedtoken.py +0 -0
  95. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/createtag.py +0 -0
  96. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/deletecustomer.py +0 -0
  97. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/deletedomain.py +0 -0
  98. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/deletefolder.py +0 -0
  99. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/deletelink.py +0 -0
  100. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/deletetag.py +0 -0
  101. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/getcustomer.py +0 -0
  102. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/getcustomers.py +0 -0
  103. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/getlinkinfo.py +0 -0
  104. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/getlinks.py +0 -0
  105. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/getlinkscount.py +0 -0
  106. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/getqrcode.py +0 -0
  107. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/gettags.py +0 -0
  108. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/getworkspace.py +0 -0
  109. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/listdomains.py +0 -0
  110. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/listfolders.py +0 -0
  111. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/registerdomain.py +0 -0
  112. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/retrievelinks.py +0 -0
  113. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/retrievepartneranalytics.py +0 -0
  114. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/tracklead.py +0 -0
  115. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/updatecustomer.py +0 -0
  116. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/updatedomain.py +0 -0
  117. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/updatefolder.py +0 -0
  118. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/updatelink.py +0 -0
  119. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/updatetag.py +0 -0
  120. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/updateworkspace.py +0 -0
  121. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/upsertlink.py +0 -0
  122. {dub-0.27.1 → dub-0.27.2}/src/dub/models/operations/upsertpartnerlink.py +0 -0
  123. {dub-0.27.1 → dub-0.27.2}/src/dub/py.typed +0 -0
  124. {dub-0.27.1 → dub-0.27.2}/src/dub/qr_codes.py +0 -0
  125. {dub-0.27.1 → dub-0.27.2}/src/dub/sdk.py +0 -0
  126. {dub-0.27.1 → dub-0.27.2}/src/dub/sdkconfiguration.py +0 -0
  127. {dub-0.27.1 → dub-0.27.2}/src/dub/tags.py +0 -0
  128. {dub-0.27.1 → dub-0.27.2}/src/dub/track.py +0 -0
  129. {dub-0.27.1 → dub-0.27.2}/src/dub/types/__init__.py +0 -0
  130. {dub-0.27.1 → dub-0.27.2}/src/dub/types/basemodel.py +0 -0
  131. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/__init__.py +0 -0
  132. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/annotations.py +0 -0
  133. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/datetimes.py +0 -0
  134. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/enums.py +0 -0
  135. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/eventstreaming.py +0 -0
  136. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/forms.py +0 -0
  137. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/headers.py +0 -0
  138. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/logger.py +0 -0
  139. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/metadata.py +0 -0
  140. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/queryparams.py +0 -0
  141. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/requestbodies.py +0 -0
  142. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/retries.py +0 -0
  143. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/security.py +0 -0
  144. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/serializers.py +0 -0
  145. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/unmarshal_json_response.py +0 -0
  146. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/url.py +0 -0
  147. {dub-0.27.1 → dub-0.27.2}/src/dub/utils/values.py +0 -0
  148. {dub-0.27.1 → dub-0.27.2}/src/dub/workspaces.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dub
3
- Version: 0.27.1
3
+ Version: 0.27.2
4
4
  Summary: Python Client SDK Generated by Speakeasy
5
5
  Author: Speakeasy
6
6
  Requires-Python: >=3.9.2
@@ -331,6 +331,7 @@ asyncio.run(main())
331
331
  ### [partners](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md)
332
332
 
333
333
  * [create](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#create) - Create a partner
334
+ * [list](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#list) - List all partners
334
335
  * [create_link](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#create_link) - Create a link for a partner
335
336
  * [retrieve_links](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#retrieve_links) - Retrieve a partner's links.
336
337
  * [upsert_link](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#upsert_link) - Upsert a link for a partner
@@ -313,6 +313,7 @@ asyncio.run(main())
313
313
  ### [partners](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md)
314
314
 
315
315
  * [create](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#create) - Create a partner
316
+ * [list](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#list) - List all partners
316
317
  * [create_link](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#create_link) - Create a link for a partner
317
318
  * [retrieve_links](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#retrieve_links) - Retrieve a partner's links.
318
319
  * [upsert_link](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#upsert_link) - Upsert a link for a partner
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dub"
3
- version = "0.27.1"
3
+ version = "0.27.2"
4
4
  description = "Python Client SDK Generated by Speakeasy"
5
5
  authors = [{ name = "Speakeasy" },]
6
6
  readme = "README-PYPI.md"
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "dub"
6
- __version__: str = "0.27.1"
6
+ __version__: str = "0.27.2"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
- __gen_version__: str = "2.656.5"
9
- __user_agent__: str = "speakeasy-sdk/python 0.27.1 2.656.5 0.0.1 dub"
8
+ __gen_version__: str = "2.662.0"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.27.2 2.662.0 0.0.1 dub"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -51,6 +51,19 @@ if TYPE_CHECKING:
51
51
  Link,
52
52
  LinkTypedDict,
53
53
  )
54
+ from .commissioncreatedevent import (
55
+ CommissionCreatedEvent,
56
+ CommissionCreatedEventCustomer,
57
+ CommissionCreatedEventCustomerTypedDict,
58
+ CommissionCreatedEventData,
59
+ CommissionCreatedEventDataTypedDict,
60
+ CommissionCreatedEventEvent,
61
+ CommissionCreatedEventStatus,
62
+ CommissionCreatedEventType,
63
+ CommissionCreatedEventTypedDict,
64
+ Partner,
65
+ PartnerTypedDict,
66
+ )
54
67
  from .continentcode import ContinentCode
55
68
  from .countrycode import CountryCode
56
69
  from .domainschema import (
@@ -145,6 +158,7 @@ if TYPE_CHECKING:
145
158
  PartnerAnalyticsTopLinksTypedDict,
146
159
  )
147
160
  from .partnerenrolledevent import (
161
+ BannedReason,
148
162
  PartnerEnrolledEvent,
149
163
  PartnerEnrolledEventData,
150
164
  PartnerEnrolledEventDataTypedDict,
@@ -236,6 +250,7 @@ __all__ = [
236
250
  "AnalyticsTopUrlsTypedDict",
237
251
  "AnalyticsTriggers",
238
252
  "AnalyticsTriggersTypedDict",
253
+ "BannedReason",
239
254
  "City",
240
255
  "Click",
241
256
  "ClickEvent",
@@ -247,6 +262,15 @@ __all__ = [
247
262
  "ClickTypedDict",
248
263
  "Code",
249
264
  "Color",
265
+ "CommissionCreatedEvent",
266
+ "CommissionCreatedEventCustomer",
267
+ "CommissionCreatedEventCustomerTypedDict",
268
+ "CommissionCreatedEventData",
269
+ "CommissionCreatedEventDataTypedDict",
270
+ "CommissionCreatedEventEvent",
271
+ "CommissionCreatedEventStatus",
272
+ "CommissionCreatedEventType",
273
+ "CommissionCreatedEventTypedDict",
250
274
  "Continent",
251
275
  "ContinentCode",
252
276
  "CountryCode",
@@ -319,6 +343,7 @@ __all__ = [
319
343
  "LinkWebhookEventTestVariantsTypedDict",
320
344
  "LinkWebhookEventTypedDict",
321
345
  "One",
346
+ "Partner",
322
347
  "PartnerAnalyticsCount",
323
348
  "PartnerAnalyticsCountTypedDict",
324
349
  "PartnerAnalyticsTimeseries",
@@ -332,6 +357,7 @@ __all__ = [
332
357
  "PartnerEnrolledEventLink",
333
358
  "PartnerEnrolledEventLinkTypedDict",
334
359
  "PartnerEnrolledEventTypedDict",
360
+ "PartnerTypedDict",
335
361
  "PaymentProcessor",
336
362
  "Plan",
337
363
  "Region",
@@ -434,6 +460,17 @@ _dynamic_imports: dict[str, str] = {
434
460
  "Event": ".clickevent",
435
461
  "Link": ".clickevent",
436
462
  "LinkTypedDict": ".clickevent",
463
+ "CommissionCreatedEvent": ".commissioncreatedevent",
464
+ "CommissionCreatedEventCustomer": ".commissioncreatedevent",
465
+ "CommissionCreatedEventCustomerTypedDict": ".commissioncreatedevent",
466
+ "CommissionCreatedEventData": ".commissioncreatedevent",
467
+ "CommissionCreatedEventDataTypedDict": ".commissioncreatedevent",
468
+ "CommissionCreatedEventEvent": ".commissioncreatedevent",
469
+ "CommissionCreatedEventStatus": ".commissioncreatedevent",
470
+ "CommissionCreatedEventType": ".commissioncreatedevent",
471
+ "CommissionCreatedEventTypedDict": ".commissioncreatedevent",
472
+ "Partner": ".commissioncreatedevent",
473
+ "PartnerTypedDict": ".commissioncreatedevent",
437
474
  "ContinentCode": ".continentcode",
438
475
  "CountryCode": ".countrycode",
439
476
  "DomainSchema": ".domainschema",
@@ -515,6 +552,7 @@ _dynamic_imports: dict[str, str] = {
515
552
  "PartnerAnalyticsTimeseriesTypedDict": ".partneranalyticstimeseries",
516
553
  "PartnerAnalyticsTopLinks": ".partneranalyticstoplinks",
517
554
  "PartnerAnalyticsTopLinksTypedDict": ".partneranalyticstoplinks",
555
+ "BannedReason": ".partnerenrolledevent",
518
556
  "PartnerEnrolledEvent": ".partnerenrolledevent",
519
557
  "PartnerEnrolledEventData": ".partnerenrolledevent",
520
558
  "PartnerEnrolledEventDataTypedDict": ".partnerenrolledevent",
@@ -13,6 +13,8 @@ class Trigger(str, Enum):
13
13
 
14
14
  QR = "qr"
15
15
  LINK = "link"
16
+ PAGEVIEW = "pageview"
17
+ DEEPLINK = "deeplink"
16
18
 
17
19
 
18
20
  class AnalyticsTriggersTypedDict(TypedDict):
@@ -0,0 +1,281 @@
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 enum import Enum
6
+ import pydantic
7
+ from pydantic import model_serializer
8
+ from typing import Optional
9
+ from typing_extensions import Annotated, NotRequired, TypedDict
10
+
11
+
12
+ class CommissionCreatedEventEvent(str, Enum):
13
+ COMMISSION_CREATED = "commission.created"
14
+
15
+
16
+ class CommissionCreatedEventType(str, Enum):
17
+ CLICK = "click"
18
+ LEAD = "lead"
19
+ SALE = "sale"
20
+ CUSTOM = "custom"
21
+
22
+
23
+ class CommissionCreatedEventStatus(str, Enum):
24
+ PENDING = "pending"
25
+ PROCESSED = "processed"
26
+ PAID = "paid"
27
+ REFUNDED = "refunded"
28
+ DUPLICATE = "duplicate"
29
+ FRAUD = "fraud"
30
+ CANCELED = "canceled"
31
+
32
+
33
+ class PartnerTypedDict(TypedDict):
34
+ id: str
35
+ r"""The partner's unique ID on Dub."""
36
+ name: str
37
+ r"""The partner's full legal name."""
38
+ email: Nullable[str]
39
+ r"""The partner's email address. Should be a unique value across Dub."""
40
+ image: Nullable[str]
41
+ r"""The partner's avatar image."""
42
+ payouts_enabled_at: Nullable[str]
43
+ r"""The date when the partner enabled payouts."""
44
+ country: Nullable[str]
45
+ r"""The partner's country (required for tax purposes)."""
46
+
47
+
48
+ class Partner(BaseModel):
49
+ id: str
50
+ r"""The partner's unique ID on Dub."""
51
+
52
+ name: str
53
+ r"""The partner's full legal name."""
54
+
55
+ email: Nullable[str]
56
+ r"""The partner's email address. Should be a unique value across Dub."""
57
+
58
+ image: Nullable[str]
59
+ r"""The partner's avatar image."""
60
+
61
+ payouts_enabled_at: Annotated[
62
+ Nullable[str], pydantic.Field(alias="payoutsEnabledAt")
63
+ ]
64
+ r"""The date when the partner enabled payouts."""
65
+
66
+ country: Nullable[str]
67
+ r"""The partner's country (required for tax purposes)."""
68
+
69
+ @model_serializer(mode="wrap")
70
+ def serialize_model(self, handler):
71
+ optional_fields = []
72
+ nullable_fields = ["email", "image", "payoutsEnabledAt", "country"]
73
+ null_default_fields = []
74
+
75
+ serialized = handler(self)
76
+
77
+ m = {}
78
+
79
+ for n, f in type(self).model_fields.items():
80
+ k = f.alias or n
81
+ val = serialized.get(k)
82
+ serialized.pop(k, None)
83
+
84
+ optional_nullable = k in optional_fields and k in nullable_fields
85
+ is_set = (
86
+ self.__pydantic_fields_set__.intersection({n})
87
+ or k in null_default_fields
88
+ ) # pylint: disable=no-member
89
+
90
+ if val is not None and val != UNSET_SENTINEL:
91
+ m[k] = val
92
+ elif val != UNSET_SENTINEL and (
93
+ not k in optional_fields or (optional_nullable and is_set)
94
+ ):
95
+ m[k] = val
96
+
97
+ return m
98
+
99
+
100
+ class CommissionCreatedEventCustomerTypedDict(TypedDict):
101
+ id: str
102
+ r"""The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."""
103
+ external_id: str
104
+ r"""Unique identifier for the customer in the client's app."""
105
+ name: str
106
+ r"""Name of the customer."""
107
+ created_at: str
108
+ r"""The date the customer was created."""
109
+ email: NotRequired[Nullable[str]]
110
+ r"""Email of the customer."""
111
+ avatar: NotRequired[Nullable[str]]
112
+ r"""Avatar URL of the customer."""
113
+ country: NotRequired[Nullable[str]]
114
+ r"""Country of the customer."""
115
+ sales: NotRequired[Nullable[float]]
116
+ r"""Total number of sales for the customer."""
117
+ sale_amount: NotRequired[Nullable[float]]
118
+ r"""Total amount of sales for the customer."""
119
+
120
+
121
+ class CommissionCreatedEventCustomer(BaseModel):
122
+ id: str
123
+ r"""The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."""
124
+
125
+ external_id: Annotated[str, pydantic.Field(alias="externalId")]
126
+ r"""Unique identifier for the customer in the client's app."""
127
+
128
+ name: str
129
+ r"""Name of the customer."""
130
+
131
+ created_at: Annotated[str, pydantic.Field(alias="createdAt")]
132
+ r"""The date the customer was created."""
133
+
134
+ email: OptionalNullable[str] = UNSET
135
+ r"""Email of the customer."""
136
+
137
+ avatar: OptionalNullable[str] = UNSET
138
+ r"""Avatar URL of the customer."""
139
+
140
+ country: OptionalNullable[str] = UNSET
141
+ r"""Country of the customer."""
142
+
143
+ sales: OptionalNullable[float] = UNSET
144
+ r"""Total number of sales for the customer."""
145
+
146
+ sale_amount: Annotated[
147
+ OptionalNullable[float], pydantic.Field(alias="saleAmount")
148
+ ] = UNSET
149
+ r"""Total amount of sales for the customer."""
150
+
151
+ @model_serializer(mode="wrap")
152
+ def serialize_model(self, handler):
153
+ optional_fields = ["email", "avatar", "country", "sales", "saleAmount"]
154
+ nullable_fields = ["email", "avatar", "country", "sales", "saleAmount"]
155
+ null_default_fields = []
156
+
157
+ serialized = handler(self)
158
+
159
+ m = {}
160
+
161
+ for n, f in type(self).model_fields.items():
162
+ k = f.alias or n
163
+ val = serialized.get(k)
164
+ serialized.pop(k, None)
165
+
166
+ optional_nullable = k in optional_fields and k in nullable_fields
167
+ is_set = (
168
+ self.__pydantic_fields_set__.intersection({n})
169
+ or k in null_default_fields
170
+ ) # pylint: disable=no-member
171
+
172
+ if val is not None and val != UNSET_SENTINEL:
173
+ m[k] = val
174
+ elif val != UNSET_SENTINEL and (
175
+ not k in optional_fields or (optional_nullable and is_set)
176
+ ):
177
+ m[k] = val
178
+
179
+ return m
180
+
181
+
182
+ class CommissionCreatedEventDataTypedDict(TypedDict):
183
+ id: str
184
+ r"""The commission's unique ID on Dub."""
185
+ amount: float
186
+ earnings: float
187
+ currency: str
188
+ status: CommissionCreatedEventStatus
189
+ invoice_id: Nullable[str]
190
+ description: Nullable[str]
191
+ quantity: float
192
+ created_at: str
193
+ updated_at: str
194
+ partner: PartnerTypedDict
195
+ type: NotRequired[CommissionCreatedEventType]
196
+ user_id: NotRequired[Nullable[str]]
197
+ r"""The user who created the manual commission."""
198
+ customer: NotRequired[Nullable[CommissionCreatedEventCustomerTypedDict]]
199
+
200
+
201
+ class CommissionCreatedEventData(BaseModel):
202
+ id: str
203
+ r"""The commission's unique ID on Dub."""
204
+
205
+ amount: float
206
+
207
+ earnings: float
208
+
209
+ currency: str
210
+
211
+ status: CommissionCreatedEventStatus
212
+
213
+ invoice_id: Annotated[Nullable[str], pydantic.Field(alias="invoiceId")]
214
+
215
+ description: Nullable[str]
216
+
217
+ quantity: float
218
+
219
+ created_at: Annotated[str, pydantic.Field(alias="createdAt")]
220
+
221
+ updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
222
+
223
+ partner: Partner
224
+
225
+ type: Optional[CommissionCreatedEventType] = None
226
+
227
+ user_id: Annotated[OptionalNullable[str], pydantic.Field(alias="userId")] = UNSET
228
+ r"""The user who created the manual commission."""
229
+
230
+ customer: OptionalNullable[CommissionCreatedEventCustomer] = UNSET
231
+
232
+ @model_serializer(mode="wrap")
233
+ def serialize_model(self, handler):
234
+ optional_fields = ["type", "userId", "customer"]
235
+ nullable_fields = ["invoiceId", "description", "userId", "customer"]
236
+ null_default_fields = []
237
+
238
+ serialized = handler(self)
239
+
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
+ serialized.pop(k, None)
246
+
247
+ optional_nullable = k in optional_fields and k in nullable_fields
248
+ is_set = (
249
+ self.__pydantic_fields_set__.intersection({n})
250
+ or k in null_default_fields
251
+ ) # pylint: disable=no-member
252
+
253
+ if val is not None and val != UNSET_SENTINEL:
254
+ m[k] = val
255
+ elif val != UNSET_SENTINEL and (
256
+ not k in optional_fields or (optional_nullable and is_set)
257
+ ):
258
+ m[k] = val
259
+
260
+ return m
261
+
262
+
263
+ class CommissionCreatedEventTypedDict(TypedDict):
264
+ r"""Triggered when a commission is created for a partner."""
265
+
266
+ id: str
267
+ event: CommissionCreatedEventEvent
268
+ created_at: str
269
+ data: CommissionCreatedEventDataTypedDict
270
+
271
+
272
+ class CommissionCreatedEvent(BaseModel):
273
+ r"""Triggered when a commission is created for a partner."""
274
+
275
+ id: str
276
+
277
+ event: CommissionCreatedEventEvent
278
+
279
+ created_at: Annotated[str, pydantic.Field(alias="createdAt")]
280
+
281
+ data: CommissionCreatedEventData