export type DeleteApiV1ClientBillTosClientIdArgs = {clientId: number}; export type DeleteApiV1ClientBillTosClientIdOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a client bill to. * * DELETE /v1/client_bill_tos/{clientId} */ export const deleteApiV1ClientBillTosClientId = async (args: DeleteApiV1ClientBillTosClientIdArgs, options: DeleteApiV1ClientBillTosClientIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("x-forecast-api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/client_bill_tos/${encodeURIComponent(String(args.clientId))}${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 };