class

Polar::Api::LicenseKeys

Inherits Reference < Object

API client for license_keys operations

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new LicenseKeys instance

@param client [Client] The Polar API client instance

Source

Instance methods

Activate License Key

Activate a license key instance.

Scopes: license_keys:write

Endpoint: POST /v1/license-keys/activate

Parameters:

  • body (required): Request body as Polar::Models::LicenseKeyActivate

Returns: Polar::Models::LicenseKeyActivationRead

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Deactivate License Key

Deactivate a license key instance.

Scopes: license_keys:write

Endpoint: POST /v1/license-keys/deactivate

Parameters:

  • body (required): Request body as Polar::Models::LicenseKeyDeactivate

Returns: JSON response string

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Get License Key

Get a license key.

Scopes: license_keys:read license_keys:write

Endpoint: GET /v1/license-keys/{id}

Parameters:

  • id (required): Path parameter

Returns: Polar::Models::LicenseKeyWithActivations

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
get_activation(id : String, activation_id : String) : Polar::Models::LicenseKeyActivationRead

Get Activation

Get a license key activation.

Scopes: license_keys:read license_keys:write

Endpoint: GET /v1/license-keys/{id}/activations/{activation_id}

Parameters:

  • id (required): Path parameter
  • activation_id (required): Path parameter

Returns: Polar::Models::LicenseKeyActivationRead

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(organization_id : String | Nil = nil, benefit_id : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil) : Polar::Models::ListResource(Polar::Models::LicenseKeyRead)

List License Keys

Get license keys connected to the given organization & filters.

Scopes: license_keys:read license_keys:write

Endpoint: GET /v1/license-keys/

Parameters:

  • organization_id (optional): Filter by organization ID.
  • benefit_id (optional): Filter by benefit ID.
  • page (optional): Page number, defaults to 1.
  • limit (optional): Size of a page, defaults to 10. Maximum is 100.

Returns: Polar::Models::ListResource(Polar::Models::LicenseKeyRead)

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Update License Key

Update a license key.

Scopes: license_keys:write

Endpoint: PATCH /v1/license-keys/{id}

Parameters:

  • id (required): Path parameter
  • body (required): Request body as Polar::Models::LicenseKeyUpdate

Returns: Polar::Models::LicenseKeyRead

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Validate License Key

Validate a license key.

Scopes: license_keys:write

Endpoint: POST /v1/license-keys/validate

Parameters:

  • body (required): Request body as Polar::Models::LicenseKeyValidate

Returns: Polar::Models::ValidatedLicenseKey

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source