export type DeleteApiApiAdminTenantsTenantIdArgs = {tenant_id: string}; export type DeleteApiApiAdminTenantsTenantIdOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Tenant * * DELETE /api/admin/tenants/{tenant_id} */ export const deleteApiApiAdminTenantsTenantId = async (args: DeleteApiApiAdminTenantsTenantIdArgs, options?: DeleteApiApiAdminTenantsTenantIdOptions) => { const {baseUrl = "https://api.e-invoice.be", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/admin/tenants/${encodeURIComponent(String(args.tenant_id))}${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 };