dub 0.34.1__py3-none-any.whl → 0.35.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 (93) hide show
  1. dub/_version.py +3 -3
  2. dub/basesdk.py +20 -6
  3. dub/models/components/__init__.py +108 -26
  4. dub/models/components/analyticsbrowsers.py +18 -1
  5. dub/models/components/analyticscities.py +18 -1
  6. dub/models/components/analyticscontinents.py +18 -1
  7. dub/models/components/analyticscount.py +18 -1
  8. dub/models/components/analyticscountries.py +20 -1
  9. dub/models/components/analyticsdevices.py +18 -1
  10. dub/models/components/analyticsos.py +18 -1
  11. dub/models/components/analyticsreferers.py +18 -1
  12. dub/models/components/analyticsrefererurls.py +18 -1
  13. dub/models/components/analyticsregions.py +18 -1
  14. dub/models/components/analyticstimeseries.py +18 -1
  15. dub/models/components/analyticstoplinks.py +16 -26
  16. dub/models/components/analyticstopurls.py +18 -1
  17. dub/models/components/analyticstriggers.py +18 -1
  18. dub/models/components/commissioncreatedevent.py +96 -64
  19. dub/models/components/domainschema.py +31 -50
  20. dub/models/components/folderschema.py +18 -19
  21. dub/models/components/leadcreatedevent.py +151 -134
  22. dub/models/components/linkclickedevent.py +57 -70
  23. dub/models/components/linkschema.py +63 -64
  24. dub/models/components/linkwebhookevent.py +43 -51
  25. dub/models/components/partneranalyticscount.py +18 -1
  26. dub/models/components/partneranalyticstimeseries.py +18 -1
  27. dub/models/components/partneranalyticstoplinks.py +16 -27
  28. dub/models/components/partnerapplicationsubmittedevent.py +42 -75
  29. dub/models/components/partnerenrolledevent.py +477 -83
  30. dub/models/components/salecreatedevent.py +152 -151
  31. dub/models/errors/badrequest.py +18 -1
  32. dub/models/errors/conflict.py +18 -1
  33. dub/models/errors/forbidden.py +18 -1
  34. dub/models/errors/internalservererror.py +18 -1
  35. dub/models/errors/inviteexpired.py +18 -1
  36. dub/models/errors/notfound.py +18 -1
  37. dub/models/errors/ratelimitexceeded.py +18 -1
  38. dub/models/errors/unauthorized.py +18 -1
  39. dub/models/errors/unprocessableentity.py +18 -1
  40. dub/models/operations/__init__.py +230 -19
  41. dub/models/operations/approvebountysubmission.py +71 -45
  42. dub/models/operations/banpartner.py +14 -19
  43. dub/models/operations/bulkcreatelinks.py +86 -87
  44. dub/models/operations/bulkupdatelinks.py +97 -82
  45. dub/models/operations/checkdomainstatus.py +1 -17
  46. dub/models/operations/createdomain.py +33 -34
  47. dub/models/operations/createfolder.py +18 -19
  48. dub/models/operations/createlink.py +86 -87
  49. dub/models/operations/createpartner.py +560 -168
  50. dub/models/operations/createpartnerlink.py +74 -85
  51. dub/models/operations/createreferralsembedtoken.py +99 -87
  52. dub/models/operations/createtag.py +18 -1
  53. dub/models/operations/deactivatepartner.py +65 -0
  54. dub/models/operations/getcustomer.py +106 -105
  55. dub/models/operations/getcustomers.py +123 -105
  56. dub/models/operations/getlinkinfo.py +18 -1
  57. dub/models/operations/getlinks.py +36 -1
  58. dub/models/operations/getlinkscount.py +32 -1
  59. dub/models/operations/getqrcode.py +29 -1
  60. dub/models/operations/gettags.py +20 -1
  61. dub/models/operations/listbountysubmissions.py +63 -26
  62. dub/models/operations/listcommissions.py +129 -64
  63. dub/models/operations/listdomains.py +18 -1
  64. dub/models/operations/listevents.py +414 -389
  65. dub/models/operations/listfolders.py +18 -1
  66. dub/models/operations/listpartners.py +510 -84
  67. dub/models/operations/registerdomain.py +1 -17
  68. dub/models/operations/rejectbountysubmission.py +71 -26
  69. dub/models/operations/retrieveanalytics.py +65 -66
  70. dub/models/operations/retrievelinks.py +30 -19
  71. dub/models/operations/retrievepartneranalytics.py +25 -28
  72. dub/models/operations/tracklead.py +38 -83
  73. dub/models/operations/tracksale.py +52 -95
  74. dub/models/operations/updatecommission.py +126 -64
  75. dub/models/operations/updatecustomer.py +122 -131
  76. dub/models/operations/updatedomain.py +50 -35
  77. dub/models/operations/updatefolder.py +34 -19
  78. dub/models/operations/updatelink.py +101 -86
  79. dub/models/operations/updatetag.py +34 -1
  80. dub/models/operations/upsertlink.py +86 -87
  81. dub/models/operations/upsertpartnerlink.py +72 -78
  82. dub/partners.py +288 -0
  83. dub/sdk.py +0 -3
  84. dub/utils/__init__.py +10 -1
  85. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/METADATA +4 -8
  86. dub-0.35.0.dist-info/RECORD +143 -0
  87. dub/models/components/workspaceschema.py +0 -328
  88. dub/models/operations/getworkspace.py +0 -21
  89. dub/models/operations/updateworkspace.py +0 -78
  90. dub/workspaces.py +0 -561
  91. dub-0.34.1.dist-info/RECORD +0 -146
  92. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
  93. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,9 +1,10 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  from __future__ import annotations
4
- from dub.types import BaseModel
4
+ from dub.types import BaseModel, UNSET_SENTINEL
5
5
  from dub.utils import FieldMetadata, QueryParamMetadata
6
6
  import pydantic
7
+ from pydantic import model_serializer
7
8
  from typing import Optional
8
9
  from typing_extensions import Annotated, NotRequired, TypedDict
9
10
 
@@ -36,3 +37,19 @@ class ListFoldersRequest(BaseModel):
36
37
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
37
38
  ] = 50
38
39
  r"""The number of items per page."""
40
+
41
+ @model_serializer(mode="wrap")
42
+ def serialize_model(self, handler):
43
+ optional_fields = set(["search", "page", "pageSize"])
44
+ serialized = handler(self)
45
+ m = {}
46
+
47
+ for n, f in type(self).model_fields.items():
48
+ k = f.alias or n
49
+ val = serialized.get(k)
50
+
51
+ if val != UNSET_SENTINEL:
52
+ if val is not None or k not in optional_fields:
53
+ m[k] = val
54
+
55
+ return m
@@ -2,12 +2,12 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
- from dub.utils import FieldMetadata, QueryParamMetadata
5
+ from dub.utils import FieldMetadata, QueryParamMetadata, get_discriminator
6
6
  from enum import Enum
7
7
  import pydantic
8
- from pydantic import model_serializer
9
- from typing import List, Optional
10
- from typing_extensions import Annotated, NotRequired, TypedDict
8
+ from pydantic import Discriminator, Tag, model_serializer
9
+ from typing import List, Optional, Union
10
+ from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
11
11
 
12
12
 
13
13
  class ListPartnersQueryParamStatus(str, Enum):
@@ -128,6 +128,34 @@ class ListPartnersRequest(BaseModel):
128
128
  ] = 100
129
129
  r"""The number of items per page."""
130
130
 
131
+ @model_serializer(mode="wrap")
132
+ def serialize_model(self, handler):
133
+ optional_fields = set(
134
+ [
135
+ "status",
136
+ "country",
137
+ "sortBy",
138
+ "sortOrder",
139
+ "email",
140
+ "tenantId",
141
+ "search",
142
+ "page",
143
+ "pageSize",
144
+ ]
145
+ )
146
+ serialized = handler(self)
147
+ m = {}
148
+
149
+ for n, f in type(self).model_fields.items():
150
+ k = f.alias or n
151
+ val = serialized.get(k)
152
+
153
+ if val != UNSET_SENTINEL:
154
+ if val is not None or k not in optional_fields:
155
+ m[k] = val
156
+
157
+ return m
158
+
131
159
 
132
160
  class ListPartnersStatus(str, Enum):
133
161
  r"""The status of the partner's enrollment in the program."""
@@ -196,6 +224,22 @@ class ListPartnersLinks(BaseModel):
196
224
  sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
197
225
  r"""The total dollar value of sales (in cents) generated by the short link."""
198
226
 
227
+ @model_serializer(mode="wrap")
228
+ def serialize_model(self, handler):
229
+ optional_fields = set(["clicks", "leads", "conversions", "sales", "saleAmount"])
230
+ serialized = handler(self)
231
+ m = {}
232
+
233
+ for n, f in type(self).model_fields.items():
234
+ k = f.alias or n
235
+ val = serialized.get(k)
236
+
237
+ if val != UNSET_SENTINEL:
238
+ if val is not None or k not in optional_fields:
239
+ m[k] = val
240
+
241
+ return m
242
+
199
243
 
200
244
  class ListPartnersBannedReason(str, Enum):
201
245
  r"""If the partner was banned from the program, this is the reason for the ban."""
@@ -208,6 +252,381 @@ class ListPartnersBannedReason(str, Enum):
208
252
  BRAND_ABUSE = "brand_abuse"
209
253
 
210
254
 
255
+ class ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyReferralFormData8Type(
256
+ str, Enum
257
+ ):
258
+ PHONE = "phone"
259
+
260
+
261
+ class Fields8TypedDict(TypedDict):
262
+ key: str
263
+ label: str
264
+ required: bool
265
+ locked: bool
266
+ position: int
267
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyReferralFormData8Type
268
+
269
+
270
+ class Fields8(BaseModel):
271
+ key: str
272
+
273
+ label: str
274
+
275
+ required: bool
276
+
277
+ locked: bool
278
+
279
+ position: int
280
+
281
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyReferralFormData8Type
282
+
283
+
284
+ class ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyReferralFormDataType(
285
+ str, Enum
286
+ ):
287
+ NUMBER = "number"
288
+
289
+
290
+ class Fields7TypedDict(TypedDict):
291
+ key: str
292
+ label: str
293
+ required: bool
294
+ locked: bool
295
+ position: int
296
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyReferralFormDataType
297
+
298
+
299
+ class Fields7(BaseModel):
300
+ key: str
301
+
302
+ label: str
303
+
304
+ required: bool
305
+
306
+ locked: bool
307
+
308
+ position: int
309
+
310
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyReferralFormDataType
311
+
312
+
313
+ class ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyType(str, Enum):
314
+ MULTI_SELECT = "multiSelect"
315
+
316
+
317
+ class ListPartnersFieldsPartnersOptionsTypedDict(TypedDict):
318
+ label: str
319
+ value: str
320
+
321
+
322
+ class ListPartnersFieldsPartnersOptions(BaseModel):
323
+ label: str
324
+
325
+ value: str
326
+
327
+
328
+ class Fields6TypedDict(TypedDict):
329
+ key: str
330
+ label: str
331
+ required: bool
332
+ locked: bool
333
+ position: int
334
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyType
335
+ options: List[ListPartnersFieldsPartnersOptionsTypedDict]
336
+
337
+
338
+ class Fields6(BaseModel):
339
+ key: str
340
+
341
+ label: str
342
+
343
+ required: bool
344
+
345
+ locked: bool
346
+
347
+ position: int
348
+
349
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONResponseBodyType
350
+
351
+ options: List[ListPartnersFieldsPartnersOptions]
352
+
353
+
354
+ class ListPartnersFieldsPartnersResponse200ApplicationJSONType(str, Enum):
355
+ DATE = "date"
356
+
357
+
358
+ class Fields5TypedDict(TypedDict):
359
+ key: str
360
+ label: str
361
+ required: bool
362
+ locked: bool
363
+ position: int
364
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONType
365
+
366
+
367
+ class Fields5(BaseModel):
368
+ key: str
369
+
370
+ label: str
371
+
372
+ required: bool
373
+
374
+ locked: bool
375
+
376
+ position: int
377
+
378
+ type: ListPartnersFieldsPartnersResponse200ApplicationJSONType
379
+
380
+
381
+ class ListPartnersFieldsPartnersResponse200Type(str, Enum):
382
+ COUNTRY = "country"
383
+
384
+
385
+ class ListPartnersFields4TypedDict(TypedDict):
386
+ key: str
387
+ label: str
388
+ required: bool
389
+ locked: bool
390
+ position: int
391
+ type: ListPartnersFieldsPartnersResponse200Type
392
+
393
+
394
+ class ListPartnersFields4(BaseModel):
395
+ key: str
396
+
397
+ label: str
398
+
399
+ required: bool
400
+
401
+ locked: bool
402
+
403
+ position: int
404
+
405
+ type: ListPartnersFieldsPartnersResponse200Type
406
+
407
+
408
+ class ListPartnersFieldsPartnersResponseType(str, Enum):
409
+ SELECT = "select"
410
+
411
+
412
+ class ListPartnersFieldsOptionsTypedDict(TypedDict):
413
+ label: str
414
+ value: str
415
+
416
+
417
+ class ListPartnersFieldsOptions(BaseModel):
418
+ label: str
419
+
420
+ value: str
421
+
422
+
423
+ class ListPartnersFields3TypedDict(TypedDict):
424
+ key: str
425
+ label: str
426
+ required: bool
427
+ locked: bool
428
+ position: int
429
+ type: ListPartnersFieldsPartnersResponseType
430
+ options: List[ListPartnersFieldsOptionsTypedDict]
431
+
432
+
433
+ class ListPartnersFields3(BaseModel):
434
+ key: str
435
+
436
+ label: str
437
+
438
+ required: bool
439
+
440
+ locked: bool
441
+
442
+ position: int
443
+
444
+ type: ListPartnersFieldsPartnersResponseType
445
+
446
+ options: List[ListPartnersFieldsOptions]
447
+
448
+
449
+ class ListPartnersFieldsPartnersType(str, Enum):
450
+ TEXTAREA = "textarea"
451
+
452
+
453
+ class ListPartnersFieldsPartnersConstraintsTypedDict(TypedDict):
454
+ max_length: NotRequired[int]
455
+
456
+
457
+ class ListPartnersFieldsPartnersConstraints(BaseModel):
458
+ max_length: Annotated[Optional[int], pydantic.Field(alias="maxLength")] = None
459
+
460
+ @model_serializer(mode="wrap")
461
+ def serialize_model(self, handler):
462
+ optional_fields = set(["maxLength"])
463
+ serialized = handler(self)
464
+ m = {}
465
+
466
+ for n, f in type(self).model_fields.items():
467
+ k = f.alias or n
468
+ val = serialized.get(k)
469
+
470
+ if val != UNSET_SENTINEL:
471
+ if val is not None or k not in optional_fields:
472
+ m[k] = val
473
+
474
+ return m
475
+
476
+
477
+ class ListPartnersFields2TypedDict(TypedDict):
478
+ key: str
479
+ label: str
480
+ required: bool
481
+ locked: bool
482
+ position: int
483
+ type: ListPartnersFieldsPartnersType
484
+ constraints: NotRequired[ListPartnersFieldsPartnersConstraintsTypedDict]
485
+
486
+
487
+ class ListPartnersFields2(BaseModel):
488
+ key: str
489
+
490
+ label: str
491
+
492
+ required: bool
493
+
494
+ locked: bool
495
+
496
+ position: int
497
+
498
+ type: ListPartnersFieldsPartnersType
499
+
500
+ constraints: Optional[ListPartnersFieldsPartnersConstraints] = None
501
+
502
+ @model_serializer(mode="wrap")
503
+ def serialize_model(self, handler):
504
+ optional_fields = set(["constraints"])
505
+ serialized = handler(self)
506
+ m = {}
507
+
508
+ for n, f in type(self).model_fields.items():
509
+ k = f.alias or n
510
+ val = serialized.get(k)
511
+
512
+ if val != UNSET_SENTINEL:
513
+ if val is not None or k not in optional_fields:
514
+ m[k] = val
515
+
516
+ return m
517
+
518
+
519
+ class ListPartnersFieldsType(str, Enum):
520
+ TEXT = "text"
521
+
522
+
523
+ class ListPartnersFieldsConstraintsTypedDict(TypedDict):
524
+ max_length: NotRequired[int]
525
+ pattern: NotRequired[str]
526
+
527
+
528
+ class ListPartnersFieldsConstraints(BaseModel):
529
+ max_length: Annotated[Optional[int], pydantic.Field(alias="maxLength")] = None
530
+
531
+ pattern: Optional[str] = None
532
+
533
+ @model_serializer(mode="wrap")
534
+ def serialize_model(self, handler):
535
+ optional_fields = set(["maxLength", "pattern"])
536
+ serialized = handler(self)
537
+ m = {}
538
+
539
+ for n, f in type(self).model_fields.items():
540
+ k = f.alias or n
541
+ val = serialized.get(k)
542
+
543
+ if val != UNSET_SENTINEL:
544
+ if val is not None or k not in optional_fields:
545
+ m[k] = val
546
+
547
+ return m
548
+
549
+
550
+ class ListPartnersFields1TypedDict(TypedDict):
551
+ key: str
552
+ label: str
553
+ required: bool
554
+ locked: bool
555
+ position: int
556
+ type: ListPartnersFieldsType
557
+ constraints: NotRequired[ListPartnersFieldsConstraintsTypedDict]
558
+
559
+
560
+ class ListPartnersFields1(BaseModel):
561
+ key: str
562
+
563
+ label: str
564
+
565
+ required: bool
566
+
567
+ locked: bool
568
+
569
+ position: int
570
+
571
+ type: ListPartnersFieldsType
572
+
573
+ constraints: Optional[ListPartnersFieldsConstraints] = None
574
+
575
+ @model_serializer(mode="wrap")
576
+ def serialize_model(self, handler):
577
+ optional_fields = set(["constraints"])
578
+ serialized = handler(self)
579
+ m = {}
580
+
581
+ for n, f in type(self).model_fields.items():
582
+ k = f.alias or n
583
+ val = serialized.get(k)
584
+
585
+ if val != UNSET_SENTINEL:
586
+ if val is not None or k not in optional_fields:
587
+ m[k] = val
588
+
589
+ return m
590
+
591
+
592
+ ListPartnersFieldsTypedDict = TypeAliasType(
593
+ "ListPartnersFieldsTypedDict",
594
+ Union[
595
+ ListPartnersFields4TypedDict,
596
+ Fields5TypedDict,
597
+ Fields7TypedDict,
598
+ Fields8TypedDict,
599
+ ListPartnersFields1TypedDict,
600
+ ListPartnersFields2TypedDict,
601
+ ListPartnersFields3TypedDict,
602
+ Fields6TypedDict,
603
+ ],
604
+ )
605
+
606
+
607
+ ListPartnersFields = Annotated[
608
+ Union[
609
+ Annotated[ListPartnersFields1, Tag("text")],
610
+ Annotated[ListPartnersFields2, Tag("textarea")],
611
+ Annotated[ListPartnersFields3, Tag("select")],
612
+ Annotated[ListPartnersFields4, Tag("country")],
613
+ Annotated[Fields5, Tag("date")],
614
+ Annotated[Fields6, Tag("multiSelect")],
615
+ Annotated[Fields7, Tag("number")],
616
+ Annotated[Fields8, Tag("phone")],
617
+ ],
618
+ Discriminator(lambda m: get_discriminator(m, "type", "type")),
619
+ ]
620
+
621
+
622
+ class ListPartnersReferralFormDataTypedDict(TypedDict):
623
+ fields: List[ListPartnersFieldsTypedDict]
624
+
625
+
626
+ class ListPartnersReferralFormData(BaseModel):
627
+ fields: List[ListPartnersFields]
628
+
629
+
211
630
  class ListPartnersResponseBodyTypedDict(TypedDict):
212
631
  id: str
213
632
  r"""The partner's unique ID on Dub."""
@@ -256,6 +675,7 @@ class ListPartnersResponseBodyTypedDict(TypedDict):
256
675
  r"""If the partner was banned from the program, this is the date of the ban."""
257
676
  banned_reason: NotRequired[Nullable[ListPartnersBannedReason]]
258
677
  r"""If the partner was banned from the program, this is the reason for the ban."""
678
+ referral_form_data: NotRequired[Nullable[ListPartnersReferralFormDataTypedDict]]
259
679
  total_clicks: NotRequired[float]
260
680
  r"""The total number of clicks on the partner's links"""
261
681
  total_leads: NotRequired[float]
@@ -386,6 +806,11 @@ class ListPartnersResponseBody(BaseModel):
386
806
  ] = UNSET
387
807
  r"""If the partner was banned from the program, this is the reason for the ban."""
388
808
 
809
+ referral_form_data: Annotated[
810
+ OptionalNullable[ListPartnersReferralFormData],
811
+ pydantic.Field(alias="referralFormData"),
812
+ ] = UNSET
813
+
389
814
  total_clicks: Annotated[Optional[float], pydantic.Field(alias="totalClicks")] = 0
390
815
  r"""The total number of clicks on the partner's links"""
391
816
 
@@ -458,91 +883,92 @@ class ListPartnersResponseBody(BaseModel):
458
883
 
459
884
  @model_serializer(mode="wrap")
460
885
  def serialize_model(self, handler):
461
- optional_fields = [
462
- "description",
463
- "groupId",
464
- "totalCommissions",
465
- "clickRewardId",
466
- "leadRewardId",
467
- "saleRewardId",
468
- "discountId",
469
- "applicationId",
470
- "bannedAt",
471
- "bannedReason",
472
- "totalClicks",
473
- "totalLeads",
474
- "totalConversions",
475
- "totalSales",
476
- "totalSaleAmount",
477
- "netRevenue",
478
- "earningsPerClick",
479
- "averageLifetimeValue",
480
- "clickToLeadRate",
481
- "clickToConversionRate",
482
- "leadToConversionRate",
483
- "returnOnAdSpend",
484
- "website",
485
- "youtube",
486
- "twitter",
487
- "linkedin",
488
- "instagram",
489
- "tiktok",
490
- ]
491
- nullable_fields = [
492
- "companyName",
493
- "email",
494
- "image",
495
- "description",
496
- "country",
497
- "paypalEmail",
498
- "stripeConnectId",
499
- "payoutsEnabledAt",
500
- "trustedAt",
501
- "groupId",
502
- "tenantId",
503
- "links",
504
- "clickRewardId",
505
- "leadRewardId",
506
- "saleRewardId",
507
- "discountId",
508
- "applicationId",
509
- "bannedAt",
510
- "bannedReason",
511
- "earningsPerClick",
512
- "averageLifetimeValue",
513
- "clickToLeadRate",
514
- "clickToConversionRate",
515
- "leadToConversionRate",
516
- "returnOnAdSpend",
517
- "website",
518
- "youtube",
519
- "twitter",
520
- "linkedin",
521
- "instagram",
522
- "tiktok",
523
- ]
524
- null_default_fields = []
525
-
886
+ optional_fields = set(
887
+ [
888
+ "description",
889
+ "groupId",
890
+ "totalCommissions",
891
+ "clickRewardId",
892
+ "leadRewardId",
893
+ "saleRewardId",
894
+ "discountId",
895
+ "applicationId",
896
+ "bannedAt",
897
+ "bannedReason",
898
+ "referralFormData",
899
+ "totalClicks",
900
+ "totalLeads",
901
+ "totalConversions",
902
+ "totalSales",
903
+ "totalSaleAmount",
904
+ "netRevenue",
905
+ "earningsPerClick",
906
+ "averageLifetimeValue",
907
+ "clickToLeadRate",
908
+ "clickToConversionRate",
909
+ "leadToConversionRate",
910
+ "returnOnAdSpend",
911
+ "website",
912
+ "youtube",
913
+ "twitter",
914
+ "linkedin",
915
+ "instagram",
916
+ "tiktok",
917
+ ]
918
+ )
919
+ nullable_fields = set(
920
+ [
921
+ "companyName",
922
+ "email",
923
+ "image",
924
+ "description",
925
+ "country",
926
+ "paypalEmail",
927
+ "stripeConnectId",
928
+ "payoutsEnabledAt",
929
+ "trustedAt",
930
+ "groupId",
931
+ "tenantId",
932
+ "links",
933
+ "clickRewardId",
934
+ "leadRewardId",
935
+ "saleRewardId",
936
+ "discountId",
937
+ "applicationId",
938
+ "bannedAt",
939
+ "bannedReason",
940
+ "referralFormData",
941
+ "earningsPerClick",
942
+ "averageLifetimeValue",
943
+ "clickToLeadRate",
944
+ "clickToConversionRate",
945
+ "leadToConversionRate",
946
+ "returnOnAdSpend",
947
+ "website",
948
+ "youtube",
949
+ "twitter",
950
+ "linkedin",
951
+ "instagram",
952
+ "tiktok",
953
+ ]
954
+ )
526
955
  serialized = handler(self)
527
-
528
956
  m = {}
529
957
 
530
958
  for n, f in type(self).model_fields.items():
531
959
  k = f.alias or n
532
960
  val = serialized.get(k)
533
- serialized.pop(k, None)
534
-
535
- optional_nullable = k in optional_fields and k in nullable_fields
536
- is_set = (
537
- self.__pydantic_fields_set__.intersection({n})
538
- or k in null_default_fields
539
- ) # pylint: disable=no-member
540
-
541
- if val is not None and val != UNSET_SENTINEL:
542
- m[k] = val
543
- elif val != UNSET_SENTINEL and (
544
- not k in optional_fields or (optional_nullable and is_set)
545
- ):
546
- m[k] = val
961
+ is_nullable_and_explicitly_set = (
962
+ k in nullable_fields
963
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
964
+ )
965
+
966
+ if val != UNSET_SENTINEL:
967
+ if (
968
+ val is not None
969
+ or k not in optional_fields
970
+ or is_nullable_and_explicitly_set
971
+ ):
972
+ m[k] = val
547
973
 
548
974
  return m