export type DeleteApiV2DistributorsAccountsIdArgs = {'client-id': string, 'client-secret': string, id: string}; export type DeleteApiV2DistributorsAccountsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * unsubscribeAccount * * DELETE /v2/distributors/accounts/{id} */ export const deleteApiV2DistributorsAccountsId = async (args: DeleteApiV2DistributorsAccountsIdArgs, options?: DeleteApiV2DistributorsAccountsIdOptions) => { const {baseUrl = "https://api.cloudally.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args['client-id'] != null) headers.set("client-id", String(args['client-id'])) if (args['client-secret'] != null) headers.set("client-secret", String(args['client-secret'])) const url = `${baseUrl.replace(/\/+$/, '')}/v2/distributors/accounts/${encodeURIComponent(String(args.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 res.blob() };