dub 0.31.0__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 (55) 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/links.py +20 -20
  10. dub/models/components/__init__.py +6 -6
  11. dub/models/components/clickevent.py +3 -3
  12. dub/models/components/commissioncreatedevent.py +5 -2
  13. dub/models/components/folderschema.py +6 -1
  14. dub/models/components/leadcreatedevent.py +8 -5
  15. dub/models/components/leadevent.py +3 -3
  16. dub/models/components/linkclickedevent.py +3 -3
  17. dub/models/components/linkschema.py +3 -3
  18. dub/models/components/{tagschema.py → linktagschema.py} +2 -2
  19. dub/models/components/linkwebhookevent.py +3 -3
  20. dub/models/components/partnerenrolledevent.py +33 -29
  21. dub/models/components/salecreatedevent.py +8 -5
  22. dub/models/components/saleevent.py +3 -3
  23. dub/models/components/workspaceschema.py +5 -0
  24. dub/models/errors/badrequest.py +1 -1
  25. dub/models/errors/conflict.py +1 -1
  26. dub/models/errors/duberror.py +1 -1
  27. dub/models/errors/forbidden.py +1 -1
  28. dub/models/errors/internalservererror.py +1 -1
  29. dub/models/errors/inviteexpired.py +1 -1
  30. dub/models/errors/no_response_error.py +1 -1
  31. dub/models/errors/notfound.py +1 -1
  32. dub/models/errors/ratelimitexceeded.py +1 -1
  33. dub/models/errors/responsevalidationerror.py +1 -1
  34. dub/models/errors/sdkerror.py +1 -1
  35. dub/models/errors/unauthorized.py +1 -1
  36. dub/models/errors/unprocessableentity.py +1 -1
  37. dub/models/operations/bulkcreatelinks.py +2 -2
  38. dub/models/operations/createfolder.py +8 -3
  39. dub/models/operations/createlink.py +2 -2
  40. dub/models/operations/createpartner.py +33 -29
  41. dub/models/operations/listpartners.py +41 -48
  42. dub/models/operations/retrieveanalytics.py +4 -1
  43. dub/models/operations/tracklead.py +2 -2
  44. dub/models/operations/updatefolder.py +8 -3
  45. dub/models/operations/updatelink.py +2 -2
  46. dub/models/operations/upsertlink.py +2 -2
  47. dub/partners.py +12 -12
  48. dub/qr_codes.py +2 -2
  49. dub/tags.py +20 -20
  50. dub/track.py +4 -4
  51. dub/workspaces.py +4 -4
  52. {dub-0.31.0.dist-info → dub-0.32.0.dist-info}/METADATA +1 -2
  53. {dub-0.31.0.dist-info → dub-0.32.0.dist-info}/RECORD +55 -55
  54. {dub-0.31.0.dist-info → dub-0.32.0.dist-info}/WHEEL +0 -0
  55. {dub-0.31.0.dist-info → dub-0.32.0.dist-info}/licenses/LICENSE +0 -0
@@ -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
@@ -227,7 +227,7 @@ class LeadCreatedEventLinkTypedDict(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 LeadCreatedEventLink(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")]
@@ -510,6 +510,7 @@ class PartnerTypedDict(TypedDict):
510
510
  total_sales: float
511
511
  total_sale_amount: float
512
512
  total_commissions: float
513
+ group_id: NotRequired[Nullable[str]]
513
514
 
514
515
 
515
516
  class Partner(BaseModel):
@@ -545,10 +546,12 @@ class Partner(BaseModel):
545
546
 
546
547
  total_commissions: Annotated[float, pydantic.Field(alias="totalCommissions")]
547
548
 
549
+ group_id: Annotated[OptionalNullable[str], pydantic.Field(alias="groupId")] = UNSET
550
+
548
551
  @model_serializer(mode="wrap")
549
552
  def serialize_model(self, handler):
550
- optional_fields = []
551
- nullable_fields = ["email", "image", "payoutsEnabledAt", "country"]
553
+ optional_fields = ["groupId"]
554
+ nullable_fields = ["email", "image", "payoutsEnabledAt", "country", "groupId"]
552
555
  null_default_fields = []
553
556
 
554
557
  serialized = handler(self)
@@ -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
@@ -145,7 +145,7 @@ class LeadEventLinkTypedDict(TypedDict):
145
145
  geo: Nullable[Dict[str, str]]
146
146
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
147
147
  public_stats: bool
148
- tags: Nullable[List[TagSchemaTypedDict]]
148
+ tags: Nullable[List[LinkTagSchemaTypedDict]]
149
149
  r"""The tags assigned to the short link."""
150
150
  folder_id: Nullable[str]
151
151
  r"""The unique ID of the folder assigned to the short link."""
@@ -257,7 +257,7 @@ class LeadEventLink(BaseModel):
257
257
 
258
258
  public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
259
259
 
260
- tags: Nullable[List[TagSchema]]
260
+ tags: Nullable[List[LinkTagSchema]]
261
261
  r"""The tags assigned to the short link."""
262
262
 
263
263
  folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
@@ -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
@@ -145,7 +145,7 @@ class LinkClickedEventLinkTypedDict(TypedDict):
145
145
  geo: Nullable[Dict[str, str]]
146
146
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
147
147
  public_stats: bool
148
- tags: Nullable[List[TagSchemaTypedDict]]
148
+ tags: Nullable[List[LinkTagSchemaTypedDict]]
149
149
  r"""The tags assigned to the short link."""
150
150
  folder_id: Nullable[str]
151
151
  r"""The unique ID of the folder assigned to the short link."""
@@ -257,7 +257,7 @@ class LinkClickedEventLink(BaseModel):
257
257
 
258
258
  public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
259
259
 
260
- tags: Nullable[List[TagSchema]]
260
+ tags: Nullable[List[LinkTagSchema]]
261
261
  r"""The tags assigned to the short link."""
262
262
 
263
263
  folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
@@ -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
  import pydantic
7
7
  from pydantic import model_serializer
@@ -61,7 +61,7 @@ class LinkSchemaTypedDict(TypedDict):
61
61
  r"""The Android destination URL for the short link for Android device targeting."""
62
62
  geo: Nullable[Dict[str, str]]
63
63
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
64
- tags: Nullable[List[TagSchemaTypedDict]]
64
+ tags: Nullable[List[LinkTagSchemaTypedDict]]
65
65
  r"""The tags assigned to the short link."""
66
66
  folder_id: Nullable[str]
67
67
  r"""The unique ID of the folder assigned to the short link."""
@@ -182,7 +182,7 @@ class LinkSchema(BaseModel):
182
182
  geo: Nullable[Dict[str, str]]
183
183
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
184
184
 
185
- tags: Nullable[List[TagSchema]]
185
+ tags: Nullable[List[LinkTagSchema]]
186
186
  r"""The tags assigned to the short link."""
187
187
 
188
188
  folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
@@ -18,7 +18,7 @@ class Color(str, Enum):
18
18
  PINK = "pink"
19
19
 
20
20
 
21
- class TagSchemaTypedDict(TypedDict):
21
+ class LinkTagSchemaTypedDict(TypedDict):
22
22
  id: str
23
23
  r"""The unique ID of the tag."""
24
24
  name: str
@@ -27,7 +27,7 @@ class TagSchemaTypedDict(TypedDict):
27
27
  r"""The color of the tag."""
28
28
 
29
29
 
30
- class TagSchema(BaseModel):
30
+ class LinkTagSchema(BaseModel):
31
31
  id: str
32
32
  r"""The unique ID of the tag."""
33
33
 
@@ -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
@@ -81,7 +81,7 @@ class LinkWebhookEventLinkTypedDict(TypedDict):
81
81
  geo: Nullable[Dict[str, str]]
82
82
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
83
83
  public_stats: bool
84
- tags: Nullable[List[TagSchemaTypedDict]]
84
+ tags: Nullable[List[LinkTagSchemaTypedDict]]
85
85
  r"""The tags assigned to the short link."""
86
86
  folder_id: Nullable[str]
87
87
  r"""The unique ID of the folder assigned to the short link."""
@@ -193,7 +193,7 @@ class LinkWebhookEventLink(BaseModel):
193
193
 
194
194
  public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
195
195
 
196
- tags: Nullable[List[TagSchema]]
196
+ tags: Nullable[List[LinkTagSchema]]
197
197
  r"""The tags assigned to the short link."""
198
198
 
199
199
  folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
@@ -127,7 +127,7 @@ class PartnerEnrolledEventDataTypedDict(TypedDict):
127
127
  group_id: NotRequired[Nullable[str]]
128
128
  r"""The partner's group ID on Dub."""
129
129
  total_commissions: NotRequired[float]
130
- 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"""
131
131
  click_reward_id: NotRequired[Nullable[str]]
132
132
  lead_reward_id: NotRequired[Nullable[str]]
133
133
  sale_reward_id: NotRequired[Nullable[str]]
@@ -138,18 +138,18 @@ class PartnerEnrolledEventDataTypedDict(TypedDict):
138
138
  r"""If the partner was banned from the program, this is the date of the ban."""
139
139
  banned_reason: NotRequired[Nullable[BannedReason]]
140
140
  r"""If the partner was banned from the program, this is the reason for the ban."""
141
- clicks: NotRequired[float]
142
- r"""The total number of clicks on the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
143
- leads: NotRequired[float]
144
- r"""The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
145
- conversions: NotRequired[float]
146
- r"""The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."""
147
- sales: NotRequired[float]
148
- r"""The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."""
149
- sale_amount: NotRequired[float]
150
- 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"""
151
151
  net_revenue: NotRequired[float]
152
- 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"""
153
153
  website: NotRequired[Nullable[str]]
154
154
  r"""The partner's website URL (including the https protocol)."""
155
155
  youtube: NotRequired[Nullable[str]]
@@ -220,7 +220,7 @@ class PartnerEnrolledEventData(BaseModel):
220
220
  total_commissions: Annotated[
221
221
  Optional[float], pydantic.Field(alias="totalCommissions")
222
222
  ] = 0
223
- 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"""
224
224
 
225
225
  click_reward_id: Annotated[
226
226
  OptionalNullable[str], pydantic.Field(alias="clickRewardId")
@@ -253,23 +253,27 @@ class PartnerEnrolledEventData(BaseModel):
253
253
  ] = UNSET
254
254
  r"""If the partner was banned from the program, this is the reason for the ban."""
255
255
 
256
- clicks: Optional[float] = 0
257
- 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"""
258
258
 
259
- leads: Optional[float] = 0
260
- 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"""
261
261
 
262
- conversions: Optional[float] = 0
263
- 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"""
264
266
 
265
- sales: Optional[float] = 0
266
- 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)"""
267
269
 
268
- sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
269
- 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"""
270
274
 
271
275
  net_revenue: Annotated[Optional[float], pydantic.Field(alias="netRevenue")] = 0
272
- 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"""
273
277
 
274
278
  website: OptionalNullable[str] = UNSET
275
279
  r"""The partner's website URL (including the https protocol)."""
@@ -302,11 +306,11 @@ class PartnerEnrolledEventData(BaseModel):
302
306
  "applicationId",
303
307
  "bannedAt",
304
308
  "bannedReason",
305
- "clicks",
306
- "leads",
307
- "conversions",
308
- "sales",
309
- "saleAmount",
309
+ "totalClicks",
310
+ "totalLeads",
311
+ "totalConversions",
312
+ "totalSales",
313
+ "totalSaleAmount",
310
314
  "netRevenue",
311
315
  "website",
312
316
  "youtube",
@@ -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
@@ -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")]
@@ -557,6 +557,7 @@ class SaleCreatedEventPartnerTypedDict(TypedDict):
557
557
  total_sales: float
558
558
  total_sale_amount: float
559
559
  total_commissions: float
560
+ group_id: NotRequired[Nullable[str]]
560
561
 
561
562
 
562
563
  class SaleCreatedEventPartner(BaseModel):
@@ -592,10 +593,12 @@ class SaleCreatedEventPartner(BaseModel):
592
593
 
593
594
  total_commissions: Annotated[float, pydantic.Field(alias="totalCommissions")]
594
595
 
596
+ group_id: Annotated[OptionalNullable[str], pydantic.Field(alias="groupId")] = UNSET
597
+
595
598
  @model_serializer(mode="wrap")
596
599
  def serialize_model(self, handler):
597
- optional_fields = []
598
- nullable_fields = ["email", "image", "payoutsEnabledAt", "country"]
600
+ optional_fields = ["groupId"]
601
+ nullable_fields = ["email", "image", "payoutsEnabledAt", "country", "groupId"]
599
602
  null_default_fields = []
600
603
 
601
604
  serialized = handler(self)
@@ -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
@@ -234,6 +236,9 @@ class WorkspaceSchema(BaseModel):
234
236
  groups_limit: Annotated[float, pydantic.Field(alias="groupsLimit")]
235
237
  r"""The groups limit of the workspace."""
236
238
 
239
+ network_invites_limit: Annotated[float, pydantic.Field(alias="networkInvitesLimit")]
240
+ r"""The weekly network invites limit of the workspace."""
241
+
237
242
  users_limit: Annotated[float, pydantic.Field(alias="usersLimit")]
238
243
  r"""The users limit of the workspace."""
239
244
 
@@ -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."""
@@ -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 dub.types import BaseModel, Nullable, OptionalNullable, UNSET_SENTINEL
4
+ from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
5
  from enum import Enum
6
6
  import pydantic
7
7
  from pydantic import model_serializer
@@ -18,6 +18,8 @@ class AccessLevel(str, Enum):
18
18
  class CreateFolderRequestBodyTypedDict(TypedDict):
19
19
  name: str
20
20
  r"""The name of the folder."""
21
+ description: NotRequired[Nullable[str]]
22
+ r"""The description of the folder."""
21
23
  access_level: NotRequired[Nullable[AccessLevel]]
22
24
  r"""The access level of the folder within the workspace."""
23
25
 
@@ -26,6 +28,9 @@ class CreateFolderRequestBody(BaseModel):
26
28
  name: str
27
29
  r"""The name of the folder."""
28
30
 
31
+ description: OptionalNullable[str] = UNSET
32
+ r"""The description of the folder."""
33
+
29
34
  access_level: Annotated[
30
35
  OptionalNullable[AccessLevel], pydantic.Field(alias="accessLevel")
31
36
  ] = None
@@ -33,8 +38,8 @@ class CreateFolderRequestBody(BaseModel):
33
38
 
34
39
  @model_serializer(mode="wrap")
35
40
  def serialize_model(self, handler):
36
- optional_fields = ["accessLevel"]
37
- nullable_fields = ["accessLevel"]
41
+ optional_fields = ["description", "accessLevel"]
42
+ nullable_fields = ["description", "accessLevel"]
38
43
  null_default_fields = ["accessLevel"]
39
44
 
40
45
  serialized = handler(self)
@@ -43,7 +43,7 @@ class CreateLinkRequestBodyTypedDict(TypedDict):
43
43
  url: str
44
44
  r"""The destination URL of the short link."""
45
45
  domain: NotRequired[str]
46
- 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)."""
46
+ 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)."""
47
47
  key: NotRequired[str]
48
48
  r"""The short link slug. If not provided, a random 7-character slug will be generated."""
49
49
  key_length: NotRequired[float]
@@ -127,7 +127,7 @@ class CreateLinkRequestBody(BaseModel):
127
127
  r"""The destination URL of the short link."""
128
128
 
129
129
  domain: Optional[str] = None
130
- 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)."""
130
+ 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)."""
131
131
 
132
132
  key: Optional[str] = None
133
133
  r"""The short link slug. If not provided, a random 7-character slug will be generated."""