/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { costsCreateCostsheet } from "../funcs/costs-create-costsheet.js"; import { costsDeleteCostsheet } from "../funcs/costs-delete-costsheet.js"; import { costsGetActiveCostsheet } from "../funcs/costs-get-active-costsheet.js"; import { costsGetCostsheet } from "../funcs/costs-get-costsheet.js"; import { costsGetDetailedCostAnalytics } from "../funcs/costs-get-detailed-cost-analytics.js"; import { costsQueryCostsheet } from "../funcs/costs-query-costsheet.js"; import { costsUpdateCostsheet } from "../funcs/costs-update-costsheet.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class Costs extends ClientSDK { /** * Create costsheet * * @remarks * Use when setting up a new pricing configuration (e.g. a new product or region). Costsheets group prices and define the default for the environment. */ async createCostsheet( request: models.CreateCostsheetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(costsCreateCostsheet( this, request, options, )); } /** * Get active costsheet * * @remarks * Use when you need the tenant's default pricing configuration (e.g. for checkout or plan display). Returns the active costsheet for the environment. */ async getActiveCostsheet( options?: RequestOptions, ): Promise { return unwrapAsync(costsGetActiveCostsheet( this, options, )); } /** * Get combined revenue and cost analytics * * @remarks * Use when building dashboards or reports that need revenue vs cost, ROI, and margin over a time period (e.g. finance views or executive summaries). */ async getDetailedCostAnalytics( request: models.GetCostAnalyticsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(costsGetDetailedCostAnalytics( this, request, options, )); } /** * Query costsheets * * @remarks * Use when listing or searching costsheets (e.g. admin catalog). Returns a paginated list; supports filtering and sorting. */ async queryCostsheet( request: models.CostsheetFilter, options?: RequestOptions, ): Promise { return unwrapAsync(costsQueryCostsheet( this, request, options, )); } /** * Get costsheet * * @remarks * Use when you need to load a single costsheet (e.g. for editing or display). Supports optional expand for related prices. */ async getCostsheet( id: string, expand?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(costsGetCostsheet( this, id, expand, options, )); } /** * Update costsheet * * @remarks * Use when changing costsheet name or metadata. */ async updateCostsheet( id: string, body: models.UpdateCostsheetRequest, options?: RequestOptions, ): Promise { return unwrapAsync(costsUpdateCostsheet( this, id, body, options, )); } /** * Delete costsheet * * @remarks * Use when retiring a costsheet (e.g. end-of-life product). Soft-deletes; status set to deleted. */ async deleteCostsheet( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(costsDeleteCostsheet( this, id, options, )); } }