export type DeleteApiGroupsGroupIdAppsAppIdUserRegistrationsByEmailEmailOptions = {baseUrl?: string | undefined, tokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a pending email/password authentication user * * DELETE /groups/{groupId}/apps/{appId}/user_registrations/by_email/{email} */ export const deleteApiGroupsGroupIdAppsAppIdUserRegistrationsByEmailEmail = async (options?: DeleteApiGroupsGroupIdAppsAppIdUserRegistrationsByEmailEmailOptions) => { const {baseUrl = "https://services.cloud.mongodb.com/api/admin/v3.0", fetch: fetchFn = fetch, tokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (tokenAuth !== undefined) headers.set('authorization', `Bearer ${tokenAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/groups/${encodeURIComponent(String(args.groupId))}/apps/${encodeURIComponent(String(args.appId))}/user_registrations/by_email/${encodeURIComponent(String(args.email))}${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 };