/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { customerPortalLicenseKeysActivate } from "../funcs/customerPortalLicenseKeysActivate.js"; import { customerPortalLicenseKeysDeactivate } from "../funcs/customerPortalLicenseKeysDeactivate.js"; import { customerPortalLicenseKeysGet } from "../funcs/customerPortalLicenseKeysGet.js"; import { customerPortalLicenseKeysList } from "../funcs/customerPortalLicenseKeysList.js"; import { customerPortalLicenseKeysValidate } from "../funcs/customerPortalLicenseKeysValidate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { LicenseKeyActivate } from "../models/components/licensekeyactivate.js"; import { LicenseKeyActivationRead } from "../models/components/licensekeyactivationread.js"; import { LicenseKeyDeactivate } from "../models/components/licensekeydeactivate.js"; import { LicenseKeyValidate } from "../models/components/licensekeyvalidate.js"; import { LicenseKeyWithActivations } from "../models/components/licensekeywithactivations.js"; import { ValidatedLicenseKey } from "../models/components/validatedlicensekey.js"; import { CustomerPortalLicenseKeysGetRequest, CustomerPortalLicenseKeysGetSecurity, } from "../models/operations/customerportallicensekeysget.js"; import { CustomerPortalLicenseKeysListRequest, CustomerPortalLicenseKeysListResponse, CustomerPortalLicenseKeysListSecurity, } from "../models/operations/customerportallicensekeyslist.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class PolarLicenseKeys extends ClientSDK { /** * List License Keys * * @remarks * **Scopes**: `customer_portal:read` `customer_portal:write` */ async list( security: CustomerPortalLicenseKeysListSecurity, request: CustomerPortalLicenseKeysListRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(customerPortalLicenseKeysList( this, security, request, options, )); } /** * Get License Key * * @remarks * Get a license key. * * **Scopes**: `customer_portal:read` `customer_portal:write` */ async get( security: CustomerPortalLicenseKeysGetSecurity, request: CustomerPortalLicenseKeysGetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(customerPortalLicenseKeysGet( this, security, request, options, )); } /** * Validate License Key * * @remarks * 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. */ async validate( request: LicenseKeyValidate, options?: RequestOptions, ): Promise { return unwrapAsync(customerPortalLicenseKeysValidate( this, request, options, )); } /** * Activate License Key * * @remarks * 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. */ async activate( request: LicenseKeyActivate, options?: RequestOptions, ): Promise { return unwrapAsync(customerPortalLicenseKeysActivate( this, request, options, )); } /** * Deactivate License Key * * @remarks * 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. */ async deactivate( request: LicenseKeyDeactivate, options?: RequestOptions, ): Promise { return unwrapAsync(customerPortalLicenseKeysDeactivate( this, request, options, )); } }