export type UpdateApiV1RecoveryCasesRecoveryCaseUuidRedebitArgs = {'X-Gusto-API-Version'?: '2026-06-15' | undefined, recovery_case_uuid: string}; export type UpdateApiV1RecoveryCasesRecoveryCaseUuidRedebitOptions = {baseUrl?: string | undefined, CompanyAccessAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Initiate a redebit for a recovery case * * PUT /v1/recovery_cases/{recovery_case_uuid}/redebit */ export const updateApiV1RecoveryCasesRecoveryCaseUuidRedebit = async (args: UpdateApiV1RecoveryCasesRecoveryCaseUuidRedebitArgs, options?: UpdateApiV1RecoveryCasesRecoveryCaseUuidRedebitOptions) => { const {baseUrl = "https://api.gusto-demo.com", fetch: fetchFn = fetch, CompanyAccessAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Gusto-API-Version'] != null) headers.set("X-Gusto-API-Version", String(args['X-Gusto-API-Version'])) if (CompanyAccessAuth !== undefined) headers.set('authorization', `Bearer ${CompanyAccessAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/recovery_cases/${encodeURIComponent(String(args.recovery_case_uuid))}/redebit${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };