/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { paymentMethodsNetworkTokensCreate } from "../funcs/paymentMethodsNetworkTokensCreate.js"; import { paymentMethodsNetworkTokensDelete } from "../funcs/paymentMethodsNetworkTokensDelete.js"; import { paymentMethodsNetworkTokensList } from "../funcs/paymentMethodsNetworkTokensList.js"; import { paymentMethodsNetworkTokensResume } from "../funcs/paymentMethodsNetworkTokensResume.js"; import { paymentMethodsNetworkTokensSuspend } from "../funcs/paymentMethodsNetworkTokensSuspend.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; import { Cryptogram } from "./cryptogram.js"; export class NetworkTokens extends ClientSDK { private _cryptogram?: Cryptogram; get cryptogram(): Cryptogram { return (this._cryptogram ??= new Cryptogram(this._options)); } /** * List network tokens * * @remarks * List all network tokens stored for a payment method. */ async list( paymentMethodId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentMethodsNetworkTokensList( this, paymentMethodId, merchantAccountId, options, )); } /** * Provision network token * * @remarks * Provision a network token for a payment method. */ async create( networkTokenCreate: components.NetworkTokenCreate, paymentMethodId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentMethodsNetworkTokensCreate( this, networkTokenCreate, paymentMethodId, merchantAccountId, options, )); } /** * Suspend network token * * @remarks * Suspend a network token for a payment method. */ async suspend( paymentMethodId: string, networkTokenId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentMethodsNetworkTokensSuspend( this, paymentMethodId, networkTokenId, merchantAccountId, options, )); } /** * Resume network token * * @remarks * Resume a suspended network token for a payment method. */ async resume( paymentMethodId: string, networkTokenId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentMethodsNetworkTokensResume( this, paymentMethodId, networkTokenId, merchantAccountId, options, )); } /** * Delete network token * * @remarks * Delete a network token for a payment method. */ async delete( paymentMethodId: string, networkTokenId: string, merchantAccountId?: string | null | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(paymentMethodsNetworkTokensDelete( this, paymentMethodId, networkTokenId, merchantAccountId, options, )); } }