export type DeleteApiV1AccountsAccountIdUsersUserIdDeleteUserArgs = {account_id: string, user_id: string}; export type DeleteApiV1AccountsAccountIdUsersUserIdDeleteUserOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete User From Account * * DELETE /v1/accounts/{account_id}/users/{user_id}/delete_user */ export const deleteApiV1AccountsAccountIdUsersUserIdDeleteUser = async (args: DeleteApiV1AccountsAccountIdUsersUserIdDeleteUserArgs, options?: DeleteApiV1AccountsAccountIdUsersUserIdDeleteUserOptions) => { const {baseUrl = "https://api.rivery.io", 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(/\/+$/, '')}/v1/accounts/${encodeURIComponent(String(args.account_id))}/users/${encodeURIComponent(String(args.user_id))}/delete_user${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 };