/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { pricesCreatePrice } from "../funcs/prices-create-price.js"; import { pricesCreatePricesBulk } from "../funcs/prices-create-prices-bulk.js"; import { pricesDeletePrice } from "../funcs/prices-delete-price.js"; import { pricesGetPriceByLookupKey } from "../funcs/prices-get-price-by-lookup-key.js"; import { pricesGetPrice } from "../funcs/prices-get-price.js"; import { pricesQueryPrice } from "../funcs/prices-query-price.js"; import { pricesUpdatePrice } from "../funcs/prices-update-price.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class Prices extends ClientSDK { /** * Create price * * @remarks * Use when adding a new price to a plan or catalog (e.g. per-seat, flat, or metered). Ideal for both simple and usage-based pricing. */ async createPrice( request: models.CreatePriceRequest, options?: RequestOptions, ): Promise { return unwrapAsync(pricesCreatePrice( this, request, options, )); } /** * Create prices in bulk * * @remarks * Use when creating many prices at once (e.g. importing a catalog or setting up a plan with multiple tiers). */ async createPricesBulk( request: models.CreateBulkPriceRequest, options?: RequestOptions, ): Promise { return unwrapAsync(pricesCreatePricesBulk( this, request, options, )); } /** * Get price by lookup key * * @remarks * Use when resolving a price by external id (e.g. from your catalog or CMS). Ideal for integrations. */ async getPriceByLookupKey( lookupKey: string, options?: RequestOptions, ): Promise { return unwrapAsync(pricesGetPriceByLookupKey( this, lookupKey, options, )); } /** * Query prices * * @remarks * Use when listing or searching prices (e.g. plan builder or catalog). Returns a paginated list; supports filtering and sorting. */ async queryPrice( request: models.PriceFilter, options?: RequestOptions, ): Promise { return unwrapAsync(pricesQueryPrice( this, request, options, )); } /** * Get price * * @remarks * Use when you need to load a single price (e.g. for display or editing). Response includes expanded meter and price unit when applicable. */ async getPrice( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(pricesGetPrice( this, id, options, )); } /** * Update price * * @remarks * Use when changing price configuration (e.g. amount, billing scheme, or metadata). */ async updatePrice( id: string, body: models.UpdatePriceRequest, options?: RequestOptions, ): Promise { return unwrapAsync(pricesUpdatePrice( this, id, body, options, )); } /** * Delete price * * @remarks * Use when retiring a price (e.g. end-of-life or replacement). Optional effective date or cascade for subscriptions. */ async deletePrice( id: string, body: models.DeletePriceRequest, options?: RequestOptions, ): Promise { return unwrapAsync(pricesDeletePrice( this, id, body, options, )); } }