dub 0.33.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.
Files changed (59) hide show
  1. dub/_version.py +3 -3
  2. dub/analytics.py +2 -0
  3. dub/basesdk.py +6 -0
  4. dub/commissions.py +4 -0
  5. dub/customers.py +8 -0
  6. dub/domains.py +12 -0
  7. dub/embed_tokens.py +2 -0
  8. dub/events.py +2 -0
  9. dub/folders.py +8 -0
  10. dub/links.py +20 -0
  11. dub/models/components/__init__.py +49 -149
  12. dub/models/components/leadcreatedevent.py +8 -8
  13. dub/models/components/linkclickedevent.py +12 -12
  14. dub/models/components/linkerrorschema.py +12 -12
  15. dub/models/components/linkschema.py +3 -3
  16. dub/models/components/linktagschema.py +3 -3
  17. dub/models/components/linktagschemaoutput.py +38 -0
  18. dub/models/components/linkwebhookevent.py +8 -10
  19. dub/models/components/partnerenrolledevent.py +4 -4
  20. dub/models/components/salecreatedevent.py +8 -8
  21. dub/models/operations/__init__.py +130 -22
  22. dub/models/operations/createpartner.py +4 -55
  23. dub/models/operations/createpartnerlink.py +0 -51
  24. dub/models/operations/createreferralsembedtoken.py +0 -51
  25. dub/models/operations/getcustomers.py +18 -0
  26. dub/models/operations/getlinkinfo.py +0 -2
  27. dub/models/operations/getlinks.py +2 -2
  28. dub/models/operations/getlinkscount.py +2 -2
  29. dub/models/operations/getqrcode.py +1 -1
  30. dub/models/operations/listdomains.py +1 -1
  31. dub/models/operations/listevents.py +2016 -21
  32. dub/models/operations/listpartners.py +4 -4
  33. dub/models/operations/retrieveanalytics.py +16 -5
  34. dub/models/operations/retrievelinks.py +2 -2
  35. dub/models/operations/tracklead.py +4 -4
  36. dub/models/operations/updatecustomer.py +23 -11
  37. dub/models/operations/updatelink.py +0 -2
  38. dub/models/operations/updateworkspace.py +3 -3
  39. dub/models/operations/upsertpartnerlink.py +0 -51
  40. dub/partners.py +22 -4
  41. dub/qr_codes.py +2 -0
  42. dub/tags.py +24 -12
  43. dub/track.py +4 -0
  44. dub/types/basemodel.py +41 -3
  45. dub/utils/__init__.py +0 -3
  46. dub/utils/enums.py +60 -0
  47. dub/utils/forms.py +21 -10
  48. dub/utils/queryparams.py +14 -2
  49. dub/utils/requestbodies.py +3 -3
  50. dub/utils/serializers.py +0 -20
  51. dub/workspaces.py +4 -0
  52. {dub-0.33.0.dist-info → dub-0.34.0.dist-info}/METADATA +14 -14
  53. {dub-0.33.0.dist-info → dub-0.34.0.dist-info}/RECORD +55 -58
  54. dub/models/components/clickevent.py +0 -557
  55. dub/models/components/continentcode.py +0 -16
  56. dub/models/components/leadevent.py +0 -681
  57. dub/models/components/saleevent.py +0 -780
  58. {dub-0.33.0.dist-info → dub-0.34.0.dist-info}/WHEEL +0 -0
  59. {dub-0.33.0.dist-info → dub-0.34.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,681 +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 Any, Dict, List, Optional
10
- from typing_extensions import Annotated, NotRequired, TypedDict
11
-
12
-
13
- class LeadEventEvent(str, Enum):
14
- LEAD = "lead"
15
-
16
-
17
- class LeadEventClickTypedDict(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 LeadEventClick(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 LeadEventTestVariantsTypedDict(TypedDict):
98
- url: str
99
- percentage: float
100
-
101
-
102
- class LeadEventTestVariants(BaseModel):
103
- url: str
104
-
105
- percentage: float
106
-
107
-
108
- class LeadEventLinkTypedDict(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
- disabled_at: str
129
- password: Nullable[str]
130
- r"""The password required to access the destination URL of the short link."""
131
- proxy: bool
132
- title: Nullable[str]
133
- r"""The title of the short link. Will be used for Custom Link Previews if `proxy` is true."""
134
- description: Nullable[str]
135
- r"""The description of the short link. Will be used for Custom Link Previews if `proxy` is true."""
136
- image: Nullable[str]
137
- r"""The image of the short link. Will be used for Custom Link Previews if `proxy` is true."""
138
- video: Nullable[str]
139
- 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"""
140
- rewrite: bool
141
- do_index: bool
142
- ios: Nullable[str]
143
- r"""The iOS destination URL for the short link for iOS device targeting."""
144
- android: Nullable[str]
145
- r"""The Android destination URL for the short link for Android device targeting."""
146
- geo: Nullable[Dict[str, str]]
147
- r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
148
- public_stats: bool
149
- tags: Nullable[List[LinkTagSchemaTypedDict]]
150
- r"""The tags assigned to the short link."""
151
- folder_id: Nullable[str]
152
- r"""The unique ID of the folder assigned to the short link."""
153
- webhook_ids: List[str]
154
- r"""The IDs of the webhooks that the short link is associated with."""
155
- comments: Nullable[str]
156
- r"""The comments for the short link."""
157
- short_link: str
158
- r"""The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."""
159
- qr_code: str
160
- r"""The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`)."""
161
- utm_source: Nullable[str]
162
- r"""The UTM source of the short link."""
163
- utm_medium: Nullable[str]
164
- r"""The UTM medium of the short link."""
165
- utm_campaign: Nullable[str]
166
- r"""The UTM campaign of the short link."""
167
- utm_term: Nullable[str]
168
- r"""The UTM term of the short link."""
169
- utm_content: Nullable[str]
170
- r"""The UTM content of the short link."""
171
- test_started_at: str
172
- test_completed_at: str
173
- user_id: Nullable[str]
174
- workspace_id: str
175
- r"""The workspace ID of the short link."""
176
- last_clicked: str
177
- created_at: str
178
- updated_at: str
179
- tag_id: Nullable[str]
180
- r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
181
- project_id: str
182
- r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
183
- test_variants: NotRequired[Nullable[List[LeadEventTestVariantsTypedDict]]]
184
- r"""An array of A/B test URLs and the percentage of traffic to send to each URL."""
185
- clicks: NotRequired[float]
186
- r"""The number of clicks on the short link."""
187
- leads: NotRequired[float]
188
- r"""The number of leads the short link has generated."""
189
- conversions: NotRequired[float]
190
- r"""The number of leads that converted to paying customers."""
191
- sales: NotRequired[float]
192
- r"""The total number of sales (includes recurring sales) generated by the short link."""
193
- sale_amount: NotRequired[float]
194
- r"""The total dollar value of sales (in cents) generated by the short link."""
195
-
196
-
197
- class LeadEventLink(BaseModel):
198
- id: str
199
- r"""The unique ID of the short link."""
200
-
201
- domain: str
202
- 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)."""
203
-
204
- key: str
205
- r"""The short link slug. If not provided, a random 7-character slug will be generated."""
206
-
207
- url: str
208
-
209
- track_conversion: Annotated[bool, pydantic.Field(alias="trackConversion")]
210
-
211
- external_id: Annotated[Nullable[str], pydantic.Field(alias="externalId")]
212
- 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."""
213
-
214
- tenant_id: Annotated[Nullable[str], pydantic.Field(alias="tenantId")]
215
- 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."""
216
-
217
- program_id: Annotated[Nullable[str], pydantic.Field(alias="programId")]
218
- r"""The ID of the program the short link is associated with."""
219
-
220
- partner_id: Annotated[Nullable[str], pydantic.Field(alias="partnerId")]
221
- r"""The ID of the partner the short link is associated with."""
222
-
223
- archived: bool
224
-
225
- expires_at: Annotated[str, pydantic.Field(alias="expiresAt")]
226
-
227
- expired_url: Annotated[Nullable[str], pydantic.Field(alias="expiredUrl")]
228
-
229
- disabled_at: Annotated[str, pydantic.Field(alias="disabledAt")]
230
-
231
- password: Nullable[str]
232
- r"""The password required to access the destination URL of the short link."""
233
-
234
- proxy: bool
235
-
236
- title: Nullable[str]
237
- r"""The title of the short link. Will be used for Custom Link Previews if `proxy` is true."""
238
-
239
- description: Nullable[str]
240
- r"""The description of the short link. Will be used for Custom Link Previews if `proxy` is true."""
241
-
242
- image: Nullable[str]
243
- r"""The image of the short link. Will be used for Custom Link Previews if `proxy` is true."""
244
-
245
- video: Nullable[str]
246
- 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"""
247
-
248
- rewrite: bool
249
-
250
- do_index: Annotated[bool, pydantic.Field(alias="doIndex")]
251
-
252
- ios: Nullable[str]
253
- r"""The iOS destination URL for the short link for iOS device targeting."""
254
-
255
- android: Nullable[str]
256
- r"""The Android destination URL for the short link for Android device targeting."""
257
-
258
- geo: Nullable[Dict[str, str]]
259
- r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
260
-
261
- public_stats: Annotated[bool, pydantic.Field(alias="publicStats")]
262
-
263
- tags: Nullable[List[LinkTagSchema]]
264
- r"""The tags assigned to the short link."""
265
-
266
- folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
267
- r"""The unique ID of the folder assigned to the short link."""
268
-
269
- webhook_ids: Annotated[List[str], pydantic.Field(alias="webhookIds")]
270
- r"""The IDs of the webhooks that the short link is associated with."""
271
-
272
- comments: Nullable[str]
273
- r"""The comments for the short link."""
274
-
275
- short_link: Annotated[str, pydantic.Field(alias="shortLink")]
276
- r"""The full URL of the short link, including the https protocol (e.g. `https://dub.sh/try`)."""
277
-
278
- qr_code: Annotated[str, pydantic.Field(alias="qrCode")]
279
- r"""The full URL of the QR code for the short link (e.g. `https://api.dub.co/qr?url=https://dub.sh/try`)."""
280
-
281
- utm_source: Nullable[str]
282
- r"""The UTM source of the short link."""
283
-
284
- utm_medium: Nullable[str]
285
- r"""The UTM medium of the short link."""
286
-
287
- utm_campaign: Nullable[str]
288
- r"""The UTM campaign of the short link."""
289
-
290
- utm_term: Nullable[str]
291
- r"""The UTM term of the short link."""
292
-
293
- utm_content: Nullable[str]
294
- r"""The UTM content of the short link."""
295
-
296
- test_started_at: Annotated[str, pydantic.Field(alias="testStartedAt")]
297
-
298
- test_completed_at: Annotated[str, pydantic.Field(alias="testCompletedAt")]
299
-
300
- user_id: Annotated[Nullable[str], pydantic.Field(alias="userId")]
301
-
302
- workspace_id: Annotated[str, pydantic.Field(alias="workspaceId")]
303
- r"""The workspace ID of the short link."""
304
-
305
- last_clicked: Annotated[str, pydantic.Field(alias="lastClicked")]
306
-
307
- created_at: Annotated[str, pydantic.Field(alias="createdAt")]
308
-
309
- updated_at: Annotated[str, pydantic.Field(alias="updatedAt")]
310
-
311
- tag_id: Annotated[
312
- Nullable[str],
313
- pydantic.Field(
314
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
315
- alias="tagId",
316
- ),
317
- ]
318
- r"""Deprecated: Use `tags` instead. The unique ID of the tag assigned to the short link."""
319
-
320
- project_id: Annotated[
321
- str,
322
- pydantic.Field(
323
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible.",
324
- alias="projectId",
325
- ),
326
- ]
327
- r"""Deprecated: Use `workspaceId` instead. The project ID of the short link."""
328
-
329
- test_variants: Annotated[
330
- OptionalNullable[List[LeadEventTestVariants]],
331
- pydantic.Field(alias="testVariants"),
332
- ] = UNSET
333
- r"""An array of A/B test URLs and the percentage of traffic to send to each URL."""
334
-
335
- clicks: Optional[float] = 0
336
- r"""The number of clicks on the short link."""
337
-
338
- leads: Optional[float] = 0
339
- r"""The number of leads the short link has generated."""
340
-
341
- conversions: Optional[float] = 0
342
- r"""The number of leads that converted to paying customers."""
343
-
344
- sales: Optional[float] = 0
345
- r"""The total number of sales (includes recurring sales) generated by the short link."""
346
-
347
- sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
348
- r"""The total dollar value of sales (in cents) generated by the short link."""
349
-
350
- @model_serializer(mode="wrap")
351
- def serialize_model(self, handler):
352
- optional_fields = [
353
- "testVariants",
354
- "clicks",
355
- "leads",
356
- "conversions",
357
- "sales",
358
- "saleAmount",
359
- ]
360
- nullable_fields = [
361
- "externalId",
362
- "tenantId",
363
- "programId",
364
- "partnerId",
365
- "expiredUrl",
366
- "password",
367
- "title",
368
- "description",
369
- "image",
370
- "video",
371
- "ios",
372
- "android",
373
- "geo",
374
- "tags",
375
- "folderId",
376
- "comments",
377
- "utm_source",
378
- "utm_medium",
379
- "utm_campaign",
380
- "utm_term",
381
- "utm_content",
382
- "testVariants",
383
- "userId",
384
- "tagId",
385
- ]
386
- null_default_fields = []
387
-
388
- serialized = handler(self)
389
-
390
- m = {}
391
-
392
- for n, f in type(self).model_fields.items():
393
- k = f.alias or n
394
- val = serialized.get(k)
395
- serialized.pop(k, None)
396
-
397
- optional_nullable = k in optional_fields and k in nullable_fields
398
- is_set = (
399
- self.__pydantic_fields_set__.intersection({n})
400
- or k in null_default_fields
401
- ) # pylint: disable=no-member
402
-
403
- if val is not None and val != UNSET_SENTINEL:
404
- m[k] = val
405
- elif val != UNSET_SENTINEL and (
406
- not k in optional_fields or (optional_nullable and is_set)
407
- ):
408
- m[k] = val
409
-
410
- return m
411
-
412
-
413
- class CustomerTypedDict(TypedDict):
414
- id: str
415
- r"""The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."""
416
- external_id: str
417
- r"""Unique identifier for the customer in the client's app."""
418
- name: str
419
- r"""Name of the customer."""
420
- created_at: str
421
- r"""The date the customer was created."""
422
- email: NotRequired[Nullable[str]]
423
- r"""Email of the customer."""
424
- avatar: NotRequired[Nullable[str]]
425
- r"""Avatar URL of the customer."""
426
- country: NotRequired[Nullable[str]]
427
- r"""Country of the customer."""
428
- sales: NotRequired[Nullable[float]]
429
- r"""Total number of sales for the customer."""
430
- sale_amount: NotRequired[Nullable[float]]
431
- r"""Total amount of sales for the customer."""
432
-
433
-
434
- class Customer(BaseModel):
435
- id: str
436
- r"""The unique ID of the customer. You may use either the customer's `id` on Dub (obtained via `/customers` endpoint) or their `externalId` (unique ID within your system, prefixed with `ext_`, e.g. `ext_123`)."""
437
-
438
- external_id: Annotated[str, pydantic.Field(alias="externalId")]
439
- r"""Unique identifier for the customer in the client's app."""
440
-
441
- name: str
442
- r"""Name of the customer."""
443
-
444
- created_at: Annotated[str, pydantic.Field(alias="createdAt")]
445
- r"""The date the customer was created."""
446
-
447
- email: OptionalNullable[str] = UNSET
448
- r"""Email of the customer."""
449
-
450
- avatar: OptionalNullable[str] = UNSET
451
- r"""Avatar URL of the customer."""
452
-
453
- country: OptionalNullable[str] = UNSET
454
- r"""Country of the customer."""
455
-
456
- sales: OptionalNullable[float] = UNSET
457
- r"""Total number of sales for the customer."""
458
-
459
- sale_amount: Annotated[
460
- OptionalNullable[float], pydantic.Field(alias="saleAmount")
461
- ] = UNSET
462
- r"""Total amount of sales for the customer."""
463
-
464
- @model_serializer(mode="wrap")
465
- def serialize_model(self, handler):
466
- optional_fields = ["email", "avatar", "country", "sales", "saleAmount"]
467
- nullable_fields = ["email", "avatar", "country", "sales", "saleAmount"]
468
- null_default_fields = []
469
-
470
- serialized = handler(self)
471
-
472
- m = {}
473
-
474
- for n, f in type(self).model_fields.items():
475
- k = f.alias or n
476
- val = serialized.get(k)
477
- serialized.pop(k, None)
478
-
479
- optional_nullable = k in optional_fields and k in nullable_fields
480
- is_set = (
481
- self.__pydantic_fields_set__.intersection({n})
482
- or k in null_default_fields
483
- ) # pylint: disable=no-member
484
-
485
- if val is not None and val != UNSET_SENTINEL:
486
- m[k] = val
487
- elif val != UNSET_SENTINEL and (
488
- not k in optional_fields or (optional_nullable and is_set)
489
- ):
490
- m[k] = val
491
-
492
- return m
493
-
494
-
495
- class LeadEventTypedDict(TypedDict):
496
- event: LeadEventEvent
497
- timestamp: str
498
- event_id: str
499
- event_name: str
500
- click: LeadEventClickTypedDict
501
- link: LeadEventLinkTypedDict
502
- customer: CustomerTypedDict
503
- click_id: str
504
- r"""Deprecated: Use `click.id` instead."""
505
- link_id: str
506
- r"""Deprecated: Use `link.id` instead."""
507
- domain: str
508
- r"""Deprecated: Use `link.domain` instead."""
509
- key: str
510
- r"""Deprecated: Use `link.key` instead."""
511
- url: str
512
- r"""Deprecated: Use `click.url` instead."""
513
- continent: str
514
- r"""Deprecated: Use `click.continent` instead."""
515
- country: str
516
- r"""Deprecated: Use `click.country` instead."""
517
- city: str
518
- r"""Deprecated: Use `click.city` instead."""
519
- device: str
520
- r"""Deprecated: Use `click.device` instead."""
521
- browser: str
522
- r"""Deprecated: Use `click.browser` instead."""
523
- os: str
524
- r"""Deprecated: Use `click.os` instead."""
525
- qr: float
526
- r"""Deprecated: Use `click.qr` instead."""
527
- ip: str
528
- r"""Deprecated: Use `click.ip` instead."""
529
- metadata: NotRequired[Nullable[Any]]
530
-
531
-
532
- class LeadEvent(BaseModel):
533
- event: LeadEventEvent
534
-
535
- timestamp: str
536
-
537
- event_id: Annotated[str, pydantic.Field(alias="eventId")]
538
-
539
- event_name: Annotated[str, pydantic.Field(alias="eventName")]
540
-
541
- click: LeadEventClick
542
-
543
- link: LeadEventLink
544
-
545
- customer: Customer
546
-
547
- click_id: Annotated[
548
- str,
549
- pydantic.Field(
550
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
551
- ),
552
- ]
553
- r"""Deprecated: Use `click.id` instead."""
554
-
555
- link_id: Annotated[
556
- str,
557
- pydantic.Field(
558
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
559
- ),
560
- ]
561
- r"""Deprecated: Use `link.id` instead."""
562
-
563
- domain: Annotated[
564
- str,
565
- pydantic.Field(
566
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
567
- ),
568
- ]
569
- r"""Deprecated: Use `link.domain` instead."""
570
-
571
- key: Annotated[
572
- str,
573
- pydantic.Field(
574
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
575
- ),
576
- ]
577
- r"""Deprecated: Use `link.key` instead."""
578
-
579
- url: Annotated[
580
- str,
581
- pydantic.Field(
582
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
583
- ),
584
- ]
585
- r"""Deprecated: Use `click.url` instead."""
586
-
587
- continent: Annotated[
588
- str,
589
- pydantic.Field(
590
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
591
- ),
592
- ]
593
- r"""Deprecated: Use `click.continent` instead."""
594
-
595
- country: Annotated[
596
- str,
597
- pydantic.Field(
598
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
599
- ),
600
- ]
601
- r"""Deprecated: Use `click.country` instead."""
602
-
603
- city: Annotated[
604
- str,
605
- pydantic.Field(
606
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
607
- ),
608
- ]
609
- r"""Deprecated: Use `click.city` instead."""
610
-
611
- device: Annotated[
612
- str,
613
- pydantic.Field(
614
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
615
- ),
616
- ]
617
- r"""Deprecated: Use `click.device` instead."""
618
-
619
- browser: Annotated[
620
- str,
621
- pydantic.Field(
622
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
623
- ),
624
- ]
625
- r"""Deprecated: Use `click.browser` instead."""
626
-
627
- os: Annotated[
628
- str,
629
- pydantic.Field(
630
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
631
- ),
632
- ]
633
- r"""Deprecated: Use `click.os` instead."""
634
-
635
- qr: Annotated[
636
- float,
637
- pydantic.Field(
638
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
639
- ),
640
- ]
641
- r"""Deprecated: Use `click.qr` instead."""
642
-
643
- ip: Annotated[
644
- str,
645
- pydantic.Field(
646
- deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
647
- ),
648
- ]
649
- r"""Deprecated: Use `click.ip` instead."""
650
-
651
- metadata: OptionalNullable[Any] = UNSET
652
-
653
- @model_serializer(mode="wrap")
654
- def serialize_model(self, handler):
655
- optional_fields = ["metadata"]
656
- nullable_fields = ["metadata"]
657
- null_default_fields = []
658
-
659
- serialized = handler(self)
660
-
661
- m = {}
662
-
663
- for n, f in type(self).model_fields.items():
664
- k = f.alias or n
665
- val = serialized.get(k)
666
- serialized.pop(k, None)
667
-
668
- optional_nullable = k in optional_fields and k in nullable_fields
669
- is_set = (
670
- self.__pydantic_fields_set__.intersection({n})
671
- or k in null_default_fields
672
- ) # pylint: disable=no-member
673
-
674
- if val is not None and val != UNSET_SENTINEL:
675
- m[k] = val
676
- elif val != UNSET_SENTINEL and (
677
- not k in optional_fields or (optional_nullable and is_set)
678
- ):
679
- m[k] = val
680
-
681
- return m