export type UnpauseCollections = {notes?: string | undefined}; export type CreateApiCustomersCustomerIdDebtsDebtIdUnpauseCollectionsArgs = {changeDebtStatus?: boolean | undefined, body: UnpauseCollections}; export type CreateApiCustomersCustomerIdDebtsDebtIdUnpauseCollectionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unpause collections on a debt * * POST /customers/{customerId}/debts/{debtId}/unpauseCollections */ export const createApiCustomersCustomerIdDebtsDebtIdUnpauseCollections = async (args: CreateApiCustomersCustomerIdDebtsDebtIdUnpauseCollectionsArgs, options?: CreateApiCustomersCustomerIdDebtsDebtIdUnpauseCollectionsOptions) => { const {baseUrl = "https://api.trueaccord.com/api/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.changeDebtStatus != null) query.append("changeDebtStatus", String(args.changeDebtStatus)) const url = `${baseUrl.replace(/\/+$/, '')}/customers/${encodeURIComponent(String(args.customerId))}/debts/${encodeURIComponent(String(args.debtId))}/unpauseCollections${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };