export type PatchApiV20AicopilotconfigsConfigIdArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, configId: string, body: {name?: string | undefined, description?: string | undefined, config?: ({grid?: ({columns?: number | undefined, rows?: number | undefined, gap?: number | undefined}) | undefined, tiles?: ({'tile-id'?: ({x?: number | undefined, y?: number | undefined, columns?: number | undefined, rows?: number | undefined}) | undefined}) | undefined}) | undefined}}; export type PatchApiV20AicopilotconfigsConfigIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an Agent Copilot Configuration * * PATCH /v2.0/aicopilotconfigs/{configId} * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const patchApiV20AicopilotconfigsConfigId = async (args: PatchApiV20AicopilotconfigsConfigIdArgs, options?: PatchApiV20AicopilotconfigsConfigIdOptions) => { 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/aicopilotconfigs/${encodeURIComponent(String(args.configId))}${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 };