/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { paymentLinksCreate } from "../funcs/paymentLinksCreate.js"; import { paymentLinksExpire } from "../funcs/paymentLinksExpire.js"; import { paymentLinksGet } from "../funcs/paymentLinksGet.js"; import { paymentLinksList } from "../funcs/paymentLinksList.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"; export class PaymentLinks extends ClientSDK { /** * Add a payment link * * @remarks * Create a new payment link. */ async create( paymentLinkCreate: components.PaymentLinkCreate, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksCreate( this, paymentLinkCreate, merchantAccountId, options, )); } /** * List all payment links * * @remarks * List all created payment links. */ async list( request?: operations.ListPaymentLinksRequest | undefined, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(paymentLinksList( this, request, options, )); } /** * Expire a payment link * * @remarks * Expire an existing payment link. */ async expire( paymentLinkId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksExpire( this, paymentLinkId, merchantAccountId, options, )); } /** * Get payment link * * @remarks * Fetch the details for a payment link. */ async get( paymentLinkId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentLinksGet( this, paymentLinkId, merchantAccountId, options, )); } }