export type PatchApiV20EndpointsEndpointIdArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, endpointId: string, body: {foreignId?: string | undefined, channel?: ('facebook' | 'alexa' | 'slack' | 'generic' | 'inject' | 'rest' | 'realtime' | 'socket' | 'adminconsole' | 'webchat2' | 'dialogflow' | 'twilio' | 'twilio-sms' | 'line' | 'intercom' | 'microsoftBotFramework' | 'microsoftTeams' | 'sunshineConversations' | 'admin-webchat' | 'avaya' | 'nonConversational' | 'voiceGateway2' | 'amazonLex' | 'workplace' | 'webhook' | 'abstractRest' | 'userlike' | 'ringCentralEngage' | 'audioCodes' | 'bandwidth' | 'whatsapp' | 'eightByEight' | 'genesysBotConnector' | 'niceCXOne' | 'agentAssistVoice' | 'webchat3' | 'niceCXOneAAH' | 'zoomContactCenter' | 'mcpServer') | undefined, flowId?: string | undefined, localeId?: string | undefined, URLToken?: string | undefined, name?: string | undefined, entrypoint?: string | undefined, active?: boolean | undefined, nluConnectorId?: ('alexa' | 'dialogflow' | 'dialogflowBuiltIn' | 'amazonLexBuiltIn' | 'luis' | 'watson' | 'noNlu' | 'cognigy' | 'code' | 'generativeAI' | 'lex' | string) | undefined, useConversations?: boolean | undefined, maskIPAddress?: boolean | undefined, maskAnalytics?: boolean | undefined, maskLogging?: boolean | undefined, useContactProfiles?: boolean | undefined, useAnalytics?: boolean | undefined, useDashbotAnalytics?: boolean | undefined, dashbotApikey?: string | undefined, dashbotPlatform?: string | undefined, disableInputSanitization?: string | undefined, disableSkipUriTags?: string | undefined, overrideSnapshotConnections?: boolean | undefined, settings?: ({accessScope?: string | undefined, accessToken?: string | undefined, appId?: string | undefined, appSecret?: string | undefined, backgroundImageUrl?: string | undefined, basicAuthPassword?: string | undefined, basicAuthUser?: string | undefined, botUserId?: string | undefined, businessHours?: ({businessHours?: (Array<{startTime?: string | undefined, endTime?: string | undefined, weekDay?: string | undefined}>) | undefined, enabled?: boolean | undefined, text?: string | undefined, mode?: string | undefined, timeZone?: string | undefined, title?: string | undefined}) | undefined, colorScheme?: string | undefined, connectionName?: string | undefined, customJSON?: string | undefined, designTemplate?: number | undefined, disableHtmlContentSanitization?: boolean | undefined, disableInputAutocomplete?: boolean | undefined, disableInputAutogrow?: boolean | undefined, disableUrlButtonSanitization?: boolean | undefined, enableGenericHTMLStyling?: boolean | undefined, enableAsyncCommunication?: boolean | undefined, engagementMessageText?: string | undefined, displayGetStartedButton?: boolean | undefined, dynamicImageAspectRatio?: boolean | undefined, enableCollectMetadata?: boolean | undefined, enableConnectionStatusIndicator?: boolean | undefined, enableDemoWebchat?: boolean | undefined, enableFileUpload?: boolean | undefined, enablePersistentMenu?: boolean | undefined, enableRating?: ('onRequest' | 'always' | 'once') | undefined, enableSTT?: boolean | undefined, enableTTS?: boolean | undefined, enableUnreadMessageBadge?: boolean | undefined, enableUnreadMessagePreview?: boolean | undefined, enableUnreadMessageSound?: boolean | undefined, enableUnreadMessageTitleIndicator?: boolean | undefined, enableTypingIndicator?: boolean | undefined, facebookPageToken?: string | undefined, focusInputAfterPostback?: boolean | undefined, getStartedButtonText?: string | undefined, getStartedPayload?: string | undefined, getStartedText?: string | undefined, getStartedData?: string | undefined, headerLogoUrl?: string | undefined, hubSecret?: string | undefined, inputAutogrowMaxRows?: number | undefined, inputPlaceholder?: string | undefined, language?: string | undefined, lineChannelAccessToken?: string | undefined, lineChannelSecret?: string | undefined, maintenance?: ({enabled?: boolean | undefined, mode?: string | undefined, text?: string | undefined, title?: string | undefined}) | undefined, mergeContactProfiles?: boolean | undefined, messageDelay?: number | undefined, messageLogoUrl?: string | undefined, overwriteWebchatBundleUrl?: string | undefined, ratingTitleText?: string | undefined, ratingCommentText?: string | undefined, ratingMessageHistoryRatingText?: string | undefined, ratingMessageHistoryCommentText?: string | undefined, reparseAlexaSlots?: boolean | undefined, requestFacebookProfileData?: boolean | undefined, restEndpointAuthentication?: ({authenticationType?: ('no-auth' | 'apiKey') | undefined}) | undefined, sessionExpiration?: number | undefined, shouldOverwriteWebchatBundleUrl?: boolean | undefined, showEngagementMessagesInChat?: boolean | undefined, slackOAuthAccessToken?: string | undefined, slackVerifyToken?: string | undefined, sunshineConversationsChannelKeyId?: string | undefined, sunshineConversationsChannelSecret?: string | undefined, sunshineConversationsChannelUri?: string | undefined, tenantId?: string | undefined, updateContactProfileWithFacebookProfile?: boolean | undefined, voice?: string | undefined, webhookEndpointAuthentication?: ({authenticationType?: ('no-auth' | 'apiKey') | undefined}) | undefined, webhookUrl?: string | undefined, skill?: Record | undefined, persistentMenu?: Record | undefined}) | undefined, transformer?: ({abortOnError?: boolean | undefined, transformer?: string | undefined, transpiledTransformer?: string | undefined, inputTransformerEnabled?: boolean | undefined, outputTransformerEnabled?: boolean | undefined, finalPingTransformerEnabled?: boolean | undefined, notifyTransformerEnabled?: boolean | undefined, injectTransformerEnabled?: boolean | undefined}) | undefined, handoverSettings?: ({provider?: ('cognigy' | 'none' | 'rce') | undefined, providerSettings?: ({forwardOnlyHandoverConversations?: boolean | undefined, getQueueUpdates?: boolean | undefined, apiVersion?: string | undefined, baseUrl?: string | undefined, apiAccessToken?: string | undefined, baseApiUrl?: string | undefined, realtimeAccessToken?: string | undefined, realtimeEndpointUrl?: string | undefined, webhookSecret?: string | undefined, botCategoryId?: string | undefined, agentCategoryId?: string | undefined, organizationId?: string | undefined, deploymentId?: string | undefined, buttonId?: string | undefined}) | undefined, agentAssistSettings?: ({copilotType?: ('none' | 'workspace' | 'whisper') | undefined, agentAssistFlowId?: string | undefined, agentAssistConfigId?: string | undefined, enableTranscriptTile?: boolean | undefined, enableTranscriptTileChatInput?: boolean | undefined, redactTranscriptTileMessages?: boolean | undefined, enableAgentCopilotAuthentication?: boolean | undefined, blockNonJWTRequests?: boolean | undefined, agentCopilotAuthentication?: string | undefined, copilotAuthenticationMethod?: ('default' | 'tokenSecret' | 'publicKey' | 'keyStore') | undefined, copilotAuthenticationPublicKeys?: Array | undefined, copilotAuthenticationKeyStoreUrl?: string | undefined, oAuth2Connection?: string | undefined}) | undefined}) | undefined, orgDataPrivacySettings?: ({enabled?: boolean | undefined, useAnalytics?: boolean | undefined, storeDataPayload?: boolean | undefined, useContactProfiles?: boolean | undefined, useConversations?: boolean | undefined, maskIPAddress?: boolean | undefined, maskAnalytics?: boolean | undefined, maskLogging?: boolean | undefined}) | undefined}}; export type PatchApiV20EndpointsEndpointIdOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an Endpoint * * PATCH /v2.0/endpoints/{endpointId} * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const patchApiV20EndpointsEndpointId = async (args: PatchApiV20EndpointsEndpointIdArgs, options?: PatchApiV20EndpointsEndpointIdOptions) => { 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/endpoints/${encodeURIComponent(String(args.endpointId))}${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 };