Skip to content

Commit 445b442

Browse files
committed
Regenerate
1 parent 32afcc1 commit 445b442

776 files changed

Lines changed: 1289 additions & 10327 deletions

File tree

Some content is hidden

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

.speakeasy/gen.lock

Lines changed: 329 additions & 328 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ generation:
1515
auth:
1616
oAuth2ClientCredentialsEnabled: true
1717
python:
18-
version: 0.1.3
18+
version: 0.1.4
1919
additionalDependencies:
2020
dev: {}
2121
main: {}

.speakeasy/workflow.lock

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
speakeasyVersion: 1.382.0
1+
speakeasyVersion: 1.383.2
22
sources:
33
Polar-OAS:
44
sourceNamespace: polar-oas
5-
sourceRevisionDigest: sha256:19ff53595232890cef232fc6931e820feeea0e0c71f084811d2ab3d2d50363fe
6-
sourceBlobDigest: sha256:3303542239bcd6692ae1b85934483e76917bf962b7ffdddbe792c78718887a36
5+
sourceRevisionDigest: sha256:22abf4ccd2c959ac89d9e96f652ca32747feb8df6bd18fb20b570e3a88da2786
6+
sourceBlobDigest: sha256:2e445b28e1c8f9fe80a9f4cfd04b44748fc6daa3cc521d13d73ea571bec616f2
77
tags:
88
- latest
9-
- main
109
targets:
1110
polar:
1211
source: Polar-OAS
1312
sourceNamespace: polar-oas
14-
sourceRevisionDigest: sha256:19ff53595232890cef232fc6931e820feeea0e0c71f084811d2ab3d2d50363fe
15-
sourceBlobDigest: sha256:3303542239bcd6692ae1b85934483e76917bf962b7ffdddbe792c78718887a36
16-
outLocation: /github/workspace/repo
13+
sourceRevisionDigest: sha256:22abf4ccd2c959ac89d9e96f652ca32747feb8df6bd18fb20b570e3a88da2786
14+
sourceBlobDigest: sha256:2e445b28e1c8f9fe80a9f4cfd04b44748fc6daa3cc521d13d73ea571bec616f2
15+
outLocation: /Users/fvoron/Development/polar-python
1716
workflow:
1817
workflowVersion: 1.0.0
1918
speakeasyVersion: latest
@@ -30,5 +29,8 @@ workflow:
3029
polar:
3130
target: python
3231
source: Polar-OAS
32+
publish:
33+
pypi:
34+
token: $pypi_token
3335
codeSamples:
3436
output: codeSamples.yaml

README.md

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,22 @@ It has been generated successfully based on your OpenAPI spec. However, it is no
1919
<!-- Start SDK Installation [installation] -->
2020
## SDK Installation
2121

22-
PIP
22+
The SDK can be installed with either *pip* or *poetry* package managers.
23+
24+
### PIP
25+
26+
*PIP* is the default package installer for Python, enabling easy installation and management of packages from PyPI via the command line.
27+
2328
```bash
24-
pip install git+https://github.com/polarsource/polar-python.git
29+
pip install polar-sdk
2530
```
2631

27-
Poetry
32+
### Poetry
33+
34+
*Poetry* is a modern tool that simplifies dependency management and package publishing by using a single `pyproject.toml` file to handle project metadata and dependencies.
35+
2836
```bash
29-
poetry add git+https://github.com/polarsource/polar-python.git
37+
poetry add polar-sdk
3038
```
3139
<!-- End SDK Installation [installation] -->
3240

@@ -47,7 +55,7 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
4755

4856
```python
4957
# Synchronous Example
50-
from polar import Polar
58+
from polar_sdk import Polar
5159

5260
s = Polar(
5361
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -72,7 +80,7 @@ The same SDK client can also be used to make asychronous requests by importing a
7280
```python
7381
# Asynchronous Example
7482
import asyncio
75-
from polar import Polar
83+
from polar_sdk import Polar
7684

7785
async def main():
7886
s = Polar(
@@ -235,7 +243,7 @@ Certain SDK methods accept file objects as part of a request body or multi-part
235243
>
236244
237245
```python
238-
from polar import Polar
246+
from polar_sdk import Polar
239247

240248
s = Polar(
241249
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -264,8 +272,8 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
264272

265273
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
266274
```python
267-
from polar import Polar
268275
from polar.utils import BackoffStrategy, RetryConfig
276+
from polar_sdk import Polar
269277

270278
s = Polar(
271279
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -288,8 +296,8 @@ if res is not None:
288296

289297
If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
290298
```python
291-
from polar import Polar
292299
from polar.utils import BackoffStrategy, RetryConfig
300+
from polar_sdk import Polar
293301

294302
s = Polar(
295303
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
@@ -324,7 +332,7 @@ Handling errors in this SDK should largely match your expectations. All operati
324332
### Example
325333

326334
```python
327-
from polar import Polar, models
335+
from polar_sdk import Polar, models
328336

329337
s = Polar(
330338
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -335,7 +343,7 @@ try:
335343
res = s.users.benefits.list()
336344

337345
except models.HTTPValidationError as e:
338-
# handle exception
346+
# handle e.data: models.HTTPValidationErrorData
339347
raise(e)
340348
except models.SDKError as e:
341349
# handle exception
@@ -367,7 +375,7 @@ You can override the default server globally by passing a server index to the `s
367375
#### Example
368376

369377
```python
370-
from polar import Polar
378+
from polar_sdk import Polar
371379

372380
s = Polar(
373381
server_idx=0,
@@ -393,7 +401,7 @@ if res is not None:
393401

394402
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
395403
```python
396-
from polar import Polar
404+
from polar_sdk import Polar
397405

398406
s = Polar(
399407
server_url="https://api.polar.sh",
@@ -424,7 +432,7 @@ This allows you to wrap the client with your own custom logic, such as adding cu
424432

425433
For example, you could specify a header for every request that this sdk makes as follows:
426434
```python
427-
from polar import Polar
435+
from polar_sdk import Polar
428436
import httpx
429437

430438
http_client = httpx.Client(headers={"x-custom-header": "someValue"})
@@ -433,8 +441,8 @@ s = Polar(client=http_client)
433441

434442
or you could wrap the client with your own custom logic:
435443
```python
436-
from polar import Polar
437-
from polar.httpclient import AsyncHttpClient
444+
from polar_sdk import Polar
445+
from polar_sdk.httpclient import AsyncHttpClient
438446
import httpx
439447

440448
class CustomClient(AsyncHttpClient):
@@ -509,7 +517,7 @@ This SDK supports the following security scheme globally:
509517

510518
To authenticate with the API the `access_token` parameter must be set when initializing the SDK client instance. For example:
511519
```python
512-
from polar import Polar
520+
from polar_sdk import Polar
513521

514522
s = Polar(
515523
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -537,11 +545,11 @@ You can setup your SDK to emit debug logs for SDK requests and responses.
537545

538546
You can pass your own logger class directly into your SDK.
539547
```python
540-
from polar import Polar
548+
from polar_sdk import Polar
541549
import logging
542550

543551
logging.basicConfig(level=logging.DEBUG)
544-
s = Polar(debug_logger=logging.getLogger("polar"))
552+
s = Polar(debug_logger=logging.getLogger("polar_sdk"))
545553
```
546554
<!-- End Debugging [debug] -->
547555

@@ -554,7 +562,7 @@ return value of `Next` is `None`, then there are no more pages to be fetched.
554562

555563
Here's an example of one such pagination call:
556564
```python
557-
from polar import Polar
565+
from polar_sdk import Polar
558566

559567
s = Polar(
560568
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -575,6 +583,31 @@ if res is not None:
575583
```
576584
<!-- End Pagination [pagination] -->
577585

586+
<!-- Start Summary [summary] -->
587+
## Summary
588+
589+
Polar API: Polar HTTP and Webhooks API
590+
591+
Read the docs at https://docs.polar.sh/api
592+
<!-- End Summary [summary] -->
593+
594+
<!-- Start Table of Contents [toc] -->
595+
## Table of Contents
596+
597+
* [SDK Installation](#sdk-installation)
598+
* [IDE Support](#ide-support)
599+
* [SDK Example Usage](#sdk-example-usage)
600+
* [Available Resources and Operations](#available-resources-and-operations)
601+
* [Pagination](#pagination)
602+
* [File uploads](#file-uploads)
603+
* [Retries](#retries)
604+
* [Error Handling](#error-handling)
605+
* [Server Selection](#server-selection)
606+
* [Custom HTTP Client](#custom-http-client)
607+
* [Authentication](#authentication)
608+
* [Debugging](#debugging)
609+
<!-- End Table of Contents [toc] -->
610+
578611
<!-- Placeholder for Future Speakeasy SDK Sections -->
579612

580613
# Development

USAGE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- Start SDK Example Usage [usage] -->
22
```python
33
# Synchronous Example
4-
from polar import Polar
4+
from polar_sdk import Polar
55

66
s = Polar(
77
access_token="<YOUR_BEARER_TOKEN_HERE>",
@@ -26,7 +26,7 @@ The same SDK client can also be used to make asychronous requests by importing a
2626
```python
2727
# Asynchronous Example
2828
import asyncio
29-
from polar import Polar
29+
from polar_sdk import Polar
3030

3131
async def main():
3232
s = Polar(

0 commit comments

Comments
 (0)