Polarex.LicenseKeys (Polarex v0.3.0)

View Source

Provides API endpoints related to license keys

Summary

Functions

customer_portal_license_keys_activate(body, opts \\ [])

@spec customer_portal_license_keys_activate(
  body :: Polarex.LicenseKeyActivate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.LicenseKeyActivationRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.NotPermitted.t()
     | Polarex.ResourceNotFound.t()}

Activate License Key

Activate a license key instance.

This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the /v1/license-keys/activate endpoint instead.

Request Body

Content Types: application/json

customer_portal_license_keys_deactivate(body, opts \\ [])

@spec customer_portal_license_keys_deactivate(
  body :: Polarex.LicenseKeyDeactivate.t(),
  opts :: keyword()
) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Deactivate License Key

Deactivate a license key instance.

This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the /v1/license-keys/deactivate endpoint instead.

Request Body

Content Types: application/json

customer_portal_license_keys_get(id, opts \\ [])

@spec customer_portal_license_keys_get(id :: String.t(), opts :: keyword()) ::
  {:ok, Polarex.LicenseKeyWithActivations.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Get License Key

Get a license key.

Scopes: customer_portal:read customer_portal:write

customer_portal_license_keys_list(opts \\ [])

@spec customer_portal_license_keys_list(opts :: keyword()) ::
  {:ok, Polarex.ListResourceLicenseKeyRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()
     | Polarex.Unauthorized.t()}

List License Keys

Scopes: customer_portal:read customer_portal:write

Options

  • benefit_id: Filter by a specific benefit
  • page: Page number, defaults to 1.
  • limit: Size of a page, defaults to 10. Maximum is 100.

customer_portal_license_keys_validate(body, opts \\ [])

@spec customer_portal_license_keys_validate(
  body :: Polarex.LicenseKeyValidate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.ValidatedLicenseKey.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Validate License Key

Validate a license key.

This endpoint doesn't require authentication and can be safely used on a public client, like a desktop application or a mobile app. If you plan to validate a license key on a server, use the /v1/license-keys/validate endpoint instead.

Request Body

Content Types: application/json

license_keys_activate(body, opts \\ [])

Activate License Key

Activate a license key instance.

Scopes: license_keys:write

Request Body

Content Types: application/json

license_keys_deactivate(body, opts \\ [])

@spec license_keys_deactivate(
  body :: Polarex.LicenseKeyDeactivate.t(),
  opts :: keyword()
) ::
  :ok | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Deactivate License Key

Deactivate a license key instance.

Scopes: license_keys:write

Request Body

Content Types: application/json

license_keys_get(id, opts \\ [])

Get License Key

Get a license key.

Scopes: license_keys:read license_keys:write

license_keys_get_activation(id, activation_id, opts \\ [])

@spec license_keys_get_activation(
  id :: String.t(),
  activation_id :: String.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.LicenseKeyActivationRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()
     | Polarex.Unauthorized.t()}

Get Activation

Get a license key activation.

Scopes: license_keys:read license_keys:write

license_keys_list(opts \\ [])

List License Keys

Get license keys connected to the given organization & filters.

Scopes: license_keys:read license_keys:write

Options

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

license_keys_update(id, body, opts \\ [])

@spec license_keys_update(
  id :: String.t(),
  body :: Polarex.LicenseKeyUpdate.t(),
  opts :: keyword()
) ::
  {:ok, Polarex.LicenseKeyRead.t()}
  | {:error,
     Polarex.HTTPValidationError.t()
     | Polarex.ResourceNotFound.t()
     | Polarex.Unauthorized.t()}

Update License Key

Update a license key.

Scopes: license_keys:write

Request Body

Content Types: application/json

license_keys_validate(body, opts \\ [])

@spec license_keys_validate(body :: Polarex.LicenseKeyValidate.t(), opts :: keyword()) ::
  {:ok, Polarex.ValidatedLicenseKey.t()}
  | {:error, Polarex.HTTPValidationError.t() | Polarex.ResourceNotFound.t()}

Validate License Key

Validate a license key.

Scopes: license_keys:write

Request Body

Content Types: application/json