export type PatchApiV20FlowsFlowIdSlotfillersSlotFillerIdArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, flowId: string, slotFillerId: string, body: {name?: string | undefined, type?: ('age' | 'date' | 'duration' | 'email' | 'intent' | 'slot' | 'money' | 'number' | 'percentage' | 'regex' | 'temperature') | undefined, usePositiveOnly?: boolean | undefined, storeResultInContext?: boolean | undefined, contextKey?: string | undefined, storeInContactProfile?: boolean | undefined, profileKey?: string | undefined, storeDetailedResults?: boolean | undefined, skipIfResultInContext?: boolean | undefined, additionalValidation?: string | undefined, resultLocation?: string | undefined, regex?: string | undefined, slot?: string | undefined}}; export type PatchApiV20FlowsFlowIdSlotfillersSlotFillerIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a Slot Filler * * PATCH /v2.0/flows/{flowId}/slotfillers/{slotFillerId} * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const patchApiV20FlowsFlowIdSlotfillersSlotFillerId = async (args: PatchApiV20FlowsFlowIdSlotfillersSlotFillerIdArgs, options?: PatchApiV20FlowsFlowIdSlotfillersSlotFillerIdOptions) => { const {baseUrl = "https://api-trial.cognigy.ai/testing", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v2.0/flows/${encodeURIComponent(String(args.flowId))}/slotfillers/${encodeURIComponent(String(args.slotFillerId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };