export type DeleteApiCustomersCustomerIdArgs = {customerId: string | null, version: string | null}; export type DeleteApiCustomersCustomerIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a customer * * DELETE /customers/{customerId} */ export const deleteApiCustomersCustomerId = async (args: DeleteApiCustomersCustomerIdArgs, options?: DeleteApiCustomersCustomerIdOptions) => { const {baseUrl = "https://api.dojo.tech", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.version != null) headers.set("version", String(args.version)) if (ApiKeyAuth !== undefined) headers.set("Authorization", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/customers/${encodeURIComponent(String(args.customerId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };