/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { discountsCreate } from "../funcs/discountsCreate.js"; import { discountsDelete } from "../funcs/discountsDelete.js"; import { discountsGet } from "../funcs/discountsGet.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Discounts extends ClientSDK { /** * Retrieve discount * * @remarks * Retrieve discount code details by ID or code. Check usage limits, expiration, and discount amount. */ async get( discountId?: string | undefined, discountCode?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(discountsGet( this, discountId, discountCode, options, )); } /** * Create a discount. * * @remarks * Create promotional discount codes for products. Set percentage or fixed amount discounts with expiration dates. */ async create( request: components.CreateDiscountRequestEntity, options?: RequestOptions, ): Promise { return unwrapAsync(discountsCreate( this, request, options, )); } /** * Delete a discount. * * @remarks * Permanently delete a discount code. Prevent further usage of the discount. */ async delete( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(discountsDelete( this, id, options, )); } }