/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { recoveryCasesGet } from "../funcs/recoveryCasesGet.js"; import { recoveryCasesRedebit } from "../funcs/recoveryCasesRedebit.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { GetRecoveryCasesRequest, GetRecoveryCasesResponse, } from "../models/operations/getrecoverycases.js"; import { RedebitRecoveryCaseRequest, RedebitRecoveryCaseResponse, } from "../models/operations/redebitrecoverycase.js"; import { unwrapAsync } from "../types/fp.js"; export class RecoveryCases extends ClientSDK { /** * Get all recovery cases for a company * * @remarks * Fetch all recovery cases for a company. * * scope: `recovery_cases:read` */ async get( request: GetRecoveryCasesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(recoveryCasesGet( this, request, options, )); } /** * Initiate a redebit for a recovery case * * @remarks * After resolving the underlying bank error, initiate a redebit for an open recovery case. This submission is asynchronous and a successful request responds with a 202 HTTP status. * * It may take up to four business days for the ACH debit to process; in the meantime, the status of the recovery case will be in the `initiated_redebit` state. When funds are successfully redebited, the recovery case is transitioned to the `recovered` state. * * If the company has exceeded maximum redebit attempts, or if the recovery case is not in a redebitable state, the response will be 422 Unprocessable Entity. * * scope: `recovery_cases:write` */ async redebit( request: RedebitRecoveryCaseRequest, options?: RequestOptions, ): Promise { return unwrapAsync(recoveryCasesRedebit( this, request, options, )); } }