dub 0.27.1__py3-none-any.whl → 0.27.3__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/models/components/__init__.py +41 -2
- dub/models/components/analyticstriggers.py +2 -0
- dub/models/components/clickevent.py +92 -47
- dub/models/components/commissioncreatedevent.py +281 -0
- dub/models/components/leadcreatedevent.py +66 -21
- dub/models/components/leadevent.py +126 -48
- dub/models/components/linkclickedevent.py +66 -21
- dub/models/components/linkschema.py +26 -20
- dub/models/components/linkwebhookevent.py +33 -21
- dub/models/components/partnerenrolledevent.py +207 -80
- dub/models/components/salecreatedevent.py +66 -21
- dub/models/components/saleevent.py +206 -122
- dub/models/components/webhookevent.py +6 -0
- dub/models/errors/__init__.py +3 -2
- dub/models/operations/__init__.py +71 -2
- dub/models/operations/bulkcreatelinks.py +25 -25
- dub/models/operations/bulkupdatelinks.py +25 -25
- dub/models/operations/createlink.py +25 -25
- dub/models/operations/createpartner.py +207 -80
- dub/models/operations/getlinks.py +2 -2
- dub/models/operations/getlinkscount.py +2 -2
- dub/models/operations/listcommissions.py +169 -8
- dub/models/operations/listevents.py +48 -20
- dub/models/operations/listpartners.py +516 -0
- dub/models/operations/retrieveanalytics.py +48 -20
- dub/models/operations/retrievelinks.py +6 -6
- dub/models/operations/tracksale.py +1 -0
- dub/models/operations/updatecommission.py +169 -8
- dub/models/operations/updatelink.py +25 -25
- dub/models/operations/upsertlink.py +25 -25
- dub/partners.py +262 -0
- dub/sdk.py +1 -1
- dub/utils/__init__.py +3 -2
- {dub-0.27.1.dist-info → dub-0.27.3.dist-info}/METADATA +3 -2
- {dub-0.27.1.dist-info → dub-0.27.3.dist-info}/RECORD +38 -36
- {dub-0.27.1.dist-info → dub-0.27.3.dist-info}/LICENSE +0 -0
- {dub-0.27.1.dist-info → dub-0.27.3.dist-info}/WHEEL +0 -0
|
@@ -6,7 +6,7 @@ from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTIN
|
|
|
6
6
|
from enum import Enum
|
|
7
7
|
import pydantic
|
|
8
8
|
from pydantic import model_serializer
|
|
9
|
-
from typing import List, Optional
|
|
9
|
+
from typing import Any, List, Optional
|
|
10
10
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
11
11
|
|
|
12
12
|
|
|
@@ -29,6 +29,7 @@ class LeadEventClickTypedDict(TypedDict):
|
|
|
29
29
|
referer_url: str
|
|
30
30
|
qr: bool
|
|
31
31
|
ip: str
|
|
32
|
+
trigger: NotRequired[Nullable[str]]
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
class LeadEventClick(BaseModel):
|
|
@@ -60,6 +61,38 @@ class LeadEventClick(BaseModel):
|
|
|
60
61
|
|
|
61
62
|
ip: str
|
|
62
63
|
|
|
64
|
+
trigger: OptionalNullable[str] = UNSET
|
|
65
|
+
|
|
66
|
+
@model_serializer(mode="wrap")
|
|
67
|
+
def serialize_model(self, handler):
|
|
68
|
+
optional_fields = ["trigger"]
|
|
69
|
+
nullable_fields = ["trigger"]
|
|
70
|
+
null_default_fields = []
|
|
71
|
+
|
|
72
|
+
serialized = handler(self)
|
|
73
|
+
|
|
74
|
+
m = {}
|
|
75
|
+
|
|
76
|
+
for n, f in type(self).model_fields.items():
|
|
77
|
+
k = f.alias or n
|
|
78
|
+
val = serialized.get(k)
|
|
79
|
+
serialized.pop(k, None)
|
|
80
|
+
|
|
81
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
82
|
+
is_set = (
|
|
83
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
84
|
+
or k in null_default_fields
|
|
85
|
+
) # pylint: disable=no-member
|
|
86
|
+
|
|
87
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
88
|
+
m[k] = val
|
|
89
|
+
elif val != UNSET_SENTINEL and (
|
|
90
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
91
|
+
):
|
|
92
|
+
m[k] = val
|
|
93
|
+
|
|
94
|
+
return m
|
|
95
|
+
|
|
63
96
|
|
|
64
97
|
class LeadEventGeoTypedDict(TypedDict):
|
|
65
98
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
|
|
@@ -871,8 +904,6 @@ class LeadEventLinkTypedDict(TypedDict):
|
|
|
871
904
|
geo: Nullable[LeadEventGeoTypedDict]
|
|
872
905
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
|
|
873
906
|
public_stats: bool
|
|
874
|
-
tag_id: Nullable[str]
|
|
875
|
-
r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
|
|
876
907
|
tags: Nullable[List[TagSchemaTypedDict]]
|
|
877
908
|
r"""The tags assigned to the short link."""
|
|
878
909
|
folder_id: Nullable[str]
|
|
@@ -903,18 +934,22 @@ class LeadEventLinkTypedDict(TypedDict):
|
|
|
903
934
|
last_clicked: str
|
|
904
935
|
created_at: str
|
|
905
936
|
updated_at: str
|
|
937
|
+
tag_id: Nullable[str]
|
|
938
|
+
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
906
939
|
project_id: str
|
|
907
|
-
r"""The project ID of the short link.
|
|
940
|
+
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
908
941
|
test_variants: NotRequired[Nullable[List[LeadEventTestVariantsTypedDict]]]
|
|
909
942
|
r"""An array of A/B test URLs and the percentage of traffic to send to each URL."""
|
|
910
943
|
clicks: NotRequired[float]
|
|
911
944
|
r"""The number of clicks on the short link."""
|
|
912
945
|
leads: NotRequired[float]
|
|
913
|
-
r"""The number of leads the short
|
|
946
|
+
r"""The number of leads the short link has generated."""
|
|
947
|
+
conversions: NotRequired[float]
|
|
948
|
+
r"""The number of leads that converted to paying customers."""
|
|
914
949
|
sales: NotRequired[float]
|
|
915
|
-
r"""The number of sales the short
|
|
950
|
+
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
916
951
|
sale_amount: NotRequired[float]
|
|
917
|
-
r"""The total dollar
|
|
952
|
+
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
918
953
|
|
|
919
954
|
|
|
920
955
|
class LeadEventLink(BaseModel):
|
|
@@ -981,15 +1016,6 @@ class LeadEventLink(BaseModel):
|
|
|
981
1016
|
|
|
982
1017
|
public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
|
|
983
1018
|
|
|
984
|
-
tag_id: Annotated[
|
|
985
|
-
Nullable[str],
|
|
986
|
-
pydantic.Field(
|
|
987
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
988
|
-
alias="tagId",
|
|
989
|
-
),
|
|
990
|
-
]
|
|
991
|
-
r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
|
|
992
|
-
|
|
993
1019
|
tags: Nullable[List[TagSchema]]
|
|
994
1020
|
r"""The tags assigned to the short link."""
|
|
995
1021
|
|
|
@@ -1038,6 +1064,15 @@ class LeadEventLink(BaseModel):
|
|
|
1038
1064
|
|
|
1039
1065
|
updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
|
|
1040
1066
|
|
|
1067
|
+
tag_id: Annotated[
|
|
1068
|
+
Nullable[str],
|
|
1069
|
+
pydantic.Field(
|
|
1070
|
+
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
1071
|
+
alias="tagId",
|
|
1072
|
+
),
|
|
1073
|
+
]
|
|
1074
|
+
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
1075
|
+
|
|
1041
1076
|
project_id: Annotated[
|
|
1042
1077
|
str,
|
|
1043
1078
|
pydantic.Field(
|
|
@@ -1045,7 +1080,7 @@ class LeadEventLink(BaseModel):
|
|
|
1045
1080
|
alias="projectId",
|
|
1046
1081
|
),
|
|
1047
1082
|
]
|
|
1048
|
-
r"""The project ID of the short link.
|
|
1083
|
+
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
1049
1084
|
|
|
1050
1085
|
test_variants: Annotated[
|
|
1051
1086
|
OptionalNullable[List[LeadEventTestVariants]],
|
|
@@ -1057,17 +1092,27 @@ class LeadEventLink(BaseModel):
|
|
|
1057
1092
|
r"""The number of clicks on the short link."""
|
|
1058
1093
|
|
|
1059
1094
|
leads: Optional[float] = 0
|
|
1060
|
-
r"""The number of leads the short
|
|
1095
|
+
r"""The number of leads the short link has generated."""
|
|
1096
|
+
|
|
1097
|
+
conversions: Optional[float] = 0
|
|
1098
|
+
r"""The number of leads that converted to paying customers."""
|
|
1061
1099
|
|
|
1062
1100
|
sales: Optional[float] = 0
|
|
1063
|
-
r"""The number of sales the short
|
|
1101
|
+
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
1064
1102
|
|
|
1065
1103
|
sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
|
|
1066
|
-
r"""The total dollar
|
|
1104
|
+
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
1067
1105
|
|
|
1068
1106
|
@model_serializer(mode="wrap")
|
|
1069
1107
|
def serialize_model(self, handler):
|
|
1070
|
-
optional_fields = [
|
|
1108
|
+
optional_fields = [
|
|
1109
|
+
"testVariants",
|
|
1110
|
+
"clicks",
|
|
1111
|
+
"leads",
|
|
1112
|
+
"conversions",
|
|
1113
|
+
"sales",
|
|
1114
|
+
"saleAmount",
|
|
1115
|
+
]
|
|
1071
1116
|
nullable_fields = [
|
|
1072
1117
|
"externalId",
|
|
1073
1118
|
"tenantId",
|
|
@@ -1082,7 +1127,6 @@ class LeadEventLink(BaseModel):
|
|
|
1082
1127
|
"ios",
|
|
1083
1128
|
"android",
|
|
1084
1129
|
"geo",
|
|
1085
|
-
"tagId",
|
|
1086
1130
|
"tags",
|
|
1087
1131
|
"folderId",
|
|
1088
1132
|
"comments",
|
|
@@ -1095,6 +1139,7 @@ class LeadEventLink(BaseModel):
|
|
|
1095
1139
|
"testStartedAt",
|
|
1096
1140
|
"testCompletedAt",
|
|
1097
1141
|
"userId",
|
|
1142
|
+
"tagId",
|
|
1098
1143
|
]
|
|
1099
1144
|
null_default_fields = []
|
|
1100
1145
|
|
|
@@ -1214,31 +1259,32 @@ class LeadEventTypedDict(TypedDict):
|
|
|
1214
1259
|
link: LeadEventLinkTypedDict
|
|
1215
1260
|
customer: CustomerTypedDict
|
|
1216
1261
|
click_id: str
|
|
1217
|
-
r"""Deprecated
|
|
1262
|
+
r"""Deprecated: Use `click.id` instead."""
|
|
1218
1263
|
link_id: str
|
|
1219
|
-
r"""Deprecated
|
|
1264
|
+
r"""Deprecated: Use `link.id` instead."""
|
|
1220
1265
|
domain: str
|
|
1221
|
-
r"""Deprecated
|
|
1266
|
+
r"""Deprecated: Use `link.domain` instead."""
|
|
1222
1267
|
key: str
|
|
1223
|
-
r"""Deprecated
|
|
1268
|
+
r"""Deprecated: Use `link.key` instead."""
|
|
1224
1269
|
url: str
|
|
1225
|
-
r"""Deprecated
|
|
1270
|
+
r"""Deprecated: Use `click.url` instead."""
|
|
1226
1271
|
continent: str
|
|
1227
|
-
r"""Deprecated
|
|
1272
|
+
r"""Deprecated: Use `click.continent` instead."""
|
|
1228
1273
|
country: str
|
|
1229
|
-
r"""Deprecated
|
|
1274
|
+
r"""Deprecated: Use `click.country` instead."""
|
|
1230
1275
|
city: str
|
|
1231
|
-
r"""Deprecated
|
|
1276
|
+
r"""Deprecated: Use `click.city` instead."""
|
|
1232
1277
|
device: str
|
|
1233
|
-
r"""Deprecated
|
|
1278
|
+
r"""Deprecated: Use `click.device` instead."""
|
|
1234
1279
|
browser: str
|
|
1235
|
-
r"""Deprecated
|
|
1280
|
+
r"""Deprecated: Use `click.browser` instead."""
|
|
1236
1281
|
os: str
|
|
1237
|
-
r"""Deprecated
|
|
1282
|
+
r"""Deprecated: Use `click.os` instead."""
|
|
1238
1283
|
qr: float
|
|
1239
|
-
r"""Deprecated
|
|
1284
|
+
r"""Deprecated: Use `click.qr` instead."""
|
|
1240
1285
|
ip: str
|
|
1241
|
-
r"""Deprecated
|
|
1286
|
+
r"""Deprecated: Use `click.ip` instead."""
|
|
1287
|
+
metadata: NotRequired[Nullable[Any]]
|
|
1242
1288
|
|
|
1243
1289
|
|
|
1244
1290
|
class LeadEvent(BaseModel):
|
|
@@ -1262,7 +1308,7 @@ class LeadEvent(BaseModel):
|
|
|
1262
1308
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1263
1309
|
),
|
|
1264
1310
|
]
|
|
1265
|
-
r"""Deprecated
|
|
1311
|
+
r"""Deprecated: Use `click.id` instead."""
|
|
1266
1312
|
|
|
1267
1313
|
link_id: Annotated[
|
|
1268
1314
|
str,
|
|
@@ -1270,7 +1316,7 @@ class LeadEvent(BaseModel):
|
|
|
1270
1316
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1271
1317
|
),
|
|
1272
1318
|
]
|
|
1273
|
-
r"""Deprecated
|
|
1319
|
+
r"""Deprecated: Use `link.id` instead."""
|
|
1274
1320
|
|
|
1275
1321
|
domain: Annotated[
|
|
1276
1322
|
str,
|
|
@@ -1278,7 +1324,7 @@ class LeadEvent(BaseModel):
|
|
|
1278
1324
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1279
1325
|
),
|
|
1280
1326
|
]
|
|
1281
|
-
r"""Deprecated
|
|
1327
|
+
r"""Deprecated: Use `link.domain` instead."""
|
|
1282
1328
|
|
|
1283
1329
|
key: Annotated[
|
|
1284
1330
|
str,
|
|
@@ -1286,7 +1332,7 @@ class LeadEvent(BaseModel):
|
|
|
1286
1332
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1287
1333
|
),
|
|
1288
1334
|
]
|
|
1289
|
-
r"""Deprecated
|
|
1335
|
+
r"""Deprecated: Use `link.key` instead."""
|
|
1290
1336
|
|
|
1291
1337
|
url: Annotated[
|
|
1292
1338
|
str,
|
|
@@ -1294,7 +1340,7 @@ class LeadEvent(BaseModel):
|
|
|
1294
1340
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1295
1341
|
),
|
|
1296
1342
|
]
|
|
1297
|
-
r"""Deprecated
|
|
1343
|
+
r"""Deprecated: Use `click.url` instead."""
|
|
1298
1344
|
|
|
1299
1345
|
continent: Annotated[
|
|
1300
1346
|
str,
|
|
@@ -1302,7 +1348,7 @@ class LeadEvent(BaseModel):
|
|
|
1302
1348
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1303
1349
|
),
|
|
1304
1350
|
]
|
|
1305
|
-
r"""Deprecated
|
|
1351
|
+
r"""Deprecated: Use `click.continent` instead."""
|
|
1306
1352
|
|
|
1307
1353
|
country: Annotated[
|
|
1308
1354
|
str,
|
|
@@ -1310,7 +1356,7 @@ class LeadEvent(BaseModel):
|
|
|
1310
1356
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1311
1357
|
),
|
|
1312
1358
|
]
|
|
1313
|
-
r"""Deprecated
|
|
1359
|
+
r"""Deprecated: Use `click.country` instead."""
|
|
1314
1360
|
|
|
1315
1361
|
city: Annotated[
|
|
1316
1362
|
str,
|
|
@@ -1318,7 +1364,7 @@ class LeadEvent(BaseModel):
|
|
|
1318
1364
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1319
1365
|
),
|
|
1320
1366
|
]
|
|
1321
|
-
r"""Deprecated
|
|
1367
|
+
r"""Deprecated: Use `click.city` instead."""
|
|
1322
1368
|
|
|
1323
1369
|
device: Annotated[
|
|
1324
1370
|
str,
|
|
@@ -1326,7 +1372,7 @@ class LeadEvent(BaseModel):
|
|
|
1326
1372
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1327
1373
|
),
|
|
1328
1374
|
]
|
|
1329
|
-
r"""Deprecated
|
|
1375
|
+
r"""Deprecated: Use `click.device` instead."""
|
|
1330
1376
|
|
|
1331
1377
|
browser: Annotated[
|
|
1332
1378
|
str,
|
|
@@ -1334,7 +1380,7 @@ class LeadEvent(BaseModel):
|
|
|
1334
1380
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1335
1381
|
),
|
|
1336
1382
|
]
|
|
1337
|
-
r"""Deprecated
|
|
1383
|
+
r"""Deprecated: Use `click.browser` instead."""
|
|
1338
1384
|
|
|
1339
1385
|
os: Annotated[
|
|
1340
1386
|
str,
|
|
@@ -1342,7 +1388,7 @@ class LeadEvent(BaseModel):
|
|
|
1342
1388
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1343
1389
|
),
|
|
1344
1390
|
]
|
|
1345
|
-
r"""Deprecated
|
|
1391
|
+
r"""Deprecated: Use `click.os` instead."""
|
|
1346
1392
|
|
|
1347
1393
|
qr: Annotated[
|
|
1348
1394
|
float,
|
|
@@ -1350,7 +1396,7 @@ class LeadEvent(BaseModel):
|
|
|
1350
1396
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1351
1397
|
),
|
|
1352
1398
|
]
|
|
1353
|
-
r"""Deprecated
|
|
1399
|
+
r"""Deprecated: Use `click.qr` instead."""
|
|
1354
1400
|
|
|
1355
1401
|
ip: Annotated[
|
|
1356
1402
|
str,
|
|
@@ -1358,4 +1404,36 @@ class LeadEvent(BaseModel):
|
|
|
1358
1404
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1359
1405
|
),
|
|
1360
1406
|
]
|
|
1361
|
-
r"""Deprecated
|
|
1407
|
+
r"""Deprecated: Use `click.ip` instead."""
|
|
1408
|
+
|
|
1409
|
+
metadata: OptionalNullable[Any] = UNSET
|
|
1410
|
+
|
|
1411
|
+
@model_serializer(mode="wrap")
|
|
1412
|
+
def serialize_model(self, handler):
|
|
1413
|
+
optional_fields = ["metadata"]
|
|
1414
|
+
nullable_fields = ["metadata"]
|
|
1415
|
+
null_default_fields = []
|
|
1416
|
+
|
|
1417
|
+
serialized = handler(self)
|
|
1418
|
+
|
|
1419
|
+
m = {}
|
|
1420
|
+
|
|
1421
|
+
for n, f in type(self).model_fields.items():
|
|
1422
|
+
k = f.alias or n
|
|
1423
|
+
val = serialized.get(k)
|
|
1424
|
+
serialized.pop(k, None)
|
|
1425
|
+
|
|
1426
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
1427
|
+
is_set = (
|
|
1428
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
1429
|
+
or k in null_default_fields
|
|
1430
|
+
) # pylint: disable=no-member
|
|
1431
|
+
|
|
1432
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
1433
|
+
m[k] = val
|
|
1434
|
+
elif val != UNSET_SENTINEL and (
|
|
1435
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
1436
|
+
):
|
|
1437
|
+
m[k] = val
|
|
1438
|
+
|
|
1439
|
+
return m
|
|
@@ -29,6 +29,7 @@ class LinkClickedEventClickTypedDict(TypedDict):
|
|
|
29
29
|
referer_url: str
|
|
30
30
|
qr: bool
|
|
31
31
|
ip: str
|
|
32
|
+
trigger: NotRequired[Nullable[str]]
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
class LinkClickedEventClick(BaseModel):
|
|
@@ -60,6 +61,38 @@ class LinkClickedEventClick(BaseModel):
|
|
|
60
61
|
|
|
61
62
|
ip: str
|
|
62
63
|
|
|
64
|
+
trigger: OptionalNullable[str] = UNSET
|
|
65
|
+
|
|
66
|
+
@model_serializer(mode="wrap")
|
|
67
|
+
def serialize_model(self, handler):
|
|
68
|
+
optional_fields = ["trigger"]
|
|
69
|
+
nullable_fields = ["trigger"]
|
|
70
|
+
null_default_fields = []
|
|
71
|
+
|
|
72
|
+
serialized = handler(self)
|
|
73
|
+
|
|
74
|
+
m = {}
|
|
75
|
+
|
|
76
|
+
for n, f in type(self).model_fields.items():
|
|
77
|
+
k = f.alias or n
|
|
78
|
+
val = serialized.get(k)
|
|
79
|
+
serialized.pop(k, None)
|
|
80
|
+
|
|
81
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
82
|
+
is_set = (
|
|
83
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
84
|
+
or k in null_default_fields
|
|
85
|
+
) # pylint: disable=no-member
|
|
86
|
+
|
|
87
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
88
|
+
m[k] = val
|
|
89
|
+
elif val != UNSET_SENTINEL and (
|
|
90
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
91
|
+
):
|
|
92
|
+
m[k] = val
|
|
93
|
+
|
|
94
|
+
return m
|
|
95
|
+
|
|
63
96
|
|
|
64
97
|
class LinkClickedEventGeoTypedDict(TypedDict):
|
|
65
98
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
|
|
@@ -871,8 +904,6 @@ class LinkClickedEventLinkTypedDict(TypedDict):
|
|
|
871
904
|
geo: Nullable[LinkClickedEventGeoTypedDict]
|
|
872
905
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
|
|
873
906
|
public_stats: bool
|
|
874
|
-
tag_id: Nullable[str]
|
|
875
|
-
r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
|
|
876
907
|
tags: Nullable[List[TagSchemaTypedDict]]
|
|
877
908
|
r"""The tags assigned to the short link."""
|
|
878
909
|
folder_id: Nullable[str]
|
|
@@ -903,18 +934,22 @@ class LinkClickedEventLinkTypedDict(TypedDict):
|
|
|
903
934
|
last_clicked: str
|
|
904
935
|
created_at: str
|
|
905
936
|
updated_at: str
|
|
937
|
+
tag_id: Nullable[str]
|
|
938
|
+
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
906
939
|
project_id: str
|
|
907
|
-
r"""The project ID of the short link.
|
|
940
|
+
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
908
941
|
test_variants: NotRequired[Nullable[List[LinkClickedEventTestVariantsTypedDict]]]
|
|
909
942
|
r"""An array of A/B test URLs and the percentage of traffic to send to each URL."""
|
|
910
943
|
clicks: NotRequired[float]
|
|
911
944
|
r"""The number of clicks on the short link."""
|
|
912
945
|
leads: NotRequired[float]
|
|
913
|
-
r"""The number of leads the short
|
|
946
|
+
r"""The number of leads the short link has generated."""
|
|
947
|
+
conversions: NotRequired[float]
|
|
948
|
+
r"""The number of leads that converted to paying customers."""
|
|
914
949
|
sales: NotRequired[float]
|
|
915
|
-
r"""The number of sales the short
|
|
950
|
+
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
916
951
|
sale_amount: NotRequired[float]
|
|
917
|
-
r"""The total dollar
|
|
952
|
+
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
918
953
|
|
|
919
954
|
|
|
920
955
|
class LinkClickedEventLink(BaseModel):
|
|
@@ -981,15 +1016,6 @@ class LinkClickedEventLink(BaseModel):
|
|
|
981
1016
|
|
|
982
1017
|
public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
|
|
983
1018
|
|
|
984
|
-
tag_id: Annotated[
|
|
985
|
-
Nullable[str],
|
|
986
|
-
pydantic.Field(
|
|
987
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
988
|
-
alias="tagId",
|
|
989
|
-
),
|
|
990
|
-
]
|
|
991
|
-
r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
|
|
992
|
-
|
|
993
1019
|
tags: Nullable[List[TagSchema]]
|
|
994
1020
|
r"""The tags assigned to the short link."""
|
|
995
1021
|
|
|
@@ -1038,6 +1064,15 @@ class LinkClickedEventLink(BaseModel):
|
|
|
1038
1064
|
|
|
1039
1065
|
updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
|
|
1040
1066
|
|
|
1067
|
+
tag_id: Annotated[
|
|
1068
|
+
Nullable[str],
|
|
1069
|
+
pydantic.Field(
|
|
1070
|
+
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
1071
|
+
alias="tagId",
|
|
1072
|
+
),
|
|
1073
|
+
]
|
|
1074
|
+
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
1075
|
+
|
|
1041
1076
|
project_id: Annotated[
|
|
1042
1077
|
str,
|
|
1043
1078
|
pydantic.Field(
|
|
@@ -1045,7 +1080,7 @@ class LinkClickedEventLink(BaseModel):
|
|
|
1045
1080
|
alias="projectId",
|
|
1046
1081
|
),
|
|
1047
1082
|
]
|
|
1048
|
-
r"""The project ID of the short link.
|
|
1083
|
+
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
1049
1084
|
|
|
1050
1085
|
test_variants: Annotated[
|
|
1051
1086
|
OptionalNullable[List[LinkClickedEventTestVariants]],
|
|
@@ -1057,17 +1092,27 @@ class LinkClickedEventLink(BaseModel):
|
|
|
1057
1092
|
r"""The number of clicks on the short link."""
|
|
1058
1093
|
|
|
1059
1094
|
leads: Optional[float] = 0
|
|
1060
|
-
r"""The number of leads the short
|
|
1095
|
+
r"""The number of leads the short link has generated."""
|
|
1096
|
+
|
|
1097
|
+
conversions: Optional[float] = 0
|
|
1098
|
+
r"""The number of leads that converted to paying customers."""
|
|
1061
1099
|
|
|
1062
1100
|
sales: Optional[float] = 0
|
|
1063
|
-
r"""The number of sales the short
|
|
1101
|
+
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
1064
1102
|
|
|
1065
1103
|
sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
|
|
1066
|
-
r"""The total dollar
|
|
1104
|
+
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
1067
1105
|
|
|
1068
1106
|
@model_serializer(mode="wrap")
|
|
1069
1107
|
def serialize_model(self, handler):
|
|
1070
|
-
optional_fields = [
|
|
1108
|
+
optional_fields = [
|
|
1109
|
+
"testVariants",
|
|
1110
|
+
"clicks",
|
|
1111
|
+
"leads",
|
|
1112
|
+
"conversions",
|
|
1113
|
+
"sales",
|
|
1114
|
+
"saleAmount",
|
|
1115
|
+
]
|
|
1071
1116
|
nullable_fields = [
|
|
1072
1117
|
"externalId",
|
|
1073
1118
|
"tenantId",
|
|
@@ -1082,7 +1127,6 @@ class LinkClickedEventLink(BaseModel):
|
|
|
1082
1127
|
"ios",
|
|
1083
1128
|
"android",
|
|
1084
1129
|
"geo",
|
|
1085
|
-
"tagId",
|
|
1086
1130
|
"tags",
|
|
1087
1131
|
"folderId",
|
|
1088
1132
|
"comments",
|
|
@@ -1095,6 +1139,7 @@ class LinkClickedEventLink(BaseModel):
|
|
|
1095
1139
|
"testStartedAt",
|
|
1096
1140
|
"testCompletedAt",
|
|
1097
1141
|
"userId",
|
|
1142
|
+
"tagId",
|
|
1098
1143
|
]
|
|
1099
1144
|
null_default_fields = []
|
|
1100
1145
|
|
|
@@ -820,8 +820,6 @@ class LinkSchemaTypedDict(TypedDict):
|
|
|
820
820
|
r"""The Android destination URL for the short link for Android device targeting."""
|
|
821
821
|
geo: Nullable[GeoTypedDict]
|
|
822
822
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
|
|
823
|
-
tag_id: Nullable[str]
|
|
824
|
-
r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
|
|
825
823
|
tags: Nullable[List[TagSchemaTypedDict]]
|
|
826
824
|
r"""The tags assigned to the short link."""
|
|
827
825
|
folder_id: Nullable[str]
|
|
@@ -854,8 +852,10 @@ class LinkSchemaTypedDict(TypedDict):
|
|
|
854
852
|
r"""The date and time when the short link was created."""
|
|
855
853
|
updated_at: str
|
|
856
854
|
r"""The date and time when the short link was last updated."""
|
|
855
|
+
tag_id: Nullable[str]
|
|
856
|
+
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
857
857
|
project_id: str
|
|
858
|
-
r"""The project ID of the short link.
|
|
858
|
+
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
859
859
|
track_conversion: NotRequired[bool]
|
|
860
860
|
r"""Whether to track conversions for the short link."""
|
|
861
861
|
archived: NotRequired[bool]
|
|
@@ -877,11 +877,13 @@ class LinkSchemaTypedDict(TypedDict):
|
|
|
877
877
|
clicks: NotRequired[float]
|
|
878
878
|
r"""The number of clicks on the short link."""
|
|
879
879
|
leads: NotRequired[float]
|
|
880
|
-
r"""The number of leads the short
|
|
880
|
+
r"""The number of leads the short link has generated."""
|
|
881
|
+
conversions: NotRequired[float]
|
|
882
|
+
r"""The number of leads that converted to paying customers."""
|
|
881
883
|
sales: NotRequired[float]
|
|
882
|
-
r"""The number of sales the short
|
|
884
|
+
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
883
885
|
sale_amount: NotRequired[float]
|
|
884
|
-
r"""The total dollar
|
|
886
|
+
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
885
887
|
|
|
886
888
|
|
|
887
889
|
class LinkSchema(BaseModel):
|
|
@@ -939,15 +941,6 @@ class LinkSchema(BaseModel):
|
|
|
939
941
|
geo: Nullable[Geo]
|
|
940
942
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
|
|
941
943
|
|
|
942
|
-
tag_id: Annotated[
|
|
943
|
-
Nullable[str],
|
|
944
|
-
pydantic.Field(
|
|
945
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
946
|
-
alias="tagId",
|
|
947
|
-
),
|
|
948
|
-
]
|
|
949
|
-
r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
|
|
950
|
-
|
|
951
944
|
tags: Nullable[List[TagSchema]]
|
|
952
945
|
r"""The tags assigned to the short link."""
|
|
953
946
|
|
|
@@ -996,6 +989,15 @@ class LinkSchema(BaseModel):
|
|
|
996
989
|
updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
|
|
997
990
|
r"""The date and time when the short link was last updated."""
|
|
998
991
|
|
|
992
|
+
tag_id: Annotated[
|
|
993
|
+
Nullable[str],
|
|
994
|
+
pydantic.Field(
|
|
995
|
+
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
996
|
+
alias="tagId",
|
|
997
|
+
),
|
|
998
|
+
]
|
|
999
|
+
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
1000
|
+
|
|
999
1001
|
project_id: Annotated[
|
|
1000
1002
|
str,
|
|
1001
1003
|
pydantic.Field(
|
|
@@ -1003,7 +1005,7 @@ class LinkSchema(BaseModel):
|
|
|
1003
1005
|
alias="projectId",
|
|
1004
1006
|
),
|
|
1005
1007
|
]
|
|
1006
|
-
r"""The project ID of the short link.
|
|
1008
|
+
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
1007
1009
|
|
|
1008
1010
|
track_conversion: Annotated[
|
|
1009
1011
|
Optional[bool], pydantic.Field(alias="trackConversion")
|
|
@@ -1044,13 +1046,16 @@ class LinkSchema(BaseModel):
|
|
|
1044
1046
|
r"""The number of clicks on the short link."""
|
|
1045
1047
|
|
|
1046
1048
|
leads: Optional[float] = 0
|
|
1047
|
-
r"""The number of leads the short
|
|
1049
|
+
r"""The number of leads the short link has generated."""
|
|
1050
|
+
|
|
1051
|
+
conversions: Optional[float] = 0
|
|
1052
|
+
r"""The number of leads that converted to paying customers."""
|
|
1048
1053
|
|
|
1049
1054
|
sales: Optional[float] = 0
|
|
1050
|
-
r"""The number of sales the short
|
|
1055
|
+
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
1051
1056
|
|
|
1052
1057
|
sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
|
|
1053
|
-
r"""The total dollar
|
|
1058
|
+
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
1054
1059
|
|
|
1055
1060
|
@model_serializer(mode="wrap")
|
|
1056
1061
|
def serialize_model(self, handler):
|
|
@@ -1066,6 +1071,7 @@ class LinkSchema(BaseModel):
|
|
|
1066
1071
|
"testCompletedAt",
|
|
1067
1072
|
"clicks",
|
|
1068
1073
|
"leads",
|
|
1074
|
+
"conversions",
|
|
1069
1075
|
"sales",
|
|
1070
1076
|
"saleAmount",
|
|
1071
1077
|
]
|
|
@@ -1084,7 +1090,6 @@ class LinkSchema(BaseModel):
|
|
|
1084
1090
|
"ios",
|
|
1085
1091
|
"android",
|
|
1086
1092
|
"geo",
|
|
1087
|
-
"tagId",
|
|
1088
1093
|
"tags",
|
|
1089
1094
|
"folderId",
|
|
1090
1095
|
"comments",
|
|
@@ -1098,6 +1103,7 @@ class LinkSchema(BaseModel):
|
|
|
1098
1103
|
"testCompletedAt",
|
|
1099
1104
|
"userId",
|
|
1100
1105
|
"lastClicked",
|
|
1106
|
+
"tagId",
|
|
1101
1107
|
]
|
|
1102
1108
|
null_default_fields = []
|
|
1103
1109
|
|