/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { giftCardsCreate } from "../funcs/giftCardsCreate.js"; import { giftCardsDelete } from "../funcs/giftCardsDelete.js"; import { giftCardsGet } from "../funcs/giftCardsGet.js"; import { giftCardsList } from "../funcs/giftCardsList.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; import { Activations } from "./activations.js"; import { Balances } from "./balances.js"; import { Issuances } from "./issuances.js"; export class GiftCards extends ClientSDK { private _balances?: Balances; get balances(): Balances { return (this._balances ??= new Balances(this._options)); } private _activations?: Activations; get activations(): Activations { return (this._activations ??= new Activations(this._options)); } private _issuances?: Issuances; get issuances(): Issuances { return (this._issuances ??= new Issuances(this._options)); } /** * Get gift card * * @remarks * Fetch details about a gift card. */ async get( giftCardId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(giftCardsGet( this, giftCardId, merchantAccountId, options, )); } /** * Delete a gift card * * @remarks * Removes a gift card from our system. */ async delete( giftCardId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(giftCardsDelete( this, giftCardId, merchantAccountId, options, )); } /** * Create gift card * * @remarks * Store a new gift card in the vault. */ async create( giftCardCreate: components.GiftCardCreate, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(giftCardsCreate( this, giftCardCreate, merchantAccountId, options, )); } /** * List gift cards * * @remarks * Browser all gift cards. */ async list( request?: operations.ListGiftCardsRequest | undefined, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(giftCardsList( this, request, options, )); } }