export type DeleteApiV3ContractsIdObligationsObligationIdArgs = {id: string, obligationId: string}; export type DeleteApiV3ContractsIdObligationsObligationIdOptions = {baseUrl?: string | undefined, customHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete contract obligation * * DELETE /v3/contracts/{id}/obligations/{obligationId} */ export const deleteApiV3ContractsIdObligationsObligationId = async (args: DeleteApiV3ContractsIdObligationsObligationIdArgs, options?: DeleteApiV3ContractsIdObligationsObligationIdOptions) => { const {baseUrl = "https://integrators.prod.api.tabsplatform.com", fetch: fetchFn = fetch, customHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (customHeader !== undefined) headers.set("Authorization", customHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v3/contracts/${encodeURIComponent(String(args.id))}/obligations/${encodeURIComponent(String(args.obligationId))}${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 };