/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { featuresCloneFeature } from "../funcs/features-clone-feature.js"; import { featuresCreateFeature } from "../funcs/features-create-feature.js"; import { featuresDeleteFeature } from "../funcs/features-delete-feature.js"; import { featuresQueryFeature } from "../funcs/features-query-feature.js"; import { featuresUpdateFeature } from "../funcs/features-update-feature.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { unwrapAsync } from "../types/fp.js"; import * as models from "./models/index.js"; export class Features extends ClientSDK { /** * Create feature * * @remarks * Use when defining a new feature or capability to gate or meter (e.g. feature flags or usage-based limits). Ideal for boolean or usage features. */ async createFeature( request: models.CreateFeatureRequest, options?: RequestOptions, ): Promise { return unwrapAsync(featuresCreateFeature( this, request, options, )); } /** * Query features * * @remarks * Use when listing or searching features (e.g. catalog or entitlement setup). Returns a paginated list; supports filtering and sorting. */ async queryFeature( request: models.FeatureFilter, options?: RequestOptions, ): Promise { return unwrapAsync(featuresQueryFeature( this, request, options, )); } /** * Update feature * * @remarks * Use when changing feature definition (e.g. name, type, or meter). Request body contains the fields to update. */ async updateFeature( id: string, body: models.UpdateFeatureRequest, options?: RequestOptions, ): Promise { return unwrapAsync(featuresUpdateFeature( this, id, body, options, )); } /** * Delete feature * * @remarks * Use when retiring a feature (e.g. deprecated capability). Returns 200 with success message. */ async deleteFeature( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(featuresDeleteFeature( this, id, options, )); } /** * Clone a feature * * @remarks * Clone an existing feature */ async cloneFeature( id: string, body: models.CloneFeatureRequest, options?: RequestOptions, ): Promise { return unwrapAsync(featuresCloneFeature( this, id, body, options, )); } }