export type DeleteApiV2CollaborationGroupsGroupsCollaborationGroupIdArgs = {collaborationGroupId: number, includeArchived?: boolean | undefined}; export type DeleteApiV2CollaborationGroupsGroupsCollaborationGroupIdOptions = {baseUrl?: string | undefined, OAuth2ClientCredentials?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete collaboration group with its children * * DELETE /v2/collaboration-groups/groups/{collaborationGroupId} */ export const deleteApiV2CollaborationGroupsGroupsCollaborationGroupId = async (args: DeleteApiV2CollaborationGroupsGroupsCollaborationGroupIdArgs, options?: DeleteApiV2CollaborationGroupsGroupsCollaborationGroupIdOptions) => { const {baseUrl = "https://api.quinyx.com", fetch: fetchFn = fetch, OAuth2ClientCredentials} = options ?? {} const query = new URLSearchParams() const headers = new Headers() 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/groups/${encodeURIComponent(String(args.collaborationGroupId))}${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 };