export type PatchApiV20FlowsFlowIdSettingsArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, flowId: string, body: {continueExecutionAfterAttachedFlow?: boolean | undefined, continueExecutionAterDefaultReply?: boolean | undefined, continueExecutionAfterNegativeConfirmation?: boolean | undefined, passDefaultRepliesIntoFlow?: boolean | undefined, flowIntentMappingOrder?: ('joint' | 'main' | 'attached') | undefined, useAttachedFlowThresholds?: boolean | undefined, useAttachedFlowContinueAfterDefaultReply?: boolean | undefined, useAttachedFlowPassDefaultRepliesIntoFlow?: boolean | undefined, implicitSlotParsing?: ('disabled' | 'full' | 'system' | 'lexicon') | undefined, useAttachedFlowImplicitSlotParsing?: boolean | undefined, lexiconSlotsWithSubMatches?: boolean | undefined, useIntentDefaultRepliesAsExamples?: boolean | undefined, localeSettings?: ({localeReference?: string | undefined, inheritFallbackLocaleModel?: boolean | undefined}) | undefined}}; export type PatchApiV20FlowsFlowIdSettingsOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Flow Settings * * PATCH /v2.0/flows/{flowId}/settings * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const patchApiV20FlowsFlowIdSettings = async (args: PatchApiV20FlowsFlowIdSettingsArgs, options?: PatchApiV20FlowsFlowIdSettingsOptions) => { 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))}/settings${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 };