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
|
|
|
@@ -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.
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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 = [
|
|
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,111 +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
|
-
CUSTOM = "custom"
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
class SaleTypedDict(TypedDict):
|
|
1219
|
-
amount: int
|
|
1220
|
-
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"""
|
|
1221
|
-
payment_processor: PaymentProcessor
|
|
1222
|
-
r"""The payment processor via which the sale was made."""
|
|
1223
|
-
invoice_id: NotRequired[Nullable[str]]
|
|
1224
|
-
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."""
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
class Sale(BaseModel):
|
|
1228
|
-
amount: int
|
|
1229
|
-
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"""
|
|
1230
|
-
|
|
1231
|
-
payment_processor: Annotated[
|
|
1232
|
-
PaymentProcessor, pydantic.Field(alias="paymentProcessor")
|
|
1233
|
-
]
|
|
1234
|
-
r"""The payment processor via which the sale was made."""
|
|
1235
|
-
|
|
1236
|
-
invoice_id: Annotated[OptionalNullable[str], pydantic.Field(alias="invoiceId")] = (
|
|
1237
|
-
None
|
|
1238
|
-
)
|
|
1239
|
-
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."""
|
|
1240
|
-
|
|
1241
|
-
@model_serializer(mode="wrap")
|
|
1242
|
-
def serialize_model(self, handler):
|
|
1243
|
-
optional_fields = ["invoiceId"]
|
|
1244
|
-
nullable_fields = ["invoiceId"]
|
|
1245
|
-
null_default_fields = ["invoiceId"]
|
|
1246
|
-
|
|
1247
|
-
serialized = handler(self)
|
|
1248
|
-
|
|
1249
|
-
m = {}
|
|
1250
|
-
|
|
1251
|
-
for n, f in type(self).model_fields.items():
|
|
1252
|
-
k = f.alias or n
|
|
1253
|
-
val = serialized.get(k)
|
|
1254
|
-
serialized.pop(k, None)
|
|
1255
|
-
|
|
1256
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
|
1257
|
-
is_set = (
|
|
1258
|
-
self.__pydantic_fields_set__.intersection({n})
|
|
1259
|
-
or k in null_default_fields
|
|
1260
|
-
) # pylint: disable=no-member
|
|
1261
|
-
|
|
1262
|
-
if val is not None and val != UNSET_SENTINEL:
|
|
1263
|
-
m[k] = val
|
|
1264
|
-
elif val != UNSET_SENTINEL and (
|
|
1265
|
-
not k in optional_fields or (optional_nullable and is_set)
|
|
1266
|
-
):
|
|
1267
|
-
m[k] = val
|
|
1268
|
-
|
|
1269
|
-
return m
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
1318
|
class SaleEventTypedDict(TypedDict):
|
|
1273
1319
|
event: SaleEventEvent
|
|
1274
1320
|
timestamp: str
|
|
1275
1321
|
event_id: str
|
|
1276
1322
|
event_name: str
|
|
1323
|
+
sale: SaleTypedDict
|
|
1277
1324
|
link: SaleEventLinkTypedDict
|
|
1278
1325
|
click: SaleEventClickTypedDict
|
|
1279
1326
|
customer: SaleEventCustomerTypedDict
|
|
1280
|
-
sale: SaleTypedDict
|
|
1281
1327
|
sale_amount: float
|
|
1282
|
-
r"""Deprecated
|
|
1328
|
+
r"""Deprecated: Use `sale.amount` instead."""
|
|
1283
1329
|
invoice_id: str
|
|
1284
|
-
r"""Deprecated
|
|
1330
|
+
r"""Deprecated: Use `sale.invoiceId` instead."""
|
|
1285
1331
|
payment_processor: str
|
|
1286
|
-
r"""Deprecated
|
|
1332
|
+
r"""Deprecated: Use `sale.paymentProcessor` instead."""
|
|
1287
1333
|
click_id: str
|
|
1288
|
-
r"""Deprecated
|
|
1334
|
+
r"""Deprecated: Use `click.id` instead."""
|
|
1289
1335
|
link_id: str
|
|
1290
|
-
r"""Deprecated
|
|
1336
|
+
r"""Deprecated: Use `link.id` instead."""
|
|
1291
1337
|
domain: str
|
|
1292
|
-
r"""Deprecated
|
|
1338
|
+
r"""Deprecated: Use `link.domain` instead."""
|
|
1293
1339
|
key: str
|
|
1294
|
-
r"""Deprecated
|
|
1340
|
+
r"""Deprecated: Use `link.key` instead."""
|
|
1295
1341
|
url: str
|
|
1296
|
-
r"""Deprecated
|
|
1342
|
+
r"""Deprecated: Use `click.url` instead."""
|
|
1297
1343
|
continent: str
|
|
1298
|
-
r"""Deprecated
|
|
1344
|
+
r"""Deprecated: Use `click.continent` instead."""
|
|
1299
1345
|
country: str
|
|
1300
|
-
r"""Deprecated
|
|
1346
|
+
r"""Deprecated: Use `click.country` instead."""
|
|
1301
1347
|
city: str
|
|
1302
|
-
r"""Deprecated
|
|
1348
|
+
r"""Deprecated: Use `click.city` instead."""
|
|
1303
1349
|
device: str
|
|
1304
|
-
r"""Deprecated
|
|
1350
|
+
r"""Deprecated: Use `click.device` instead."""
|
|
1305
1351
|
browser: str
|
|
1306
|
-
r"""Deprecated
|
|
1352
|
+
r"""Deprecated: Use `click.browser` instead."""
|
|
1307
1353
|
os: str
|
|
1308
|
-
r"""Deprecated
|
|
1354
|
+
r"""Deprecated: Use `click.os` instead."""
|
|
1309
1355
|
qr: float
|
|
1310
|
-
r"""Deprecated
|
|
1356
|
+
r"""Deprecated: Use `click.qr` instead."""
|
|
1311
1357
|
ip: str
|
|
1312
|
-
r"""Deprecated
|
|
1358
|
+
r"""Deprecated: Use `click.ip` instead."""
|
|
1359
|
+
metadata: NotRequired[Nullable[Any]]
|
|
1313
1360
|
|
|
1314
1361
|
|
|
1315
1362
|
class SaleEvent(BaseModel):
|
|
@@ -1321,14 +1368,14 @@ class SaleEvent(BaseModel):
|
|
|
1321
1368
|
|
|
1322
1369
|
event_name: Annotated[str, pydantic.Field(alias="eventName")]
|
|
1323
1370
|
|
|
1371
|
+
sale: Sale
|
|
1372
|
+
|
|
1324
1373
|
link: SaleEventLink
|
|
1325
1374
|
|
|
1326
1375
|
click: SaleEventClick
|
|
1327
1376
|
|
|
1328
1377
|
customer: SaleEventCustomer
|
|
1329
1378
|
|
|
1330
|
-
sale: Sale
|
|
1331
|
-
|
|
1332
1379
|
sale_amount: Annotated[
|
|
1333
1380
|
float,
|
|
1334
1381
|
pydantic.Field(
|
|
@@ -1336,7 +1383,7 @@ class SaleEvent(BaseModel):
|
|
|
1336
1383
|
alias="saleAmount",
|
|
1337
1384
|
),
|
|
1338
1385
|
]
|
|
1339
|
-
r"""Deprecated
|
|
1386
|
+
r"""Deprecated: Use `sale.amount` instead."""
|
|
1340
1387
|
|
|
1341
1388
|
invoice_id: Annotated[
|
|
1342
1389
|
str,
|
|
@@ -1344,10 +1391,15 @@ class SaleEvent(BaseModel):
|
|
|
1344
1391
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1345
1392
|
),
|
|
1346
1393
|
]
|
|
1347
|
-
r"""Deprecated
|
|
1394
|
+
r"""Deprecated: Use `sale.invoiceId` instead."""
|
|
1348
1395
|
|
|
1349
|
-
payment_processor:
|
|
1350
|
-
|
|
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."""
|
|
1351
1403
|
|
|
1352
1404
|
click_id: Annotated[
|
|
1353
1405
|
str,
|
|
@@ -1355,7 +1407,7 @@ class SaleEvent(BaseModel):
|
|
|
1355
1407
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1356
1408
|
),
|
|
1357
1409
|
]
|
|
1358
|
-
r"""Deprecated
|
|
1410
|
+
r"""Deprecated: Use `click.id` instead."""
|
|
1359
1411
|
|
|
1360
1412
|
link_id: Annotated[
|
|
1361
1413
|
str,
|
|
@@ -1363,7 +1415,7 @@ class SaleEvent(BaseModel):
|
|
|
1363
1415
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1364
1416
|
),
|
|
1365
1417
|
]
|
|
1366
|
-
r"""Deprecated
|
|
1418
|
+
r"""Deprecated: Use `link.id` instead."""
|
|
1367
1419
|
|
|
1368
1420
|
domain: Annotated[
|
|
1369
1421
|
str,
|
|
@@ -1371,7 +1423,7 @@ class SaleEvent(BaseModel):
|
|
|
1371
1423
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1372
1424
|
),
|
|
1373
1425
|
]
|
|
1374
|
-
r"""Deprecated
|
|
1426
|
+
r"""Deprecated: Use `link.domain` instead."""
|
|
1375
1427
|
|
|
1376
1428
|
key: Annotated[
|
|
1377
1429
|
str,
|
|
@@ -1379,7 +1431,7 @@ class SaleEvent(BaseModel):
|
|
|
1379
1431
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1380
1432
|
),
|
|
1381
1433
|
]
|
|
1382
|
-
r"""Deprecated
|
|
1434
|
+
r"""Deprecated: Use `link.key` instead."""
|
|
1383
1435
|
|
|
1384
1436
|
url: Annotated[
|
|
1385
1437
|
str,
|
|
@@ -1387,7 +1439,7 @@ class SaleEvent(BaseModel):
|
|
|
1387
1439
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1388
1440
|
),
|
|
1389
1441
|
]
|
|
1390
|
-
r"""Deprecated
|
|
1442
|
+
r"""Deprecated: Use `click.url` instead."""
|
|
1391
1443
|
|
|
1392
1444
|
continent: Annotated[
|
|
1393
1445
|
str,
|
|
@@ -1395,7 +1447,7 @@ class SaleEvent(BaseModel):
|
|
|
1395
1447
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1396
1448
|
),
|
|
1397
1449
|
]
|
|
1398
|
-
r"""Deprecated
|
|
1450
|
+
r"""Deprecated: Use `click.continent` instead."""
|
|
1399
1451
|
|
|
1400
1452
|
country: Annotated[
|
|
1401
1453
|
str,
|
|
@@ -1403,7 +1455,7 @@ class SaleEvent(BaseModel):
|
|
|
1403
1455
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1404
1456
|
),
|
|
1405
1457
|
]
|
|
1406
|
-
r"""Deprecated
|
|
1458
|
+
r"""Deprecated: Use `click.country` instead."""
|
|
1407
1459
|
|
|
1408
1460
|
city: Annotated[
|
|
1409
1461
|
str,
|
|
@@ -1411,7 +1463,7 @@ class SaleEvent(BaseModel):
|
|
|
1411
1463
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1412
1464
|
),
|
|
1413
1465
|
]
|
|
1414
|
-
r"""Deprecated
|
|
1466
|
+
r"""Deprecated: Use `click.city` instead."""
|
|
1415
1467
|
|
|
1416
1468
|
device: Annotated[
|
|
1417
1469
|
str,
|
|
@@ -1419,7 +1471,7 @@ class SaleEvent(BaseModel):
|
|
|
1419
1471
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1420
1472
|
),
|
|
1421
1473
|
]
|
|
1422
|
-
r"""Deprecated
|
|
1474
|
+
r"""Deprecated: Use `click.device` instead."""
|
|
1423
1475
|
|
|
1424
1476
|
browser: Annotated[
|
|
1425
1477
|
str,
|
|
@@ -1427,7 +1479,7 @@ class SaleEvent(BaseModel):
|
|
|
1427
1479
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1428
1480
|
),
|
|
1429
1481
|
]
|
|
1430
|
-
r"""Deprecated
|
|
1482
|
+
r"""Deprecated: Use `click.browser` instead."""
|
|
1431
1483
|
|
|
1432
1484
|
os: Annotated[
|
|
1433
1485
|
str,
|
|
@@ -1435,7 +1487,7 @@ class SaleEvent(BaseModel):
|
|
|
1435
1487
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1436
1488
|
),
|
|
1437
1489
|
]
|
|
1438
|
-
r"""Deprecated
|
|
1490
|
+
r"""Deprecated: Use `click.os` instead."""
|
|
1439
1491
|
|
|
1440
1492
|
qr: Annotated[
|
|
1441
1493
|
float,
|
|
@@ -1443,7 +1495,7 @@ class SaleEvent(BaseModel):
|
|
|
1443
1495
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1444
1496
|
),
|
|
1445
1497
|
]
|
|
1446
|
-
r"""Deprecated
|
|
1498
|
+
r"""Deprecated: Use `click.qr` instead."""
|
|
1447
1499
|
|
|
1448
1500
|
ip: Annotated[
|
|
1449
1501
|
str,
|
|
@@ -1451,4 +1503,36 @@ class SaleEvent(BaseModel):
|
|
|
1451
1503
|
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
1452
1504
|
),
|
|
1453
1505
|
]
|
|
1454
|
-
r"""Deprecated
|
|
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
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
+
from .commissioncreatedevent import (
|
|
5
|
+
CommissionCreatedEvent,
|
|
6
|
+
CommissionCreatedEventTypedDict,
|
|
7
|
+
)
|
|
4
8
|
from .leadcreatedevent import LeadCreatedEvent, LeadCreatedEventTypedDict
|
|
5
9
|
from .linkclickedevent import LinkClickedEvent, LinkClickedEventTypedDict
|
|
6
10
|
from .linkwebhookevent import LinkWebhookEvent, LinkWebhookEventTypedDict
|
|
@@ -18,6 +22,7 @@ WebhookEventTypedDict = TypeAliasType(
|
|
|
18
22
|
LeadCreatedEventTypedDict,
|
|
19
23
|
SaleCreatedEventTypedDict,
|
|
20
24
|
PartnerEnrolledEventTypedDict,
|
|
25
|
+
CommissionCreatedEventTypedDict,
|
|
21
26
|
],
|
|
22
27
|
)
|
|
23
28
|
r"""Webhook event schema"""
|
|
@@ -31,6 +36,7 @@ WebhookEvent = TypeAliasType(
|
|
|
31
36
|
LeadCreatedEvent,
|
|
32
37
|
SaleCreatedEvent,
|
|
33
38
|
PartnerEnrolledEvent,
|
|
39
|
+
CommissionCreatedEvent,
|
|
34
40
|
],
|
|
35
41
|
)
|
|
36
42
|
r"""Webhook event schema"""
|
dub/models/errors/__init__.py
CHANGED
|
@@ -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)
|