Skip to content

Commit e7cd744

Browse files
speakeasybotfrankie567
authored andcommitted
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.446.1
1 parent ebe58fa commit e7cd744

File tree

136 files changed

+2313
-1797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+2313
-1797
lines changed

.speakeasy/gen.lock

+11-11
Large diffs are not rendered by default.

.speakeasy/gen.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ generation:
1616
oAuth2ClientCredentialsEnabled: true
1717
oAuth2PasswordEnabled: false
1818
python:
19-
version: 0.8.2
19+
version: 0.9.0
2020
additionalDependencies:
2121
dev: {}
2222
main: {}

.speakeasy/workflow.lock

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
speakeasyVersion: 1.445.0
1+
speakeasyVersion: 1.446.1
22
sources:
33
Polar-OAS:
44
sourceNamespace: polar-oas
5-
sourceRevisionDigest: sha256:a69abcf57cd3f4fd8f3454a1c4c6571b63119e1f293f296f950c10857d394611
6-
sourceBlobDigest: sha256:675cfde1ed410fd61f558ed9d9904661ffb72949527c537a4848b6dff8fa8aa9
5+
sourceRevisionDigest: sha256:dae78e5264f7348f47c55eacaf633c5d0d249bdf1ad89ead475f3471645a6c2c
6+
sourceBlobDigest: sha256:3defd416a4202fbf16d78eb0e511f678dbb85e09c9df9dbd75aefd6f66e19dda
77
tags:
88
- latest
9-
- speakeasy-sdk-regen-1732548619
9+
- speakeasy-sdk-regen-1732634409
1010
- 0.1.0
1111
targets:
1212
polar:
1313
source: Polar-OAS
1414
sourceNamespace: polar-oas
15-
sourceRevisionDigest: sha256:a69abcf57cd3f4fd8f3454a1c4c6571b63119e1f293f296f950c10857d394611
16-
sourceBlobDigest: sha256:675cfde1ed410fd61f558ed9d9904661ffb72949527c537a4848b6dff8fa8aa9
15+
sourceRevisionDigest: sha256:dae78e5264f7348f47c55eacaf633c5d0d249bdf1ad89ead475f3471645a6c2c
16+
sourceBlobDigest: sha256:3defd416a4202fbf16d78eb0e511f678dbb85e09c9df9dbd75aefd6f66e19dda
1717
codeSamplesNamespace: polar-oas-code-samples
18-
codeSamplesRevisionDigest: sha256:8ea12d60b78c3290d4dfc230ed739095a85e71122014d99ec8f172997fb49718
18+
codeSamplesRevisionDigest: sha256:de0cdd8ebf82736bfc00b1ebcde6da4a5fb1619042822ad5fc6737b9c6004824
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

README.md

+94-101
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,18 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
4848
# Synchronous Example
4949
from polar_sdk import Polar
5050

51-
s = Polar(
51+
with Polar(
5252
access_token="<YOUR_BEARER_TOKEN_HERE>",
53-
)
54-
55-
res = s.users.benefits.list()
53+
) as s:
54+
res = s.users.benefits.list()
5655

57-
if res is not None:
58-
while True:
59-
# handle items
56+
if res is not None:
57+
while True:
58+
# handle items
6059

61-
res = res.next()
62-
if res is None:
63-
break
60+
res = res.next()
61+
if res is None:
62+
break
6463
```
6564

6665
</br>
@@ -72,17 +71,18 @@ import asyncio
7271
from polar_sdk import Polar
7372

7473
async def main():
75-
s = Polar(
74+
async with Polar(
7675
access_token="<YOUR_BEARER_TOKEN_HERE>",
77-
)
78-
res = await s.users.benefits.list_async()
79-
if res is not None:
80-
while True:
81-
# handle items
76+
) as s:
77+
res = await s.users.benefits.list_async()
8278

83-
res = res.next()
84-
if res is None:
85-
break
79+
if res is not None:
80+
while True:
81+
# handle items
82+
83+
res = res.next()
84+
if res is None:
85+
break
8686

8787
asyncio.run(main())
8888
```
@@ -288,20 +288,19 @@ To change the default retry strategy for a single API call, simply provide a `Re
288288
from polar.utils import BackoffStrategy, RetryConfig
289289
from polar_sdk import Polar
290290

291-
s = Polar(
291+
with Polar(
292292
access_token="<YOUR_BEARER_TOKEN_HERE>",
293-
)
293+
) as s:
294+
res = s.users.benefits.list(,
295+
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
294296

295-
res = s.users.benefits.list(,
296-
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
297-
298-
if res is not None:
299-
while True:
300-
# handle items
297+
if res is not None:
298+
while True:
299+
# handle items
301300

302-
res = res.next()
303-
if res is None:
304-
break
301+
res = res.next()
302+
if res is None:
303+
break
305304

306305
```
307306

@@ -310,20 +309,19 @@ If you'd like to override the default retry strategy for all operations that sup
310309
from polar.utils import BackoffStrategy, RetryConfig
311310
from polar_sdk import Polar
312311

313-
s = Polar(
312+
with Polar(
314313
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
315314
access_token="<YOUR_BEARER_TOKEN_HERE>",
316-
)
317-
318-
res = s.users.benefits.list()
315+
) as s:
316+
res = s.users.benefits.list()
319317

320-
if res is not None:
321-
while True:
322-
# handle items
318+
if res is not None:
319+
while True:
320+
# handle items
323321

324-
res = res.next()
325-
if res is None:
326-
break
322+
res = res.next()
323+
if res is None:
324+
break
327325

328326
```
329327
<!-- End Retries [retries] -->
@@ -354,28 +352,27 @@ When custom error responses are specified for an operation, the SDK may also rai
354352
```python
355353
from polar_sdk import Polar, models
356354

357-
s = Polar(
355+
with Polar(
358356
access_token="<YOUR_BEARER_TOKEN_HERE>",
359-
)
360-
361-
res = None
362-
try:
363-
res = s.users.benefits.list()
364-
365-
if res is not None:
366-
while True:
367-
# handle items
368-
369-
res = res.next()
370-
if res is None:
371-
break
372-
373-
except models.HTTPValidationError as e:
374-
# handle e.data: models.HTTPValidationErrorData
375-
raise(e)
376-
except models.SDKError as e:
377-
# handle exception
378-
raise(e)
357+
) as s:
358+
res = None
359+
try:
360+
res = s.users.benefits.list()
361+
362+
if res is not None:
363+
while True:
364+
# handle items
365+
366+
res = res.next()
367+
if res is None:
368+
break
369+
370+
except models.HTTPValidationError as e:
371+
# handle e.data: models.HTTPValidationErrorData
372+
raise(e)
373+
except models.SDKError as e:
374+
# handle exception
375+
raise(e)
379376
```
380377
<!-- End Error Handling [errors] -->
381378

@@ -396,20 +393,19 @@ You can override the default server globally by passing a server name to the `se
396393
```python
397394
from polar_sdk import Polar
398395

399-
s = Polar(
396+
with Polar(
400397
server="sandbox",
401398
access_token="<YOUR_BEARER_TOKEN_HERE>",
402-
)
403-
404-
res = s.users.benefits.list()
399+
) as s:
400+
res = s.users.benefits.list()
405401

406-
if res is not None:
407-
while True:
408-
# handle items
402+
if res is not None:
403+
while True:
404+
# handle items
409405

410-
res = res.next()
411-
if res is None:
412-
break
406+
res = res.next()
407+
if res is None:
408+
break
413409

414410
```
415411

@@ -419,20 +415,19 @@ The default server can also be overridden globally by passing a URL to the `serv
419415
```python
420416
from polar_sdk import Polar
421417

422-
s = Polar(
418+
with Polar(
423419
server_url="https://api.polar.sh",
424420
access_token="<YOUR_BEARER_TOKEN_HERE>",
425-
)
426-
427-
res = s.users.benefits.list()
421+
) as s:
422+
res = s.users.benefits.list()
428423

429-
if res is not None:
430-
while True:
431-
# handle items
424+
if res is not None:
425+
while True:
426+
# handle items
432427

433-
res = res.next()
434-
if res is None:
435-
break
428+
res = res.next()
429+
if res is None:
430+
break
436431

437432
```
438433
<!-- End Server Selection [server] -->
@@ -533,19 +528,18 @@ To authenticate with the API the `access_token` parameter must be set when initi
533528
```python
534529
from polar_sdk import Polar
535530

536-
s = Polar(
531+
with Polar(
537532
access_token="<YOUR_BEARER_TOKEN_HERE>",
538-
)
539-
540-
res = s.users.benefits.list()
533+
) as s:
534+
res = s.users.benefits.list()
541535

542-
if res is not None:
543-
while True:
544-
# handle items
536+
if res is not None:
537+
while True:
538+
# handle items
545539

546-
res = res.next()
547-
if res is None:
548-
break
540+
res = res.next()
541+
if res is None:
542+
break
549543

550544
```
551545
<!-- End Authentication [security] -->
@@ -576,19 +570,18 @@ Here's an example of one such pagination call:
576570
```python
577571
from polar_sdk import Polar
578572

579-
s = Polar(
573+
with Polar(
580574
access_token="<YOUR_BEARER_TOKEN_HERE>",
581-
)
582-
583-
res = s.users.benefits.list()
575+
) as s:
576+
res = s.users.benefits.list()
584577

585-
if res is not None:
586-
while True:
587-
# handle items
578+
if res is not None:
579+
while True:
580+
# handle items
588581

589-
res = res.next()
590-
if res is None:
591-
break
582+
res = res.next()
583+
if res is None:
584+
break
592585

593586
```
594587
<!-- End Pagination [pagination] -->

RELEASES.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,14 @@ Based on:
323323
### Generated
324324
- [python v0.8.2] .
325325
### Releases
326-
- [PyPI v0.8.2] https://pypi.org/project/polar-sdk/0.8.2 - .
326+
- [PyPI v0.8.2] https://pypi.org/project/polar-sdk/0.8.2 - .
327+
328+
## 2024-11-26 15:20:04
329+
### Changes
330+
Based on:
331+
- OpenAPI Doc
332+
- Speakeasy CLI 1.446.1 (2.462.1) https://github.com/speakeasy-api/speakeasy
333+
### Generated
334+
- [python v0.9.0] .
335+
### Releases
336+
- [PyPI v0.9.0] https://pypi.org/project/polar-sdk/0.9.0 - .

USAGE.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
# Synchronous Example
44
from polar_sdk import Polar
55

6-
s = Polar(
6+
with Polar(
77
access_token="<YOUR_BEARER_TOKEN_HERE>",
8-
)
8+
) as s:
9+
res = s.users.benefits.list()
910

10-
res = s.users.benefits.list()
11-
12-
if res is not None:
13-
while True:
14-
# handle items
11+
if res is not None:
12+
while True:
13+
# handle items
1514

16-
res = res.next()
17-
if res is None:
18-
break
15+
res = res.next()
16+
if res is None:
17+
break
1918
```
2019

2120
</br>
@@ -27,17 +26,18 @@ import asyncio
2726
from polar_sdk import Polar
2827

2928
async def main():
30-
s = Polar(
29+
async with Polar(
3130
access_token="<YOUR_BEARER_TOKEN_HERE>",
32-
)
33-
res = await s.users.benefits.list_async()
34-
if res is not None:
35-
while True:
36-
# handle items
31+
) as s:
32+
res = await s.users.benefits.list_async()
3733

38-
res = res.next()
39-
if res is None:
40-
break
34+
if res is not None:
35+
while True:
36+
# handle items
37+
38+
res = res.next()
39+
if res is None:
40+
break
4141

4242
asyncio.run(main())
4343
```

0 commit comments

Comments
 (0)