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.
- dub/_version.py +3 -3
- dub/basesdk.py +20 -6
- dub/models/components/__init__.py +108 -26
- dub/models/components/analyticsbrowsers.py +18 -1
- dub/models/components/analyticscities.py +18 -1
- dub/models/components/analyticscontinents.py +18 -1
- dub/models/components/analyticscount.py +18 -1
- dub/models/components/analyticscountries.py +20 -1
- dub/models/components/analyticsdevices.py +18 -1
- dub/models/components/analyticsos.py +18 -1
- dub/models/components/analyticsreferers.py +18 -1
- dub/models/components/analyticsrefererurls.py +18 -1
- dub/models/components/analyticsregions.py +18 -1
- dub/models/components/analyticstimeseries.py +18 -1
- dub/models/components/analyticstoplinks.py +16 -26
- dub/models/components/analyticstopurls.py +18 -1
- dub/models/components/analyticstriggers.py +18 -1
- dub/models/components/commissioncreatedevent.py +96 -64
- dub/models/components/domainschema.py +31 -50
- dub/models/components/folderschema.py +18 -19
- dub/models/components/leadcreatedevent.py +151 -134
- dub/models/components/linkclickedevent.py +57 -70
- dub/models/components/linkschema.py +63 -64
- dub/models/components/linkwebhookevent.py +43 -51
- dub/models/components/partneranalyticscount.py +18 -1
- dub/models/components/partneranalyticstimeseries.py +18 -1
- dub/models/components/partneranalyticstoplinks.py +16 -27
- dub/models/components/partnerapplicationsubmittedevent.py +42 -75
- dub/models/components/partnerenrolledevent.py +477 -83
- dub/models/components/salecreatedevent.py +152 -151
- dub/models/errors/badrequest.py +18 -1
- dub/models/errors/conflict.py +18 -1
- dub/models/errors/forbidden.py +18 -1
- dub/models/errors/internalservererror.py +18 -1
- dub/models/errors/inviteexpired.py +18 -1
- dub/models/errors/notfound.py +18 -1
- dub/models/errors/ratelimitexceeded.py +18 -1
- dub/models/errors/unauthorized.py +18 -1
- dub/models/errors/unprocessableentity.py +18 -1
- dub/models/operations/__init__.py +230 -19
- dub/models/operations/approvebountysubmission.py +71 -45
- dub/models/operations/banpartner.py +14 -19
- dub/models/operations/bulkcreatelinks.py +86 -87
- dub/models/operations/bulkupdatelinks.py +97 -82
- dub/models/operations/checkdomainstatus.py +1 -17
- dub/models/operations/createdomain.py +33 -34
- dub/models/operations/createfolder.py +18 -19
- dub/models/operations/createlink.py +86 -87
- dub/models/operations/createpartner.py +560 -168
- dub/models/operations/createpartnerlink.py +74 -85
- dub/models/operations/createreferralsembedtoken.py +99 -87
- dub/models/operations/createtag.py +18 -1
- dub/models/operations/deactivatepartner.py +65 -0
- dub/models/operations/getcustomer.py +106 -105
- dub/models/operations/getcustomers.py +123 -105
- dub/models/operations/getlinkinfo.py +18 -1
- dub/models/operations/getlinks.py +36 -1
- dub/models/operations/getlinkscount.py +32 -1
- dub/models/operations/getqrcode.py +29 -1
- dub/models/operations/gettags.py +20 -1
- dub/models/operations/listbountysubmissions.py +63 -26
- dub/models/operations/listcommissions.py +129 -64
- dub/models/operations/listdomains.py +18 -1
- dub/models/operations/listevents.py +414 -389
- dub/models/operations/listfolders.py +18 -1
- dub/models/operations/listpartners.py +510 -84
- dub/models/operations/registerdomain.py +1 -17
- dub/models/operations/rejectbountysubmission.py +71 -26
- dub/models/operations/retrieveanalytics.py +65 -66
- dub/models/operations/retrievelinks.py +30 -19
- dub/models/operations/retrievepartneranalytics.py +25 -28
- dub/models/operations/tracklead.py +38 -83
- dub/models/operations/tracksale.py +52 -95
- dub/models/operations/updatecommission.py +126 -64
- dub/models/operations/updatecustomer.py +122 -131
- dub/models/operations/updatedomain.py +50 -35
- dub/models/operations/updatefolder.py +34 -19
- dub/models/operations/updatelink.py +101 -86
- dub/models/operations/updatetag.py +34 -1
- dub/models/operations/upsertlink.py +86 -87
- dub/models/operations/upsertpartnerlink.py +72 -78
- dub/partners.py +288 -0
- dub/sdk.py +0 -3
- dub/utils/__init__.py +10 -1
- {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/METADATA +4 -8
- dub-0.35.0.dist-info/RECORD +143 -0
- dub/models/components/workspaceschema.py +0 -328
- dub/models/operations/getworkspace.py +0 -21
- dub/models/operations/updateworkspace.py +0 -78
- dub/workspaces.py +0 -561
- dub-0.34.1.dist-info/RECORD +0 -146
- {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
- {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,11 +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 get_discriminator
|
|
5
6
|
from enum import Enum
|
|
6
7
|
import pydantic
|
|
7
|
-
from pydantic import model_serializer
|
|
8
|
-
from typing import List, Optional
|
|
9
|
-
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
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class PartnerEnrolledEventEvent(str, Enum):
|
|
@@ -80,6 +81,22 @@ class Links(BaseModel):
|
|
|
80
81
|
sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
|
|
81
82
|
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
82
83
|
|
|
84
|
+
@model_serializer(mode="wrap")
|
|
85
|
+
def serialize_model(self, handler):
|
|
86
|
+
optional_fields = set(["clicks", "leads", "conversions", "sales", "saleAmount"])
|
|
87
|
+
serialized = handler(self)
|
|
88
|
+
m = {}
|
|
89
|
+
|
|
90
|
+
for n, f in type(self).model_fields.items():
|
|
91
|
+
k = f.alias or n
|
|
92
|
+
val = serialized.get(k)
|
|
93
|
+
|
|
94
|
+
if val != UNSET_SENTINEL:
|
|
95
|
+
if val is not None or k not in optional_fields:
|
|
96
|
+
m[k] = val
|
|
97
|
+
|
|
98
|
+
return m
|
|
99
|
+
|
|
83
100
|
|
|
84
101
|
class BannedReason(str, Enum):
|
|
85
102
|
r"""If the partner was banned from the program, this is the reason for the ban."""
|
|
@@ -92,6 +109,377 @@ class BannedReason(str, Enum):
|
|
|
92
109
|
BRAND_ABUSE = "brand_abuse"
|
|
93
110
|
|
|
94
111
|
|
|
112
|
+
class PartnerEnrolledEventFieldsDataReferralFormData8Type(str, Enum):
|
|
113
|
+
PHONE = "phone"
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class EightTypedDict(TypedDict):
|
|
117
|
+
key: str
|
|
118
|
+
label: str
|
|
119
|
+
required: bool
|
|
120
|
+
locked: bool
|
|
121
|
+
position: int
|
|
122
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData8Type
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
class Eight(BaseModel):
|
|
126
|
+
key: str
|
|
127
|
+
|
|
128
|
+
label: str
|
|
129
|
+
|
|
130
|
+
required: bool
|
|
131
|
+
|
|
132
|
+
locked: bool
|
|
133
|
+
|
|
134
|
+
position: int
|
|
135
|
+
|
|
136
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData8Type
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
class PartnerEnrolledEventFieldsDataReferralFormData7Type(str, Enum):
|
|
140
|
+
NUMBER = "number"
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class SevenTypedDict(TypedDict):
|
|
144
|
+
key: str
|
|
145
|
+
label: str
|
|
146
|
+
required: bool
|
|
147
|
+
locked: bool
|
|
148
|
+
position: int
|
|
149
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData7Type
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
class Seven(BaseModel):
|
|
153
|
+
key: str
|
|
154
|
+
|
|
155
|
+
label: str
|
|
156
|
+
|
|
157
|
+
required: bool
|
|
158
|
+
|
|
159
|
+
locked: bool
|
|
160
|
+
|
|
161
|
+
position: int
|
|
162
|
+
|
|
163
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData7Type
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class PartnerEnrolledEventFieldsDataReferralFormData6Type(str, Enum):
|
|
167
|
+
MULTI_SELECT = "multiSelect"
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class FieldsOptionsTypedDict(TypedDict):
|
|
171
|
+
label: str
|
|
172
|
+
value: str
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
class FieldsOptions(BaseModel):
|
|
176
|
+
label: str
|
|
177
|
+
|
|
178
|
+
value: str
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class SixTypedDict(TypedDict):
|
|
182
|
+
key: str
|
|
183
|
+
label: str
|
|
184
|
+
required: bool
|
|
185
|
+
locked: bool
|
|
186
|
+
position: int
|
|
187
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData6Type
|
|
188
|
+
options: List[FieldsOptionsTypedDict]
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class Six(BaseModel):
|
|
192
|
+
key: str
|
|
193
|
+
|
|
194
|
+
label: str
|
|
195
|
+
|
|
196
|
+
required: bool
|
|
197
|
+
|
|
198
|
+
locked: bool
|
|
199
|
+
|
|
200
|
+
position: int
|
|
201
|
+
|
|
202
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData6Type
|
|
203
|
+
|
|
204
|
+
options: List[FieldsOptions]
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
class PartnerEnrolledEventFieldsDataReferralFormData5Type(str, Enum):
|
|
208
|
+
DATE = "date"
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
class FiveTypedDict(TypedDict):
|
|
212
|
+
key: str
|
|
213
|
+
label: str
|
|
214
|
+
required: bool
|
|
215
|
+
locked: bool
|
|
216
|
+
position: int
|
|
217
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData5Type
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
class Five(BaseModel):
|
|
221
|
+
key: str
|
|
222
|
+
|
|
223
|
+
label: str
|
|
224
|
+
|
|
225
|
+
required: bool
|
|
226
|
+
|
|
227
|
+
locked: bool
|
|
228
|
+
|
|
229
|
+
position: int
|
|
230
|
+
|
|
231
|
+
type: PartnerEnrolledEventFieldsDataReferralFormData5Type
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
class PartnerEnrolledEventFieldsDataReferralFormDataType(str, Enum):
|
|
235
|
+
COUNTRY = "country"
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
class FourTypedDict(TypedDict):
|
|
239
|
+
key: str
|
|
240
|
+
label: str
|
|
241
|
+
required: bool
|
|
242
|
+
locked: bool
|
|
243
|
+
position: int
|
|
244
|
+
type: PartnerEnrolledEventFieldsDataReferralFormDataType
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
class Four(BaseModel):
|
|
248
|
+
key: str
|
|
249
|
+
|
|
250
|
+
label: str
|
|
251
|
+
|
|
252
|
+
required: bool
|
|
253
|
+
|
|
254
|
+
locked: bool
|
|
255
|
+
|
|
256
|
+
position: int
|
|
257
|
+
|
|
258
|
+
type: PartnerEnrolledEventFieldsDataReferralFormDataType
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class PartnerEnrolledEventFieldsDataType(str, Enum):
|
|
262
|
+
SELECT = "select"
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class OptionsTypedDict(TypedDict):
|
|
266
|
+
label: str
|
|
267
|
+
value: str
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
class Options(BaseModel):
|
|
271
|
+
label: str
|
|
272
|
+
|
|
273
|
+
value: str
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class Fields3TypedDict(TypedDict):
|
|
277
|
+
key: str
|
|
278
|
+
label: str
|
|
279
|
+
required: bool
|
|
280
|
+
locked: bool
|
|
281
|
+
position: int
|
|
282
|
+
type: PartnerEnrolledEventFieldsDataType
|
|
283
|
+
options: List[OptionsTypedDict]
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
class Fields3(BaseModel):
|
|
287
|
+
key: str
|
|
288
|
+
|
|
289
|
+
label: str
|
|
290
|
+
|
|
291
|
+
required: bool
|
|
292
|
+
|
|
293
|
+
locked: bool
|
|
294
|
+
|
|
295
|
+
position: int
|
|
296
|
+
|
|
297
|
+
type: PartnerEnrolledEventFieldsDataType
|
|
298
|
+
|
|
299
|
+
options: List[Options]
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
class PartnerEnrolledEventFieldsType(str, Enum):
|
|
303
|
+
TEXTAREA = "textarea"
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
class FieldsConstraintsTypedDict(TypedDict):
|
|
307
|
+
max_length: NotRequired[int]
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
class FieldsConstraints(BaseModel):
|
|
311
|
+
max_length: Annotated[Optional[int], pydantic.Field(alias="maxLength")] = None
|
|
312
|
+
|
|
313
|
+
@model_serializer(mode="wrap")
|
|
314
|
+
def serialize_model(self, handler):
|
|
315
|
+
optional_fields = set(["maxLength"])
|
|
316
|
+
serialized = handler(self)
|
|
317
|
+
m = {}
|
|
318
|
+
|
|
319
|
+
for n, f in type(self).model_fields.items():
|
|
320
|
+
k = f.alias or n
|
|
321
|
+
val = serialized.get(k)
|
|
322
|
+
|
|
323
|
+
if val != UNSET_SENTINEL:
|
|
324
|
+
if val is not None or k not in optional_fields:
|
|
325
|
+
m[k] = val
|
|
326
|
+
|
|
327
|
+
return m
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
class Fields2TypedDict(TypedDict):
|
|
331
|
+
key: str
|
|
332
|
+
label: str
|
|
333
|
+
required: bool
|
|
334
|
+
locked: bool
|
|
335
|
+
position: int
|
|
336
|
+
type: PartnerEnrolledEventFieldsType
|
|
337
|
+
constraints: NotRequired[FieldsConstraintsTypedDict]
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
class Fields2(BaseModel):
|
|
341
|
+
key: str
|
|
342
|
+
|
|
343
|
+
label: str
|
|
344
|
+
|
|
345
|
+
required: bool
|
|
346
|
+
|
|
347
|
+
locked: bool
|
|
348
|
+
|
|
349
|
+
position: int
|
|
350
|
+
|
|
351
|
+
type: PartnerEnrolledEventFieldsType
|
|
352
|
+
|
|
353
|
+
constraints: Optional[FieldsConstraints] = None
|
|
354
|
+
|
|
355
|
+
@model_serializer(mode="wrap")
|
|
356
|
+
def serialize_model(self, handler):
|
|
357
|
+
optional_fields = set(["constraints"])
|
|
358
|
+
serialized = handler(self)
|
|
359
|
+
m = {}
|
|
360
|
+
|
|
361
|
+
for n, f in type(self).model_fields.items():
|
|
362
|
+
k = f.alias or n
|
|
363
|
+
val = serialized.get(k)
|
|
364
|
+
|
|
365
|
+
if val != UNSET_SENTINEL:
|
|
366
|
+
if val is not None or k not in optional_fields:
|
|
367
|
+
m[k] = val
|
|
368
|
+
|
|
369
|
+
return m
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
class FieldsType(str, Enum):
|
|
373
|
+
TEXT = "text"
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
class ConstraintsTypedDict(TypedDict):
|
|
377
|
+
max_length: NotRequired[int]
|
|
378
|
+
pattern: NotRequired[str]
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
class Constraints(BaseModel):
|
|
382
|
+
max_length: Annotated[Optional[int], pydantic.Field(alias="maxLength")] = None
|
|
383
|
+
|
|
384
|
+
pattern: Optional[str] = None
|
|
385
|
+
|
|
386
|
+
@model_serializer(mode="wrap")
|
|
387
|
+
def serialize_model(self, handler):
|
|
388
|
+
optional_fields = set(["maxLength", "pattern"])
|
|
389
|
+
serialized = handler(self)
|
|
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
|
+
|
|
396
|
+
if val != UNSET_SENTINEL:
|
|
397
|
+
if val is not None or k not in optional_fields:
|
|
398
|
+
m[k] = val
|
|
399
|
+
|
|
400
|
+
return m
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
class Fields1TypedDict(TypedDict):
|
|
404
|
+
key: str
|
|
405
|
+
label: str
|
|
406
|
+
required: bool
|
|
407
|
+
locked: bool
|
|
408
|
+
position: int
|
|
409
|
+
type: FieldsType
|
|
410
|
+
constraints: NotRequired[ConstraintsTypedDict]
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
class Fields1(BaseModel):
|
|
414
|
+
key: str
|
|
415
|
+
|
|
416
|
+
label: str
|
|
417
|
+
|
|
418
|
+
required: bool
|
|
419
|
+
|
|
420
|
+
locked: bool
|
|
421
|
+
|
|
422
|
+
position: int
|
|
423
|
+
|
|
424
|
+
type: FieldsType
|
|
425
|
+
|
|
426
|
+
constraints: Optional[Constraints] = None
|
|
427
|
+
|
|
428
|
+
@model_serializer(mode="wrap")
|
|
429
|
+
def serialize_model(self, handler):
|
|
430
|
+
optional_fields = set(["constraints"])
|
|
431
|
+
serialized = handler(self)
|
|
432
|
+
m = {}
|
|
433
|
+
|
|
434
|
+
for n, f in type(self).model_fields.items():
|
|
435
|
+
k = f.alias or n
|
|
436
|
+
val = serialized.get(k)
|
|
437
|
+
|
|
438
|
+
if val != UNSET_SENTINEL:
|
|
439
|
+
if val is not None or k not in optional_fields:
|
|
440
|
+
m[k] = val
|
|
441
|
+
|
|
442
|
+
return m
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
FieldsTypedDict = TypeAliasType(
|
|
446
|
+
"FieldsTypedDict",
|
|
447
|
+
Union[
|
|
448
|
+
FourTypedDict,
|
|
449
|
+
FiveTypedDict,
|
|
450
|
+
SevenTypedDict,
|
|
451
|
+
EightTypedDict,
|
|
452
|
+
Fields1TypedDict,
|
|
453
|
+
Fields2TypedDict,
|
|
454
|
+
Fields3TypedDict,
|
|
455
|
+
SixTypedDict,
|
|
456
|
+
],
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
Fields = Annotated[
|
|
461
|
+
Union[
|
|
462
|
+
Annotated[Fields1, Tag("text")],
|
|
463
|
+
Annotated[Fields2, Tag("textarea")],
|
|
464
|
+
Annotated[Fields3, Tag("select")],
|
|
465
|
+
Annotated[Four, Tag("country")],
|
|
466
|
+
Annotated[Five, Tag("date")],
|
|
467
|
+
Annotated[Six, Tag("multiSelect")],
|
|
468
|
+
Annotated[Seven, Tag("number")],
|
|
469
|
+
Annotated[Eight, Tag("phone")],
|
|
470
|
+
],
|
|
471
|
+
Discriminator(lambda m: get_discriminator(m, "type", "type")),
|
|
472
|
+
]
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
class ReferralFormDataTypedDict(TypedDict):
|
|
476
|
+
fields: List[FieldsTypedDict]
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
class ReferralFormData(BaseModel):
|
|
480
|
+
fields: List[Fields]
|
|
481
|
+
|
|
482
|
+
|
|
95
483
|
class PartnerEnrolledEventDataTypedDict(TypedDict):
|
|
96
484
|
id: str
|
|
97
485
|
r"""The partner's unique ID on Dub."""
|
|
@@ -140,6 +528,7 @@ class PartnerEnrolledEventDataTypedDict(TypedDict):
|
|
|
140
528
|
r"""If the partner was banned from the program, this is the date of the ban."""
|
|
141
529
|
banned_reason: NotRequired[Nullable[BannedReason]]
|
|
142
530
|
r"""If the partner was banned from the program, this is the reason for the ban."""
|
|
531
|
+
referral_form_data: NotRequired[Nullable[ReferralFormDataTypedDict]]
|
|
143
532
|
total_clicks: NotRequired[float]
|
|
144
533
|
r"""The total number of clicks on the partner's links"""
|
|
145
534
|
total_leads: NotRequired[float]
|
|
@@ -270,6 +659,10 @@ class PartnerEnrolledEventData(BaseModel):
|
|
|
270
659
|
] = UNSET
|
|
271
660
|
r"""If the partner was banned from the program, this is the reason for the ban."""
|
|
272
661
|
|
|
662
|
+
referral_form_data: Annotated[
|
|
663
|
+
OptionalNullable[ReferralFormData], pydantic.Field(alias="referralFormData")
|
|
664
|
+
] = UNSET
|
|
665
|
+
|
|
273
666
|
total_clicks: Annotated[Optional[float], pydantic.Field(alias="totalClicks")] = 0
|
|
274
667
|
r"""The total number of clicks on the partner's links"""
|
|
275
668
|
|
|
@@ -342,92 +735,93 @@ class PartnerEnrolledEventData(BaseModel):
|
|
|
342
735
|
|
|
343
736
|
@model_serializer(mode="wrap")
|
|
344
737
|
def serialize_model(self, handler):
|
|
345
|
-
optional_fields =
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
738
|
+
optional_fields = set(
|
|
739
|
+
[
|
|
740
|
+
"description",
|
|
741
|
+
"groupId",
|
|
742
|
+
"totalCommissions",
|
|
743
|
+
"clickRewardId",
|
|
744
|
+
"leadRewardId",
|
|
745
|
+
"saleRewardId",
|
|
746
|
+
"discountId",
|
|
747
|
+
"applicationId",
|
|
748
|
+
"bannedAt",
|
|
749
|
+
"bannedReason",
|
|
750
|
+
"referralFormData",
|
|
751
|
+
"totalClicks",
|
|
752
|
+
"totalLeads",
|
|
753
|
+
"totalConversions",
|
|
754
|
+
"totalSales",
|
|
755
|
+
"totalSaleAmount",
|
|
756
|
+
"netRevenue",
|
|
757
|
+
"earningsPerClick",
|
|
758
|
+
"averageLifetimeValue",
|
|
759
|
+
"clickToLeadRate",
|
|
760
|
+
"clickToConversionRate",
|
|
761
|
+
"leadToConversionRate",
|
|
762
|
+
"returnOnAdSpend",
|
|
763
|
+
"website",
|
|
764
|
+
"youtube",
|
|
765
|
+
"twitter",
|
|
766
|
+
"linkedin",
|
|
767
|
+
"instagram",
|
|
768
|
+
"tiktok",
|
|
769
|
+
]
|
|
770
|
+
)
|
|
771
|
+
nullable_fields = set(
|
|
772
|
+
[
|
|
773
|
+
"companyName",
|
|
774
|
+
"email",
|
|
775
|
+
"image",
|
|
776
|
+
"description",
|
|
777
|
+
"country",
|
|
778
|
+
"paypalEmail",
|
|
779
|
+
"stripeConnectId",
|
|
780
|
+
"payoutsEnabledAt",
|
|
781
|
+
"trustedAt",
|
|
782
|
+
"groupId",
|
|
783
|
+
"tenantId",
|
|
784
|
+
"links",
|
|
785
|
+
"clickRewardId",
|
|
786
|
+
"leadRewardId",
|
|
787
|
+
"saleRewardId",
|
|
788
|
+
"discountId",
|
|
789
|
+
"applicationId",
|
|
790
|
+
"bannedAt",
|
|
791
|
+
"bannedReason",
|
|
792
|
+
"referralFormData",
|
|
793
|
+
"earningsPerClick",
|
|
794
|
+
"averageLifetimeValue",
|
|
795
|
+
"clickToLeadRate",
|
|
796
|
+
"clickToConversionRate",
|
|
797
|
+
"leadToConversionRate",
|
|
798
|
+
"returnOnAdSpend",
|
|
799
|
+
"website",
|
|
800
|
+
"youtube",
|
|
801
|
+
"twitter",
|
|
802
|
+
"linkedin",
|
|
803
|
+
"instagram",
|
|
804
|
+
"tiktok",
|
|
805
|
+
]
|
|
806
|
+
)
|
|
410
807
|
serialized = handler(self)
|
|
411
|
-
|
|
412
808
|
m = {}
|
|
413
809
|
|
|
414
810
|
for n, f in type(self).model_fields.items():
|
|
415
811
|
k = f.alias or n
|
|
416
812
|
val = serialized.get(k)
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
):
|
|
430
|
-
m[k] = val
|
|
813
|
+
is_nullable_and_explicitly_set = (
|
|
814
|
+
k in nullable_fields
|
|
815
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
816
|
+
)
|
|
817
|
+
|
|
818
|
+
if val != UNSET_SENTINEL:
|
|
819
|
+
if (
|
|
820
|
+
val is not None
|
|
821
|
+
or k not in optional_fields
|
|
822
|
+
or is_nullable_and_explicitly_set
|
|
823
|
+
):
|
|
824
|
+
m[k] = val
|
|
431
825
|
|
|
432
826
|
return m
|
|
433
827
|
|