export type DeleteApiApiOrgIdFleetConfigsIdArgs = {org_id: string, id: string}; export type DeleteApiApiOrgIdFleetConfigsIdOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a configuration and all its versions * * DELETE /api/{org_id}/fleet/configs/{id} */ export const deleteApiApiOrgIdFleetConfigsId = async (args: DeleteApiApiOrgIdFleetConfigsIdArgs, options: DeleteApiApiOrgIdFleetConfigsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/fleet/configs/${encodeURIComponent(String(args.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 };