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
|
@@ -41,30 +41,14 @@ class RegisterDomainResponseBody(BaseModel):
|
|
|
41
41
|
|
|
42
42
|
@model_serializer(mode="wrap")
|
|
43
43
|
def serialize_model(self, handler):
|
|
44
|
-
optional_fields = []
|
|
45
|
-
nullable_fields = ["expiration"]
|
|
46
|
-
null_default_fields = []
|
|
47
|
-
|
|
48
44
|
serialized = handler(self)
|
|
49
|
-
|
|
50
45
|
m = {}
|
|
51
46
|
|
|
52
47
|
for n, f in type(self).model_fields.items():
|
|
53
48
|
k = f.alias or n
|
|
54
49
|
val = serialized.get(k)
|
|
55
|
-
serialized.pop(k, None)
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
is_set = (
|
|
59
|
-
self.__pydantic_fields_set__.intersection({n})
|
|
60
|
-
or k in null_default_fields
|
|
61
|
-
) # pylint: disable=no-member
|
|
62
|
-
|
|
63
|
-
if val is not None and val != UNSET_SENTINEL:
|
|
64
|
-
m[k] = val
|
|
65
|
-
elif val != UNSET_SENTINEL and (
|
|
66
|
-
not k in optional_fields or (optional_nullable and is_set)
|
|
67
|
-
):
|
|
51
|
+
if val != UNSET_SENTINEL:
|
|
68
52
|
m[k] = val
|
|
69
53
|
|
|
70
54
|
return m
|
|
@@ -38,10 +38,28 @@ class RejectBountySubmissionRequestBody(BaseModel):
|
|
|
38
38
|
)
|
|
39
39
|
r"""The note for rejecting the submission."""
|
|
40
40
|
|
|
41
|
+
@model_serializer(mode="wrap")
|
|
42
|
+
def serialize_model(self, handler):
|
|
43
|
+
optional_fields = set(["rejectionReason", "rejectionNote"])
|
|
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
|
|
56
|
+
|
|
41
57
|
|
|
42
58
|
class RejectBountySubmissionRequestTypedDict(TypedDict):
|
|
43
59
|
bounty_id: str
|
|
60
|
+
r"""The ID of the bounty"""
|
|
44
61
|
submission_id: str
|
|
62
|
+
r"""The ID of the bounty submission"""
|
|
45
63
|
request_body: NotRequired[RejectBountySubmissionRequestBodyTypedDict]
|
|
46
64
|
|
|
47
65
|
|
|
@@ -51,34 +69,60 @@ class RejectBountySubmissionRequest(BaseModel):
|
|
|
51
69
|
pydantic.Field(alias="bountyId"),
|
|
52
70
|
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
53
71
|
]
|
|
72
|
+
r"""The ID of the bounty"""
|
|
54
73
|
|
|
55
74
|
submission_id: Annotated[
|
|
56
75
|
str,
|
|
57
76
|
pydantic.Field(alias="submissionId"),
|
|
58
77
|
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
59
78
|
]
|
|
79
|
+
r"""The ID of the bounty submission"""
|
|
60
80
|
|
|
61
81
|
request_body: Annotated[
|
|
62
82
|
Optional[RejectBountySubmissionRequestBody],
|
|
63
83
|
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
64
84
|
] = None
|
|
65
85
|
|
|
86
|
+
@model_serializer(mode="wrap")
|
|
87
|
+
def serialize_model(self, handler):
|
|
88
|
+
optional_fields = set(["RequestBody"])
|
|
89
|
+
serialized = handler(self)
|
|
90
|
+
m = {}
|
|
91
|
+
|
|
92
|
+
for n, f in type(self).model_fields.items():
|
|
93
|
+
k = f.alias or n
|
|
94
|
+
val = serialized.get(k)
|
|
95
|
+
|
|
96
|
+
if val != UNSET_SENTINEL:
|
|
97
|
+
if val is not None or k not in optional_fields:
|
|
98
|
+
m[k] = val
|
|
99
|
+
|
|
100
|
+
return m
|
|
101
|
+
|
|
66
102
|
|
|
67
103
|
class RejectBountySubmissionFilesTypedDict(TypedDict):
|
|
68
104
|
url: str
|
|
105
|
+
r"""The URL of the uploaded file."""
|
|
69
106
|
file_name: str
|
|
107
|
+
r"""The original file name."""
|
|
70
108
|
size: float
|
|
109
|
+
r"""The file size in bytes."""
|
|
71
110
|
|
|
72
111
|
|
|
73
112
|
class RejectBountySubmissionFiles(BaseModel):
|
|
74
113
|
url: str
|
|
114
|
+
r"""The URL of the uploaded file."""
|
|
75
115
|
|
|
76
116
|
file_name: Annotated[str, pydantic.Field(alias="fileName")]
|
|
117
|
+
r"""The original file name."""
|
|
77
118
|
|
|
78
119
|
size: float
|
|
120
|
+
r"""The file size in bytes."""
|
|
79
121
|
|
|
80
122
|
|
|
81
123
|
class RejectBountySubmissionStatus(str, Enum):
|
|
124
|
+
r"""The status of the submission"""
|
|
125
|
+
|
|
82
126
|
DRAFT = "draft"
|
|
83
127
|
SUBMITTED = "submitted"
|
|
84
128
|
APPROVED = "approved"
|
|
@@ -89,86 +133,87 @@ class RejectBountySubmissionResponseBodyTypedDict(TypedDict):
|
|
|
89
133
|
r"""The rejected bounty submission."""
|
|
90
134
|
|
|
91
135
|
id: str
|
|
136
|
+
r"""The ID of the bounty submission"""
|
|
92
137
|
bounty_id: str
|
|
138
|
+
r"""The ID of the bounty"""
|
|
93
139
|
partner_id: str
|
|
140
|
+
r"""The ID of the partner"""
|
|
94
141
|
description: Nullable[str]
|
|
142
|
+
r"""The description of the submission"""
|
|
95
143
|
urls: Nullable[List[str]]
|
|
144
|
+
r"""The URLs submitted for the submission"""
|
|
96
145
|
files: Nullable[List[RejectBountySubmissionFilesTypedDict]]
|
|
146
|
+
r"""The files uploaded for the submission"""
|
|
97
147
|
status: RejectBountySubmissionStatus
|
|
148
|
+
r"""The status of the submission"""
|
|
98
149
|
performance_count: Nullable[float]
|
|
150
|
+
r"""The performance count of the submission"""
|
|
99
151
|
created_at: str
|
|
152
|
+
r"""The date and time the submission was created"""
|
|
100
153
|
completed_at: Nullable[str]
|
|
154
|
+
r"""The date and time the submission was completed"""
|
|
101
155
|
reviewed_at: Nullable[str]
|
|
156
|
+
r"""The date and time the submission was reviewed"""
|
|
102
157
|
rejection_reason: Nullable[str]
|
|
158
|
+
r"""The reason for rejecting the submission"""
|
|
103
159
|
rejection_note: Nullable[str]
|
|
160
|
+
r"""The note for rejecting the submission"""
|
|
104
161
|
|
|
105
162
|
|
|
106
163
|
class RejectBountySubmissionResponseBody(BaseModel):
|
|
107
164
|
r"""The rejected bounty submission."""
|
|
108
165
|
|
|
109
166
|
id: str
|
|
167
|
+
r"""The ID of the bounty submission"""
|
|
110
168
|
|
|
111
169
|
bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
|
|
170
|
+
r"""The ID of the bounty"""
|
|
112
171
|
|
|
113
172
|
partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
|
|
173
|
+
r"""The ID of the partner"""
|
|
114
174
|
|
|
115
175
|
description: Nullable[str]
|
|
176
|
+
r"""The description of the submission"""
|
|
116
177
|
|
|
117
178
|
urls: Nullable[List[str]]
|
|
179
|
+
r"""The URLs submitted for the submission"""
|
|
118
180
|
|
|
119
181
|
files: Nullable[List[RejectBountySubmissionFiles]]
|
|
182
|
+
r"""The files uploaded for the submission"""
|
|
120
183
|
|
|
121
184
|
status: RejectBountySubmissionStatus
|
|
185
|
+
r"""The status of the submission"""
|
|
122
186
|
|
|
123
187
|
performance_count: Annotated[
|
|
124
188
|
Nullable[float], pydantic.Field(alias="performanceCount")
|
|
125
189
|
]
|
|
190
|
+
r"""The performance count of the submission"""
|
|
126
191
|
|
|
127
192
|
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
193
|
+
r"""The date and time the submission was created"""
|
|
128
194
|
|
|
129
195
|
completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
|
|
196
|
+
r"""The date and time the submission was completed"""
|
|
130
197
|
|
|
131
198
|
reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
|
|
199
|
+
r"""The date and time the submission was reviewed"""
|
|
132
200
|
|
|
133
201
|
rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
|
|
202
|
+
r"""The reason for rejecting the submission"""
|
|
134
203
|
|
|
135
204
|
rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
|
|
205
|
+
r"""The note for rejecting the submission"""
|
|
136
206
|
|
|
137
207
|
@model_serializer(mode="wrap")
|
|
138
208
|
def serialize_model(self, handler):
|
|
139
|
-
optional_fields = []
|
|
140
|
-
nullable_fields = [
|
|
141
|
-
"description",
|
|
142
|
-
"urls",
|
|
143
|
-
"files",
|
|
144
|
-
"performanceCount",
|
|
145
|
-
"completedAt",
|
|
146
|
-
"reviewedAt",
|
|
147
|
-
"rejectionReason",
|
|
148
|
-
"rejectionNote",
|
|
149
|
-
]
|
|
150
|
-
null_default_fields = []
|
|
151
|
-
|
|
152
209
|
serialized = handler(self)
|
|
153
|
-
|
|
154
210
|
m = {}
|
|
155
211
|
|
|
156
212
|
for n, f in type(self).model_fields.items():
|
|
157
213
|
k = f.alias or n
|
|
158
214
|
val = serialized.get(k)
|
|
159
|
-
serialized.pop(k, None)
|
|
160
|
-
|
|
161
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
|
162
|
-
is_set = (
|
|
163
|
-
self.__pydantic_fields_set__.intersection({n})
|
|
164
|
-
or k in null_default_fields
|
|
165
|
-
) # pylint: disable=no-member
|
|
166
215
|
|
|
167
|
-
if val
|
|
168
|
-
m[k] = val
|
|
169
|
-
elif val != UNSET_SENTINEL and (
|
|
170
|
-
not k in optional_fields or (optional_nullable and is_set)
|
|
171
|
-
):
|
|
216
|
+
if val != UNSET_SENTINEL:
|
|
172
217
|
m[k] = val
|
|
173
218
|
|
|
174
219
|
return m
|
|
@@ -451,78 +451,77 @@ class RetrieveAnalyticsRequest(BaseModel):
|
|
|
451
451
|
|
|
452
452
|
@model_serializer(mode="wrap")
|
|
453
453
|
def serialize_model(self, handler):
|
|
454
|
-
optional_fields =
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
454
|
+
optional_fields = set(
|
|
455
|
+
[
|
|
456
|
+
"event",
|
|
457
|
+
"groupBy",
|
|
458
|
+
"domain",
|
|
459
|
+
"key",
|
|
460
|
+
"linkId",
|
|
461
|
+
"externalId",
|
|
462
|
+
"tenantId",
|
|
463
|
+
"programId",
|
|
464
|
+
"partnerId",
|
|
465
|
+
"customerId",
|
|
466
|
+
"interval",
|
|
467
|
+
"start",
|
|
468
|
+
"end",
|
|
469
|
+
"timezone",
|
|
470
|
+
"country",
|
|
471
|
+
"city",
|
|
472
|
+
"region",
|
|
473
|
+
"continent",
|
|
474
|
+
"device",
|
|
475
|
+
"browser",
|
|
476
|
+
"os",
|
|
477
|
+
"trigger",
|
|
478
|
+
"referer",
|
|
479
|
+
"refererUrl",
|
|
480
|
+
"url",
|
|
481
|
+
"tagIds",
|
|
482
|
+
"folderId",
|
|
483
|
+
"groupId",
|
|
484
|
+
"root",
|
|
485
|
+
"saleType",
|
|
486
|
+
"query",
|
|
487
|
+
"tagId",
|
|
488
|
+
"qr",
|
|
489
|
+
"utm_source",
|
|
490
|
+
"utm_medium",
|
|
491
|
+
"utm_campaign",
|
|
492
|
+
"utm_term",
|
|
493
|
+
"utm_content",
|
|
494
|
+
"ref",
|
|
495
|
+
]
|
|
496
|
+
)
|
|
497
|
+
nullable_fields = set(
|
|
498
|
+
[
|
|
499
|
+
"utm_source",
|
|
500
|
+
"utm_medium",
|
|
501
|
+
"utm_campaign",
|
|
502
|
+
"utm_term",
|
|
503
|
+
"utm_content",
|
|
504
|
+
"ref",
|
|
505
|
+
]
|
|
506
|
+
)
|
|
505
507
|
serialized = handler(self)
|
|
506
|
-
|
|
507
508
|
m = {}
|
|
508
509
|
|
|
509
510
|
for n, f in type(self).model_fields.items():
|
|
510
511
|
k = f.alias or n
|
|
511
512
|
val = serialized.get(k)
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
):
|
|
525
|
-
m[k] = val
|
|
513
|
+
is_nullable_and_explicitly_set = (
|
|
514
|
+
k in nullable_fields
|
|
515
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
516
|
+
)
|
|
517
|
+
|
|
518
|
+
if val != UNSET_SENTINEL:
|
|
519
|
+
if (
|
|
520
|
+
val is not None
|
|
521
|
+
or k not in optional_fields
|
|
522
|
+
or is_nullable_and_explicitly_set
|
|
523
|
+
):
|
|
524
|
+
m[k] = val
|
|
526
525
|
|
|
527
526
|
return m
|
|
528
527
|
|
|
@@ -33,31 +33,26 @@ class RetrieveLinksRequest(BaseModel):
|
|
|
33
33
|
|
|
34
34
|
@model_serializer(mode="wrap")
|
|
35
35
|
def serialize_model(self, handler):
|
|
36
|
-
optional_fields = ["partnerId", "tenantId"]
|
|
37
|
-
nullable_fields = ["partnerId", "tenantId"]
|
|
38
|
-
null_default_fields = []
|
|
39
|
-
|
|
36
|
+
optional_fields = set(["partnerId", "tenantId"])
|
|
37
|
+
nullable_fields = set(["partnerId", "tenantId"])
|
|
40
38
|
serialized = handler(self)
|
|
41
|
-
|
|
42
39
|
m = {}
|
|
43
40
|
|
|
44
41
|
for n, f in type(self).model_fields.items():
|
|
45
42
|
k = f.alias or n
|
|
46
43
|
val = serialized.get(k)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
):
|
|
60
|
-
m[k] = val
|
|
44
|
+
is_nullable_and_explicitly_set = (
|
|
45
|
+
k in nullable_fields
|
|
46
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
if val != UNSET_SENTINEL:
|
|
50
|
+
if (
|
|
51
|
+
val is not None
|
|
52
|
+
or k not in optional_fields
|
|
53
|
+
or is_nullable_and_explicitly_set
|
|
54
|
+
):
|
|
55
|
+
m[k] = val
|
|
61
56
|
|
|
62
57
|
return m
|
|
63
58
|
|
|
@@ -115,3 +110,19 @@ class RetrieveLinksResponseBody(BaseModel):
|
|
|
115
110
|
|
|
116
111
|
sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
|
|
117
112
|
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
113
|
+
|
|
114
|
+
@model_serializer(mode="wrap")
|
|
115
|
+
def serialize_model(self, handler):
|
|
116
|
+
optional_fields = set(["clicks", "leads", "conversions", "sales", "saleAmount"])
|
|
117
|
+
serialized = handler(self)
|
|
118
|
+
m = {}
|
|
119
|
+
|
|
120
|
+
for n, f in type(self).model_fields.items():
|
|
121
|
+
k = f.alias or n
|
|
122
|
+
val = serialized.get(k)
|
|
123
|
+
|
|
124
|
+
if val != UNSET_SENTINEL:
|
|
125
|
+
if val is not None or k not in optional_fields:
|
|
126
|
+
m[k] = val
|
|
127
|
+
|
|
128
|
+
return m
|
|
@@ -110,40 +110,37 @@ class RetrievePartnerAnalyticsRequest(BaseModel):
|
|
|
110
110
|
|
|
111
111
|
@model_serializer(mode="wrap")
|
|
112
112
|
def serialize_model(self, handler):
|
|
113
|
-
optional_fields =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
113
|
+
optional_fields = set(
|
|
114
|
+
[
|
|
115
|
+
"partnerId",
|
|
116
|
+
"tenantId",
|
|
117
|
+
"interval",
|
|
118
|
+
"start",
|
|
119
|
+
"end",
|
|
120
|
+
"timezone",
|
|
121
|
+
"query",
|
|
122
|
+
"groupBy",
|
|
123
|
+
]
|
|
124
|
+
)
|
|
125
|
+
nullable_fields = set(["partnerId", "tenantId"])
|
|
126
126
|
serialized = handler(self)
|
|
127
|
-
|
|
128
127
|
m = {}
|
|
129
128
|
|
|
130
129
|
for n, f in type(self).model_fields.items():
|
|
131
130
|
k = f.alias or n
|
|
132
131
|
val = serialized.get(k)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
):
|
|
146
|
-
m[k] = val
|
|
132
|
+
is_nullable_and_explicitly_set = (
|
|
133
|
+
k in nullable_fields
|
|
134
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
if val != UNSET_SENTINEL:
|
|
138
|
+
if (
|
|
139
|
+
val is not None
|
|
140
|
+
or k not in optional_fields
|
|
141
|
+
or is_nullable_and_explicitly_set
|
|
142
|
+
):
|
|
143
|
+
m[k] = val
|
|
147
144
|
|
|
148
145
|
return m
|
|
149
146
|
|