export type DeleteApiV2UserGroupsSettingsArgs = {partitionId: string, accountId: string, groupId: string}; export type DeleteApiV2UserGroupsSettingsOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete user group * * DELETE /v2/user-groups/settings */ export const deleteApiV2UserGroupsSettings = async (args: DeleteApiV2UserGroupsSettingsArgs, options?: DeleteApiV2UserGroupsSettingsOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.partitionId != null) query.append("partitionId", String(args.partitionId)) if (args.accountId != null) query.append("accountId", String(args.accountId)) if (args.groupId != null) query.append("groupId", String(args.groupId)) if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/user-groups/settings${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 };