dub 0.29.3__py3-none-any.whl → 0.32.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 (65) hide show
  1. dub/_version.py +3 -3
  2. dub/analytics.py +2 -2
  3. dub/commissions.py +4 -4
  4. dub/customers.py +10 -10
  5. dub/domains.py +12 -12
  6. dub/embed_tokens.py +2 -2
  7. dub/events.py +2 -2
  8. dub/folders.py +8 -8
  9. dub/httpclient.py +0 -1
  10. dub/links.py +20 -20
  11. dub/models/components/__init__.py +22 -10
  12. dub/models/components/clickevent.py +3 -3
  13. dub/models/components/commissioncreatedevent.py +9 -6
  14. dub/models/components/folderschema.py +6 -1
  15. dub/models/components/leadcreatedevent.py +128 -4
  16. dub/models/components/leadevent.py +3 -3
  17. dub/models/components/linkclickedevent.py +3 -3
  18. dub/models/components/linkschema.py +3 -3
  19. dub/models/components/{tagschema.py → linktagschema.py} +2 -2
  20. dub/models/components/linkwebhookevent.py +3 -3
  21. dub/models/components/partnerenrolledevent.py +45 -92
  22. dub/models/components/salecreatedevent.py +128 -4
  23. dub/models/components/saleevent.py +3 -3
  24. dub/models/components/workspaceschema.py +13 -0
  25. dub/models/errors/badrequest.py +1 -1
  26. dub/models/errors/conflict.py +1 -1
  27. dub/models/errors/duberror.py +1 -1
  28. dub/models/errors/forbidden.py +1 -1
  29. dub/models/errors/internalservererror.py +1 -1
  30. dub/models/errors/inviteexpired.py +1 -1
  31. dub/models/errors/no_response_error.py +1 -1
  32. dub/models/errors/notfound.py +1 -1
  33. dub/models/errors/ratelimitexceeded.py +1 -1
  34. dub/models/errors/responsevalidationerror.py +1 -1
  35. dub/models/errors/sdkerror.py +1 -1
  36. dub/models/errors/unauthorized.py +1 -1
  37. dub/models/errors/unprocessableentity.py +1 -1
  38. dub/models/operations/bulkcreatelinks.py +2 -2
  39. dub/models/operations/createcustomer.py +10 -3
  40. dub/models/operations/createfolder.py +8 -3
  41. dub/models/operations/createlink.py +2 -2
  42. dub/models/operations/createpartner.py +47 -94
  43. dub/models/operations/getcustomer.py +1 -1
  44. dub/models/operations/getcustomers.py +1 -1
  45. dub/models/operations/listcommissions.py +11 -2
  46. dub/models/operations/listevents.py +10 -0
  47. dub/models/operations/listpartners.py +66 -115
  48. dub/models/operations/retrieveanalytics.py +14 -1
  49. dub/models/operations/retrievelinks.py +5 -0
  50. dub/models/operations/tracklead.py +2 -2
  51. dub/models/operations/updatecustomer.py +10 -3
  52. dub/models/operations/updatefolder.py +8 -3
  53. dub/models/operations/updatelink.py +2 -2
  54. dub/models/operations/upsertlink.py +2 -2
  55. dub/partners.py +16 -16
  56. dub/qr_codes.py +2 -2
  57. dub/sdk.py +2 -2
  58. dub/tags.py +20 -20
  59. dub/track.py +4 -4
  60. dub/utils/annotations.py +32 -8
  61. dub/workspaces.py +4 -4
  62. {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/METADATA +7 -4
  63. {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/RECORD +65 -65
  64. {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/WHEEL +1 -1
  65. {dub-0.29.3.dist-info → dub-0.32.0.dist-info/licenses}/LICENSE +0 -0
@@ -21,6 +21,7 @@ class Status(str, Enum):
21
21
  REJECTED = "rejected"
22
22
  INVITED = "invited"
23
23
  DECLINED = "declined"
24
+ DEACTIVATED = "deactivated"
24
25
  BANNED = "banned"
25
26
  ARCHIVED = "archived"
26
27
 
@@ -40,6 +41,8 @@ class PartnerEnrolledEventLinkTypedDict(TypedDict):
40
41
  r"""The number of clicks on the short link."""
41
42
  leads: NotRequired[float]
42
43
  r"""The number of leads the short link has generated."""
44
+ conversions: NotRequired[float]
45
+ r"""The number of leads that converted to paying customers."""
43
46
  sales: NotRequired[float]
44
47
  r"""The total number of sales (includes recurring sales) generated by the short link."""
45
48
  sale_amount: NotRequired[float]
@@ -68,6 +71,9 @@ class PartnerEnrolledEventLink(BaseModel):
68
71
  leads: Optional[float] = 0
69
72
  r"""The number of leads the short link has generated."""
70
73
 
74
+ conversions: Optional[float] = 0
75
+ r"""The number of leads that converted to paying customers."""
76
+
71
77
  sales: Optional[float] = 0
72
78
  r"""The total number of sales (includes recurring sales) generated by the short link."""
73
79
 
@@ -91,6 +97,8 @@ class PartnerEnrolledEventDataTypedDict(TypedDict):
91
97
  r"""The partner's unique ID on Dub."""
92
98
  name: str
93
99
  r"""The partner's full legal name."""
100
+ company_name: Nullable[str]
101
+ r"""If the partner profile type is a company, this is the partner's legal company name."""
94
102
  email: Nullable[str]
95
103
  r"""The partner's email address. Should be a unique value across Dub."""
96
104
  image: Nullable[str]
@@ -119,7 +127,7 @@ class PartnerEnrolledEventDataTypedDict(TypedDict):
119
127
  group_id: NotRequired[Nullable[str]]
120
128
  r"""The partner's group ID on Dub."""
121
129
  total_commissions: NotRequired[float]
122
- r"""The total commissions paid to the partner for their referrals. Defaults to 0 if `includeExpandedFields` is false."""
130
+ r"""The total commissions paid to the partner for their referrals"""
123
131
  click_reward_id: NotRequired[Nullable[str]]
124
132
  lead_reward_id: NotRequired[Nullable[str]]
125
133
  sale_reward_id: NotRequired[Nullable[str]]
@@ -130,39 +138,30 @@ class PartnerEnrolledEventDataTypedDict(TypedDict):
130
138
  r"""If the partner was banned from the program, this is the date of the ban."""
131
139
  banned_reason: NotRequired[Nullable[BannedReason]]
132
140
  r"""If the partner was banned from the program, this is the reason for the ban."""
133
- clicks: NotRequired[float]
134
- r"""The total number of clicks on the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
135
- leads: NotRequired[float]
136
- r"""The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
137
- conversions: NotRequired[float]
138
- r"""The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."""
139
- sales: NotRequired[float]
140
- r"""The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."""
141
- sale_amount: NotRequired[float]
142
- r"""The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
141
+ total_clicks: NotRequired[float]
142
+ r"""The total number of clicks on the partner's links"""
143
+ total_leads: NotRequired[float]
144
+ r"""The total number of leads generated by the partner's links"""
145
+ total_conversions: NotRequired[float]
146
+ r"""The total number of leads that converted to paying customers"""
147
+ total_sales: NotRequired[float]
148
+ r"""The total number of sales generated by the partner's links (includes recurring sales)"""
149
+ total_sale_amount: NotRequired[float]
150
+ r"""The total amount of sales (in cents) generated by the partner's links"""
143
151
  net_revenue: NotRequired[float]
144
- r"""The total net revenue generated by the partner. Defaults to 0 if `includeExpandedFields` is false."""
152
+ r"""The total net revenue generated by the partner"""
145
153
  website: NotRequired[Nullable[str]]
146
154
  r"""The partner's website URL (including the https protocol)."""
147
- website_txt_record: NotRequired[Nullable[str]]
148
- website_verified_at: NotRequired[Nullable[str]]
149
155
  youtube: NotRequired[Nullable[str]]
150
156
  r"""The partner's YouTube channel username (e.g. `johndoe`)."""
151
- youtube_verified_at: NotRequired[Nullable[str]]
152
- youtube_subscriber_count: NotRequired[Nullable[float]]
153
- youtube_view_count: NotRequired[Nullable[float]]
154
157
  twitter: NotRequired[Nullable[str]]
155
158
  r"""The partner's Twitter username (e.g. `johndoe`)."""
156
- twitter_verified_at: NotRequired[Nullable[str]]
157
159
  linkedin: NotRequired[Nullable[str]]
158
160
  r"""The partner's LinkedIn username (e.g. `johndoe`)."""
159
- linkedin_verified_at: NotRequired[Nullable[str]]
160
161
  instagram: NotRequired[Nullable[str]]
161
162
  r"""The partner's Instagram username (e.g. `johndoe`)."""
162
- instagram_verified_at: NotRequired[Nullable[str]]
163
163
  tiktok: NotRequired[Nullable[str]]
164
164
  r"""The partner's TikTok username (e.g. `johndoe`)."""
165
- tiktok_verified_at: NotRequired[Nullable[str]]
166
165
 
167
166
 
168
167
  class PartnerEnrolledEventData(BaseModel):
@@ -172,6 +171,9 @@ class PartnerEnrolledEventData(BaseModel):
172
171
  name: str
173
172
  r"""The partner's full legal name."""
174
173
 
174
+ company_name: Annotated[Nullable[str], pydantic.Field(alias="companyName")]
175
+ r"""If the partner profile type is a company, this is the partner's legal company name."""
176
+
175
177
  email: Nullable[str]
176
178
  r"""The partner's email address. Should be a unique value across Dub."""
177
179
 
@@ -218,7 +220,7 @@ class PartnerEnrolledEventData(BaseModel):
218
220
  total_commissions: Annotated[
219
221
  Optional[float], pydantic.Field(alias="totalCommissions")
220
222
  ] = 0
221
- r"""The total commissions paid to the partner for their referrals. Defaults to 0 if `includeExpandedFields` is false."""
223
+ r"""The total commissions paid to the partner for their referrals"""
222
224
 
223
225
  click_reward_id: Annotated[
224
226
  OptionalNullable[str], pydantic.Field(alias="clickRewardId")
@@ -251,78 +253,46 @@ class PartnerEnrolledEventData(BaseModel):
251
253
  ] = UNSET
252
254
  r"""If the partner was banned from the program, this is the reason for the ban."""
253
255
 
254
- clicks: Optional[float] = 0
255
- r"""The total number of clicks on the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
256
+ total_clicks: Annotated[Optional[float], pydantic.Field(alias="totalClicks")] = 0
257
+ r"""The total number of clicks on the partner's links"""
256
258
 
257
- leads: Optional[float] = 0
258
- r"""The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
259
+ total_leads: Annotated[Optional[float], pydantic.Field(alias="totalLeads")] = 0
260
+ r"""The total number of leads generated by the partner's links"""
259
261
 
260
- conversions: Optional[float] = 0
261
- r"""The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."""
262
+ total_conversions: Annotated[
263
+ Optional[float], pydantic.Field(alias="totalConversions")
264
+ ] = 0
265
+ r"""The total number of leads that converted to paying customers"""
262
266
 
263
- sales: Optional[float] = 0
264
- r"""The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."""
267
+ total_sales: Annotated[Optional[float], pydantic.Field(alias="totalSales")] = 0
268
+ r"""The total number of sales generated by the partner's links (includes recurring sales)"""
265
269
 
266
- sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
267
- r"""The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
270
+ total_sale_amount: Annotated[
271
+ Optional[float], pydantic.Field(alias="totalSaleAmount")
272
+ ] = 0
273
+ r"""The total amount of sales (in cents) generated by the partner's links"""
268
274
 
269
275
  net_revenue: Annotated[Optional[float], pydantic.Field(alias="netRevenue")] = 0
270
- r"""The total net revenue generated by the partner. Defaults to 0 if `includeExpandedFields` is false."""
276
+ r"""The total net revenue generated by the partner"""
271
277
 
272
278
  website: OptionalNullable[str] = UNSET
273
279
  r"""The partner's website URL (including the https protocol)."""
274
280
 
275
- website_txt_record: Annotated[
276
- OptionalNullable[str], pydantic.Field(alias="websiteTxtRecord")
277
- ] = UNSET
278
-
279
- website_verified_at: Annotated[
280
- OptionalNullable[str], pydantic.Field(alias="websiteVerifiedAt")
281
- ] = UNSET
282
-
283
281
  youtube: OptionalNullable[str] = UNSET
284
282
  r"""The partner's YouTube channel username (e.g. `johndoe`)."""
285
283
 
286
- youtube_verified_at: Annotated[
287
- OptionalNullable[str], pydantic.Field(alias="youtubeVerifiedAt")
288
- ] = UNSET
289
-
290
- youtube_subscriber_count: Annotated[
291
- OptionalNullable[float], pydantic.Field(alias="youtubeSubscriberCount")
292
- ] = UNSET
293
-
294
- youtube_view_count: Annotated[
295
- OptionalNullable[float], pydantic.Field(alias="youtubeViewCount")
296
- ] = UNSET
297
-
298
284
  twitter: OptionalNullable[str] = UNSET
299
285
  r"""The partner's Twitter username (e.g. `johndoe`)."""
300
286
 
301
- twitter_verified_at: Annotated[
302
- OptionalNullable[str], pydantic.Field(alias="twitterVerifiedAt")
303
- ] = UNSET
304
-
305
287
  linkedin: OptionalNullable[str] = UNSET
306
288
  r"""The partner's LinkedIn username (e.g. `johndoe`)."""
307
289
 
308
- linkedin_verified_at: Annotated[
309
- OptionalNullable[str], pydantic.Field(alias="linkedinVerifiedAt")
310
- ] = UNSET
311
-
312
290
  instagram: OptionalNullable[str] = UNSET
313
291
  r"""The partner's Instagram username (e.g. `johndoe`)."""
314
292
 
315
- instagram_verified_at: Annotated[
316
- OptionalNullable[str], pydantic.Field(alias="instagramVerifiedAt")
317
- ] = UNSET
318
-
319
293
  tiktok: OptionalNullable[str] = UNSET
320
294
  r"""The partner's TikTok username (e.g. `johndoe`)."""
321
295
 
322
- tiktok_verified_at: Annotated[
323
- OptionalNullable[str], pydantic.Field(alias="tiktokVerifiedAt")
324
- ] = UNSET
325
-
326
296
  @model_serializer(mode="wrap")
327
297
  def serialize_model(self, handler):
328
298
  optional_fields = [
@@ -336,29 +306,21 @@ class PartnerEnrolledEventData(BaseModel):
336
306
  "applicationId",
337
307
  "bannedAt",
338
308
  "bannedReason",
339
- "clicks",
340
- "leads",
341
- "conversions",
342
- "sales",
343
- "saleAmount",
309
+ "totalClicks",
310
+ "totalLeads",
311
+ "totalConversions",
312
+ "totalSales",
313
+ "totalSaleAmount",
344
314
  "netRevenue",
345
315
  "website",
346
- "websiteTxtRecord",
347
- "websiteVerifiedAt",
348
316
  "youtube",
349
- "youtubeVerifiedAt",
350
- "youtubeSubscriberCount",
351
- "youtubeViewCount",
352
317
  "twitter",
353
- "twitterVerifiedAt",
354
318
  "linkedin",
355
- "linkedinVerifiedAt",
356
319
  "instagram",
357
- "instagramVerifiedAt",
358
320
  "tiktok",
359
- "tiktokVerifiedAt",
360
321
  ]
361
322
  nullable_fields = [
323
+ "companyName",
362
324
  "email",
363
325
  "image",
364
326
  "description",
@@ -377,20 +339,11 @@ class PartnerEnrolledEventData(BaseModel):
377
339
  "bannedAt",
378
340
  "bannedReason",
379
341
  "website",
380
- "websiteTxtRecord",
381
- "websiteVerifiedAt",
382
342
  "youtube",
383
- "youtubeVerifiedAt",
384
- "youtubeSubscriberCount",
385
- "youtubeViewCount",
386
343
  "twitter",
387
- "twitterVerifiedAt",
388
344
  "linkedin",
389
- "linkedinVerifiedAt",
390
345
  "instagram",
391
- "instagramVerifiedAt",
392
346
  "tiktok",
393
- "tiktokVerifiedAt",
394
347
  ]
395
348
  null_default_fields = []
396
349
 
@@ -1,12 +1,12 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .tagschema import TagSchema, TagSchemaTypedDict
4
+ from .linktagschema import LinkTagSchema, LinkTagSchemaTypedDict
5
5
  from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
6
  from enum import Enum
7
7
  import pydantic
8
8
  from pydantic import model_serializer
9
- from typing import Dict, List, Optional
9
+ from typing import Any, Dict, List, Optional
10
10
  from typing_extensions import Annotated, NotRequired, TypedDict
11
11
 
12
12
 
@@ -227,7 +227,7 @@ class SaleCreatedEventLinkTypedDict(TypedDict):
227
227
  geo: Nullable[Dict[str, str]]
228
228
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
229
229
  public_stats: bool
230
- tags: Nullable[List[TagSchemaTypedDict]]
230
+ tags: Nullable[List[LinkTagSchemaTypedDict]]
231
231
  r"""The tags assigned to the short link."""
232
232
  folder_id: Nullable[str]
233
233
  r"""The unique ID of the folder assigned to the short link."""
@@ -339,7 +339,7 @@ class SaleCreatedEventLink(BaseModel):
339
339
 
340
340
  public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
341
341
 
342
- tags: Nullable[List[TagSchema]]
342
+ tags: Nullable[List[LinkTagSchema]]
343
343
  r"""The tags assigned to the short link."""
344
344
 
345
345
  folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
@@ -538,12 +538,102 @@ class SaleCreatedEventSale(BaseModel):
538
538
  return m
539
539
 
540
540
 
541
+ class SaleCreatedEventPartnerTypedDict(TypedDict):
542
+ id: str
543
+ r"""The partner's unique ID on Dub."""
544
+ name: str
545
+ r"""The partner's full legal name."""
546
+ email: Nullable[str]
547
+ r"""The partner's email address. Should be a unique value across Dub."""
548
+ image: Nullable[str]
549
+ r"""The partner's avatar image."""
550
+ payouts_enabled_at: Nullable[str]
551
+ r"""The date when the partner enabled payouts."""
552
+ country: Nullable[str]
553
+ r"""The partner's country (required for tax purposes)."""
554
+ total_clicks: float
555
+ total_leads: float
556
+ total_conversions: float
557
+ total_sales: float
558
+ total_sale_amount: float
559
+ total_commissions: float
560
+ group_id: NotRequired[Nullable[str]]
561
+
562
+
563
+ class SaleCreatedEventPartner(BaseModel):
564
+ id: str
565
+ r"""The partner's unique ID on Dub."""
566
+
567
+ name: str
568
+ r"""The partner's full legal name."""
569
+
570
+ email: Nullable[str]
571
+ r"""The partner's email address. Should be a unique value across Dub."""
572
+
573
+ image: Nullable[str]
574
+ r"""The partner's avatar image."""
575
+
576
+ payouts_enabled_at: Annotated[
577
+ Nullable[str], pydantic.Field(alias="payoutsEnabledAt")
578
+ ]
579
+ r"""The date when the partner enabled payouts."""
580
+
581
+ country: Nullable[str]
582
+ r"""The partner's country (required for tax purposes)."""
583
+
584
+ total_clicks: Annotated[float, pydantic.Field(alias="totalClicks")]
585
+
586
+ total_leads: Annotated[float, pydantic.Field(alias="totalLeads")]
587
+
588
+ total_conversions: Annotated[float, pydantic.Field(alias="totalConversions")]
589
+
590
+ total_sales: Annotated[float, pydantic.Field(alias="totalSales")]
591
+
592
+ total_sale_amount: Annotated[float, pydantic.Field(alias="totalSaleAmount")]
593
+
594
+ total_commissions: Annotated[float, pydantic.Field(alias="totalCommissions")]
595
+
596
+ group_id: Annotated[OptionalNullable[str], pydantic.Field(alias="groupId")] = UNSET
597
+
598
+ @model_serializer(mode="wrap")
599
+ def serialize_model(self, handler):
600
+ optional_fields = ["groupId"]
601
+ nullable_fields = ["email", "image", "payoutsEnabledAt", "country", "groupId"]
602
+ null_default_fields = []
603
+
604
+ serialized = handler(self)
605
+
606
+ m = {}
607
+
608
+ for n, f in type(self).model_fields.items():
609
+ k = f.alias or n
610
+ val = serialized.get(k)
611
+ serialized.pop(k, None)
612
+
613
+ optional_nullable = k in optional_fields and k in nullable_fields
614
+ is_set = (
615
+ self.__pydantic_fields_set__.intersection({n})
616
+ or k in null_default_fields
617
+ ) # pylint: disable=no-member
618
+
619
+ if val is not None and val != UNSET_SENTINEL:
620
+ m[k] = val
621
+ elif val != UNSET_SENTINEL and (
622
+ not k in optional_fields or (optional_nullable and is_set)
623
+ ):
624
+ m[k] = val
625
+
626
+ return m
627
+
628
+
541
629
  class SaleCreatedEventDataTypedDict(TypedDict):
542
630
  event_name: str
543
631
  customer: SaleCreatedEventCustomerTypedDict
544
632
  click: SaleCreatedEventClickTypedDict
545
633
  link: SaleCreatedEventLinkTypedDict
546
634
  sale: SaleCreatedEventSaleTypedDict
635
+ metadata: Nullable[Dict[str, Any]]
636
+ partner: NotRequired[Nullable[SaleCreatedEventPartnerTypedDict]]
547
637
 
548
638
 
549
639
  class SaleCreatedEventData(BaseModel):
@@ -557,6 +647,40 @@ class SaleCreatedEventData(BaseModel):
557
647
 
558
648
  sale: SaleCreatedEventSale
559
649
 
650
+ metadata: Nullable[Dict[str, Any]]
651
+
652
+ partner: OptionalNullable[SaleCreatedEventPartner] = UNSET
653
+
654
+ @model_serializer(mode="wrap")
655
+ def serialize_model(self, handler):
656
+ optional_fields = ["partner"]
657
+ nullable_fields = ["partner", "metadata"]
658
+ null_default_fields = []
659
+
660
+ serialized = handler(self)
661
+
662
+ m = {}
663
+
664
+ for n, f in type(self).model_fields.items():
665
+ k = f.alias or n
666
+ val = serialized.get(k)
667
+ serialized.pop(k, None)
668
+
669
+ optional_nullable = k in optional_fields and k in nullable_fields
670
+ is_set = (
671
+ self.__pydantic_fields_set__.intersection({n})
672
+ or k in null_default_fields
673
+ ) # pylint: disable=no-member
674
+
675
+ if val is not None and val != UNSET_SENTINEL:
676
+ m[k] = val
677
+ elif val != UNSET_SENTINEL and (
678
+ not k in optional_fields or (optional_nullable and is_set)
679
+ ):
680
+ m[k] = val
681
+
682
+ return m
683
+
560
684
 
561
685
  class SaleCreatedEventTypedDict(TypedDict):
562
686
  r"""Triggered when a sale is created."""
@@ -1,7 +1,7 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from .tagschema import TagSchema, TagSchemaTypedDict
4
+ from .linktagschema import LinkTagSchema, LinkTagSchemaTypedDict
5
5
  from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
6
6
  from enum import Enum
7
7
  import pydantic
@@ -130,7 +130,7 @@ class SaleEventLinkTypedDict(TypedDict):
130
130
  geo: Nullable[Dict[str, str]]
131
131
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
132
132
  public_stats: bool
133
- tags: Nullable[List[TagSchemaTypedDict]]
133
+ tags: Nullable[List[LinkTagSchemaTypedDict]]
134
134
  r"""The tags assigned to the short link."""
135
135
  folder_id: Nullable[str]
136
136
  r"""The unique ID of the folder assigned to the short link."""
@@ -242,7 +242,7 @@ class SaleEventLink(BaseModel):
242
242
 
243
243
  public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
244
244
 
245
- tags: Nullable[List[TagSchema]]
245
+ tags: Nullable[List[LinkTagSchema]]
246
246
  r"""The tags assigned to the short link."""
247
247
 
248
248
  folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
@@ -139,6 +139,8 @@ class WorkspaceSchemaTypedDict(TypedDict):
139
139
  r"""The folders limit of the workspace."""
140
140
  groups_limit: float
141
141
  r"""The groups limit of the workspace."""
142
+ network_invites_limit: float
143
+ r"""The weekly network invites limit of the workspace."""
142
144
  users_limit: float
143
145
  r"""The users limit of the workspace."""
144
146
  ai_usage: float
@@ -159,6 +161,8 @@ class WorkspaceSchemaTypedDict(TypedDict):
159
161
  r"""The miscellaneous key-value store of the workspace."""
160
162
  allowed_hostnames: Nullable[List[str]]
161
163
  r"""Specifies hostnames permitted for client-side click tracking."""
164
+ sso_email_domain: Nullable[str]
165
+ sso_enforced_at: Nullable[str]
162
166
  logo: NotRequired[Nullable[str]]
163
167
  r"""The logo of the workspace."""
164
168
  flags: NotRequired[Dict[str, bool]]
@@ -232,6 +236,9 @@ class WorkspaceSchema(BaseModel):
232
236
  groups_limit: Annotated[float, pydantic.Field(alias="groupsLimit")]
233
237
  r"""The groups limit of the workspace."""
234
238
 
239
+ network_invites_limit: Annotated[float, pydantic.Field(alias="networkInvitesLimit")]
240
+ r"""The weekly network invites limit of the workspace."""
241
+
235
242
  users_limit: Annotated[float, pydantic.Field(alias="usersLimit")]
236
243
  r"""The users limit of the workspace."""
237
244
 
@@ -264,6 +271,10 @@ class WorkspaceSchema(BaseModel):
264
271
  ]
265
272
  r"""Specifies hostnames permitted for client-side click tracking."""
266
273
 
274
+ sso_email_domain: Annotated[Nullable[str], pydantic.Field(alias="ssoEmailDomain")]
275
+
276
+ sso_enforced_at: Annotated[Nullable[str], pydantic.Field(alias="ssoEnforcedAt")]
277
+
267
278
  logo: OptionalNullable[str] = None
268
279
  r"""The logo of the workspace."""
269
280
 
@@ -281,6 +292,8 @@ class WorkspaceSchema(BaseModel):
281
292
  "stripeConnectId",
282
293
  "store",
283
294
  "allowedHostnames",
295
+ "ssoEmailDomain",
296
+ "ssoEnforcedAt",
284
297
  ]
285
298
  null_default_fields = ["logo"]
286
299
 
@@ -40,7 +40,7 @@ class BadRequestData(BaseModel):
40
40
  error: Error
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class BadRequest(DubError):
45
45
  r"""The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing)."""
46
46
 
@@ -40,7 +40,7 @@ class ConflictData(BaseModel):
40
40
  error: ConflictError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class Conflict(DubError):
45
45
  r"""This response is sent when a request conflicts with the current state of the server."""
46
46
 
@@ -5,7 +5,7 @@ from typing import Optional
5
5
  from dataclasses import dataclass, field
6
6
 
7
7
 
8
- @dataclass(frozen=True)
8
+ @dataclass(unsafe_hash=True)
9
9
  class DubError(Exception):
10
10
  """The base class for all HTTP error responses."""
11
11
 
@@ -40,7 +40,7 @@ class ForbiddenData(BaseModel):
40
40
  error: ForbiddenError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class Forbidden(DubError):
45
45
  r"""The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server."""
46
46
 
@@ -40,7 +40,7 @@ class InternalServerErrorData(BaseModel):
40
40
  error: InternalServerErrorError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class InternalServerError(DubError):
45
45
  r"""The server has encountered a situation it does not know how to handle."""
46
46
 
@@ -40,7 +40,7 @@ class InviteExpiredData(BaseModel):
40
40
  error: InviteExpiredError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class InviteExpired(DubError):
45
45
  r"""This response is sent when the requested content has been permanently deleted from server, with no forwarding address."""
46
46
 
@@ -3,7 +3,7 @@
3
3
  from dataclasses import dataclass
4
4
 
5
5
 
6
- @dataclass(frozen=True)
6
+ @dataclass(unsafe_hash=True)
7
7
  class NoResponseError(Exception):
8
8
  """Error raised when no HTTP response is received from the server."""
9
9
 
@@ -40,7 +40,7 @@ class NotFoundData(BaseModel):
40
40
  error: NotFoundError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class NotFound(DubError):
45
45
  r"""The server cannot find the requested resource."""
46
46
 
@@ -40,7 +40,7 @@ class RateLimitExceededData(BaseModel):
40
40
  error: RateLimitExceededError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class RateLimitExceeded(DubError):
45
45
  r"""The user has sent too many requests in a given amount of time (\"rate limiting\")"""
46
46
 
@@ -7,7 +7,7 @@ from dataclasses import dataclass
7
7
  from dub.models.errors import DubError
8
8
 
9
9
 
10
- @dataclass(frozen=True)
10
+ @dataclass(unsafe_hash=True)
11
11
  class ResponseValidationError(DubError):
12
12
  """Error raised when there is a type mismatch between the response data and the expected Pydantic model."""
13
13
 
@@ -9,7 +9,7 @@ from dub.models.errors import DubError
9
9
  MAX_MESSAGE_LEN = 10_000
10
10
 
11
11
 
12
- @dataclass(frozen=True)
12
+ @dataclass(unsafe_hash=True)
13
13
  class SDKError(DubError):
14
14
  """The fallback error class if no more specific error class is matched."""
15
15
 
@@ -40,7 +40,7 @@ class UnauthorizedData(BaseModel):
40
40
  error: UnauthorizedError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class Unauthorized(DubError):
45
45
  r"""Although the HTTP standard specifies \"unauthorized\", semantically this response means \"unauthenticated\". That is, the client must authenticate itself to get the requested response."""
46
46
 
@@ -40,7 +40,7 @@ class UnprocessableEntityData(BaseModel):
40
40
  error: UnprocessableEntityError
41
41
 
42
42
 
43
- @dataclass(frozen=True)
43
+ @dataclass(unsafe_hash=True)
44
44
  class UnprocessableEntity(DubError):
45
45
  r"""The request was well-formed but was unable to be followed due to semantic errors."""
46
46
 
@@ -49,7 +49,7 @@ class RequestBodyTypedDict(TypedDict):
49
49
  url: str
50
50
  r"""The destination URL of the short link."""
51
51
  domain: NotRequired[str]
52
- r"""The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
52
+ r"""The domain of the short link (without protocol). If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
53
53
  key: NotRequired[str]
54
54
  r"""The short link slug. If not provided, a random 7-character slug will be generated."""
55
55
  key_length: NotRequired[float]
@@ -133,7 +133,7 @@ class RequestBody(BaseModel):
133
133
  r"""The destination URL of the short link."""
134
134
 
135
135
  domain: Optional[str] = None
136
- r"""The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
136
+ r"""The domain of the short link (without protocol). If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
137
137
 
138
138
  key: Optional[str] = None
139
139
  r"""The short link slug. If not provided, a random 7-character slug will be generated."""