export type CollaborationGroupsCollaborationGroupGroupDTO = {collaborationGroupId: number, groupIds: Array}; export type DeleteApiV2CollaborationGroupsDeleteGroupsArgs = {includeArchived?: boolean | undefined, body: CollaborationGroupsCollaborationGroupGroupDTO}; export type DeleteApiV2CollaborationGroupsDeleteGroupsOptions = {baseUrl?: string | undefined, OAuth2ClientCredentials?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove groups from a collaboration group, optionally including archived collaboration groups * * DELETE /v2/collaboration-groups/delete-groups */ export const deleteApiV2CollaborationGroupsDeleteGroups = async (args: DeleteApiV2CollaborationGroupsDeleteGroupsArgs, options?: DeleteApiV2CollaborationGroupsDeleteGroupsOptions) => { const {baseUrl = "https://api.quinyx.com", fetch: fetchFn = fetch, OAuth2ClientCredentials} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.includeArchived != null) query.append("includeArchived", String(args.includeArchived)) if (OAuth2ClientCredentials !== undefined) headers.set('authorization', `Bearer ${OAuth2ClientCredentials}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/collaboration-groups/delete-groups${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };