export type DeleteApiV2PartitionPartitionIdAccountAccountIdArgs = {accountId: string, partitionId: string}; export type DeleteApiV2PartitionPartitionIdAccountAccountIdOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete account * * DELETE /v2/partition/{partitionId}/account/{accountId} */ export const deleteApiV2PartitionPartitionIdAccountAccountId = async (args: DeleteApiV2PartitionPartitionIdAccountAccountIdArgs, options?: DeleteApiV2PartitionPartitionIdAccountAccountIdOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/partition/${encodeURIComponent(String(args.partitionId))}/account/${encodeURIComponent(String(args.accountId))}${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 };