export type DeleteApiCatalogBundlesBundleIdItemsItemIdArgs = {bundle_id: string, item_id: string}; export type DeleteApiCatalogBundlesBundleIdItemsItemIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Bundle Item * * DELETE /catalog/bundles/{bundle_id}/items/{item_id} */ export const deleteApiCatalogBundlesBundleIdItemsItemId = async (args: DeleteApiCatalogBundlesBundleIdItemsItemIdArgs, options?: DeleteApiCatalogBundlesBundleIdItemsItemIdOptions) => { const {baseUrl = "https://api.roapp.io/v2", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set('authorization', `Bearer ${apiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/catalog/bundles/${encodeURIComponent(String(args.bundle_id))}/items/${encodeURIComponent(String(args.item_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 };