export type PatchApiV1CustomersCustomerIdArchiveArgs = {customer_id: string}; export type PatchApiV1CustomersCustomerIdArchiveOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive the customer so it is no longer available for use in the system. * * PATCH /v1/customers/{customer_id}/archive */ export const patchApiV1CustomersCustomerIdArchive = async (args: PatchApiV1CustomersCustomerIdArchiveArgs, options?: PatchApiV1CustomersCustomerIdArchiveOptions) => { const {baseUrl = "https://auth-sandbox.fuse.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/customers/${encodeURIComponent(String(args.customer_id))}/archive${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };