dub 0.34.0__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/{workspaces.py → bounties.py} +349 -69
- dub/models/components/__init__.py +114 -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 +123 -63
- 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 +323 -19
- dub/models/operations/approvebountysubmission.py +211 -0
- 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 +249 -0
- 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 +219 -0
- 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 +77 -90
- dub/partners.py +288 -0
- dub/sdk.py +3 -3
- dub/utils/__init__.py +10 -1
- {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/METADATA +10 -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-0.34.0.dist-info/RECORD +0 -142
- {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
- {dub-0.34.0.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
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from dub.types import BaseModel, Nullable, UNSET_SENTINEL
|
|
5
|
+
from dub.utils import FieldMetadata, PathParamMetadata, RequestMetadata
|
|
6
|
+
from enum import Enum
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic import model_serializer
|
|
9
|
+
from typing import List, Optional
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class RejectionReason(str, Enum):
|
|
14
|
+
r"""The reason for rejecting the submission."""
|
|
15
|
+
|
|
16
|
+
INVALID_PROOF = "invalidProof"
|
|
17
|
+
DUPLICATE_SUBMISSION = "duplicateSubmission"
|
|
18
|
+
OUT_OF_TIME_WINDOW = "outOfTimeWindow"
|
|
19
|
+
DID_NOT_MEET_CRITERIA = "didNotMeetCriteria"
|
|
20
|
+
OTHER = "other"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class RejectBountySubmissionRequestBodyTypedDict(TypedDict):
|
|
24
|
+
rejection_reason: NotRequired[RejectionReason]
|
|
25
|
+
r"""The reason for rejecting the submission."""
|
|
26
|
+
rejection_note: NotRequired[str]
|
|
27
|
+
r"""The note for rejecting the submission."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class RejectBountySubmissionRequestBody(BaseModel):
|
|
31
|
+
rejection_reason: Annotated[
|
|
32
|
+
Optional[RejectionReason], pydantic.Field(alias="rejectionReason")
|
|
33
|
+
] = None
|
|
34
|
+
r"""The reason for rejecting the submission."""
|
|
35
|
+
|
|
36
|
+
rejection_note: Annotated[Optional[str], pydantic.Field(alias="rejectionNote")] = (
|
|
37
|
+
None
|
|
38
|
+
)
|
|
39
|
+
r"""The note for rejecting the submission."""
|
|
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
|
+
|
|
57
|
+
|
|
58
|
+
class RejectBountySubmissionRequestTypedDict(TypedDict):
|
|
59
|
+
bounty_id: str
|
|
60
|
+
r"""The ID of the bounty"""
|
|
61
|
+
submission_id: str
|
|
62
|
+
r"""The ID of the bounty submission"""
|
|
63
|
+
request_body: NotRequired[RejectBountySubmissionRequestBodyTypedDict]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class RejectBountySubmissionRequest(BaseModel):
|
|
67
|
+
bounty_id: Annotated[
|
|
68
|
+
str,
|
|
69
|
+
pydantic.Field(alias="bountyId"),
|
|
70
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
71
|
+
]
|
|
72
|
+
r"""The ID of the bounty"""
|
|
73
|
+
|
|
74
|
+
submission_id: Annotated[
|
|
75
|
+
str,
|
|
76
|
+
pydantic.Field(alias="submissionId"),
|
|
77
|
+
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
78
|
+
]
|
|
79
|
+
r"""The ID of the bounty submission"""
|
|
80
|
+
|
|
81
|
+
request_body: Annotated[
|
|
82
|
+
Optional[RejectBountySubmissionRequestBody],
|
|
83
|
+
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
|
84
|
+
] = None
|
|
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
|
+
|
|
102
|
+
|
|
103
|
+
class RejectBountySubmissionFilesTypedDict(TypedDict):
|
|
104
|
+
url: str
|
|
105
|
+
r"""The URL of the uploaded file."""
|
|
106
|
+
file_name: str
|
|
107
|
+
r"""The original file name."""
|
|
108
|
+
size: float
|
|
109
|
+
r"""The file size in bytes."""
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class RejectBountySubmissionFiles(BaseModel):
|
|
113
|
+
url: str
|
|
114
|
+
r"""The URL of the uploaded file."""
|
|
115
|
+
|
|
116
|
+
file_name: Annotated[str, pydantic.Field(alias="fileName")]
|
|
117
|
+
r"""The original file name."""
|
|
118
|
+
|
|
119
|
+
size: float
|
|
120
|
+
r"""The file size in bytes."""
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class RejectBountySubmissionStatus(str, Enum):
|
|
124
|
+
r"""The status of the submission"""
|
|
125
|
+
|
|
126
|
+
DRAFT = "draft"
|
|
127
|
+
SUBMITTED = "submitted"
|
|
128
|
+
APPROVED = "approved"
|
|
129
|
+
REJECTED = "rejected"
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class RejectBountySubmissionResponseBodyTypedDict(TypedDict):
|
|
133
|
+
r"""The rejected bounty submission."""
|
|
134
|
+
|
|
135
|
+
id: str
|
|
136
|
+
r"""The ID of the bounty submission"""
|
|
137
|
+
bounty_id: str
|
|
138
|
+
r"""The ID of the bounty"""
|
|
139
|
+
partner_id: str
|
|
140
|
+
r"""The ID of the partner"""
|
|
141
|
+
description: Nullable[str]
|
|
142
|
+
r"""The description of the submission"""
|
|
143
|
+
urls: Nullable[List[str]]
|
|
144
|
+
r"""The URLs submitted for the submission"""
|
|
145
|
+
files: Nullable[List[RejectBountySubmissionFilesTypedDict]]
|
|
146
|
+
r"""The files uploaded for the submission"""
|
|
147
|
+
status: RejectBountySubmissionStatus
|
|
148
|
+
r"""The status of the submission"""
|
|
149
|
+
performance_count: Nullable[float]
|
|
150
|
+
r"""The performance count of the submission"""
|
|
151
|
+
created_at: str
|
|
152
|
+
r"""The date and time the submission was created"""
|
|
153
|
+
completed_at: Nullable[str]
|
|
154
|
+
r"""The date and time the submission was completed"""
|
|
155
|
+
reviewed_at: Nullable[str]
|
|
156
|
+
r"""The date and time the submission was reviewed"""
|
|
157
|
+
rejection_reason: Nullable[str]
|
|
158
|
+
r"""The reason for rejecting the submission"""
|
|
159
|
+
rejection_note: Nullable[str]
|
|
160
|
+
r"""The note for rejecting the submission"""
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class RejectBountySubmissionResponseBody(BaseModel):
|
|
164
|
+
r"""The rejected bounty submission."""
|
|
165
|
+
|
|
166
|
+
id: str
|
|
167
|
+
r"""The ID of the bounty submission"""
|
|
168
|
+
|
|
169
|
+
bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
|
|
170
|
+
r"""The ID of the bounty"""
|
|
171
|
+
|
|
172
|
+
partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
|
|
173
|
+
r"""The ID of the partner"""
|
|
174
|
+
|
|
175
|
+
description: Nullable[str]
|
|
176
|
+
r"""The description of the submission"""
|
|
177
|
+
|
|
178
|
+
urls: Nullable[List[str]]
|
|
179
|
+
r"""The URLs submitted for the submission"""
|
|
180
|
+
|
|
181
|
+
files: Nullable[List[RejectBountySubmissionFiles]]
|
|
182
|
+
r"""The files uploaded for the submission"""
|
|
183
|
+
|
|
184
|
+
status: RejectBountySubmissionStatus
|
|
185
|
+
r"""The status of the submission"""
|
|
186
|
+
|
|
187
|
+
performance_count: Annotated[
|
|
188
|
+
Nullable[float], pydantic.Field(alias="performanceCount")
|
|
189
|
+
]
|
|
190
|
+
r"""The performance count of the submission"""
|
|
191
|
+
|
|
192
|
+
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
193
|
+
r"""The date and time the submission was created"""
|
|
194
|
+
|
|
195
|
+
completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
|
|
196
|
+
r"""The date and time the submission was completed"""
|
|
197
|
+
|
|
198
|
+
reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
|
|
199
|
+
r"""The date and time the submission was reviewed"""
|
|
200
|
+
|
|
201
|
+
rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
|
|
202
|
+
r"""The reason for rejecting the submission"""
|
|
203
|
+
|
|
204
|
+
rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
|
|
205
|
+
r"""The note for rejecting the submission"""
|
|
206
|
+
|
|
207
|
+
@model_serializer(mode="wrap")
|
|
208
|
+
def serialize_model(self, handler):
|
|
209
|
+
serialized = handler(self)
|
|
210
|
+
m = {}
|
|
211
|
+
|
|
212
|
+
for n, f in type(self).model_fields.items():
|
|
213
|
+
k = f.alias or n
|
|
214
|
+
val = serialized.get(k)
|
|
215
|
+
|
|
216
|
+
if val != UNSET_SENTINEL:
|
|
217
|
+
m[k] = val
|
|
218
|
+
|
|
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
|
|