export type Id = unknown; export type EntityType = 'CARD' | 'CARD_HIERARCHY_GROUP'; export type ExternalEntityReference = {id: string, type: EntityType}; export type EntityBindingList = {entities?: Array | undefined}; export type CreateApiV1RuleSetsRuleSetIdEntityBindingsRemoveArgs = {'rule-set-id': Id, auditUser: string, body: EntityBindingList}; export type CreateApiV1RuleSetsRuleSetIdEntityBindingsRemoveOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete Entity Bindings * * POST /v1/rule-sets/{rule-set-id}/entity-bindings/remove */ export const createApiV1RuleSetsRuleSetIdEntityBindingsRemove = async (args: CreateApiV1RuleSetsRuleSetIdEntityBindingsRemoveArgs, options: CreateApiV1RuleSetsRuleSetIdEntityBindingsRemoveOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.auditUser != null) query.append("auditUser", String(args.auditUser)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/rule-sets/${encodeURIComponent(String(args['rule-set-id']))}/entity-bindings/remove${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };