/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { addonsCreateAddon } from "../funcs/addons-create-addon.js"; import { addonsDeleteAddon } from "../funcs/addons-delete-addon.js"; import { addonsGetAddonByLookupKey } from "../funcs/addons-get-addon-by-lookup-key.js"; import { addonsGetAddon } from "../funcs/addons-get-addon.js"; import { addonsQueryAddon } from "../funcs/addons-query-addon.js"; import { addonsUpdateAddon } from "../funcs/addons-update-addon.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class Addons extends ClientSDK { /** * Create addon * * @remarks * Use when defining an optional purchasable item (e.g. extra storage or support tier). Ideal for add-ons that customers can attach to a subscription. */ async createAddon( request: models.CreateAddonRequest, options?: RequestOptions, ): Promise { return unwrapAsync(addonsCreateAddon( this, request, options, )); } /** * Get addon by lookup key * * @remarks * Use when resolving an addon by external id (e.g. from your product catalog). Ideal for integrations. */ async getAddonByLookupKey( lookupKey: string, options?: RequestOptions, ): Promise { return unwrapAsync(addonsGetAddonByLookupKey( this, lookupKey, options, )); } /** * Query addons * * @remarks * Use when listing or searching addons (e.g. catalog or subscription builder). Returns a paginated list; supports filtering and sorting. */ async queryAddon( request: models.AddonFilter, options?: RequestOptions, ): Promise { return unwrapAsync(addonsQueryAddon( this, request, options, )); } /** * Get addon * * @remarks * Use when you need to load a single addon (e.g. for display or to attach to a subscription). */ async getAddon( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(addonsGetAddon( this, id, options, )); } /** * Update addon * * @remarks * Use when changing addon details (e.g. name, pricing, or metadata). */ async updateAddon( id: string, body: models.UpdateAddonRequest, options?: RequestOptions, ): Promise { return unwrapAsync(addonsUpdateAddon( this, id, body, options, )); } /** * Delete addon * * @remarks * Use when retiring an addon (e.g. end-of-life). Returns 200 with success message. */ async deleteAddon( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(addonsDeleteAddon( this, id, options, )); } }