Skip to content

Latest commit

 

History

History
224 lines (150 loc) · 10.6 KB

README.md

File metadata and controls

224 lines (150 loc) · 10.6 KB

Clients

(oauth2.clients)

Overview

Available Operations

list

List OAuth2 clients.

Example Usage

from polar_sdk import Polar

s = Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.oauth2.clients.list()

if res is not None:
    while True:
        # handle items

        res = res.next()
        if res is None:
            break

Parameters

Parameter Type Required Description
page Optional[int] Page number, defaults to 1.
limit Optional[int] Size of a page, defaults to 10. Maximum is 100.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.Oauth2ClientsListResponse

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

create

Create an OAuth2 client.

Example Usage

from polar_sdk import Polar

s = Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.oauth2.clients.create(request={
    "redirect_uris": [
        "https://probable-heating.com/",
    ],
    "client_name": "<value>",
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
request models.OAuth2ClientConfiguration ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

get

Get an OAuth2 client by Client ID.

Example Usage

from polar_sdk import Polar

s = Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.oauth2.clients.get(client_id="<value>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
client_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

update

Update an OAuth2 client.

Example Usage

from polar_sdk import Polar

s = Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.oauth2.clients.update(client_id="<value>", o_auth2_client_configuration_update={
    "redirect_uris": [
        "https://passionate-flu.org",
    ],
    "client_name": "<value>",
    "client_id": "<value>",
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
client_id str ✔️ N/A
o_auth2_client_configuration_update models.OAuth2ClientConfigurationUpdate ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*

delete

Delete an OAuth2 client.

Example Usage

from polar_sdk import Polar

s = Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
)

res = s.oauth2.clients.delete(client_id="<value>")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
client_id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error Type Status Code Content Type
models.HTTPValidationError 422 application/json
models.SDKError 4XX, 5XX */*