dub 0.29.3__py3-none-any.whl → 0.32.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/analytics.py +2 -2
- dub/commissions.py +4 -4
- dub/customers.py +10 -10
- dub/domains.py +12 -12
- dub/embed_tokens.py +2 -2
- dub/events.py +2 -2
- dub/folders.py +8 -8
- dub/httpclient.py +0 -1
- dub/links.py +20 -20
- dub/models/components/__init__.py +22 -10
- dub/models/components/clickevent.py +3 -3
- dub/models/components/commissioncreatedevent.py +9 -6
- dub/models/components/folderschema.py +6 -1
- dub/models/components/leadcreatedevent.py +128 -4
- dub/models/components/leadevent.py +3 -3
- dub/models/components/linkclickedevent.py +3 -3
- dub/models/components/linkschema.py +3 -3
- dub/models/components/{tagschema.py → linktagschema.py} +2 -2
- dub/models/components/linkwebhookevent.py +3 -3
- dub/models/components/partnerenrolledevent.py +45 -92
- dub/models/components/salecreatedevent.py +128 -4
- dub/models/components/saleevent.py +3 -3
- dub/models/components/workspaceschema.py +13 -0
- dub/models/errors/badrequest.py +1 -1
- dub/models/errors/conflict.py +1 -1
- dub/models/errors/duberror.py +1 -1
- dub/models/errors/forbidden.py +1 -1
- dub/models/errors/internalservererror.py +1 -1
- dub/models/errors/inviteexpired.py +1 -1
- dub/models/errors/no_response_error.py +1 -1
- dub/models/errors/notfound.py +1 -1
- dub/models/errors/ratelimitexceeded.py +1 -1
- dub/models/errors/responsevalidationerror.py +1 -1
- dub/models/errors/sdkerror.py +1 -1
- dub/models/errors/unauthorized.py +1 -1
- dub/models/errors/unprocessableentity.py +1 -1
- dub/models/operations/bulkcreatelinks.py +2 -2
- dub/models/operations/createcustomer.py +10 -3
- dub/models/operations/createfolder.py +8 -3
- dub/models/operations/createlink.py +2 -2
- dub/models/operations/createpartner.py +47 -94
- dub/models/operations/getcustomer.py +1 -1
- dub/models/operations/getcustomers.py +1 -1
- dub/models/operations/listcommissions.py +11 -2
- dub/models/operations/listevents.py +10 -0
- dub/models/operations/listpartners.py +66 -115
- dub/models/operations/retrieveanalytics.py +14 -1
- dub/models/operations/retrievelinks.py +5 -0
- dub/models/operations/tracklead.py +2 -2
- dub/models/operations/updatecustomer.py +10 -3
- dub/models/operations/updatefolder.py +8 -3
- dub/models/operations/updatelink.py +2 -2
- dub/models/operations/upsertlink.py +2 -2
- dub/partners.py +16 -16
- dub/qr_codes.py +2 -2
- dub/sdk.py +2 -2
- dub/tags.py +20 -20
- dub/track.py +4 -4
- dub/utils/annotations.py +32 -8
- dub/workspaces.py +4 -4
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/METADATA +7 -4
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/RECORD +65 -65
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info}/WHEEL +1 -1
- {dub-0.29.3.dist-info → dub-0.32.0.dist-info/licenses}/LICENSE +0 -0
dub/partners.py
CHANGED
|
@@ -24,9 +24,9 @@ class Partners(BaseSDK):
|
|
|
24
24
|
timeout_ms: Optional[int] = None,
|
|
25
25
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
26
26
|
) -> Optional[operations.CreatePartnerResponseBody]:
|
|
27
|
-
r"""Create a partner
|
|
27
|
+
r"""Create or update a partner
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Creates or updates a partner record (upsert behavior). If a partner with the same email already exists, their program enrollment will be updated with the provided tenantId. If no existing partner is found, a new partner will be created using the supplied information.
|
|
30
30
|
|
|
31
31
|
:param request: The request object to send.
|
|
32
32
|
:param retries: Override the default retry configuration for this method
|
|
@@ -86,7 +86,7 @@ class Partners(BaseSDK):
|
|
|
86
86
|
config=self.sdk_configuration,
|
|
87
87
|
base_url=base_url or "",
|
|
88
88
|
operation_id="createPartner",
|
|
89
|
-
oauth2_scopes=
|
|
89
|
+
oauth2_scopes=None,
|
|
90
90
|
security_source=self.sdk_configuration.security,
|
|
91
91
|
),
|
|
92
92
|
request=req,
|
|
@@ -167,9 +167,9 @@ class Partners(BaseSDK):
|
|
|
167
167
|
timeout_ms: Optional[int] = None,
|
|
168
168
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
169
169
|
) -> Optional[operations.CreatePartnerResponseBody]:
|
|
170
|
-
r"""Create a partner
|
|
170
|
+
r"""Create or update a partner
|
|
171
171
|
|
|
172
|
-
|
|
172
|
+
Creates or updates a partner record (upsert behavior). If a partner with the same email already exists, their program enrollment will be updated with the provided tenantId. If no existing partner is found, a new partner will be created using the supplied information.
|
|
173
173
|
|
|
174
174
|
:param request: The request object to send.
|
|
175
175
|
:param retries: Override the default retry configuration for this method
|
|
@@ -229,7 +229,7 @@ class Partners(BaseSDK):
|
|
|
229
229
|
config=self.sdk_configuration,
|
|
230
230
|
base_url=base_url or "",
|
|
231
231
|
operation_id="createPartner",
|
|
232
|
-
oauth2_scopes=
|
|
232
|
+
oauth2_scopes=None,
|
|
233
233
|
security_source=self.sdk_configuration.security,
|
|
234
234
|
),
|
|
235
235
|
request=req,
|
|
@@ -360,7 +360,7 @@ class Partners(BaseSDK):
|
|
|
360
360
|
config=self.sdk_configuration,
|
|
361
361
|
base_url=base_url or "",
|
|
362
362
|
operation_id="listPartners",
|
|
363
|
-
oauth2_scopes=
|
|
363
|
+
oauth2_scopes=None,
|
|
364
364
|
security_source=self.sdk_configuration.security,
|
|
365
365
|
),
|
|
366
366
|
request=req,
|
|
@@ -491,7 +491,7 @@ class Partners(BaseSDK):
|
|
|
491
491
|
config=self.sdk_configuration,
|
|
492
492
|
base_url=base_url or "",
|
|
493
493
|
operation_id="listPartners",
|
|
494
|
-
oauth2_scopes=
|
|
494
|
+
oauth2_scopes=None,
|
|
495
495
|
security_source=self.sdk_configuration.security,
|
|
496
496
|
),
|
|
497
497
|
request=req,
|
|
@@ -634,7 +634,7 @@ class Partners(BaseSDK):
|
|
|
634
634
|
config=self.sdk_configuration,
|
|
635
635
|
base_url=base_url or "",
|
|
636
636
|
operation_id="createPartnerLink",
|
|
637
|
-
oauth2_scopes=
|
|
637
|
+
oauth2_scopes=None,
|
|
638
638
|
security_source=self.sdk_configuration.security,
|
|
639
639
|
),
|
|
640
640
|
request=req,
|
|
@@ -775,7 +775,7 @@ class Partners(BaseSDK):
|
|
|
775
775
|
config=self.sdk_configuration,
|
|
776
776
|
base_url=base_url or "",
|
|
777
777
|
operation_id="createPartnerLink",
|
|
778
|
-
oauth2_scopes=
|
|
778
|
+
oauth2_scopes=None,
|
|
779
779
|
security_source=self.sdk_configuration.security,
|
|
780
780
|
),
|
|
781
781
|
request=req,
|
|
@@ -904,7 +904,7 @@ class Partners(BaseSDK):
|
|
|
904
904
|
config=self.sdk_configuration,
|
|
905
905
|
base_url=base_url or "",
|
|
906
906
|
operation_id="retrieveLinks",
|
|
907
|
-
oauth2_scopes=
|
|
907
|
+
oauth2_scopes=None,
|
|
908
908
|
security_source=self.sdk_configuration.security,
|
|
909
909
|
),
|
|
910
910
|
request=req,
|
|
@@ -1033,7 +1033,7 @@ class Partners(BaseSDK):
|
|
|
1033
1033
|
config=self.sdk_configuration,
|
|
1034
1034
|
base_url=base_url or "",
|
|
1035
1035
|
operation_id="retrieveLinks",
|
|
1036
|
-
oauth2_scopes=
|
|
1036
|
+
oauth2_scopes=None,
|
|
1037
1037
|
security_source=self.sdk_configuration.security,
|
|
1038
1038
|
),
|
|
1039
1039
|
request=req,
|
|
@@ -1174,7 +1174,7 @@ class Partners(BaseSDK):
|
|
|
1174
1174
|
config=self.sdk_configuration,
|
|
1175
1175
|
base_url=base_url or "",
|
|
1176
1176
|
operation_id="upsertPartnerLink",
|
|
1177
|
-
oauth2_scopes=
|
|
1177
|
+
oauth2_scopes=None,
|
|
1178
1178
|
security_source=self.sdk_configuration.security,
|
|
1179
1179
|
),
|
|
1180
1180
|
request=req,
|
|
@@ -1315,7 +1315,7 @@ class Partners(BaseSDK):
|
|
|
1315
1315
|
config=self.sdk_configuration,
|
|
1316
1316
|
base_url=base_url or "",
|
|
1317
1317
|
operation_id="upsertPartnerLink",
|
|
1318
|
-
oauth2_scopes=
|
|
1318
|
+
oauth2_scopes=None,
|
|
1319
1319
|
security_source=self.sdk_configuration.security,
|
|
1320
1320
|
),
|
|
1321
1321
|
request=req,
|
|
@@ -1447,7 +1447,7 @@ class Partners(BaseSDK):
|
|
|
1447
1447
|
config=self.sdk_configuration,
|
|
1448
1448
|
base_url=base_url or "",
|
|
1449
1449
|
operation_id="retrievePartnerAnalytics",
|
|
1450
|
-
oauth2_scopes=
|
|
1450
|
+
oauth2_scopes=None,
|
|
1451
1451
|
security_source=self.sdk_configuration.security,
|
|
1452
1452
|
),
|
|
1453
1453
|
request=req,
|
|
@@ -1581,7 +1581,7 @@ class Partners(BaseSDK):
|
|
|
1581
1581
|
config=self.sdk_configuration,
|
|
1582
1582
|
base_url=base_url or "",
|
|
1583
1583
|
operation_id="retrievePartnerAnalytics",
|
|
1584
|
-
oauth2_scopes=
|
|
1584
|
+
oauth2_scopes=None,
|
|
1585
1585
|
security_source=self.sdk_configuration.security,
|
|
1586
1586
|
),
|
|
1587
1587
|
request=req,
|
dub/qr_codes.py
CHANGED
|
@@ -74,7 +74,7 @@ class QRCodes(BaseSDK):
|
|
|
74
74
|
config=self.sdk_configuration,
|
|
75
75
|
base_url=base_url or "",
|
|
76
76
|
operation_id="getQRCode",
|
|
77
|
-
oauth2_scopes=
|
|
77
|
+
oauth2_scopes=None,
|
|
78
78
|
security_source=self.sdk_configuration.security,
|
|
79
79
|
),
|
|
80
80
|
request=req,
|
|
@@ -203,7 +203,7 @@ class QRCodes(BaseSDK):
|
|
|
203
203
|
config=self.sdk_configuration,
|
|
204
204
|
base_url=base_url or "",
|
|
205
205
|
operation_id="getQRCode",
|
|
206
|
-
oauth2_scopes=
|
|
206
|
+
oauth2_scopes=None,
|
|
207
207
|
security_source=self.sdk_configuration.security,
|
|
208
208
|
),
|
|
209
209
|
request=req,
|
dub/sdk.py
CHANGED
|
@@ -88,7 +88,7 @@ class Dub(BaseSDK):
|
|
|
88
88
|
"""
|
|
89
89
|
client_supplied = True
|
|
90
90
|
if client is None:
|
|
91
|
-
client = httpx.Client()
|
|
91
|
+
client = httpx.Client(follow_redirects=True)
|
|
92
92
|
client_supplied = False
|
|
93
93
|
|
|
94
94
|
assert issubclass(
|
|
@@ -97,7 +97,7 @@ class Dub(BaseSDK):
|
|
|
97
97
|
|
|
98
98
|
async_client_supplied = True
|
|
99
99
|
if async_client is None:
|
|
100
|
-
async_client = httpx.AsyncClient()
|
|
100
|
+
async_client = httpx.AsyncClient(follow_redirects=True)
|
|
101
101
|
async_client_supplied = False
|
|
102
102
|
|
|
103
103
|
if debug_logger is None:
|
dub/tags.py
CHANGED
|
@@ -23,7 +23,7 @@ class Tags(BaseSDK):
|
|
|
23
23
|
server_url: Optional[str] = None,
|
|
24
24
|
timeout_ms: Optional[int] = None,
|
|
25
25
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
26
|
-
) -> Optional[components.
|
|
26
|
+
) -> Optional[components.LinkTagSchema]:
|
|
27
27
|
r"""Create a tag
|
|
28
28
|
|
|
29
29
|
Create a tag for the authenticated workspace.
|
|
@@ -82,7 +82,7 @@ class Tags(BaseSDK):
|
|
|
82
82
|
config=self.sdk_configuration,
|
|
83
83
|
base_url=base_url or "",
|
|
84
84
|
operation_id="createTag",
|
|
85
|
-
oauth2_scopes=
|
|
85
|
+
oauth2_scopes=None,
|
|
86
86
|
security_source=self.sdk_configuration.security,
|
|
87
87
|
),
|
|
88
88
|
request=req,
|
|
@@ -104,7 +104,7 @@ class Tags(BaseSDK):
|
|
|
104
104
|
|
|
105
105
|
response_data: Any = None
|
|
106
106
|
if utils.match_response(http_res, "201", "application/json"):
|
|
107
|
-
return unmarshal_json_response(Optional[components.
|
|
107
|
+
return unmarshal_json_response(Optional[components.LinkTagSchema], http_res)
|
|
108
108
|
if utils.match_response(http_res, "400", "application/json"):
|
|
109
109
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
110
110
|
raise errors.BadRequest(response_data, http_res)
|
|
@@ -160,7 +160,7 @@ class Tags(BaseSDK):
|
|
|
160
160
|
server_url: Optional[str] = None,
|
|
161
161
|
timeout_ms: Optional[int] = None,
|
|
162
162
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
163
|
-
) -> Optional[components.
|
|
163
|
+
) -> Optional[components.LinkTagSchema]:
|
|
164
164
|
r"""Create a tag
|
|
165
165
|
|
|
166
166
|
Create a tag for the authenticated workspace.
|
|
@@ -219,7 +219,7 @@ class Tags(BaseSDK):
|
|
|
219
219
|
config=self.sdk_configuration,
|
|
220
220
|
base_url=base_url or "",
|
|
221
221
|
operation_id="createTag",
|
|
222
|
-
oauth2_scopes=
|
|
222
|
+
oauth2_scopes=None,
|
|
223
223
|
security_source=self.sdk_configuration.security,
|
|
224
224
|
),
|
|
225
225
|
request=req,
|
|
@@ -241,7 +241,7 @@ class Tags(BaseSDK):
|
|
|
241
241
|
|
|
242
242
|
response_data: Any = None
|
|
243
243
|
if utils.match_response(http_res, "201", "application/json"):
|
|
244
|
-
return unmarshal_json_response(Optional[components.
|
|
244
|
+
return unmarshal_json_response(Optional[components.LinkTagSchema], http_res)
|
|
245
245
|
if utils.match_response(http_res, "400", "application/json"):
|
|
246
246
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
247
247
|
raise errors.BadRequest(response_data, http_res)
|
|
@@ -292,7 +292,7 @@ class Tags(BaseSDK):
|
|
|
292
292
|
server_url: Optional[str] = None,
|
|
293
293
|
timeout_ms: Optional[int] = None,
|
|
294
294
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
295
|
-
) -> Optional[List[components.
|
|
295
|
+
) -> Optional[List[components.LinkTagSchema]]:
|
|
296
296
|
r"""Retrieve a list of tags
|
|
297
297
|
|
|
298
298
|
Retrieve a list of tags for the authenticated workspace.
|
|
@@ -346,7 +346,7 @@ class Tags(BaseSDK):
|
|
|
346
346
|
config=self.sdk_configuration,
|
|
347
347
|
base_url=base_url or "",
|
|
348
348
|
operation_id="getTags",
|
|
349
|
-
oauth2_scopes=
|
|
349
|
+
oauth2_scopes=None,
|
|
350
350
|
security_source=self.sdk_configuration.security,
|
|
351
351
|
),
|
|
352
352
|
request=req,
|
|
@@ -369,7 +369,7 @@ class Tags(BaseSDK):
|
|
|
369
369
|
response_data: Any = None
|
|
370
370
|
if utils.match_response(http_res, "200", "application/json"):
|
|
371
371
|
return unmarshal_json_response(
|
|
372
|
-
Optional[List[components.
|
|
372
|
+
Optional[List[components.LinkTagSchema]], http_res
|
|
373
373
|
)
|
|
374
374
|
if utils.match_response(http_res, "400", "application/json"):
|
|
375
375
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
@@ -421,7 +421,7 @@ class Tags(BaseSDK):
|
|
|
421
421
|
server_url: Optional[str] = None,
|
|
422
422
|
timeout_ms: Optional[int] = None,
|
|
423
423
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
424
|
-
) -> Optional[List[components.
|
|
424
|
+
) -> Optional[List[components.LinkTagSchema]]:
|
|
425
425
|
r"""Retrieve a list of tags
|
|
426
426
|
|
|
427
427
|
Retrieve a list of tags for the authenticated workspace.
|
|
@@ -475,7 +475,7 @@ class Tags(BaseSDK):
|
|
|
475
475
|
config=self.sdk_configuration,
|
|
476
476
|
base_url=base_url or "",
|
|
477
477
|
operation_id="getTags",
|
|
478
|
-
oauth2_scopes=
|
|
478
|
+
oauth2_scopes=None,
|
|
479
479
|
security_source=self.sdk_configuration.security,
|
|
480
480
|
),
|
|
481
481
|
request=req,
|
|
@@ -498,7 +498,7 @@ class Tags(BaseSDK):
|
|
|
498
498
|
response_data: Any = None
|
|
499
499
|
if utils.match_response(http_res, "200", "application/json"):
|
|
500
500
|
return unmarshal_json_response(
|
|
501
|
-
Optional[List[components.
|
|
501
|
+
Optional[List[components.LinkTagSchema]], http_res
|
|
502
502
|
)
|
|
503
503
|
if utils.match_response(http_res, "400", "application/json"):
|
|
504
504
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
@@ -556,7 +556,7 @@ class Tags(BaseSDK):
|
|
|
556
556
|
server_url: Optional[str] = None,
|
|
557
557
|
timeout_ms: Optional[int] = None,
|
|
558
558
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
559
|
-
) -> Optional[components.
|
|
559
|
+
) -> Optional[components.LinkTagSchema]:
|
|
560
560
|
r"""Update a tag
|
|
561
561
|
|
|
562
562
|
Update a tag in the workspace.
|
|
@@ -621,7 +621,7 @@ class Tags(BaseSDK):
|
|
|
621
621
|
config=self.sdk_configuration,
|
|
622
622
|
base_url=base_url or "",
|
|
623
623
|
operation_id="updateTag",
|
|
624
|
-
oauth2_scopes=
|
|
624
|
+
oauth2_scopes=None,
|
|
625
625
|
security_source=self.sdk_configuration.security,
|
|
626
626
|
),
|
|
627
627
|
request=req,
|
|
@@ -643,7 +643,7 @@ class Tags(BaseSDK):
|
|
|
643
643
|
|
|
644
644
|
response_data: Any = None
|
|
645
645
|
if utils.match_response(http_res, "200", "application/json"):
|
|
646
|
-
return unmarshal_json_response(Optional[components.
|
|
646
|
+
return unmarshal_json_response(Optional[components.LinkTagSchema], http_res)
|
|
647
647
|
if utils.match_response(http_res, "400", "application/json"):
|
|
648
648
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
649
649
|
raise errors.BadRequest(response_data, http_res)
|
|
@@ -700,7 +700,7 @@ class Tags(BaseSDK):
|
|
|
700
700
|
server_url: Optional[str] = None,
|
|
701
701
|
timeout_ms: Optional[int] = None,
|
|
702
702
|
http_headers: Optional[Mapping[str, str]] = None,
|
|
703
|
-
) -> Optional[components.
|
|
703
|
+
) -> Optional[components.LinkTagSchema]:
|
|
704
704
|
r"""Update a tag
|
|
705
705
|
|
|
706
706
|
Update a tag in the workspace.
|
|
@@ -765,7 +765,7 @@ class Tags(BaseSDK):
|
|
|
765
765
|
config=self.sdk_configuration,
|
|
766
766
|
base_url=base_url or "",
|
|
767
767
|
operation_id="updateTag",
|
|
768
|
-
oauth2_scopes=
|
|
768
|
+
oauth2_scopes=None,
|
|
769
769
|
security_source=self.sdk_configuration.security,
|
|
770
770
|
),
|
|
771
771
|
request=req,
|
|
@@ -787,7 +787,7 @@ class Tags(BaseSDK):
|
|
|
787
787
|
|
|
788
788
|
response_data: Any = None
|
|
789
789
|
if utils.match_response(http_res, "200", "application/json"):
|
|
790
|
-
return unmarshal_json_response(Optional[components.
|
|
790
|
+
return unmarshal_json_response(Optional[components.LinkTagSchema], http_res)
|
|
791
791
|
if utils.match_response(http_res, "400", "application/json"):
|
|
792
792
|
response_data = unmarshal_json_response(errors.BadRequestData, http_res)
|
|
793
793
|
raise errors.BadRequest(response_data, http_res)
|
|
@@ -892,7 +892,7 @@ class Tags(BaseSDK):
|
|
|
892
892
|
config=self.sdk_configuration,
|
|
893
893
|
base_url=base_url or "",
|
|
894
894
|
operation_id="deleteTag",
|
|
895
|
-
oauth2_scopes=
|
|
895
|
+
oauth2_scopes=None,
|
|
896
896
|
security_source=self.sdk_configuration.security,
|
|
897
897
|
),
|
|
898
898
|
request=req,
|
|
@@ -1021,7 +1021,7 @@ class Tags(BaseSDK):
|
|
|
1021
1021
|
config=self.sdk_configuration,
|
|
1022
1022
|
base_url=base_url or "",
|
|
1023
1023
|
operation_id="deleteTag",
|
|
1024
|
-
oauth2_scopes=
|
|
1024
|
+
oauth2_scopes=None,
|
|
1025
1025
|
security_source=self.sdk_configuration.security,
|
|
1026
1026
|
),
|
|
1027
1027
|
request=req,
|
dub/track.py
CHANGED
|
@@ -82,7 +82,7 @@ class Track(BaseSDK):
|
|
|
82
82
|
config=self.sdk_configuration,
|
|
83
83
|
base_url=base_url or "",
|
|
84
84
|
operation_id="trackLead",
|
|
85
|
-
oauth2_scopes=
|
|
85
|
+
oauth2_scopes=None,
|
|
86
86
|
security_source=self.sdk_configuration.security,
|
|
87
87
|
),
|
|
88
88
|
request=req,
|
|
@@ -221,7 +221,7 @@ class Track(BaseSDK):
|
|
|
221
221
|
config=self.sdk_configuration,
|
|
222
222
|
base_url=base_url or "",
|
|
223
223
|
operation_id="trackLead",
|
|
224
|
-
oauth2_scopes=
|
|
224
|
+
oauth2_scopes=None,
|
|
225
225
|
security_source=self.sdk_configuration.security,
|
|
226
226
|
),
|
|
227
227
|
request=req,
|
|
@@ -360,7 +360,7 @@ class Track(BaseSDK):
|
|
|
360
360
|
config=self.sdk_configuration,
|
|
361
361
|
base_url=base_url or "",
|
|
362
362
|
operation_id="trackSale",
|
|
363
|
-
oauth2_scopes=
|
|
363
|
+
oauth2_scopes=None,
|
|
364
364
|
security_source=self.sdk_configuration.security,
|
|
365
365
|
),
|
|
366
366
|
request=req,
|
|
@@ -499,7 +499,7 @@ class Track(BaseSDK):
|
|
|
499
499
|
config=self.sdk_configuration,
|
|
500
500
|
base_url=base_url or "",
|
|
501
501
|
operation_id="trackSale",
|
|
502
|
-
oauth2_scopes=
|
|
502
|
+
oauth2_scopes=None,
|
|
503
503
|
security_source=self.sdk_configuration.security,
|
|
504
504
|
),
|
|
505
505
|
request=req,
|
dub/utils/annotations.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
from typing import Any, Optional
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
def get_discriminator(model: Any, fieldname: str, key: str) -> str:
|
|
7
8
|
"""
|
|
8
9
|
Recursively search for the discriminator attribute in a model.
|
|
@@ -25,31 +26,54 @@ def get_discriminator(model: Any, fieldname: str, key: str) -> str:
|
|
|
25
26
|
|
|
26
27
|
if isinstance(field, dict):
|
|
27
28
|
if key in field:
|
|
28
|
-
return f
|
|
29
|
+
return f"{field[key]}"
|
|
29
30
|
|
|
30
31
|
if hasattr(field, fieldname):
|
|
31
32
|
attr = getattr(field, fieldname)
|
|
32
33
|
if isinstance(attr, Enum):
|
|
33
|
-
return f
|
|
34
|
-
return f
|
|
34
|
+
return f"{attr.value}"
|
|
35
|
+
return f"{attr}"
|
|
35
36
|
|
|
36
37
|
if hasattr(field, upper_fieldname):
|
|
37
38
|
attr = getattr(field, upper_fieldname)
|
|
38
39
|
if isinstance(attr, Enum):
|
|
39
|
-
return f
|
|
40
|
-
return f
|
|
40
|
+
return f"{attr.value}"
|
|
41
|
+
return f"{attr}"
|
|
41
42
|
|
|
42
43
|
return None
|
|
43
44
|
|
|
45
|
+
def search_nested_discriminator(obj: Any) -> Optional[str]:
|
|
46
|
+
"""Recursively search for discriminator in nested structures."""
|
|
47
|
+
# First try direct field lookup
|
|
48
|
+
discriminator = get_field_discriminator(obj)
|
|
49
|
+
if discriminator is not None:
|
|
50
|
+
return discriminator
|
|
51
|
+
|
|
52
|
+
# If it's a dict, search in nested values
|
|
53
|
+
if isinstance(obj, dict):
|
|
54
|
+
for value in obj.values():
|
|
55
|
+
if isinstance(value, list):
|
|
56
|
+
# Search in list items
|
|
57
|
+
for item in value:
|
|
58
|
+
nested_discriminator = search_nested_discriminator(item)
|
|
59
|
+
if nested_discriminator is not None:
|
|
60
|
+
return nested_discriminator
|
|
61
|
+
elif isinstance(value, dict):
|
|
62
|
+
# Search in nested dict
|
|
63
|
+
nested_discriminator = search_nested_discriminator(value)
|
|
64
|
+
if nested_discriminator is not None:
|
|
65
|
+
return nested_discriminator
|
|
66
|
+
|
|
67
|
+
return None
|
|
44
68
|
|
|
45
69
|
if isinstance(model, list):
|
|
46
70
|
for field in model:
|
|
47
|
-
discriminator =
|
|
71
|
+
discriminator = search_nested_discriminator(field)
|
|
48
72
|
if discriminator is not None:
|
|
49
73
|
return discriminator
|
|
50
74
|
|
|
51
|
-
discriminator =
|
|
75
|
+
discriminator = search_nested_discriminator(model)
|
|
52
76
|
if discriminator is not None:
|
|
53
77
|
return discriminator
|
|
54
78
|
|
|
55
|
-
raise ValueError(f
|
|
79
|
+
raise ValueError(f"Could not find discriminator field {fieldname} in {model}")
|
dub/workspaces.py
CHANGED
|
@@ -74,7 +74,7 @@ class Workspaces(BaseSDK):
|
|
|
74
74
|
config=self.sdk_configuration,
|
|
75
75
|
base_url=base_url or "",
|
|
76
76
|
operation_id="getWorkspace",
|
|
77
|
-
oauth2_scopes=
|
|
77
|
+
oauth2_scopes=None,
|
|
78
78
|
security_source=self.sdk_configuration.security,
|
|
79
79
|
),
|
|
80
80
|
request=req,
|
|
@@ -205,7 +205,7 @@ class Workspaces(BaseSDK):
|
|
|
205
205
|
config=self.sdk_configuration,
|
|
206
206
|
base_url=base_url or "",
|
|
207
207
|
operation_id="getWorkspace",
|
|
208
|
-
oauth2_scopes=
|
|
208
|
+
oauth2_scopes=None,
|
|
209
209
|
security_source=self.sdk_configuration.security,
|
|
210
210
|
),
|
|
211
211
|
request=req,
|
|
@@ -351,7 +351,7 @@ class Workspaces(BaseSDK):
|
|
|
351
351
|
config=self.sdk_configuration,
|
|
352
352
|
base_url=base_url or "",
|
|
353
353
|
operation_id="updateWorkspace",
|
|
354
|
-
oauth2_scopes=
|
|
354
|
+
oauth2_scopes=None,
|
|
355
355
|
security_source=self.sdk_configuration.security,
|
|
356
356
|
),
|
|
357
357
|
request=req,
|
|
@@ -497,7 +497,7 @@ class Workspaces(BaseSDK):
|
|
|
497
497
|
config=self.sdk_configuration,
|
|
498
498
|
base_url=base_url or "",
|
|
499
499
|
operation_id="updateWorkspace",
|
|
500
|
-
oauth2_scopes=
|
|
500
|
+
oauth2_scopes=None,
|
|
501
501
|
security_source=self.sdk_configuration.security,
|
|
502
502
|
),
|
|
503
503
|
request=req,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: dub
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.32.0
|
|
4
4
|
Summary: Python Client SDK Generated by Speakeasy
|
|
5
|
+
License-File: LICENSE
|
|
5
6
|
Author: Speakeasy
|
|
6
7
|
Requires-Python: >=3.9.2
|
|
7
8
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -9,6 +10,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
9
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
12
|
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
12
14
|
Requires-Dist: httpcore (>=1.0.9)
|
|
13
15
|
Requires-Dist: httpx (>=0.28.1)
|
|
14
16
|
Requires-Dist: jsonpath-python (>=1.0.6)
|
|
@@ -162,6 +164,7 @@ with Dub(
|
|
|
162
164
|
</br>
|
|
163
165
|
|
|
164
166
|
The same SDK client can also be used to make asynchronous requests by importing asyncio.
|
|
167
|
+
|
|
165
168
|
```python
|
|
166
169
|
# Asynchronous Example
|
|
167
170
|
import asyncio
|
|
@@ -237,6 +240,7 @@ with Dub(
|
|
|
237
240
|
</br>
|
|
238
241
|
|
|
239
242
|
The same SDK client can also be used to make asynchronous requests by importing asyncio.
|
|
243
|
+
|
|
240
244
|
```python
|
|
241
245
|
# Asynchronous Example
|
|
242
246
|
import asyncio
|
|
@@ -307,7 +311,6 @@ asyncio.run(main())
|
|
|
307
311
|
* [register](https://github.com/dubinc/dub-python/blob/master/docs/sdks/domains/README.md#register) - Register a domain
|
|
308
312
|
* [check_status](https://github.com/dubinc/dub-python/blob/master/docs/sdks/domains/README.md#check_status) - Check the availability of one or more domains
|
|
309
313
|
|
|
310
|
-
|
|
311
314
|
### [embed_tokens](https://github.com/dubinc/dub-python/blob/master/docs/sdks/embedtokens/README.md)
|
|
312
315
|
|
|
313
316
|
* [referrals](https://github.com/dubinc/dub-python/blob/master/docs/sdks/embedtokens/README.md#referrals) - Create a referrals embed token
|
|
@@ -338,7 +341,7 @@ asyncio.run(main())
|
|
|
338
341
|
|
|
339
342
|
### [partners](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md)
|
|
340
343
|
|
|
341
|
-
* [create](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#create) - Create a partner
|
|
344
|
+
* [create](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#create) - Create or update a partner
|
|
342
345
|
* [list](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#list) - List all partners
|
|
343
346
|
* [create_link](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#create_link) - Create a link for a partner
|
|
344
347
|
* [retrieve_links](https://github.com/dubinc/dub-python/blob/master/docs/sdks/partners/README.md#retrieve_links) - Retrieve a partner's links.
|