export type UpdateApiPublicV1GroupsGroupIdUserEmailEmailArgs = {groupId: string, email: string}; export type UpdateApiPublicV1GroupsGroupIdUserEmailEmailOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add a user to a group * * PUT /public/v1/groups/{groupId}/userEmail/{email} */ export const updateApiPublicV1GroupsGroupIdUserEmailEmail = async (args: UpdateApiPublicV1GroupsGroupIdUserEmailEmailArgs, options: UpdateApiPublicV1GroupsGroupIdUserEmailEmailOptions) => { 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))}/userEmail/${encodeURIComponent(String(args.email))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };