export type DeleteApiV3ResellersResellerIdOrganizationsIdArgs = {resellerId: string, id: string}; export type DeleteApiV3ResellersResellerIdOrganizationsIdOptions = {baseUrl?: string | undefined, JWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a reseller organization * * DELETE /v3/resellers/{resellerId}/organizations/{id} */ export const deleteApiV3ResellersResellerIdOrganizationsId = async (args: DeleteApiV3ResellersResellerIdOrganizationsIdArgs, options?: DeleteApiV3ResellersResellerIdOrganizationsIdOptions) => { const {baseUrl = "https://api.cryptlex.com", fetch: fetchFn = fetch, JWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWT !== undefined) headers.set('authorization', `Bearer ${JWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/v3/resellers/${encodeURIComponent(String(args.resellerId))}/organizations/${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 undefined };