export type DeleteApiStackAdminconfigV2UsersUserNameArgs = {stack: string, userName: string}; export type DeleteApiStackAdminconfigV2UsersUserNameOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * delete a specific user * * DELETE /{stack}/adminconfig/v2/users/{userName} */ export const deleteApiStackAdminconfigV2UsersUserName = async (args: DeleteApiStackAdminconfigV2UsersUserNameArgs, options: DeleteApiStackAdminconfigV2UsersUserNameOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.stack))}/adminconfig/v2/users/${encodeURIComponent(String(args.userName))}${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 };