export type DeleteApiRrApiV1ContractsContractIdBundlesIdArgs = {contract_id: number, id: number}; export type DeleteApiRrApiV1ContractsContractIdBundlesIdOptions = {baseUrl?: string | undefined, knoxApiToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Contract Bundle * * DELETE /rr/api/v1/contracts/{contract_id}/bundles/{id} */ export const deleteApiRrApiV1ContractsContractIdBundlesId = async (args: DeleteApiRrApiV1ContractsContractIdBundlesIdArgs, options?: DeleteApiRrApiV1ContractsContractIdBundlesIdOptions) => { const {baseUrl = "https://api.meetcampfire.com", fetch: fetchFn = fetch, knoxApiToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (knoxApiToken !== undefined) headers.set("Authorization", knoxApiToken) const url = `${baseUrl.replace(/\/+$/, '')}/rr/api/v1/contracts/${encodeURIComponent(String(args.contract_id))}/bundles/${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 };