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
@@ -1,328 +0,0 @@
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_SENTINEL
5
- from enum import Enum
6
- import pydantic
7
- from pydantic import model_serializer
8
- from typing import Any, Dict, List, Optional
9
- from typing_extensions import Annotated, NotRequired, TypedDict
10
-
11
-
12
- class Plan(str, Enum):
13
- r"""The plan of the workspace."""
14
-
15
- FREE = "free"
16
- PRO = "pro"
17
- BUSINESS = "business"
18
- BUSINESS_PLUS = "business plus"
19
- BUSINESS_EXTRA = "business extra"
20
- BUSINESS_MAX = "business max"
21
- ADVANCED = "advanced"
22
- ENTERPRISE = "enterprise"
23
-
24
-
25
- class Role(str, Enum):
26
- r"""The role of the authenticated user in the workspace."""
27
-
28
- OWNER = "owner"
29
- MEMBER = "member"
30
-
31
-
32
- class UsersTypedDict(TypedDict):
33
- role: Role
34
- r"""The role of the authenticated user in the workspace."""
35
- default_folder_id: Nullable[str]
36
- r"""The ID of the default folder for the user in the workspace."""
37
-
38
-
39
- class Users(BaseModel):
40
- role: Role
41
- r"""The role of the authenticated user in the workspace."""
42
-
43
- default_folder_id: Annotated[Nullable[str], pydantic.Field(alias="defaultFolderId")]
44
- r"""The ID of the default folder for the user in the workspace."""
45
-
46
- @model_serializer(mode="wrap")
47
- def serialize_model(self, handler):
48
- optional_fields = []
49
- nullable_fields = ["defaultFolderId"]
50
- null_default_fields = []
51
-
52
- serialized = handler(self)
53
-
54
- m = {}
55
-
56
- for n, f in type(self).model_fields.items():
57
- k = f.alias or n
58
- val = serialized.get(k)
59
- serialized.pop(k, None)
60
-
61
- optional_nullable = k in optional_fields and k in nullable_fields
62
- is_set = (
63
- self.__pydantic_fields_set__.intersection({n})
64
- or k in null_default_fields
65
- ) # pylint: disable=no-member
66
-
67
- if val is not None and val != UNSET_SENTINEL:
68
- m[k] = val
69
- elif val != UNSET_SENTINEL and (
70
- not k in optional_fields or (optional_nullable and is_set)
71
- ):
72
- m[k] = val
73
-
74
- return m
75
-
76
-
77
- class DomainsTypedDict(TypedDict):
78
- slug: str
79
- r"""The domain name."""
80
- primary: NotRequired[bool]
81
- r"""Whether the domain is the primary domain for the workspace."""
82
- verified: NotRequired[bool]
83
- r"""Whether the domain is verified."""
84
-
85
-
86
- class Domains(BaseModel):
87
- slug: str
88
- r"""The domain name."""
89
-
90
- primary: Optional[bool] = False
91
- r"""Whether the domain is the primary domain for the workspace."""
92
-
93
- verified: Optional[bool] = False
94
- r"""Whether the domain is verified."""
95
-
96
-
97
- class WorkspaceSchemaTypedDict(TypedDict):
98
- id: str
99
- r"""The unique ID of the workspace."""
100
- name: str
101
- r"""The name of the workspace."""
102
- slug: str
103
- r"""The slug of the workspace."""
104
- invite_code: Nullable[str]
105
- r"""The invite code of the workspace."""
106
- plan: Plan
107
- r"""The plan of the workspace."""
108
- plan_tier: Nullable[float]
109
- r"""The tier of the workspace's plan."""
110
- stripe_id: Nullable[str]
111
- r"""The Stripe ID of the workspace."""
112
- billing_cycle_start: float
113
- r"""The date and time when the billing cycle starts for the workspace."""
114
- payment_failed_at: Nullable[str]
115
- r"""The date and time when the payment failed for the workspace."""
116
- stripe_connect_id: Nullable[str]
117
- r"""The Stripe Connect ID of the workspace."""
118
- total_links: float
119
- r"""The total number of links in the workspace."""
120
- usage: float
121
- r"""The usage of the workspace."""
122
- usage_limit: float
123
- r"""The usage limit of the workspace."""
124
- links_usage: float
125
- r"""The links usage of the workspace."""
126
- links_limit: float
127
- r"""The links limit of the workspace."""
128
- payouts_usage: float
129
- r"""The dollar amount of partner payouts processed in the current billing cycle (in cents)."""
130
- payouts_limit: float
131
- r"""The max dollar amount of partner payouts that can be processed within a billing cycle (in cents)."""
132
- payout_fee: float
133
- r"""The processing fee (in decimals) for partner payouts. For card payments, an additional 0.03 is added to the fee. Learn more: https://d.to/payouts"""
134
- domains_limit: float
135
- r"""The domains limit of the workspace."""
136
- tags_limit: float
137
- r"""The tags limit of the workspace."""
138
- folders_usage: float
139
- r"""The folders usage of the workspace."""
140
- folders_limit: float
141
- r"""The folders limit of the workspace."""
142
- groups_limit: float
143
- r"""The groups limit of the workspace."""
144
- network_invites_limit: float
145
- r"""The weekly network invites limit of the workspace."""
146
- users_limit: float
147
- r"""The users limit of the workspace."""
148
- ai_usage: float
149
- r"""The AI usage of the workspace."""
150
- ai_limit: float
151
- r"""The AI limit of the workspace."""
152
- conversion_enabled: bool
153
- r"""Whether the workspace has conversion tracking enabled automatically for new links (d.to/conversions)."""
154
- dot_link_claimed: bool
155
- r"""Whether the workspace has claimed a free .link domain. (dub.link/free)"""
156
- created_at: str
157
- r"""The date and time when the workspace was created."""
158
- users: List[UsersTypedDict]
159
- r"""The role of the authenticated user in the workspace."""
160
- domains: List[DomainsTypedDict]
161
- r"""The domains of the workspace."""
162
- store: Nullable[Dict[str, Any]]
163
- r"""The miscellaneous key-value store of the workspace."""
164
- allowed_hostnames: Nullable[List[str]]
165
- r"""Specifies hostnames permitted for client-side click tracking."""
166
- sso_email_domain: Nullable[str]
167
- sso_enforced_at: Nullable[str]
168
- logo: NotRequired[Nullable[str]]
169
- r"""The logo of the workspace."""
170
- flags: NotRequired[Dict[str, bool]]
171
- r"""The feature flags of the workspace, indicating which features are enabled."""
172
-
173
-
174
- class WorkspaceSchema(BaseModel):
175
- id: str
176
- r"""The unique ID of the workspace."""
177
-
178
- name: str
179
- r"""The name of the workspace."""
180
-
181
- slug: str
182
- r"""The slug of the workspace."""
183
-
184
- invite_code: Annotated[Nullable[str], pydantic.Field(alias="inviteCode")]
185
- r"""The invite code of the workspace."""
186
-
187
- plan: Plan
188
- r"""The plan of the workspace."""
189
-
190
- plan_tier: Annotated[Nullable[float], pydantic.Field(alias="planTier")]
191
- r"""The tier of the workspace's plan."""
192
-
193
- stripe_id: Annotated[Nullable[str], pydantic.Field(alias="stripeId")]
194
- r"""The Stripe ID of the workspace."""
195
-
196
- billing_cycle_start: Annotated[float, pydantic.Field(alias="billingCycleStart")]
197
- r"""The date and time when the billing cycle starts for the workspace."""
198
-
199
- payment_failed_at: Annotated[Nullable[str], pydantic.Field(alias="paymentFailedAt")]
200
- r"""The date and time when the payment failed for the workspace."""
201
-
202
- stripe_connect_id: Annotated[Nullable[str], pydantic.Field(alias="stripeConnectId")]
203
- r"""The Stripe Connect ID of the workspace."""
204
-
205
- total_links: Annotated[float, pydantic.Field(alias="totalLinks")]
206
- r"""The total number of links in the workspace."""
207
-
208
- usage: float
209
- r"""The usage of the workspace."""
210
-
211
- usage_limit: Annotated[float, pydantic.Field(alias="usageLimit")]
212
- r"""The usage limit of the workspace."""
213
-
214
- links_usage: Annotated[float, pydantic.Field(alias="linksUsage")]
215
- r"""The links usage of the workspace."""
216
-
217
- links_limit: Annotated[float, pydantic.Field(alias="linksLimit")]
218
- r"""The links limit of the workspace."""
219
-
220
- payouts_usage: Annotated[float, pydantic.Field(alias="payoutsUsage")]
221
- r"""The dollar amount of partner payouts processed in the current billing cycle (in cents)."""
222
-
223
- payouts_limit: Annotated[float, pydantic.Field(alias="payoutsLimit")]
224
- r"""The max dollar amount of partner payouts that can be processed within a billing cycle (in cents)."""
225
-
226
- payout_fee: Annotated[float, pydantic.Field(alias="payoutFee")]
227
- r"""The processing fee (in decimals) for partner payouts. For card payments, an additional 0.03 is added to the fee. Learn more: https://d.to/payouts"""
228
-
229
- domains_limit: Annotated[float, pydantic.Field(alias="domainsLimit")]
230
- r"""The domains limit of the workspace."""
231
-
232
- tags_limit: Annotated[float, pydantic.Field(alias="tagsLimit")]
233
- r"""The tags limit of the workspace."""
234
-
235
- folders_usage: Annotated[float, pydantic.Field(alias="foldersUsage")]
236
- r"""The folders usage of the workspace."""
237
-
238
- folders_limit: Annotated[float, pydantic.Field(alias="foldersLimit")]
239
- r"""The folders limit of the workspace."""
240
-
241
- groups_limit: Annotated[float, pydantic.Field(alias="groupsLimit")]
242
- r"""The groups limit of the workspace."""
243
-
244
- network_invites_limit: Annotated[float, pydantic.Field(alias="networkInvitesLimit")]
245
- r"""The weekly network invites limit of the workspace."""
246
-
247
- users_limit: Annotated[float, pydantic.Field(alias="usersLimit")]
248
- r"""The users limit of the workspace."""
249
-
250
- ai_usage: Annotated[float, pydantic.Field(alias="aiUsage")]
251
- r"""The AI usage of the workspace."""
252
-
253
- ai_limit: Annotated[float, pydantic.Field(alias="aiLimit")]
254
- r"""The AI limit of the workspace."""
255
-
256
- conversion_enabled: Annotated[bool, pydantic.Field(alias="conversionEnabled")]
257
- r"""Whether the workspace has conversion tracking enabled automatically for new links (d.to/conversions)."""
258
-
259
- dot_link_claimed: Annotated[bool, pydantic.Field(alias="dotLinkClaimed")]
260
- r"""Whether the workspace has claimed a free .link domain. (dub.link/free)"""
261
-
262
- created_at: Annotated[str, pydantic.Field(alias="createdAt")]
263
- r"""The date and time when the workspace was created."""
264
-
265
- users: List[Users]
266
- r"""The role of the authenticated user in the workspace."""
267
-
268
- domains: List[Domains]
269
- r"""The domains of the workspace."""
270
-
271
- store: Nullable[Dict[str, Any]]
272
- r"""The miscellaneous key-value store of the workspace."""
273
-
274
- allowed_hostnames: Annotated[
275
- Nullable[List[str]], pydantic.Field(alias="allowedHostnames")
276
- ]
277
- r"""Specifies hostnames permitted for client-side click tracking."""
278
-
279
- sso_email_domain: Annotated[Nullable[str], pydantic.Field(alias="ssoEmailDomain")]
280
-
281
- sso_enforced_at: Annotated[Nullable[str], pydantic.Field(alias="ssoEnforcedAt")]
282
-
283
- logo: OptionalNullable[str] = None
284
- r"""The logo of the workspace."""
285
-
286
- flags: Optional[Dict[str, bool]] = None
287
- r"""The feature flags of the workspace, indicating which features are enabled."""
288
-
289
- @model_serializer(mode="wrap")
290
- def serialize_model(self, handler):
291
- optional_fields = ["logo", "flags"]
292
- nullable_fields = [
293
- "logo",
294
- "inviteCode",
295
- "planTier",
296
- "stripeId",
297
- "paymentFailedAt",
298
- "stripeConnectId",
299
- "store",
300
- "allowedHostnames",
301
- "ssoEmailDomain",
302
- "ssoEnforcedAt",
303
- ]
304
- null_default_fields = ["logo"]
305
-
306
- serialized = handler(self)
307
-
308
- m = {}
309
-
310
- for n, f in type(self).model_fields.items():
311
- k = f.alias or n
312
- val = serialized.get(k)
313
- serialized.pop(k, None)
314
-
315
- optional_nullable = k in optional_fields and k in nullable_fields
316
- is_set = (
317
- self.__pydantic_fields_set__.intersection({n})
318
- or k in null_default_fields
319
- ) # pylint: disable=no-member
320
-
321
- if val is not None and val != UNSET_SENTINEL:
322
- m[k] = val
323
- elif val != UNSET_SENTINEL and (
324
- not k in optional_fields or (optional_nullable and is_set)
325
- ):
326
- m[k] = val
327
-
328
- return m
@@ -1,21 +0,0 @@
1
- """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
-
3
- from __future__ import annotations
4
- from dub.types import BaseModel
5
- from dub.utils import FieldMetadata, PathParamMetadata
6
- import pydantic
7
- from typing_extensions import Annotated, TypedDict
8
-
9
-
10
- class GetWorkspaceRequestTypedDict(TypedDict):
11
- id_or_slug: str
12
- r"""The ID or slug of the workspace."""
13
-
14
-
15
- class GetWorkspaceRequest(BaseModel):
16
- id_or_slug: Annotated[
17
- str,
18
- pydantic.Field(alias="idOrSlug"),
19
- FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
20
- ]
21
- r"""The ID or slug of the workspace."""
@@ -1,78 +0,0 @@
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 dub.utils import FieldMetadata, PathParamMetadata, RequestMetadata
6
- import pydantic
7
- from pydantic import model_serializer
8
- from typing import Any, Optional
9
- from typing_extensions import Annotated, NotRequired, TypedDict
10
-
11
-
12
- class UpdateWorkspaceRequestBodyTypedDict(TypedDict):
13
- name: NotRequired[str]
14
- slug: NotRequired[str]
15
- logo: NotRequired[Nullable[Any]]
16
- conversion_enabled: NotRequired[bool]
17
-
18
-
19
- class UpdateWorkspaceRequestBody(BaseModel):
20
- name: Optional[str] = None
21
-
22
- slug: Optional[str] = None
23
-
24
- logo: OptionalNullable[Any] = UNSET
25
-
26
- conversion_enabled: Annotated[
27
- Optional[bool], pydantic.Field(alias="conversionEnabled")
28
- ] = None
29
-
30
- @model_serializer(mode="wrap")
31
- def serialize_model(self, handler):
32
- optional_fields = ["name", "slug", "logo", "conversionEnabled"]
33
- nullable_fields = ["logo"]
34
- null_default_fields = []
35
-
36
- serialized = handler(self)
37
-
38
- m = {}
39
-
40
- for n, f in type(self).model_fields.items():
41
- k = f.alias or n
42
- val = serialized.get(k)
43
- serialized.pop(k, None)
44
-
45
- optional_nullable = k in optional_fields and k in nullable_fields
46
- is_set = (
47
- self.__pydantic_fields_set__.intersection({n})
48
- or k in null_default_fields
49
- ) # pylint: disable=no-member
50
-
51
- if val is not None and val != UNSET_SENTINEL:
52
- m[k] = val
53
- elif val != UNSET_SENTINEL and (
54
- not k in optional_fields or (optional_nullable and is_set)
55
- ):
56
- m[k] = val
57
-
58
- return m
59
-
60
-
61
- class UpdateWorkspaceRequestTypedDict(TypedDict):
62
- id_or_slug: str
63
- r"""The ID or slug of the workspace to update."""
64
- request_body: NotRequired[UpdateWorkspaceRequestBodyTypedDict]
65
-
66
-
67
- class UpdateWorkspaceRequest(BaseModel):
68
- id_or_slug: Annotated[
69
- str,
70
- pydantic.Field(alias="idOrSlug"),
71
- FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
72
- ]
73
- r"""The ID or slug of the workspace to update."""
74
-
75
- request_body: Annotated[
76
- Optional[UpdateWorkspaceRequestBody],
77
- FieldMetadata(request=RequestMetadata(media_type="application/json")),
78
- ] = None