export type DeleteApiV2OrganisationGroupsGroupIdArgs = {groupId: number}; export type DeleteApiV2OrganisationGroupsGroupIdOptions = {baseUrl?: string | undefined, OAuth2ClientCredentials?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a group * * DELETE /v2/organisation/groups/{groupId} */ export const deleteApiV2OrganisationGroupsGroupId = async (args: DeleteApiV2OrganisationGroupsGroupIdArgs, options?: DeleteApiV2OrganisationGroupsGroupIdOptions) => { const {baseUrl = "https://api.quinyx.com", fetch: fetchFn = fetch, OAuth2ClientCredentials} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2ClientCredentials !== undefined) headers.set('authorization', `Bearer ${OAuth2ClientCredentials}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/organisation/groups/${encodeURIComponent(String(args.groupId))}${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 };