Skip to content

Latest commit

 

History

History
178 lines (118 loc) · 11.5 KB

README.md

File metadata and controls

178 lines (118 loc) · 11.5 KB

LicenseKeys

(license_keys)

Overview

Available Operations

list

Get license keys connected to the given organization & filters.

Example Usage

from polar_sdk import Polar

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

    res = polar.license_keys.list()

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description
organization_id OptionalNullable[models.LicenseKeysListQueryParamOrganizationIDFilter] Filter by organization ID.
benefit_id OptionalNullable[models.QueryParamBenefitIDFilter] Filter by benefit ID.
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.LicenseKeysListResponse

Errors

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

get

Get a license key.

Example Usage

from polar_sdk import Polar

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

    res = polar.license_keys.get(id="<value>")

    # Handle response
    print(res)

Parameters

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

Response

models.LicenseKeyWithActivations

Errors

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

update

Update a license key.

Example Usage

from polar_sdk import Polar

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

    res = polar.license_keys.update(id="<value>", license_key_update={})

    # Handle response
    print(res)

Parameters

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

Response

models.LicenseKeyRead

Errors

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

get_activation

Get a license key activation.

Example Usage

from polar_sdk import Polar

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

    res = polar.license_keys.get_activation(id="<value>", activation_id="<value>")

    # Handle response
    print(res)

Parameters

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

Response

models.LicenseKeyActivationRead

Errors

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