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.
- dub/_version.py +3 -3
- dub/analytics.py +2 -2
- dub/commissions.py +4 -4
- dub/customers.py +10 -10
- dub/domains.py +12 -12
- dub/embed_tokens.py +2 -2
- dub/events.py +2 -2
- dub/folders.py +8 -8
- dub/httpclient.py +0 -1
- dub/links.py +20 -20
- dub/models/components/__init__.py +22 -10
- dub/models/components/clickevent.py +3 -3
- dub/models/components/commissioncreatedevent.py +9 -6
- dub/models/components/folderschema.py +6 -1
- dub/models/components/leadcreatedevent.py +128 -4
- dub/models/components/leadevent.py +3 -3
- dub/models/components/linkclickedevent.py +3 -3
- dub/models/components/linkschema.py +3 -3
- dub/models/components/{tagschema.py → linktagschema.py} +2 -2
- dub/models/components/linkwebhookevent.py +3 -3
- dub/models/components/partnerenrolledevent.py +45 -92
- dub/models/components/salecreatedevent.py +128 -4
- dub/models/components/saleevent.py +3 -3
- dub/models/components/workspaceschema.py +13 -0
- dub/models/errors/badrequest.py +1 -1
- dub/models/errors/conflict.py +1 -1
- dub/models/errors/duberror.py +1 -1
- dub/models/errors/forbidden.py +1 -1
- dub/models/errors/internalservererror.py +1 -1
- dub/models/errors/inviteexpired.py +1 -1
- dub/models/errors/no_response_error.py +1 -1
- dub/models/errors/notfound.py +1 -1
- dub/models/errors/ratelimitexceeded.py +1 -1
- dub/models/errors/responsevalidationerror.py +1 -1
- dub/models/errors/sdkerror.py +1 -1
- dub/models/errors/unauthorized.py +1 -1
- dub/models/errors/unprocessableentity.py +1 -1
- dub/models/operations/bulkcreatelinks.py +2 -2
- dub/models/operations/createcustomer.py +10 -3
- dub/models/operations/createfolder.py +8 -3
- dub/models/operations/createlink.py +2 -2
- dub/models/operations/createpartner.py +47 -94
- dub/models/operations/getcustomer.py +1 -1
- dub/models/operations/getcustomers.py +1 -1
- dub/models/operations/listcommissions.py +11 -2
- dub/models/operations/listevents.py +10 -0
- dub/models/operations/listpartners.py +66 -115
- dub/models/operations/retrieveanalytics.py +14 -1
- dub/models/operations/retrievelinks.py +5 -0
- dub/models/operations/tracklead.py +2 -2
- dub/models/operations/updatecustomer.py +10 -3
- dub/models/operations/updatefolder.py +8 -3
- dub/models/operations/updatelink.py +2 -2
- dub/models/operations/upsertlink.py +2 -2
- dub/partners.py +16 -16
- dub/qr_codes.py +2 -2
- dub/sdk.py +2 -2
- dub/tags.py +20 -20
- dub/track.py +4 -4
- dub/utils/annotations.py +32 -8
- dub/workspaces.py +4 -4
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/METADATA +7 -4
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/RECORD +65 -65
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/WHEEL +1 -1
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info/licenses}/LICENSE +0 -0
|
@@ -58,11 +58,11 @@ if TYPE_CHECKING:
|
|
|
58
58
|
CommissionCreatedEventData,
|
|
59
59
|
CommissionCreatedEventDataTypedDict,
|
|
60
60
|
CommissionCreatedEventEvent,
|
|
61
|
+
CommissionCreatedEventPartner,
|
|
62
|
+
CommissionCreatedEventPartnerTypedDict,
|
|
61
63
|
CommissionCreatedEventStatus,
|
|
62
64
|
CommissionCreatedEventType,
|
|
63
65
|
CommissionCreatedEventTypedDict,
|
|
64
|
-
Partner,
|
|
65
|
-
PartnerTypedDict,
|
|
66
66
|
)
|
|
67
67
|
from .continentcode import ContinentCode
|
|
68
68
|
from .domainschema import (
|
|
@@ -86,6 +86,8 @@ if TYPE_CHECKING:
|
|
|
86
86
|
LeadCreatedEventTestVariants,
|
|
87
87
|
LeadCreatedEventTestVariantsTypedDict,
|
|
88
88
|
LeadCreatedEventTypedDict,
|
|
89
|
+
Partner,
|
|
90
|
+
PartnerTypedDict,
|
|
89
91
|
)
|
|
90
92
|
from .leadevent import (
|
|
91
93
|
Customer,
|
|
@@ -120,6 +122,7 @@ if TYPE_CHECKING:
|
|
|
120
122
|
TestVariants,
|
|
121
123
|
TestVariantsTypedDict,
|
|
122
124
|
)
|
|
125
|
+
from .linktagschema import Color, LinkTagSchema, LinkTagSchemaTypedDict
|
|
123
126
|
from .linkwebhookevent import (
|
|
124
127
|
LinkWebhookEvent,
|
|
125
128
|
LinkWebhookEventEvent,
|
|
@@ -167,6 +170,8 @@ if TYPE_CHECKING:
|
|
|
167
170
|
SaleCreatedEventEvent,
|
|
168
171
|
SaleCreatedEventLink,
|
|
169
172
|
SaleCreatedEventLinkTypedDict,
|
|
173
|
+
SaleCreatedEventPartner,
|
|
174
|
+
SaleCreatedEventPartnerTypedDict,
|
|
170
175
|
SaleCreatedEventSale,
|
|
171
176
|
SaleCreatedEventSaleTypedDict,
|
|
172
177
|
SaleCreatedEventTestVariants,
|
|
@@ -190,7 +195,6 @@ if TYPE_CHECKING:
|
|
|
190
195
|
SaleTypedDict,
|
|
191
196
|
)
|
|
192
197
|
from .security import Security, SecurityTypedDict
|
|
193
|
-
from .tagschema import Color, TagSchema, TagSchemaTypedDict
|
|
194
198
|
from .webhookevent import WebhookEvent, WebhookEventTypedDict
|
|
195
199
|
from .workspaceschema import (
|
|
196
200
|
Domains,
|
|
@@ -250,6 +254,8 @@ __all__ = [
|
|
|
250
254
|
"CommissionCreatedEventData",
|
|
251
255
|
"CommissionCreatedEventDataTypedDict",
|
|
252
256
|
"CommissionCreatedEventEvent",
|
|
257
|
+
"CommissionCreatedEventPartner",
|
|
258
|
+
"CommissionCreatedEventPartnerTypedDict",
|
|
253
259
|
"CommissionCreatedEventStatus",
|
|
254
260
|
"CommissionCreatedEventType",
|
|
255
261
|
"CommissionCreatedEventTypedDict",
|
|
@@ -302,6 +308,8 @@ __all__ = [
|
|
|
302
308
|
"LinkErrorSchemaTypedDict",
|
|
303
309
|
"LinkSchema",
|
|
304
310
|
"LinkSchemaTypedDict",
|
|
311
|
+
"LinkTagSchema",
|
|
312
|
+
"LinkTagSchemaTypedDict",
|
|
305
313
|
"LinkTypedDict",
|
|
306
314
|
"LinkWebhookEvent",
|
|
307
315
|
"LinkWebhookEventEvent",
|
|
@@ -344,6 +352,8 @@ __all__ = [
|
|
|
344
352
|
"SaleCreatedEventEvent",
|
|
345
353
|
"SaleCreatedEventLink",
|
|
346
354
|
"SaleCreatedEventLinkTypedDict",
|
|
355
|
+
"SaleCreatedEventPartner",
|
|
356
|
+
"SaleCreatedEventPartnerTypedDict",
|
|
347
357
|
"SaleCreatedEventSale",
|
|
348
358
|
"SaleCreatedEventSaleTypedDict",
|
|
349
359
|
"SaleCreatedEventTestVariants",
|
|
@@ -364,8 +374,6 @@ __all__ = [
|
|
|
364
374
|
"Security",
|
|
365
375
|
"SecurityTypedDict",
|
|
366
376
|
"Status",
|
|
367
|
-
"TagSchema",
|
|
368
|
-
"TagSchemaTypedDict",
|
|
369
377
|
"TestVariants",
|
|
370
378
|
"TestVariantsTypedDict",
|
|
371
379
|
"Three",
|
|
@@ -429,11 +437,11 @@ _dynamic_imports: dict[str, str] = {
|
|
|
429
437
|
"CommissionCreatedEventData": ".commissioncreatedevent",
|
|
430
438
|
"CommissionCreatedEventDataTypedDict": ".commissioncreatedevent",
|
|
431
439
|
"CommissionCreatedEventEvent": ".commissioncreatedevent",
|
|
440
|
+
"CommissionCreatedEventPartner": ".commissioncreatedevent",
|
|
441
|
+
"CommissionCreatedEventPartnerTypedDict": ".commissioncreatedevent",
|
|
432
442
|
"CommissionCreatedEventStatus": ".commissioncreatedevent",
|
|
433
443
|
"CommissionCreatedEventType": ".commissioncreatedevent",
|
|
434
444
|
"CommissionCreatedEventTypedDict": ".commissioncreatedevent",
|
|
435
|
-
"Partner": ".commissioncreatedevent",
|
|
436
|
-
"PartnerTypedDict": ".commissioncreatedevent",
|
|
437
445
|
"ContinentCode": ".continentcode",
|
|
438
446
|
"DomainSchema": ".domainschema",
|
|
439
447
|
"DomainSchemaTypedDict": ".domainschema",
|
|
@@ -456,6 +464,8 @@ _dynamic_imports: dict[str, str] = {
|
|
|
456
464
|
"LeadCreatedEventTestVariants": ".leadcreatedevent",
|
|
457
465
|
"LeadCreatedEventTestVariantsTypedDict": ".leadcreatedevent",
|
|
458
466
|
"LeadCreatedEventTypedDict": ".leadcreatedevent",
|
|
467
|
+
"Partner": ".leadcreatedevent",
|
|
468
|
+
"PartnerTypedDict": ".leadcreatedevent",
|
|
459
469
|
"Customer": ".leadevent",
|
|
460
470
|
"CustomerTypedDict": ".leadevent",
|
|
461
471
|
"LeadEvent": ".leadevent",
|
|
@@ -485,6 +495,9 @@ _dynamic_imports: dict[str, str] = {
|
|
|
485
495
|
"LinkSchemaTypedDict": ".linkschema",
|
|
486
496
|
"TestVariants": ".linkschema",
|
|
487
497
|
"TestVariantsTypedDict": ".linkschema",
|
|
498
|
+
"Color": ".linktagschema",
|
|
499
|
+
"LinkTagSchema": ".linktagschema",
|
|
500
|
+
"LinkTagSchemaTypedDict": ".linktagschema",
|
|
488
501
|
"LinkWebhookEvent": ".linkwebhookevent",
|
|
489
502
|
"LinkWebhookEventEvent": ".linkwebhookevent",
|
|
490
503
|
"LinkWebhookEventEventTypedDict": ".linkwebhookevent",
|
|
@@ -521,6 +534,8 @@ _dynamic_imports: dict[str, str] = {
|
|
|
521
534
|
"SaleCreatedEventEvent": ".salecreatedevent",
|
|
522
535
|
"SaleCreatedEventLink": ".salecreatedevent",
|
|
523
536
|
"SaleCreatedEventLinkTypedDict": ".salecreatedevent",
|
|
537
|
+
"SaleCreatedEventPartner": ".salecreatedevent",
|
|
538
|
+
"SaleCreatedEventPartnerTypedDict": ".salecreatedevent",
|
|
524
539
|
"SaleCreatedEventSale": ".salecreatedevent",
|
|
525
540
|
"SaleCreatedEventSaleTypedDict": ".salecreatedevent",
|
|
526
541
|
"SaleCreatedEventTestVariants": ".salecreatedevent",
|
|
@@ -542,9 +557,6 @@ _dynamic_imports: dict[str, str] = {
|
|
|
542
557
|
"SaleTypedDict": ".saleevent",
|
|
543
558
|
"Security": ".security",
|
|
544
559
|
"SecurityTypedDict": ".security",
|
|
545
|
-
"Color": ".tagschema",
|
|
546
|
-
"TagSchema": ".tagschema",
|
|
547
|
-
"TagSchemaTypedDict": ".tagschema",
|
|
548
560
|
"WebhookEvent": ".webhookevent",
|
|
549
561
|
"WebhookEventTypedDict": ".webhookevent",
|
|
550
562
|
"Domains": ".workspaceschema",
|
|
@@ -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 .
|
|
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 LinkTypedDict(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[
|
|
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 Link(BaseModel):
|
|
|
257
257
|
|
|
258
258
|
public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
|
|
259
259
|
|
|
260
|
-
tags: Nullable[List[
|
|
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")]
|
|
@@ -30,7 +30,7 @@ class CommissionCreatedEventStatus(str, Enum):
|
|
|
30
30
|
CANCELED = "canceled"
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
class
|
|
33
|
+
class CommissionCreatedEventPartnerTypedDict(TypedDict):
|
|
34
34
|
id: str
|
|
35
35
|
r"""The partner's unique ID on Dub."""
|
|
36
36
|
name: str
|
|
@@ -49,9 +49,10 @@ class PartnerTypedDict(TypedDict):
|
|
|
49
49
|
total_sales: float
|
|
50
50
|
total_sale_amount: float
|
|
51
51
|
total_commissions: float
|
|
52
|
+
group_id: NotRequired[Nullable[str]]
|
|
52
53
|
|
|
53
54
|
|
|
54
|
-
class
|
|
55
|
+
class CommissionCreatedEventPartner(BaseModel):
|
|
55
56
|
id: str
|
|
56
57
|
r"""The partner's unique ID on Dub."""
|
|
57
58
|
|
|
@@ -84,10 +85,12 @@ class Partner(BaseModel):
|
|
|
84
85
|
|
|
85
86
|
total_commissions: Annotated[float, pydantic.Field(alias="totalCommissions")]
|
|
86
87
|
|
|
88
|
+
group_id: Annotated[OptionalNullable[str], pydantic.Field(alias="groupId")] = UNSET
|
|
89
|
+
|
|
87
90
|
@model_serializer(mode="wrap")
|
|
88
91
|
def serialize_model(self, handler):
|
|
89
|
-
optional_fields = []
|
|
90
|
-
nullable_fields = ["email", "image", "payoutsEnabledAt", "country"]
|
|
92
|
+
optional_fields = ["groupId"]
|
|
93
|
+
nullable_fields = ["email", "image", "payoutsEnabledAt", "country", "groupId"]
|
|
91
94
|
null_default_fields = []
|
|
92
95
|
|
|
93
96
|
serialized = handler(self)
|
|
@@ -209,7 +212,7 @@ class CommissionCreatedEventDataTypedDict(TypedDict):
|
|
|
209
212
|
quantity: float
|
|
210
213
|
created_at: str
|
|
211
214
|
updated_at: str
|
|
212
|
-
partner:
|
|
215
|
+
partner: CommissionCreatedEventPartnerTypedDict
|
|
213
216
|
type: NotRequired[CommissionCreatedEventType]
|
|
214
217
|
user_id: NotRequired[Nullable[str]]
|
|
215
218
|
r"""The user who created the manual commission."""
|
|
@@ -238,7 +241,7 @@ class CommissionCreatedEventData(BaseModel):
|
|
|
238
241
|
|
|
239
242
|
updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
|
|
240
243
|
|
|
241
|
-
partner:
|
|
244
|
+
partner: CommissionCreatedEventPartner
|
|
242
245
|
|
|
243
246
|
type: Optional[CommissionCreatedEventType] = None
|
|
244
247
|
|
|
@@ -25,6 +25,8 @@ class FolderSchemaTypedDict(TypedDict):
|
|
|
25
25
|
r"""The unique ID of the folder."""
|
|
26
26
|
name: str
|
|
27
27
|
r"""The name of the folder."""
|
|
28
|
+
description: Nullable[str]
|
|
29
|
+
r"""The description of the folder."""
|
|
28
30
|
type: Type
|
|
29
31
|
created_at: str
|
|
30
32
|
r"""The date the folder was created."""
|
|
@@ -41,6 +43,9 @@ class FolderSchema(BaseModel):
|
|
|
41
43
|
name: str
|
|
42
44
|
r"""The name of the folder."""
|
|
43
45
|
|
|
46
|
+
description: Nullable[str]
|
|
47
|
+
r"""The description of the folder."""
|
|
48
|
+
|
|
44
49
|
type: Type
|
|
45
50
|
|
|
46
51
|
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
@@ -57,7 +62,7 @@ class FolderSchema(BaseModel):
|
|
|
57
62
|
@model_serializer(mode="wrap")
|
|
58
63
|
def serialize_model(self, handler):
|
|
59
64
|
optional_fields = ["accessLevel"]
|
|
60
|
-
nullable_fields = ["accessLevel"]
|
|
65
|
+
nullable_fields = ["description", "accessLevel"]
|
|
61
66
|
null_default_fields = ["accessLevel"]
|
|
62
67
|
|
|
63
68
|
serialized = handler(self)
|
|
@@ -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 .
|
|
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 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[
|
|
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[
|
|
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")]
|
|
@@ -491,11 +491,101 @@ class LeadCreatedEventLink(BaseModel):
|
|
|
491
491
|
return m
|
|
492
492
|
|
|
493
493
|
|
|
494
|
+
class PartnerTypedDict(TypedDict):
|
|
495
|
+
id: str
|
|
496
|
+
r"""The partner's unique ID on Dub."""
|
|
497
|
+
name: str
|
|
498
|
+
r"""The partner's full legal name."""
|
|
499
|
+
email: Nullable[str]
|
|
500
|
+
r"""The partner's email address. Should be a unique value across Dub."""
|
|
501
|
+
image: Nullable[str]
|
|
502
|
+
r"""The partner's avatar image."""
|
|
503
|
+
payouts_enabled_at: Nullable[str]
|
|
504
|
+
r"""The date when the partner enabled payouts."""
|
|
505
|
+
country: Nullable[str]
|
|
506
|
+
r"""The partner's country (required for tax purposes)."""
|
|
507
|
+
total_clicks: float
|
|
508
|
+
total_leads: float
|
|
509
|
+
total_conversions: float
|
|
510
|
+
total_sales: float
|
|
511
|
+
total_sale_amount: float
|
|
512
|
+
total_commissions: float
|
|
513
|
+
group_id: NotRequired[Nullable[str]]
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
class Partner(BaseModel):
|
|
517
|
+
id: str
|
|
518
|
+
r"""The partner's unique ID on Dub."""
|
|
519
|
+
|
|
520
|
+
name: str
|
|
521
|
+
r"""The partner's full legal name."""
|
|
522
|
+
|
|
523
|
+
email: Nullable[str]
|
|
524
|
+
r"""The partner's email address. Should be a unique value across Dub."""
|
|
525
|
+
|
|
526
|
+
image: Nullable[str]
|
|
527
|
+
r"""The partner's avatar image."""
|
|
528
|
+
|
|
529
|
+
payouts_enabled_at: Annotated[
|
|
530
|
+
Nullable[str], pydantic.Field(alias="payoutsEnabledAt")
|
|
531
|
+
]
|
|
532
|
+
r"""The date when the partner enabled payouts."""
|
|
533
|
+
|
|
534
|
+
country: Nullable[str]
|
|
535
|
+
r"""The partner's country (required for tax purposes)."""
|
|
536
|
+
|
|
537
|
+
total_clicks: Annotated[float, pydantic.Field(alias="totalClicks")]
|
|
538
|
+
|
|
539
|
+
total_leads: Annotated[float, pydantic.Field(alias="totalLeads")]
|
|
540
|
+
|
|
541
|
+
total_conversions: Annotated[float, pydantic.Field(alias="totalConversions")]
|
|
542
|
+
|
|
543
|
+
total_sales: Annotated[float, pydantic.Field(alias="totalSales")]
|
|
544
|
+
|
|
545
|
+
total_sale_amount: Annotated[float, pydantic.Field(alias="totalSaleAmount")]
|
|
546
|
+
|
|
547
|
+
total_commissions: Annotated[float, pydantic.Field(alias="totalCommissions")]
|
|
548
|
+
|
|
549
|
+
group_id: Annotated[OptionalNullable[str], pydantic.Field(alias="groupId")] = UNSET
|
|
550
|
+
|
|
551
|
+
@model_serializer(mode="wrap")
|
|
552
|
+
def serialize_model(self, handler):
|
|
553
|
+
optional_fields = ["groupId"]
|
|
554
|
+
nullable_fields = ["email", "image", "payoutsEnabledAt", "country", "groupId"]
|
|
555
|
+
null_default_fields = []
|
|
556
|
+
|
|
557
|
+
serialized = handler(self)
|
|
558
|
+
|
|
559
|
+
m = {}
|
|
560
|
+
|
|
561
|
+
for n, f in type(self).model_fields.items():
|
|
562
|
+
k = f.alias or n
|
|
563
|
+
val = serialized.get(k)
|
|
564
|
+
serialized.pop(k, None)
|
|
565
|
+
|
|
566
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
567
|
+
is_set = (
|
|
568
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
569
|
+
or k in null_default_fields
|
|
570
|
+
) # pylint: disable=no-member
|
|
571
|
+
|
|
572
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
573
|
+
m[k] = val
|
|
574
|
+
elif val != UNSET_SENTINEL and (
|
|
575
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
576
|
+
):
|
|
577
|
+
m[k] = val
|
|
578
|
+
|
|
579
|
+
return m
|
|
580
|
+
|
|
581
|
+
|
|
494
582
|
class LeadCreatedEventDataTypedDict(TypedDict):
|
|
495
583
|
event_name: str
|
|
496
584
|
customer: LeadCreatedEventCustomerTypedDict
|
|
497
585
|
click: LeadCreatedEventClickTypedDict
|
|
498
586
|
link: LeadCreatedEventLinkTypedDict
|
|
587
|
+
metadata: Nullable[Dict[str, Any]]
|
|
588
|
+
partner: NotRequired[Nullable[PartnerTypedDict]]
|
|
499
589
|
|
|
500
590
|
|
|
501
591
|
class LeadCreatedEventData(BaseModel):
|
|
@@ -507,6 +597,40 @@ class LeadCreatedEventData(BaseModel):
|
|
|
507
597
|
|
|
508
598
|
link: LeadCreatedEventLink
|
|
509
599
|
|
|
600
|
+
metadata: Nullable[Dict[str, Any]]
|
|
601
|
+
|
|
602
|
+
partner: OptionalNullable[Partner] = UNSET
|
|
603
|
+
|
|
604
|
+
@model_serializer(mode="wrap")
|
|
605
|
+
def serialize_model(self, handler):
|
|
606
|
+
optional_fields = ["partner"]
|
|
607
|
+
nullable_fields = ["partner", "metadata"]
|
|
608
|
+
null_default_fields = []
|
|
609
|
+
|
|
610
|
+
serialized = handler(self)
|
|
611
|
+
|
|
612
|
+
m = {}
|
|
613
|
+
|
|
614
|
+
for n, f in type(self).model_fields.items():
|
|
615
|
+
k = f.alias or n
|
|
616
|
+
val = serialized.get(k)
|
|
617
|
+
serialized.pop(k, None)
|
|
618
|
+
|
|
619
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
620
|
+
is_set = (
|
|
621
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
622
|
+
or k in null_default_fields
|
|
623
|
+
) # pylint: disable=no-member
|
|
624
|
+
|
|
625
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
626
|
+
m[k] = val
|
|
627
|
+
elif val != UNSET_SENTINEL and (
|
|
628
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
629
|
+
):
|
|
630
|
+
m[k] = val
|
|
631
|
+
|
|
632
|
+
return m
|
|
633
|
+
|
|
510
634
|
|
|
511
635
|
class LeadCreatedEventTypedDict(TypedDict):
|
|
512
636
|
r"""Triggered when a lead 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 .
|
|
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[
|
|
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[
|
|
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 .
|
|
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[
|
|
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[
|
|
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 .
|
|
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[
|
|
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[
|
|
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
|
|
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
|
|
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 .
|
|
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[
|
|
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[
|
|
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")]
|