dub 0.27.2__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.
@@ -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
 
@@ -14,6 +14,71 @@ class SaleEventEvent(str, Enum):
14
14
  SALE = "sale"
15
15
 
16
16
 
17
+ class PaymentProcessor(str, Enum):
18
+ r"""The payment processor via which the sale was made."""
19
+
20
+ STRIPE = "stripe"
21
+ SHOPIFY = "shopify"
22
+ POLAR = "polar"
23
+ PADDLE = "paddle"
24
+ REVENUECAT = "revenuecat"
25
+ CUSTOM = "custom"
26
+
27
+
28
+ class SaleTypedDict(TypedDict):
29
+ amount: int
30
+ r"""The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency"""
31
+ payment_processor: PaymentProcessor
32
+ r"""The payment processor via which the sale was made."""
33
+ invoice_id: NotRequired[Nullable[str]]
34
+ r"""The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID."""
35
+
36
+
37
+ class Sale(BaseModel):
38
+ amount: int
39
+ r"""The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency"""
40
+
41
+ payment_processor: Annotated[
42
+ PaymentProcessor, pydantic.Field(alias="paymentProcessor")
43
+ ]
44
+ r"""The payment processor via which the sale was made."""
45
+
46
+ invoice_id: Annotated[OptionalNullable[str], pydantic.Field(alias="invoiceId")] = (
47
+ None
48
+ )
49
+ r"""The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID."""
50
+
51
+ @model_serializer(mode="wrap")
52
+ def serialize_model(self, handler):
53
+ optional_fields = ["invoiceId"]
54
+ nullable_fields = ["invoiceId"]
55
+ null_default_fields = ["invoiceId"]
56
+
57
+ serialized = handler(self)
58
+
59
+ m = {}
60
+
61
+ for n, f in type(self).model_fields.items():
62
+ k = f.alias or n
63
+ val = serialized.get(k)
64
+ serialized.pop(k, None)
65
+
66
+ optional_nullable = k in optional_fields and k in nullable_fields
67
+ is_set = (
68
+ self.__pydantic_fields_set__.intersection({n})
69
+ or k in null_default_fields
70
+ ) # pylint: disable=no-member
71
+
72
+ if val is not None and val != UNSET_SENTINEL:
73
+ m[k] = val
74
+ elif val != UNSET_SENTINEL and (
75
+ not k in optional_fields or (optional_nullable and is_set)
76
+ ):
77
+ m[k] = val
78
+
79
+ return m
80
+
81
+
17
82
  class SaleEventGeoTypedDict(TypedDict):
18
83
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
19
84
 
@@ -824,8 +889,6 @@ class SaleEventLinkTypedDict(TypedDict):
824
889
  geo: Nullable[SaleEventGeoTypedDict]
825
890
  r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo"""
826
891
  public_stats: bool
827
- tag_id: Nullable[str]
828
- r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
829
892
  tags: Nullable[List[TagSchemaTypedDict]]
830
893
  r"""The tags assigned to the short link."""
831
894
  folder_id: Nullable[str]
@@ -856,18 +919,22 @@ class SaleEventLinkTypedDict(TypedDict):
856
919
  last_clicked: str
857
920
  created_at: str
858
921
  updated_at: str
922
+ tag_id: Nullable[str]
923
+ r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
859
924
  project_id: str
860
- r"""The project ID of the short link. This field is deprecated – use `workspaceId` instead."""
925
+ r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
861
926
  test_variants: NotRequired[Nullable[List[SaleEventTestVariantsTypedDict]]]
862
927
  r"""An array of A/B test URLs and the percentage of traffic to send to each URL."""
863
928
  clicks: NotRequired[float]
864
929
  r"""The number of clicks on the short link."""
865
930
  leads: NotRequired[float]
866
- r"""The number of leads the short links has generated."""
931
+ r"""The number of leads the short link has generated."""
932
+ conversions: NotRequired[float]
933
+ r"""The number of leads that converted to paying customers."""
867
934
  sales: NotRequired[float]
868
- r"""The number of sales the short links has generated."""
935
+ r"""The total number of sales (includes recurring sales) generated by the short link."""
869
936
  sale_amount: NotRequired[float]
870
- r"""The total dollar amount of sales the short links has generated (in cents)."""
937
+ r"""The total dollar value of sales (in cents) generated by the short link."""
871
938
 
872
939
 
873
940
  class SaleEventLink(BaseModel):
@@ -934,15 +1001,6 @@ class SaleEventLink(BaseModel):
934
1001
 
935
1002
  public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
936
1003
 
937
- tag_id: Annotated[
938
- Nullable[str],
939
- pydantic.Field(
940
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
941
- alias="tagId",
942
- ),
943
- ]
944
- r"""The unique ID of the tag assigned to the short link. This field is deprecated – use `tags` instead."""
945
-
946
1004
  tags: Nullable[List[TagSchema]]
947
1005
  r"""The tags assigned to the short link."""
948
1006
 
@@ -991,6 +1049,15 @@ class SaleEventLink(BaseModel):
991
1049
 
992
1050
  updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
993
1051
 
1052
+ tag_id: Annotated[
1053
+ Nullable[str],
1054
+ pydantic.Field(
1055
+ deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
1056
+ alias="tagId",
1057
+ ),
1058
+ ]
1059
+ r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
1060
+
994
1061
  project_id: Annotated[
995
1062
  str,
996
1063
  pydantic.Field(
@@ -998,7 +1065,7 @@ class SaleEventLink(BaseModel):
998
1065
  alias="projectId",
999
1066
  ),
1000
1067
  ]
1001
- r"""The project ID of the short link. This field is deprecated – use `workspaceId` instead."""
1068
+ r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
1002
1069
 
1003
1070
  test_variants: Annotated[
1004
1071
  OptionalNullable[List[SaleEventTestVariants]],
@@ -1010,17 +1077,27 @@ class SaleEventLink(BaseModel):
1010
1077
  r"""The number of clicks on the short link."""
1011
1078
 
1012
1079
  leads: Optional[float] = 0
1013
- r"""The number of leads the short links has generated."""
1080
+ r"""The number of leads the short link has generated."""
1081
+
1082
+ conversions: Optional[float] = 0
1083
+ r"""The number of leads that converted to paying customers."""
1014
1084
 
1015
1085
  sales: Optional[float] = 0
1016
- r"""The number of sales the short links has generated."""
1086
+ r"""The total number of sales (includes recurring sales) generated by the short link."""
1017
1087
 
1018
1088
  sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
1019
- r"""The total dollar amount of sales the short links has generated (in cents)."""
1089
+ r"""The total dollar value of sales (in cents) generated by the short link."""
1020
1090
 
1021
1091
  @model_serializer(mode="wrap")
1022
1092
  def serialize_model(self, handler):
1023
- optional_fields = ["testVariants", "clicks", "leads", "sales", "saleAmount"]
1093
+ optional_fields = [
1094
+ "testVariants",
1095
+ "clicks",
1096
+ "leads",
1097
+ "conversions",
1098
+ "sales",
1099
+ "saleAmount",
1100
+ ]
1024
1101
  nullable_fields = [
1025
1102
  "externalId",
1026
1103
  "tenantId",
@@ -1035,7 +1112,6 @@ class SaleEventLink(BaseModel):
1035
1112
  "ios",
1036
1113
  "android",
1037
1114
  "geo",
1038
- "tagId",
1039
1115
  "tags",
1040
1116
  "folderId",
1041
1117
  "comments",
@@ -1048,6 +1124,7 @@ class SaleEventLink(BaseModel):
1048
1124
  "testStartedAt",
1049
1125
  "testCompletedAt",
1050
1126
  "userId",
1127
+ "tagId",
1051
1128
  ]
1052
1129
  null_default_fields = []
1053
1130
 
@@ -1091,6 +1168,7 @@ class SaleEventClickTypedDict(TypedDict):
1091
1168
  referer_url: str
1092
1169
  qr: bool
1093
1170
  ip: str
1171
+ trigger: NotRequired[Nullable[str]]
1094
1172
 
1095
1173
 
1096
1174
  class SaleEventClick(BaseModel):
@@ -1122,6 +1200,38 @@ class SaleEventClick(BaseModel):
1122
1200
 
1123
1201
  ip: str
1124
1202
 
1203
+ trigger: OptionalNullable[str] = UNSET
1204
+
1205
+ @model_serializer(mode="wrap")
1206
+ def serialize_model(self, handler):
1207
+ optional_fields = ["trigger"]
1208
+ nullable_fields = ["trigger"]
1209
+ null_default_fields = []
1210
+
1211
+ serialized = handler(self)
1212
+
1213
+ m = {}
1214
+
1215
+ for n, f in type(self).model_fields.items():
1216
+ k = f.alias or n
1217
+ val = serialized.get(k)
1218
+ serialized.pop(k, None)
1219
+
1220
+ optional_nullable = k in optional_fields and k in nullable_fields
1221
+ is_set = (
1222
+ self.__pydantic_fields_set__.intersection({n})
1223
+ or k in null_default_fields
1224
+ ) # pylint: disable=no-member
1225
+
1226
+ if val is not None and val != UNSET_SENTINEL:
1227
+ m[k] = val
1228
+ elif val != UNSET_SENTINEL and (
1229
+ not k in optional_fields or (optional_nullable and is_set)
1230
+ ):
1231
+ m[k] = val
1232
+
1233
+ return m
1234
+
1125
1235
 
1126
1236
  class SaleEventCustomerTypedDict(TypedDict):
1127
1237
  id: str
@@ -1205,112 +1315,48 @@ class SaleEventCustomer(BaseModel):
1205
1315
  return m
1206
1316
 
1207
1317
 
1208
- class PaymentProcessor(str, Enum):
1209
- r"""The payment processor via which the sale was made."""
1210
-
1211
- STRIPE = "stripe"
1212
- SHOPIFY = "shopify"
1213
- POLAR = "polar"
1214
- PADDLE = "paddle"
1215
- REVENUECAT = "revenuecat"
1216
- CUSTOM = "custom"
1217
-
1218
-
1219
- class SaleTypedDict(TypedDict):
1220
- amount: int
1221
- r"""The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency"""
1222
- payment_processor: PaymentProcessor
1223
- r"""The payment processor via which the sale was made."""
1224
- invoice_id: NotRequired[Nullable[str]]
1225
- r"""The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID."""
1226
-
1227
-
1228
- class Sale(BaseModel):
1229
- amount: int
1230
- r"""The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency"""
1231
-
1232
- payment_processor: Annotated[
1233
- PaymentProcessor, pydantic.Field(alias="paymentProcessor")
1234
- ]
1235
- r"""The payment processor via which the sale was made."""
1236
-
1237
- invoice_id: Annotated[OptionalNullable[str], pydantic.Field(alias="invoiceId")] = (
1238
- None
1239
- )
1240
- r"""The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID."""
1241
-
1242
- @model_serializer(mode="wrap")
1243
- def serialize_model(self, handler):
1244
- optional_fields = ["invoiceId"]
1245
- nullable_fields = ["invoiceId"]
1246
- null_default_fields = ["invoiceId"]
1247
-
1248
- serialized = handler(self)
1249
-
1250
- m = {}
1251
-
1252
- for n, f in type(self).model_fields.items():
1253
- k = f.alias or n
1254
- val = serialized.get(k)
1255
- serialized.pop(k, None)
1256
-
1257
- optional_nullable = k in optional_fields and k in nullable_fields
1258
- is_set = (
1259
- self.__pydantic_fields_set__.intersection({n})
1260
- or k in null_default_fields
1261
- ) # pylint: disable=no-member
1262
-
1263
- if val is not None and val != UNSET_SENTINEL:
1264
- m[k] = val
1265
- elif val != UNSET_SENTINEL and (
1266
- not k in optional_fields or (optional_nullable and is_set)
1267
- ):
1268
- m[k] = val
1269
-
1270
- return m
1271
-
1272
-
1273
1318
  class SaleEventTypedDict(TypedDict):
1274
1319
  event: SaleEventEvent
1275
1320
  timestamp: str
1276
1321
  event_id: str
1277
1322
  event_name: str
1323
+ sale: SaleTypedDict
1278
1324
  link: SaleEventLinkTypedDict
1279
1325
  click: SaleEventClickTypedDict
1280
1326
  customer: SaleEventCustomerTypedDict
1281
- sale: SaleTypedDict
1282
1327
  sale_amount: float
1283
- r"""Deprecated. Use `sale.amount` instead."""
1328
+ r"""Deprecated: Use `sale.amount` instead."""
1284
1329
  invoice_id: str
1285
- r"""Deprecated. Use `sale.invoiceId` instead."""
1330
+ r"""Deprecated: Use `sale.invoiceId` instead."""
1286
1331
  payment_processor: str
1287
- r"""Deprecated. Use `sale.paymentProcessor` instead."""
1332
+ r"""Deprecated: Use `sale.paymentProcessor` instead."""
1288
1333
  click_id: str
1289
- r"""Deprecated. Use `click.id` instead."""
1334
+ r"""Deprecated: Use `click.id` instead."""
1290
1335
  link_id: str
1291
- r"""Deprecated. Use `link.id` instead."""
1336
+ r"""Deprecated: Use `link.id` instead."""
1292
1337
  domain: str
1293
- r"""Deprecated. Use `link.domain` instead."""
1338
+ r"""Deprecated: Use `link.domain` instead."""
1294
1339
  key: str
1295
- r"""Deprecated. Use `link.key` instead."""
1340
+ r"""Deprecated: Use `link.key` instead."""
1296
1341
  url: str
1297
- r"""Deprecated. Use `click.url` instead."""
1342
+ r"""Deprecated: Use `click.url` instead."""
1298
1343
  continent: str
1299
- r"""Deprecated. Use `click.continent` instead."""
1344
+ r"""Deprecated: Use `click.continent` instead."""
1300
1345
  country: str
1301
- r"""Deprecated. Use `click.country` instead."""
1346
+ r"""Deprecated: Use `click.country` instead."""
1302
1347
  city: str
1303
- r"""Deprecated. Use `click.city` instead."""
1348
+ r"""Deprecated: Use `click.city` instead."""
1304
1349
  device: str
1305
- r"""Deprecated. Use `click.device` instead."""
1350
+ r"""Deprecated: Use `click.device` instead."""
1306
1351
  browser: str
1307
- r"""Deprecated. Use `click.browser` instead."""
1352
+ r"""Deprecated: Use `click.browser` instead."""
1308
1353
  os: str
1309
- r"""Deprecated. Use `click.os` instead."""
1354
+ r"""Deprecated: Use `click.os` instead."""
1310
1355
  qr: float
1311
- r"""Deprecated. Use `click.qr` instead."""
1356
+ r"""Deprecated: Use `click.qr` instead."""
1312
1357
  ip: str
1313
- r"""Deprecated. Use `click.ip` instead."""
1358
+ r"""Deprecated: Use `click.ip` instead."""
1359
+ metadata: NotRequired[Nullable[Any]]
1314
1360
 
1315
1361
 
1316
1362
  class SaleEvent(BaseModel):
@@ -1322,14 +1368,14 @@ class SaleEvent(BaseModel):
1322
1368
 
1323
1369
  event_name: Annotated[str, pydantic.Field(alias="eventName")]
1324
1370
 
1371
+ sale: Sale
1372
+
1325
1373
  link: SaleEventLink
1326
1374
 
1327
1375
  click: SaleEventClick
1328
1376
 
1329
1377
  customer: SaleEventCustomer
1330
1378
 
1331
- sale: Sale
1332
-
1333
1379
  sale_amount: Annotated[
1334
1380
  float,
1335
1381
  pydantic.Field(
@@ -1337,7 +1383,7 @@ class SaleEvent(BaseModel):
1337
1383
  alias="saleAmount",
1338
1384
  ),
1339
1385
  ]
1340
- r"""Deprecated. Use `sale.amount` instead."""
1386
+ r"""Deprecated: Use `sale.amount` instead."""
1341
1387
 
1342
1388
  invoice_id: Annotated[
1343
1389
  str,
@@ -1345,10 +1391,15 @@ class SaleEvent(BaseModel):
1345
1391
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1346
1392
  ),
1347
1393
  ]
1348
- r"""Deprecated. Use `sale.invoiceId` instead."""
1394
+ r"""Deprecated: Use `sale.invoiceId` instead."""
1349
1395
 
1350
- payment_processor: str
1351
- r"""Deprecated. Use `sale.paymentProcessor` instead."""
1396
+ payment_processor: Annotated[
1397
+ str,
1398
+ pydantic.Field(
1399
+ deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1400
+ ),
1401
+ ]
1402
+ r"""Deprecated: Use `sale.paymentProcessor` instead."""
1352
1403
 
1353
1404
  click_id: Annotated[
1354
1405
  str,
@@ -1356,7 +1407,7 @@ class SaleEvent(BaseModel):
1356
1407
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1357
1408
  ),
1358
1409
  ]
1359
- r"""Deprecated. Use `click.id` instead."""
1410
+ r"""Deprecated: Use `click.id` instead."""
1360
1411
 
1361
1412
  link_id: Annotated[
1362
1413
  str,
@@ -1364,7 +1415,7 @@ class SaleEvent(BaseModel):
1364
1415
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1365
1416
  ),
1366
1417
  ]
1367
- r"""Deprecated. Use `link.id` instead."""
1418
+ r"""Deprecated: Use `link.id` instead."""
1368
1419
 
1369
1420
  domain: Annotated[
1370
1421
  str,
@@ -1372,7 +1423,7 @@ class SaleEvent(BaseModel):
1372
1423
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1373
1424
  ),
1374
1425
  ]
1375
- r"""Deprecated. Use `link.domain` instead."""
1426
+ r"""Deprecated: Use `link.domain` instead."""
1376
1427
 
1377
1428
  key: Annotated[
1378
1429
  str,
@@ -1380,7 +1431,7 @@ class SaleEvent(BaseModel):
1380
1431
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1381
1432
  ),
1382
1433
  ]
1383
- r"""Deprecated. Use `link.key` instead."""
1434
+ r"""Deprecated: Use `link.key` instead."""
1384
1435
 
1385
1436
  url: Annotated[
1386
1437
  str,
@@ -1388,7 +1439,7 @@ class SaleEvent(BaseModel):
1388
1439
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1389
1440
  ),
1390
1441
  ]
1391
- r"""Deprecated. Use `click.url` instead."""
1442
+ r"""Deprecated: Use `click.url` instead."""
1392
1443
 
1393
1444
  continent: Annotated[
1394
1445
  str,
@@ -1396,7 +1447,7 @@ class SaleEvent(BaseModel):
1396
1447
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1397
1448
  ),
1398
1449
  ]
1399
- r"""Deprecated. Use `click.continent` instead."""
1450
+ r"""Deprecated: Use `click.continent` instead."""
1400
1451
 
1401
1452
  country: Annotated[
1402
1453
  str,
@@ -1404,7 +1455,7 @@ class SaleEvent(BaseModel):
1404
1455
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1405
1456
  ),
1406
1457
  ]
1407
- r"""Deprecated. Use `click.country` instead."""
1458
+ r"""Deprecated: Use `click.country` instead."""
1408
1459
 
1409
1460
  city: Annotated[
1410
1461
  str,
@@ -1412,7 +1463,7 @@ class SaleEvent(BaseModel):
1412
1463
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1413
1464
  ),
1414
1465
  ]
1415
- r"""Deprecated. Use `click.city` instead."""
1466
+ r"""Deprecated: Use `click.city` instead."""
1416
1467
 
1417
1468
  device: Annotated[
1418
1469
  str,
@@ -1420,7 +1471,7 @@ class SaleEvent(BaseModel):
1420
1471
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1421
1472
  ),
1422
1473
  ]
1423
- r"""Deprecated. Use `click.device` instead."""
1474
+ r"""Deprecated: Use `click.device` instead."""
1424
1475
 
1425
1476
  browser: Annotated[
1426
1477
  str,
@@ -1428,7 +1479,7 @@ class SaleEvent(BaseModel):
1428
1479
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1429
1480
  ),
1430
1481
  ]
1431
- r"""Deprecated. Use `click.browser` instead."""
1482
+ r"""Deprecated: Use `click.browser` instead."""
1432
1483
 
1433
1484
  os: Annotated[
1434
1485
  str,
@@ -1436,7 +1487,7 @@ class SaleEvent(BaseModel):
1436
1487
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1437
1488
  ),
1438
1489
  ]
1439
- r"""Deprecated. Use `click.os` instead."""
1490
+ r"""Deprecated: Use `click.os` instead."""
1440
1491
 
1441
1492
  qr: Annotated[
1442
1493
  float,
@@ -1444,7 +1495,7 @@ class SaleEvent(BaseModel):
1444
1495
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1445
1496
  ),
1446
1497
  ]
1447
- r"""Deprecated. Use `click.qr` instead."""
1498
+ r"""Deprecated: Use `click.qr` instead."""
1448
1499
 
1449
1500
  ip: Annotated[
1450
1501
  str,
@@ -1452,4 +1503,36 @@ class SaleEvent(BaseModel):
1452
1503
  deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
1453
1504
  ),
1454
1505
  ]
1455
- r"""Deprecated. Use `click.ip` instead."""
1506
+ r"""Deprecated: Use `click.ip` instead."""
1507
+
1508
+ metadata: OptionalNullable[Any] = UNSET
1509
+
1510
+ @model_serializer(mode="wrap")
1511
+ def serialize_model(self, handler):
1512
+ optional_fields = ["metadata"]
1513
+ nullable_fields = ["metadata"]
1514
+ null_default_fields = []
1515
+
1516
+ serialized = handler(self)
1517
+
1518
+ m = {}
1519
+
1520
+ for n, f in type(self).model_fields.items():
1521
+ k = f.alias or n
1522
+ val = serialized.get(k)
1523
+ serialized.pop(k, None)
1524
+
1525
+ optional_nullable = k in optional_fields and k in nullable_fields
1526
+ is_set = (
1527
+ self.__pydantic_fields_set__.intersection({n})
1528
+ or k in null_default_fields
1529
+ ) # pylint: disable=no-member
1530
+
1531
+ if val is not None and val != UNSET_SENTINEL:
1532
+ m[k] = val
1533
+ elif val != UNSET_SENTINEL and (
1534
+ not k in optional_fields or (optional_nullable and is_set)
1535
+ ):
1536
+ m[k] = val
1537
+
1538
+ return m
@@ -2,6 +2,7 @@
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
  from importlib import import_module
5
+ import builtins
5
6
 
6
7
  if TYPE_CHECKING:
7
8
  from .badrequest import BadRequest, BadRequestData, Code, Error, ErrorTypedDict
@@ -193,5 +194,5 @@ def __getattr__(attr_name: str) -> object:
193
194
 
194
195
 
195
196
  def __dir__():
196
- lazy_attrs = list(_dynamic_imports.keys())
197
- return sorted(lazy_attrs)
197
+ lazy_attrs = builtins.list(_dynamic_imports.keys())
198
+ return builtins.sorted(lazy_attrs)
@@ -2,6 +2,7 @@
2
2
 
3
3
  from typing import TYPE_CHECKING
4
4
  from importlib import import_module
5
+ import builtins
5
6
 
6
7
  if TYPE_CHECKING:
7
8
  from .bulkcreatelinks import (
@@ -1121,5 +1122,5 @@ def __getattr__(attr_name: str) -> object:
1121
1122
 
1122
1123
 
1123
1124
  def __dir__():
1124
- lazy_attrs = list(_dynamic_imports.keys())
1125
- return sorted(lazy_attrs)
1125
+ lazy_attrs = builtins.list(_dynamic_imports.keys())
1126
+ return builtins.sorted(lazy_attrs)