export type DeleteApiExperimentsExperimentIdGroupsGroupIdArgs = {experiment_id: string, group_id: string}; export type DeleteApiExperimentsExperimentIdGroupsGroupIdOptions = {baseUrl?: string | undefined, secretAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an experiment group * * DELETE /experiments/{experiment_id}/groups/{group_id} */ export const deleteApiExperimentsExperimentIdGroupsGroupId = async (args: DeleteApiExperimentsExperimentIdGroupsGroupIdArgs, options?: DeleteApiExperimentsExperimentIdGroupsGroupIdOptions) => { const {baseUrl = "https://api.qonversion.io/v4", fetch: fetchFn = fetch, secretAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (secretAuth !== undefined) headers.set('authorization', `Bearer ${secretAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/experiments/${encodeURIComponent(String(args.experiment_id))}/groups/${encodeURIComponent(String(args.group_id))}${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 };