Skip to content

Latest commit

 

History

History
217 lines (143 loc) · 10.6 KB

README.md

File metadata and controls

217 lines (143 loc) · 10.6 KB

Clients

(oauth2.clients)

Overview

Available Operations

list

List OAuth2 clients.

Example Usage

from polar_sdk import Polar

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

    res = polar.oauth2.clients.list()

    while res is not None:
        # Handle items

        res = res.next()

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

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

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

    # Handle response
    print(res)

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

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

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

    # Handle response
    print(res)

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

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

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

    # Handle response
    print(res)

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

with Polar(
    access_token="<YOUR_BEARER_TOKEN_HERE>",
) as polar:

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

    # Handle response
    print(res)

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 */*