export type DeleteApiV2DocumentsDocumentIdTransitionRulesRuleIdArgs = {authorization: string, document_id: string, rule_id: string}; export type DeleteApiV2DocumentsDocumentIdTransitionRulesRuleIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes the transition rule associated with ruleID from the document. * * DELETE /v2/documents/{document_id}/transition_rules/{rule_id} */ export const deleteApiV2DocumentsDocumentIdTransitionRulesRuleId = async (args: DeleteApiV2DocumentsDocumentIdTransitionRulesRuleIdArgs, options?: DeleteApiV2DocumentsDocumentIdTransitionRulesRuleIdOptions) => { const {baseUrl = "http://localhost:8082", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.authorization != null) headers.set("authorization", String(args.authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/documents/${encodeURIComponent(String(args.document_id))}/transition_rules/${encodeURIComponent(String(args.rule_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 };