dub 0.32.0__py3-none-any.whl → 0.34.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 +6 -4
- dub/basesdk.py +6 -0
- dub/commissions.py +12 -8
- dub/customers.py +24 -313
- dub/domains.py +34 -26
- dub/embed_tokens.py +6 -4
- dub/events.py +6 -4
- dub/folders.py +24 -20
- dub/links.py +58 -54
- dub/models/components/__init__.py +81 -149
- dub/models/components/analyticstopurls.py +2 -2
- dub/models/components/leadcreatedevent.py +15 -14
- dub/models/components/linkclickedevent.py +19 -18
- dub/models/components/linkerrorschema.py +12 -12
- dub/models/components/linkschema.py +9 -3
- dub/models/components/linktagschema.py +3 -3
- dub/models/components/linktagschemaoutput.py +38 -0
- dub/models/components/linkwebhookevent.py +15 -16
- dub/models/components/partnerapplicationsubmittedevent.py +269 -0
- dub/models/components/partnerenrolledevent.py +68 -8
- dub/models/components/salecreatedevent.py +15 -14
- dub/models/components/webhookevent.py +6 -0
- dub/models/components/workspaceschema.py +6 -0
- dub/models/operations/__init__.py +147 -57
- dub/models/operations/banpartner.py +83 -0
- dub/models/operations/createpartner.py +68 -59
- dub/models/operations/createpartnerlink.py +0 -51
- dub/models/operations/createreferralsembedtoken.py +0 -51
- dub/models/operations/getcustomers.py +18 -0
- dub/models/operations/getlinkinfo.py +0 -2
- dub/models/operations/getlinks.py +2 -2
- dub/models/operations/getlinkscount.py +2 -2
- dub/models/operations/getqrcode.py +1 -1
- dub/models/operations/listcommissions.py +13 -2
- dub/models/operations/listdomains.py +1 -1
- dub/models/operations/listevents.py +2026 -21
- dub/models/operations/listpartners.py +75 -8
- dub/models/operations/retrieveanalytics.py +28 -5
- dub/models/operations/retrievelinks.py +44 -9
- dub/models/operations/retrievepartneranalytics.py +51 -11
- dub/models/operations/tracklead.py +4 -4
- dub/models/operations/updatecommission.py +7 -2
- dub/models/operations/updatecustomer.py +23 -11
- dub/models/operations/updatelink.py +0 -2
- dub/models/operations/updateworkspace.py +3 -3
- dub/models/operations/upsertpartnerlink.py +0 -51
- dub/partners.py +316 -24
- dub/qr_codes.py +4 -2
- dub/tags.py +24 -20
- dub/track.py +12 -16
- dub/types/basemodel.py +41 -3
- dub/utils/__init__.py +0 -3
- dub/utils/enums.py +60 -0
- dub/utils/forms.py +21 -10
- dub/utils/queryparams.py +14 -2
- dub/utils/requestbodies.py +3 -3
- dub/utils/retries.py +69 -5
- dub/utils/serializers.py +0 -20
- dub/utils/unmarshal_json_response.py +15 -1
- dub/workspaces.py +12 -16
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/METADATA +15 -33
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/RECORD +65 -67
- dub/models/components/clickevent.py +0 -556
- dub/models/components/continentcode.py +0 -16
- dub/models/components/leadevent.py +0 -680
- dub/models/components/saleevent.py +0 -779
- dub/models/operations/createcustomer.py +0 -382
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/WHEEL +0 -0
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from .linktagschema import LinkTagSchema, LinkTagSchemaTypedDict
|
|
5
|
-
from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
6
|
-
from enum import Enum
|
|
7
|
-
import pydantic
|
|
8
|
-
from pydantic import model_serializer
|
|
9
|
-
from typing import Dict, List, Optional
|
|
10
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class Event(str, Enum):
|
|
14
|
-
CLICK = "click"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class ClickTypedDict(TypedDict):
|
|
18
|
-
id: str
|
|
19
|
-
timestamp: str
|
|
20
|
-
url: str
|
|
21
|
-
country: str
|
|
22
|
-
city: str
|
|
23
|
-
region: str
|
|
24
|
-
continent: str
|
|
25
|
-
device: str
|
|
26
|
-
browser: str
|
|
27
|
-
os: str
|
|
28
|
-
referer: str
|
|
29
|
-
referer_url: str
|
|
30
|
-
qr: bool
|
|
31
|
-
ip: str
|
|
32
|
-
trigger: NotRequired[Nullable[str]]
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class Click(BaseModel):
|
|
36
|
-
id: str
|
|
37
|
-
|
|
38
|
-
timestamp: str
|
|
39
|
-
|
|
40
|
-
url: str
|
|
41
|
-
|
|
42
|
-
country: str
|
|
43
|
-
|
|
44
|
-
city: str
|
|
45
|
-
|
|
46
|
-
region: str
|
|
47
|
-
|
|
48
|
-
continent: str
|
|
49
|
-
|
|
50
|
-
device: str
|
|
51
|
-
|
|
52
|
-
browser: str
|
|
53
|
-
|
|
54
|
-
os: str
|
|
55
|
-
|
|
56
|
-
referer: str
|
|
57
|
-
|
|
58
|
-
referer_url: Annotated[str, pydantic.Field(alias="refererUrl")]
|
|
59
|
-
|
|
60
|
-
qr: bool
|
|
61
|
-
|
|
62
|
-
ip: str
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
class ClickEventTestVariantsTypedDict(TypedDict):
|
|
98
|
-
url: str
|
|
99
|
-
percentage: float
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
class ClickEventTestVariants(BaseModel):
|
|
103
|
-
url: str
|
|
104
|
-
|
|
105
|
-
percentage: float
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class LinkTypedDict(TypedDict):
|
|
109
|
-
id: str
|
|
110
|
-
r"""The unique ID of the short link."""
|
|
111
|
-
domain: str
|
|
112
|
-
r"""The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
|
|
113
|
-
key: str
|
|
114
|
-
r"""The short link slug. If not provided, a random 7-character slug will be generated."""
|
|
115
|
-
url: str
|
|
116
|
-
track_conversion: bool
|
|
117
|
-
external_id: Nullable[str]
|
|
118
|
-
r"""The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace."""
|
|
119
|
-
tenant_id: Nullable[str]
|
|
120
|
-
r"""The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."""
|
|
121
|
-
program_id: Nullable[str]
|
|
122
|
-
r"""The ID of the program the short link is associated with."""
|
|
123
|
-
partner_id: Nullable[str]
|
|
124
|
-
r"""The ID of the partner the short link is associated with."""
|
|
125
|
-
archived: bool
|
|
126
|
-
expires_at: str
|
|
127
|
-
expired_url: Nullable[str]
|
|
128
|
-
password: Nullable[str]
|
|
129
|
-
r"""The password required to access the destination URL of the short link."""
|
|
130
|
-
proxy: bool
|
|
131
|
-
title: Nullable[str]
|
|
132
|
-
r"""The title of the short link. Will be used for Custom Link Previews if `proxy` is true."""
|
|
133
|
-
description: Nullable[str]
|
|
134
|
-
r"""The description of the short link. Will be used for Custom Link Previews if `proxy` is true."""
|
|
135
|
-
image: Nullable[str]
|
|
136
|
-
r"""The image of the short link. Will be used for Custom Link Previews if `proxy` is true."""
|
|
137
|
-
video: Nullable[str]
|
|
138
|
-
r"""The custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og"""
|
|
139
|
-
rewrite: bool
|
|
140
|
-
do_index: bool
|
|
141
|
-
ios: Nullable[str]
|
|
142
|
-
r"""The iOS destination URL for the short link for iOS device targeting."""
|
|
143
|
-
android: Nullable[str]
|
|
144
|
-
r"""The Android destination URL for the short link for Android device targeting."""
|
|
145
|
-
geo: Nullable[Dict[str, str]]
|
|
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
|
-
public_stats: bool
|
|
148
|
-
tags: Nullable[List[LinkTagSchemaTypedDict]]
|
|
149
|
-
r"""The tags assigned to the short link."""
|
|
150
|
-
folder_id: Nullable[str]
|
|
151
|
-
r"""The unique ID of the folder assigned to the short link."""
|
|
152
|
-
webhook_ids: List[str]
|
|
153
|
-
r"""The IDs of the webhooks that the short link is associated with."""
|
|
154
|
-
comments: Nullable[str]
|
|
155
|
-
r"""The comments for the short link."""
|
|
156
|
-
short_link: str
|
|
157
|
-
r"""The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."""
|
|
158
|
-
qr_code: str
|
|
159
|
-
r"""The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`)."""
|
|
160
|
-
utm_source: Nullable[str]
|
|
161
|
-
r"""The UTM source of the short link."""
|
|
162
|
-
utm_medium: Nullable[str]
|
|
163
|
-
r"""The UTM medium of the short link."""
|
|
164
|
-
utm_campaign: Nullable[str]
|
|
165
|
-
r"""The UTM campaign of the short link."""
|
|
166
|
-
utm_term: Nullable[str]
|
|
167
|
-
r"""The UTM term of the short link."""
|
|
168
|
-
utm_content: Nullable[str]
|
|
169
|
-
r"""The UTM content of the short link."""
|
|
170
|
-
test_started_at: Nullable[str]
|
|
171
|
-
test_completed_at: Nullable[str]
|
|
172
|
-
user_id: Nullable[str]
|
|
173
|
-
workspace_id: str
|
|
174
|
-
r"""The workspace ID of the short link."""
|
|
175
|
-
last_clicked: str
|
|
176
|
-
created_at: str
|
|
177
|
-
updated_at: str
|
|
178
|
-
tag_id: Nullable[str]
|
|
179
|
-
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
180
|
-
project_id: str
|
|
181
|
-
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
182
|
-
test_variants: NotRequired[Nullable[List[ClickEventTestVariantsTypedDict]]]
|
|
183
|
-
r"""An array of A/B test URLs and the percentage of traffic to send to each URL."""
|
|
184
|
-
clicks: NotRequired[float]
|
|
185
|
-
r"""The number of clicks on the short link."""
|
|
186
|
-
leads: NotRequired[float]
|
|
187
|
-
r"""The number of leads the short link has generated."""
|
|
188
|
-
conversions: NotRequired[float]
|
|
189
|
-
r"""The number of leads that converted to paying customers."""
|
|
190
|
-
sales: NotRequired[float]
|
|
191
|
-
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
192
|
-
sale_amount: NotRequired[float]
|
|
193
|
-
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
class Link(BaseModel):
|
|
197
|
-
id: str
|
|
198
|
-
r"""The unique ID of the short link."""
|
|
199
|
-
|
|
200
|
-
domain: str
|
|
201
|
-
r"""The domain of the short link. If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains)."""
|
|
202
|
-
|
|
203
|
-
key: str
|
|
204
|
-
r"""The short link slug. If not provided, a random 7-character slug will be generated."""
|
|
205
|
-
|
|
206
|
-
url: str
|
|
207
|
-
|
|
208
|
-
track_conversion: Annotated[bool, pydantic.Field(alias="trackConversion")]
|
|
209
|
-
|
|
210
|
-
external_id: Annotated[Nullable[str], pydantic.Field(alias="externalId")]
|
|
211
|
-
r"""The ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace."""
|
|
212
|
-
|
|
213
|
-
tenant_id: Annotated[Nullable[str], pydantic.Field(alias="tenantId")]
|
|
214
|
-
r"""The ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant."""
|
|
215
|
-
|
|
216
|
-
program_id: Annotated[Nullable[str], pydantic.Field(alias="programId")]
|
|
217
|
-
r"""The ID of the program the short link is associated with."""
|
|
218
|
-
|
|
219
|
-
partner_id: Annotated[Nullable[str], pydantic.Field(alias="partnerId")]
|
|
220
|
-
r"""The ID of the partner the short link is associated with."""
|
|
221
|
-
|
|
222
|
-
archived: bool
|
|
223
|
-
|
|
224
|
-
expires_at: Annotated[str, pydantic.Field(alias="expiresAt")]
|
|
225
|
-
|
|
226
|
-
expired_url: Annotated[Nullable[str], pydantic.Field(alias="expiredUrl")]
|
|
227
|
-
|
|
228
|
-
password: Nullable[str]
|
|
229
|
-
r"""The password required to access the destination URL of the short link."""
|
|
230
|
-
|
|
231
|
-
proxy: bool
|
|
232
|
-
|
|
233
|
-
title: Nullable[str]
|
|
234
|
-
r"""The title of the short link. Will be used for Custom Link Previews if `proxy` is true."""
|
|
235
|
-
|
|
236
|
-
description: Nullable[str]
|
|
237
|
-
r"""The description of the short link. Will be used for Custom Link Previews if `proxy` is true."""
|
|
238
|
-
|
|
239
|
-
image: Nullable[str]
|
|
240
|
-
r"""The image of the short link. Will be used for Custom Link Previews if `proxy` is true."""
|
|
241
|
-
|
|
242
|
-
video: Nullable[str]
|
|
243
|
-
r"""The custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og"""
|
|
244
|
-
|
|
245
|
-
rewrite: bool
|
|
246
|
-
|
|
247
|
-
do_index: Annotated[bool, pydantic.Field(alias="doIndex")]
|
|
248
|
-
|
|
249
|
-
ios: Nullable[str]
|
|
250
|
-
r"""The iOS destination URL for the short link for iOS device targeting."""
|
|
251
|
-
|
|
252
|
-
android: Nullable[str]
|
|
253
|
-
r"""The Android destination URL for the short link for Android device targeting."""
|
|
254
|
-
|
|
255
|
-
geo: Nullable[Dict[str, str]]
|
|
256
|
-
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
|
|
257
|
-
|
|
258
|
-
public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
|
|
259
|
-
|
|
260
|
-
tags: Nullable[List[LinkTagSchema]]
|
|
261
|
-
r"""The tags assigned to the short link."""
|
|
262
|
-
|
|
263
|
-
folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
|
|
264
|
-
r"""The unique ID of the folder assigned to the short link."""
|
|
265
|
-
|
|
266
|
-
webhook_ids: Annotated[List[str], pydantic.Field(alias="webhookIds")]
|
|
267
|
-
r"""The IDs of the webhooks that the short link is associated with."""
|
|
268
|
-
|
|
269
|
-
comments: Nullable[str]
|
|
270
|
-
r"""The comments for the short link."""
|
|
271
|
-
|
|
272
|
-
short_link: Annotated[str, pydantic.Field(alias="shortLink")]
|
|
273
|
-
r"""The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."""
|
|
274
|
-
|
|
275
|
-
qr_code: Annotated[str, pydantic.Field(alias="qrCode")]
|
|
276
|
-
r"""The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`)."""
|
|
277
|
-
|
|
278
|
-
utm_source: Nullable[str]
|
|
279
|
-
r"""The UTM source of the short link."""
|
|
280
|
-
|
|
281
|
-
utm_medium: Nullable[str]
|
|
282
|
-
r"""The UTM medium of the short link."""
|
|
283
|
-
|
|
284
|
-
utm_campaign: Nullable[str]
|
|
285
|
-
r"""The UTM campaign of the short link."""
|
|
286
|
-
|
|
287
|
-
utm_term: Nullable[str]
|
|
288
|
-
r"""The UTM term of the short link."""
|
|
289
|
-
|
|
290
|
-
utm_content: Nullable[str]
|
|
291
|
-
r"""The UTM content of the short link."""
|
|
292
|
-
|
|
293
|
-
test_started_at: Annotated[Nullable[str], pydantic.Field(alias="testStartedAt")]
|
|
294
|
-
|
|
295
|
-
test_completed_at: Annotated[Nullable[str], pydantic.Field(alias="testCompletedAt")]
|
|
296
|
-
|
|
297
|
-
user_id: Annotated[Nullable[str], pydantic.Field(alias="userId")]
|
|
298
|
-
|
|
299
|
-
workspace_id: Annotated[str, pydantic.Field(alias="workspaceId")]
|
|
300
|
-
r"""The workspace ID of the short link."""
|
|
301
|
-
|
|
302
|
-
last_clicked: Annotated[str, pydantic.Field(alias="lastClicked")]
|
|
303
|
-
|
|
304
|
-
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
305
|
-
|
|
306
|
-
updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
|
|
307
|
-
|
|
308
|
-
tag_id: Annotated[
|
|
309
|
-
Nullable[str],
|
|
310
|
-
pydantic.Field(
|
|
311
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
312
|
-
alias="tagId",
|
|
313
|
-
),
|
|
314
|
-
]
|
|
315
|
-
r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
|
|
316
|
-
|
|
317
|
-
project_id: Annotated[
|
|
318
|
-
str,
|
|
319
|
-
pydantic.Field(
|
|
320
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
|
|
321
|
-
alias="projectId",
|
|
322
|
-
),
|
|
323
|
-
]
|
|
324
|
-
r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
|
|
325
|
-
|
|
326
|
-
test_variants: Annotated[
|
|
327
|
-
OptionalNullable[List[ClickEventTestVariants]],
|
|
328
|
-
pydantic.Field(alias="testVariants"),
|
|
329
|
-
] = UNSET
|
|
330
|
-
r"""An array of A/B test URLs and the percentage of traffic to send to each URL."""
|
|
331
|
-
|
|
332
|
-
clicks: Optional[float] = 0
|
|
333
|
-
r"""The number of clicks on the short link."""
|
|
334
|
-
|
|
335
|
-
leads: Optional[float] = 0
|
|
336
|
-
r"""The number of leads the short link has generated."""
|
|
337
|
-
|
|
338
|
-
conversions: Optional[float] = 0
|
|
339
|
-
r"""The number of leads that converted to paying customers."""
|
|
340
|
-
|
|
341
|
-
sales: Optional[float] = 0
|
|
342
|
-
r"""The total number of sales (includes recurring sales) generated by the short link."""
|
|
343
|
-
|
|
344
|
-
sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
|
|
345
|
-
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
346
|
-
|
|
347
|
-
@model_serializer(mode="wrap")
|
|
348
|
-
def serialize_model(self, handler):
|
|
349
|
-
optional_fields = [
|
|
350
|
-
"testVariants",
|
|
351
|
-
"clicks",
|
|
352
|
-
"leads",
|
|
353
|
-
"conversions",
|
|
354
|
-
"sales",
|
|
355
|
-
"saleAmount",
|
|
356
|
-
]
|
|
357
|
-
nullable_fields = [
|
|
358
|
-
"externalId",
|
|
359
|
-
"tenantId",
|
|
360
|
-
"programId",
|
|
361
|
-
"partnerId",
|
|
362
|
-
"expiredUrl",
|
|
363
|
-
"password",
|
|
364
|
-
"title",
|
|
365
|
-
"description",
|
|
366
|
-
"image",
|
|
367
|
-
"video",
|
|
368
|
-
"ios",
|
|
369
|
-
"android",
|
|
370
|
-
"geo",
|
|
371
|
-
"tags",
|
|
372
|
-
"folderId",
|
|
373
|
-
"comments",
|
|
374
|
-
"utm_source",
|
|
375
|
-
"utm_medium",
|
|
376
|
-
"utm_campaign",
|
|
377
|
-
"utm_term",
|
|
378
|
-
"utm_content",
|
|
379
|
-
"testVariants",
|
|
380
|
-
"testStartedAt",
|
|
381
|
-
"testCompletedAt",
|
|
382
|
-
"userId",
|
|
383
|
-
"tagId",
|
|
384
|
-
]
|
|
385
|
-
null_default_fields = []
|
|
386
|
-
|
|
387
|
-
serialized = handler(self)
|
|
388
|
-
|
|
389
|
-
m = {}
|
|
390
|
-
|
|
391
|
-
for n, f in type(self).model_fields.items():
|
|
392
|
-
k = f.alias or n
|
|
393
|
-
val = serialized.get(k)
|
|
394
|
-
serialized.pop(k, None)
|
|
395
|
-
|
|
396
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
|
397
|
-
is_set = (
|
|
398
|
-
self.__pydantic_fields_set__.intersection({n})
|
|
399
|
-
or k in null_default_fields
|
|
400
|
-
) # pylint: disable=no-member
|
|
401
|
-
|
|
402
|
-
if val is not None and val != UNSET_SENTINEL:
|
|
403
|
-
m[k] = val
|
|
404
|
-
elif val != UNSET_SENTINEL and (
|
|
405
|
-
not k in optional_fields or (optional_nullable and is_set)
|
|
406
|
-
):
|
|
407
|
-
m[k] = val
|
|
408
|
-
|
|
409
|
-
return m
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
class ClickEventTypedDict(TypedDict):
|
|
413
|
-
event: Event
|
|
414
|
-
timestamp: str
|
|
415
|
-
click: ClickTypedDict
|
|
416
|
-
link: LinkTypedDict
|
|
417
|
-
click_id: str
|
|
418
|
-
r"""Deprecated: Use `click.id` instead."""
|
|
419
|
-
link_id: str
|
|
420
|
-
r"""Deprecated: Use `link.id` instead."""
|
|
421
|
-
domain: str
|
|
422
|
-
r"""Deprecated: Use `link.domain` instead."""
|
|
423
|
-
key: str
|
|
424
|
-
r"""Deprecated: Use `link.key` instead."""
|
|
425
|
-
url: str
|
|
426
|
-
r"""Deprecated: Use `click.url` instead."""
|
|
427
|
-
continent: str
|
|
428
|
-
r"""Deprecated: Use `click.continent` instead."""
|
|
429
|
-
country: str
|
|
430
|
-
r"""Deprecated: Use `click.country` instead."""
|
|
431
|
-
city: str
|
|
432
|
-
r"""Deprecated: Use `click.city` instead."""
|
|
433
|
-
device: str
|
|
434
|
-
r"""Deprecated: Use `click.device` instead."""
|
|
435
|
-
browser: str
|
|
436
|
-
r"""Deprecated: Use `click.browser` instead."""
|
|
437
|
-
os: str
|
|
438
|
-
r"""Deprecated: Use `click.os` instead."""
|
|
439
|
-
qr: float
|
|
440
|
-
r"""Deprecated: Use `click.qr` instead."""
|
|
441
|
-
ip: str
|
|
442
|
-
r"""Deprecated: Use `click.ip` instead."""
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
class ClickEvent(BaseModel):
|
|
446
|
-
event: Event
|
|
447
|
-
|
|
448
|
-
timestamp: str
|
|
449
|
-
|
|
450
|
-
click: Click
|
|
451
|
-
|
|
452
|
-
link: Link
|
|
453
|
-
|
|
454
|
-
click_id: Annotated[
|
|
455
|
-
str,
|
|
456
|
-
pydantic.Field(
|
|
457
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
458
|
-
),
|
|
459
|
-
]
|
|
460
|
-
r"""Deprecated: Use `click.id` instead."""
|
|
461
|
-
|
|
462
|
-
link_id: Annotated[
|
|
463
|
-
str,
|
|
464
|
-
pydantic.Field(
|
|
465
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
466
|
-
),
|
|
467
|
-
]
|
|
468
|
-
r"""Deprecated: Use `link.id` instead."""
|
|
469
|
-
|
|
470
|
-
domain: Annotated[
|
|
471
|
-
str,
|
|
472
|
-
pydantic.Field(
|
|
473
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
474
|
-
),
|
|
475
|
-
]
|
|
476
|
-
r"""Deprecated: Use `link.domain` instead."""
|
|
477
|
-
|
|
478
|
-
key: Annotated[
|
|
479
|
-
str,
|
|
480
|
-
pydantic.Field(
|
|
481
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
482
|
-
),
|
|
483
|
-
]
|
|
484
|
-
r"""Deprecated: Use `link.key` instead."""
|
|
485
|
-
|
|
486
|
-
url: Annotated[
|
|
487
|
-
str,
|
|
488
|
-
pydantic.Field(
|
|
489
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
490
|
-
),
|
|
491
|
-
]
|
|
492
|
-
r"""Deprecated: Use `click.url` instead."""
|
|
493
|
-
|
|
494
|
-
continent: Annotated[
|
|
495
|
-
str,
|
|
496
|
-
pydantic.Field(
|
|
497
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
498
|
-
),
|
|
499
|
-
]
|
|
500
|
-
r"""Deprecated: Use `click.continent` instead."""
|
|
501
|
-
|
|
502
|
-
country: Annotated[
|
|
503
|
-
str,
|
|
504
|
-
pydantic.Field(
|
|
505
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
506
|
-
),
|
|
507
|
-
]
|
|
508
|
-
r"""Deprecated: Use `click.country` instead."""
|
|
509
|
-
|
|
510
|
-
city: Annotated[
|
|
511
|
-
str,
|
|
512
|
-
pydantic.Field(
|
|
513
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
514
|
-
),
|
|
515
|
-
]
|
|
516
|
-
r"""Deprecated: Use `click.city` instead."""
|
|
517
|
-
|
|
518
|
-
device: Annotated[
|
|
519
|
-
str,
|
|
520
|
-
pydantic.Field(
|
|
521
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
522
|
-
),
|
|
523
|
-
]
|
|
524
|
-
r"""Deprecated: Use `click.device` instead."""
|
|
525
|
-
|
|
526
|
-
browser: Annotated[
|
|
527
|
-
str,
|
|
528
|
-
pydantic.Field(
|
|
529
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
530
|
-
),
|
|
531
|
-
]
|
|
532
|
-
r"""Deprecated: Use `click.browser` instead."""
|
|
533
|
-
|
|
534
|
-
os: Annotated[
|
|
535
|
-
str,
|
|
536
|
-
pydantic.Field(
|
|
537
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
538
|
-
),
|
|
539
|
-
]
|
|
540
|
-
r"""Deprecated: Use `click.os` instead."""
|
|
541
|
-
|
|
542
|
-
qr: Annotated[
|
|
543
|
-
float,
|
|
544
|
-
pydantic.Field(
|
|
545
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
546
|
-
),
|
|
547
|
-
]
|
|
548
|
-
r"""Deprecated: Use `click.qr` instead."""
|
|
549
|
-
|
|
550
|
-
ip: Annotated[
|
|
551
|
-
str,
|
|
552
|
-
pydantic.Field(
|
|
553
|
-
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
554
|
-
),
|
|
555
|
-
]
|
|
556
|
-
r"""Deprecated: Use `click.ip` instead."""
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from enum import Enum
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ContinentCode(str, Enum):
|
|
8
|
-
r"""The continent to retrieve analytics for."""
|
|
9
|
-
|
|
10
|
-
AF = "AF"
|
|
11
|
-
AN = "AN"
|
|
12
|
-
AS = "AS"
|
|
13
|
-
EU = "EU"
|
|
14
|
-
NA = "NA"
|
|
15
|
-
OC = "OC"
|
|
16
|
-
SA = "SA"
|