export type DeleteApiPublicV1GroupsGroupIdUsersUserIdArgs = {groupId: string, userId: number}; export type DeleteApiPublicV1GroupsGroupIdUsersUserIdOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a user from a group * * DELETE /public/v1/groups/{groupId}/users/{userId} */ export const deleteApiPublicV1GroupsGroupIdUsersUserId = async (args: DeleteApiPublicV1GroupsGroupIdUsersUserIdArgs, options: DeleteApiPublicV1GroupsGroupIdUsersUserIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/groups/${encodeURIComponent(String(args.groupId))}/users/${encodeURIComponent(String(args.userId))}${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 };