// This file was auto-generated by Fern from our API Definition.

import { VapiClient } from "../../src/Client";
import { mockServerPool } from "../mock-server/MockServerPool";

describe("AssistantsClient", () => {
    test("list", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = [
            {
                transcriber: {
                    provider: "assembly-ai",
                    language: "multi",
                    confidenceThreshold: 0.4,
                    formatTurns: true,
                    endOfTurnConfidenceThreshold: 0.7,
                    minEndOfTurnSilenceWhenConfident: 160,
                    maxTurnSilence: 400,
                    vadAssistedEndpointingEnabled: true,
                    speechModel: "universal-streaming-english",
                    realtimeUrl: "realtimeUrl",
                    wordBoost: ["wordBoost"],
                    keytermsPrompt: ["keytermsPrompt"],
                    endUtteranceSilenceThreshold: 1.1,
                    disablePartialTranscripts: true,
                    fallbackPlan: {
                        transcribers: [
                            {
                                provider: "assembly-ai",
                                confidenceThreshold: 0.4,
                                formatTurns: true,
                                endOfTurnConfidenceThreshold: 0.7,
                                minEndOfTurnSilenceWhenConfident: 160,
                                maxTurnSilence: 400,
                                vadAssistedEndpointingEnabled: true,
                            },
                        ],
                    },
                },
                model: {
                    provider: "anthropic",
                    messages: [{ content: null, role: "assistant" }],
                    tools: [
                        {
                            type: "apiRequest",
                            messages: [{ type: "request-start", blocking: false }],
                            method: "POST",
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            url: "url",
                            backoffPlan: {
                                type: { key: "value" },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                ],
                            },
                            rejectionPlan: {
                                conditions: [
                                    {
                                        type: "regex",
                                        regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                        target: { position: -1 },
                                    },
                                ],
                            },
                        },
                    ],
                    toolIds: ["toolIds"],
                    knowledgeBase: {
                        provider: "custom-knowledge-base",
                        server: {
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            staticIpAddressesEnabled: false,
                            backoffPlan: {
                                type: { key: "value" },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                    { key: "value" },
                                ],
                            },
                        },
                    },
                    model: "claude-3-opus-20240229",
                    thinking: { type: "enabled", budgetTokens: 1.1 },
                    temperature: 1.1,
                    maxTokens: 1.1,
                    emotionRecognitionEnabled: true,
                    numFastTurns: 1.1,
                },
                voice: {
                    provider: "azure",
                    cachingEnabled: true,
                    voiceId: "andrew",
                    chunkPlan: {
                        enabled: true,
                        minCharacters: 30,
                        punctuationBoundaries: [
                            "。",
                            "，",
                            ".",
                            "!",
                            "?",
                            ";",
                            "،",
                            "۔",
                            "।",
                            "॥",
                            "|",
                            "||",
                            ",",
                            ":",
                        ],
                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                    },
                    speed: 1.1,
                    fallbackPlan: {
                        voices: [
                            {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "。",
                                        "，",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "،",
                                        "۔",
                                        "।",
                                        "॥",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                },
                            },
                        ],
                    },
                },
                firstMessage: "Hello! How can I help you today?",
                firstMessageInterruptionsEnabled: true,
                firstMessageMode: "assistant-speaks-first",
                voicemailDetection: "off",
                clientMessages: [
                    "conversation-update",
                    "function-call",
                    "hang",
                    "model-output",
                    "speech-update",
                    "status-update",
                    "transfer-update",
                    "transcript",
                    "tool-calls",
                    "user-interrupted",
                    "voice-input",
                    "workflow.node.started",
                    "assistant.started",
                ],
                serverMessages: [
                    "conversation-update",
                    "end-of-call-report",
                    "function-call",
                    "hang",
                    "speech-update",
                    "status-update",
                    "tool-calls",
                    "transfer-destination-request",
                    "handoff-destination-request",
                    "user-interrupted",
                    "assistant.started",
                ],
                maxDurationSeconds: 600,
                backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                modelOutputInMessagesEnabled: false,
                transportConfigurations: [{ provider: "twilio", timeout: 60, record: false }],
                observabilityPlan: {
                    provider: "langfuse",
                    promptName: "promptName",
                    promptVersion: 1.1,
                    traceName: "traceName",
                    tags: ["tags"],
                    metadata: { key: "value" },
                },
                credentials: [{ provider: "11labs", apiKey: "apiKey" }],
                hooks: [
                    {
                        on: "call.ending",
                        do: [
                            {
                                type: "tool",
                                tool: {
                                    type: "apiRequest",
                                    messages: [{ type: "request-start", blocking: false }],
                                    method: "POST",
                                    timeoutSeconds: 20,
                                    credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                    url: "url",
                                    backoffPlan: {
                                        type: { key: "value" },
                                        maxRetries: 0,
                                        baseDelaySeconds: 1,
                                        excludedStatusCodes: [
                                            { key: "value" },
                                            { key: "value" },
                                            { key: "value" },
                                            { key: "value" },
                                        ],
                                    },
                                    rejectionPlan: {
                                        conditions: [
                                            {
                                                type: "regex",
                                                regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                target: { position: -1 },
                                            },
                                        ],
                                    },
                                },
                            },
                        ],
                    },
                ],
                name: "name",
                voicemailMessage: "voicemailMessage",
                endCallMessage: "endCallMessage",
                endCallPhrases: ["endCallPhrases"],
                compliancePlan: {
                    hipaaEnabled: true,
                    pciEnabled: true,
                    recordingConsentPlan: {
                        type: "stay-on-line",
                        message:
                            "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                        voice: {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "。",
                                    "，",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "،",
                                    "۔",
                                    "।",
                                    "॥",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                            },
                            fallbackPlan: {
                                voices: [
                                    {
                                        provider: "azure",
                                        cachingEnabled: true,
                                        voiceId: "andrew",
                                        chunkPlan: {
                                            enabled: true,
                                            minCharacters: 30,
                                            punctuationBoundaries: [
                                                "。",
                                                "，",
                                                ".",
                                                "!",
                                                "?",
                                                ";",
                                                "،",
                                                "۔",
                                                "।",
                                                "॥",
                                                "|",
                                                "||",
                                                ",",
                                                ":",
                                            ],
                                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                        },
                                    },
                                ],
                            },
                        },
                        waitSeconds: 3,
                    },
                },
                metadata: { key: "value" },
                backgroundSpeechDenoisingPlan: {
                    fourierDenoisingPlan: {
                        mediaDetectionEnabled: true,
                        staticThreshold: -35,
                        baselineOffsetDb: -15,
                        windowSizeMs: 3000,
                        baselinePercentile: 85,
                    },
                },
                artifactPlan: {
                    recordingEnabled: true,
                    recordingFormat: "wav;l16",
                    recordingUseCustomStorageEnabled: true,
                    videoRecordingEnabled: false,
                    fullMessageHistoryEnabled: false,
                    pcapEnabled: true,
                    pcapS3PathPrefix: "/pcaps",
                    pcapUseCustomStorageEnabled: true,
                    loggingEnabled: true,
                    loggingUseCustomStorageEnabled: true,
                    transcriptPlan: { enabled: true },
                    recordingPath: "recordingPath",
                    structuredOutputIds: ["structuredOutputIds"],
                    structuredOutputs: [
                        {
                            compliancePlan: { forceStoreOnHipaaEnabled: false },
                            name: "name",
                            schema: { type: "string" },
                        },
                    ],
                    scorecardIds: ["scorecardIds"],
                    scorecards: [
                        { metrics: [{ structuredOutputId: "structuredOutputId", conditions: [{ key: "value" }] }] },
                    ],
                    loggingPath: "loggingPath",
                },
                startSpeakingPlan: {
                    waitSeconds: 0.4,
                    smartEndpointingPlan: { provider: "vapi" },
                    customEndpointingRules: [{ type: "assistant", regex: "regex", timeoutSeconds: 1.1 }],
                    transcriptionEndpointingPlan: {
                        onPunctuationSeconds: 0.1,
                        onNoPunctuationSeconds: 1.5,
                        onNumberSeconds: 0.5,
                    },
                },
                stopSpeakingPlan: {
                    numWords: 0,
                    voiceSeconds: 0.2,
                    backoffSeconds: 1,
                    acknowledgementPhrases: [
                        "i understand",
                        "i see",
                        "i got it",
                        "i hear you",
                        "im listening",
                        "im with you",
                        "right",
                        "okay",
                        "ok",
                        "sure",
                        "alright",
                        "got it",
                        "understood",
                        "yeah",
                        "yes",
                        "uh-huh",
                        "mm-hmm",
                        "gotcha",
                        "mhmm",
                        "ah",
                        "yeah okay",
                        "yeah sure",
                    ],
                    interruptionPhrases: [
                        "stop",
                        "shut",
                        "up",
                        "enough",
                        "quiet",
                        "silence",
                        "but",
                        "dont",
                        "not",
                        "no",
                        "hold",
                        "wait",
                        "cut",
                        "pause",
                        "nope",
                        "nah",
                        "nevermind",
                        "never",
                        "bad",
                        "actually",
                    ],
                },
                monitorPlan: {
                    listenEnabled: false,
                    listenAuthenticationEnabled: false,
                    controlEnabled: false,
                    controlAuthenticationEnabled: false,
                    monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                },
                credentialIds: ["credentialIds"],
                server: {
                    timeoutSeconds: 20,
                    credentialId: "550e8400-e29b-41d4-a716-446655440000",
                    staticIpAddressesEnabled: false,
                    encryptedPaths: ["encryptedPaths"],
                    url: "url",
                    headers: { key: "value" },
                    backoffPlan: {
                        type: { key: "value" },
                        maxRetries: 0,
                        baseDelaySeconds: 1,
                        excludedStatusCodes: [{ key: "value" }, { key: "value" }, { key: "value" }, { key: "value" }],
                    },
                },
                keypadInputPlan: { enabled: true, timeoutSeconds: 1.1, delimiters: "#" },
                id: "id",
                orgId: "orgId",
                createdAt: "2024-01-15T09:30:00Z",
                updatedAt: "2024-01-15T09:30:00Z",
            },
        ];

        server.mockEndpoint().get("/assistant").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.assistants.list();
        expect(response).toEqual([
            {
                transcriber: {
                    provider: "assembly-ai",
                    language: "multi",
                    confidenceThreshold: 0.4,
                    formatTurns: true,
                    endOfTurnConfidenceThreshold: 0.7,
                    minEndOfTurnSilenceWhenConfident: 160,
                    maxTurnSilence: 400,
                    vadAssistedEndpointingEnabled: true,
                    speechModel: "universal-streaming-english",
                    realtimeUrl: "realtimeUrl",
                    wordBoost: ["wordBoost"],
                    keytermsPrompt: ["keytermsPrompt"],
                    endUtteranceSilenceThreshold: 1.1,
                    disablePartialTranscripts: true,
                    fallbackPlan: {
                        transcribers: [
                            {
                                provider: "assembly-ai",
                                confidenceThreshold: 0.4,
                                formatTurns: true,
                                endOfTurnConfidenceThreshold: 0.7,
                                minEndOfTurnSilenceWhenConfident: 160,
                                maxTurnSilence: 400,
                                vadAssistedEndpointingEnabled: true,
                            },
                        ],
                    },
                },
                model: {
                    provider: "anthropic",
                    messages: [
                        {
                            content: null,
                            role: "assistant",
                        },
                    ],
                    tools: [
                        {
                            type: "apiRequest",
                            messages: [
                                {
                                    type: "request-start",
                                    blocking: false,
                                },
                            ],
                            method: "POST",
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            url: "url",
                            backoffPlan: {
                                type: {
                                    key: "value",
                                },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                            rejectionPlan: {
                                conditions: [
                                    {
                                        type: "regex",
                                        regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                        target: {
                                            position: -1,
                                        },
                                    },
                                ],
                            },
                        },
                    ],
                    toolIds: ["toolIds"],
                    knowledgeBase: {
                        provider: "custom-knowledge-base",
                        server: {
                            timeoutSeconds: 20,
                            credentialId: "550e8400-e29b-41d4-a716-446655440000",
                            staticIpAddressesEnabled: false,
                            backoffPlan: {
                                type: {
                                    key: "value",
                                },
                                maxRetries: 0,
                                baseDelaySeconds: 1,
                                excludedStatusCodes: [
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                        },
                    },
                    model: "claude-3-opus-20240229",
                    thinking: {
                        type: "enabled",
                        budgetTokens: 1.1,
                    },
                    temperature: 1.1,
                    maxTokens: 1.1,
                    emotionRecognitionEnabled: true,
                    numFastTurns: 1.1,
                },
                voice: {
                    provider: "azure",
                    cachingEnabled: true,
                    voiceId: "andrew",
                    chunkPlan: {
                        enabled: true,
                        minCharacters: 30,
                        punctuationBoundaries: [
                            "\u3002",
                            "\uFF0C",
                            ".",
                            "!",
                            "?",
                            ";",
                            "\u060C",
                            "\u06D4",
                            "\u0964",
                            "\u0965",
                            "|",
                            "||",
                            ",",
                            ":",
                        ],
                        formatPlan: {
                            enabled: true,
                            numberToDigitsCutoff: 2025,
                        },
                    },
                    speed: 1.1,
                    fallbackPlan: {
                        voices: [
                            {
                                provider: "azure",
                                cachingEnabled: true,
                                voiceId: "andrew",
                                chunkPlan: {
                                    enabled: true,
                                    minCharacters: 30,
                                    punctuationBoundaries: [
                                        "\u3002",
                                        "\uFF0C",
                                        ".",
                                        "!",
                                        "?",
                                        ";",
                                        "\u060C",
                                        "\u06D4",
                                        "\u0964",
                                        "\u0965",
                                        "|",
                                        "||",
                                        ",",
                                        ":",
                                    ],
                                    formatPlan: {
                                        enabled: true,
                                        numberToDigitsCutoff: 2025,
                                    },
                                },
                            },
                        ],
                    },
                },
                firstMessage: "Hello! How can I help you today?",
                firstMessageInterruptionsEnabled: true,
                firstMessageMode: "assistant-speaks-first",
                voicemailDetection: "off",
                clientMessages: [
                    "conversation-update",
                    "function-call",
                    "hang",
                    "model-output",
                    "speech-update",
                    "status-update",
                    "transfer-update",
                    "transcript",
                    "tool-calls",
                    "user-interrupted",
                    "voice-input",
                    "workflow.node.started",
                    "assistant.started",
                ],
                serverMessages: [
                    "conversation-update",
                    "end-of-call-report",
                    "function-call",
                    "hang",
                    "speech-update",
                    "status-update",
                    "tool-calls",
                    "transfer-destination-request",
                    "handoff-destination-request",
                    "user-interrupted",
                    "assistant.started",
                ],
                maxDurationSeconds: 600,
                backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
                modelOutputInMessagesEnabled: false,
                transportConfigurations: [
                    {
                        provider: "twilio",
                        timeout: 60,
                        record: false,
                    },
                ],
                observabilityPlan: {
                    provider: "langfuse",
                    promptName: "promptName",
                    promptVersion: 1.1,
                    traceName: "traceName",
                    tags: ["tags"],
                    metadata: {
                        key: "value",
                    },
                },
                credentials: [
                    {
                        provider: "11labs",
                        apiKey: "apiKey",
                    },
                ],
                hooks: [
                    {
                        on: "call.ending",
                        do: [
                            {
                                type: "tool",
                                tool: {
                                    type: "apiRequest",
                                    messages: [
                                        {
                                            type: "request-start",
                                            blocking: false,
                                        },
                                    ],
                                    method: "POST",
                                    timeoutSeconds: 20,
                                    credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                    url: "url",
                                    backoffPlan: {
                                        type: {
                                            key: "value",
                                        },
                                        maxRetries: 0,
                                        baseDelaySeconds: 1,
                                        excludedStatusCodes: [
                                            {
                                                key: "value",
                                            },
                                            {
                                                key: "value",
                                            },
                                            {
                                                key: "value",
                                            },
                                            {
                                                key: "value",
                                            },
                                        ],
                                    },
                                    rejectionPlan: {
                                        conditions: [
                                            {
                                                type: "regex",
                                                regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                                target: {
                                                    position: -1,
                                                },
                                            },
                                        ],
                                    },
                                },
                            },
                        ],
                    },
                ],
                name: "name",
                voicemailMessage: "voicemailMessage",
                endCallMessage: "endCallMessage",
                endCallPhrases: ["endCallPhrases"],
                compliancePlan: {
                    hipaaEnabled: true,
                    pciEnabled: true,
                    recordingConsentPlan: {
                        type: "stay-on-line",
                        message:
                            "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                        voice: {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "\u3002",
                                    "\uFF0C",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "\u060C",
                                    "\u06D4",
                                    "\u0964",
                                    "\u0965",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: {
                                    enabled: true,
                                    numberToDigitsCutoff: 2025,
                                },
                            },
                            fallbackPlan: {
                                voices: [
                                    {
                                        provider: "azure",
                                        cachingEnabled: true,
                                        voiceId: "andrew",
                                        chunkPlan: {
                                            enabled: true,
                                            minCharacters: 30,
                                            punctuationBoundaries: [
                                                "\u3002",
                                                "\uFF0C",
                                                ".",
                                                "!",
                                                "?",
                                                ";",
                                                "\u060C",
                                                "\u06D4",
                                                "\u0964",
                                                "\u0965",
                                                "|",
                                                "||",
                                                ",",
                                                ":",
                                            ],
                                            formatPlan: {
                                                enabled: true,
                                                numberToDigitsCutoff: 2025,
                                            },
                                        },
                                    },
                                ],
                            },
                        },
                        waitSeconds: 3,
                    },
                },
                metadata: {
                    key: "value",
                },
                backgroundSpeechDenoisingPlan: {
                    fourierDenoisingPlan: {
                        mediaDetectionEnabled: true,
                        staticThreshold: -35,
                        baselineOffsetDb: -15,
                        windowSizeMs: 3000,
                        baselinePercentile: 85,
                    },
                },
                artifactPlan: {
                    recordingEnabled: true,
                    recordingFormat: "wav;l16",
                    recordingUseCustomStorageEnabled: true,
                    videoRecordingEnabled: false,
                    fullMessageHistoryEnabled: false,
                    pcapEnabled: true,
                    pcapS3PathPrefix: "/pcaps",
                    pcapUseCustomStorageEnabled: true,
                    loggingEnabled: true,
                    loggingUseCustomStorageEnabled: true,
                    transcriptPlan: {
                        enabled: true,
                    },
                    recordingPath: "recordingPath",
                    structuredOutputIds: ["structuredOutputIds"],
                    structuredOutputs: [
                        {
                            compliancePlan: {
                                forceStoreOnHipaaEnabled: false,
                            },
                            name: "name",
                            schema: {
                                type: "string",
                            },
                        },
                    ],
                    scorecardIds: ["scorecardIds"],
                    scorecards: [
                        {
                            metrics: [
                                {
                                    structuredOutputId: "structuredOutputId",
                                    conditions: [
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                            ],
                        },
                    ],
                    loggingPath: "loggingPath",
                },
                startSpeakingPlan: {
                    waitSeconds: 0.4,
                    smartEndpointingPlan: {
                        provider: "vapi",
                    },
                    customEndpointingRules: [
                        {
                            type: "assistant",
                            regex: "regex",
                            timeoutSeconds: 1.1,
                        },
                    ],
                    transcriptionEndpointingPlan: {
                        onPunctuationSeconds: 0.1,
                        onNoPunctuationSeconds: 1.5,
                        onNumberSeconds: 0.5,
                    },
                },
                stopSpeakingPlan: {
                    numWords: 0,
                    voiceSeconds: 0.2,
                    backoffSeconds: 1,
                    acknowledgementPhrases: [
                        "i understand",
                        "i see",
                        "i got it",
                        "i hear you",
                        "im listening",
                        "im with you",
                        "right",
                        "okay",
                        "ok",
                        "sure",
                        "alright",
                        "got it",
                        "understood",
                        "yeah",
                        "yes",
                        "uh-huh",
                        "mm-hmm",
                        "gotcha",
                        "mhmm",
                        "ah",
                        "yeah okay",
                        "yeah sure",
                    ],
                    interruptionPhrases: [
                        "stop",
                        "shut",
                        "up",
                        "enough",
                        "quiet",
                        "silence",
                        "but",
                        "dont",
                        "not",
                        "no",
                        "hold",
                        "wait",
                        "cut",
                        "pause",
                        "nope",
                        "nah",
                        "nevermind",
                        "never",
                        "bad",
                        "actually",
                    ],
                },
                monitorPlan: {
                    listenEnabled: false,
                    listenAuthenticationEnabled: false,
                    controlEnabled: false,
                    controlAuthenticationEnabled: false,
                    monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
                },
                credentialIds: ["credentialIds"],
                server: {
                    timeoutSeconds: 20,
                    credentialId: "550e8400-e29b-41d4-a716-446655440000",
                    staticIpAddressesEnabled: false,
                    encryptedPaths: ["encryptedPaths"],
                    url: "url",
                    headers: {
                        key: "value",
                    },
                    backoffPlan: {
                        type: {
                            key: "value",
                        },
                        maxRetries: 0,
                        baseDelaySeconds: 1,
                        excludedStatusCodes: [
                            {
                                key: "value",
                            },
                            {
                                key: "value",
                            },
                            {
                                key: "value",
                            },
                            {
                                key: "value",
                            },
                        ],
                    },
                },
                keypadInputPlan: {
                    enabled: true,
                    timeoutSeconds: 1.1,
                    delimiters: "#",
                },
                id: "id",
                orgId: "orgId",
                createdAt: "2024-01-15T09:30:00Z",
                updatedAt: "2024-01-15T09:30:00Z",
            },
        ]);
    });

    test("create", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });
        const rawRequestBody = {};
        const rawResponseBody = {
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [{ content: null, role: "assistant" }],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [{ type: "request-start", blocking: false }],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: { position: -1 },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: { type: "enabled", budgetTokens: 1.1 },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: ["。", "，", ".", "!", "?", ";", "،", "۔", "।", "॥", "|", "||", ",", ":"],
                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "。",
                                    "，",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "،",
                                    "۔",
                                    "।",
                                    "॥",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [{ provider: "twilio", timeout: 60, record: false, recordingChannels: "mono" }],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: { key: "value" },
            },
            credentials: [{ provider: "11labs", apiKey: "apiKey", name: "name" }],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [{ type: "oneOf", key: "key", oneOf: ["oneOf"] }],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: { key: "value" },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: { enabled: true },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: { messages: [{ key: "value" }], enabled: true, timeoutSeconds: 1.1 },
                structuredDataPlan: {
                    messages: [{ key: "value" }],
                    enabled: true,
                    schema: { type: "string" },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [{ key: "value" }],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: { enabled: true, assistantName: "assistantName", userName: "userName" },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    { compliancePlan: { forceStoreOnHipaaEnabled: false }, name: "name", schema: { type: "string" } },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    { metrics: [{ structuredOutputId: "structuredOutputId", conditions: [{ key: "value" }] }] },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: { provider: "vapi" },
                customEndpointingRules: [{ type: "assistant", regex: "regex", timeoutSeconds: 1.1 }],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: { key: "value" },
                backoffPlan: {
                    type: { key: "value" },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [{ key: "value" }, { key: "value" }, { key: "value" }, { key: "value" }],
                },
            },
            keypadInputPlan: { enabled: true, timeoutSeconds: 1.1, delimiters: "#" },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        };

        server
            .mockEndpoint()
            .post("/assistant")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.assistants.create({});
        expect(response).toEqual({
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [
                    {
                        content: null,
                        role: "assistant",
                    },
                ],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [
                            {
                                type: "request-start",
                                blocking: false,
                            },
                        ],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: {
                                        position: -1,
                                    },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: {
                    type: "enabled",
                    budgetTokens: 1.1,
                },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: [
                        "\u3002",
                        "\uFF0C",
                        ".",
                        "!",
                        "?",
                        ";",
                        "\u060C",
                        "\u06D4",
                        "\u0964",
                        "\u0965",
                        "|",
                        "||",
                        ",",
                        ":",
                    ],
                    formatPlan: {
                        enabled: true,
                        numberToDigitsCutoff: 2025,
                    },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "\u3002",
                                    "\uFF0C",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "\u060C",
                                    "\u06D4",
                                    "\u0964",
                                    "\u0965",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: {
                                    enabled: true,
                                    numberToDigitsCutoff: 2025,
                                },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [
                {
                    provider: "twilio",
                    timeout: 60,
                    record: false,
                    recordingChannels: "mono",
                },
            ],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: {
                    key: "value",
                },
            },
            credentials: [
                {
                    provider: "11labs",
                    apiKey: "apiKey",
                    name: "name",
                },
            ],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [
                        {
                            type: "oneOf",
                            key: "key",
                            oneOf: ["oneOf"],
                        },
                    ],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: {
                key: "value",
            },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: {
                    enabled: true,
                },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
                structuredDataPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    schema: {
                        type: "string",
                    },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: {
                    enabled: true,
                    assistantName: "assistantName",
                    userName: "userName",
                },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    {
                        compliancePlan: {
                            forceStoreOnHipaaEnabled: false,
                        },
                        name: "name",
                        schema: {
                            type: "string",
                        },
                    },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    {
                        metrics: [
                            {
                                structuredOutputId: "structuredOutputId",
                                conditions: [
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                        ],
                    },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: {
                    provider: "vapi",
                },
                customEndpointingRules: [
                    {
                        type: "assistant",
                        regex: "regex",
                        timeoutSeconds: 1.1,
                    },
                ],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: {
                    key: "value",
                },
                backoffPlan: {
                    type: {
                        key: "value",
                    },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                    ],
                },
            },
            keypadInputPlan: {
                enabled: true,
                timeoutSeconds: 1.1,
                delimiters: "#",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        });
    });

    test("get", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [{ content: null, role: "assistant" }],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [{ type: "request-start", blocking: false }],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: { position: -1 },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: { type: "enabled", budgetTokens: 1.1 },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: ["。", "，", ".", "!", "?", ";", "،", "۔", "।", "॥", "|", "||", ",", ":"],
                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "。",
                                    "，",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "،",
                                    "۔",
                                    "।",
                                    "॥",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [{ provider: "twilio", timeout: 60, record: false, recordingChannels: "mono" }],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: { key: "value" },
            },
            credentials: [{ provider: "11labs", apiKey: "apiKey", name: "name" }],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [{ type: "oneOf", key: "key", oneOf: ["oneOf"] }],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: { key: "value" },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: { enabled: true },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: { messages: [{ key: "value" }], enabled: true, timeoutSeconds: 1.1 },
                structuredDataPlan: {
                    messages: [{ key: "value" }],
                    enabled: true,
                    schema: { type: "string" },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [{ key: "value" }],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: { enabled: true, assistantName: "assistantName", userName: "userName" },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    { compliancePlan: { forceStoreOnHipaaEnabled: false }, name: "name", schema: { type: "string" } },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    { metrics: [{ structuredOutputId: "structuredOutputId", conditions: [{ key: "value" }] }] },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: { provider: "vapi" },
                customEndpointingRules: [{ type: "assistant", regex: "regex", timeoutSeconds: 1.1 }],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: { key: "value" },
                backoffPlan: {
                    type: { key: "value" },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [{ key: "value" }, { key: "value" }, { key: "value" }, { key: "value" }],
                },
            },
            keypadInputPlan: { enabled: true, timeoutSeconds: 1.1, delimiters: "#" },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        };

        server.mockEndpoint().get("/assistant/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.assistants.get({
            id: "id",
        });
        expect(response).toEqual({
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [
                    {
                        content: null,
                        role: "assistant",
                    },
                ],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [
                            {
                                type: "request-start",
                                blocking: false,
                            },
                        ],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: {
                                        position: -1,
                                    },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: {
                    type: "enabled",
                    budgetTokens: 1.1,
                },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: [
                        "\u3002",
                        "\uFF0C",
                        ".",
                        "!",
                        "?",
                        ";",
                        "\u060C",
                        "\u06D4",
                        "\u0964",
                        "\u0965",
                        "|",
                        "||",
                        ",",
                        ":",
                    ],
                    formatPlan: {
                        enabled: true,
                        numberToDigitsCutoff: 2025,
                    },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "\u3002",
                                    "\uFF0C",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "\u060C",
                                    "\u06D4",
                                    "\u0964",
                                    "\u0965",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: {
                                    enabled: true,
                                    numberToDigitsCutoff: 2025,
                                },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [
                {
                    provider: "twilio",
                    timeout: 60,
                    record: false,
                    recordingChannels: "mono",
                },
            ],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: {
                    key: "value",
                },
            },
            credentials: [
                {
                    provider: "11labs",
                    apiKey: "apiKey",
                    name: "name",
                },
            ],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [
                        {
                            type: "oneOf",
                            key: "key",
                            oneOf: ["oneOf"],
                        },
                    ],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: {
                key: "value",
            },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: {
                    enabled: true,
                },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
                structuredDataPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    schema: {
                        type: "string",
                    },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: {
                    enabled: true,
                    assistantName: "assistantName",
                    userName: "userName",
                },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    {
                        compliancePlan: {
                            forceStoreOnHipaaEnabled: false,
                        },
                        name: "name",
                        schema: {
                            type: "string",
                        },
                    },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    {
                        metrics: [
                            {
                                structuredOutputId: "structuredOutputId",
                                conditions: [
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                        ],
                    },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: {
                    provider: "vapi",
                },
                customEndpointingRules: [
                    {
                        type: "assistant",
                        regex: "regex",
                        timeoutSeconds: 1.1,
                    },
                ],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: {
                    key: "value",
                },
                backoffPlan: {
                    type: {
                        key: "value",
                    },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                    ],
                },
            },
            keypadInputPlan: {
                enabled: true,
                timeoutSeconds: 1.1,
                delimiters: "#",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        });
    });

    test("delete", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });

        const rawResponseBody = {
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [{ content: null, role: "assistant" }],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [{ type: "request-start", blocking: false }],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: { position: -1 },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: { type: "enabled", budgetTokens: 1.1 },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: ["。", "，", ".", "!", "?", ";", "،", "۔", "।", "॥", "|", "||", ",", ":"],
                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "。",
                                    "，",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "،",
                                    "۔",
                                    "।",
                                    "॥",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [{ provider: "twilio", timeout: 60, record: false, recordingChannels: "mono" }],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: { key: "value" },
            },
            credentials: [{ provider: "11labs", apiKey: "apiKey", name: "name" }],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [{ type: "oneOf", key: "key", oneOf: ["oneOf"] }],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: { key: "value" },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: { enabled: true },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: { messages: [{ key: "value" }], enabled: true, timeoutSeconds: 1.1 },
                structuredDataPlan: {
                    messages: [{ key: "value" }],
                    enabled: true,
                    schema: { type: "string" },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [{ key: "value" }],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: { enabled: true, assistantName: "assistantName", userName: "userName" },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    { compliancePlan: { forceStoreOnHipaaEnabled: false }, name: "name", schema: { type: "string" } },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    { metrics: [{ structuredOutputId: "structuredOutputId", conditions: [{ key: "value" }] }] },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: { provider: "vapi" },
                customEndpointingRules: [{ type: "assistant", regex: "regex", timeoutSeconds: 1.1 }],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: { key: "value" },
                backoffPlan: {
                    type: { key: "value" },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [{ key: "value" }, { key: "value" }, { key: "value" }, { key: "value" }],
                },
            },
            keypadInputPlan: { enabled: true, timeoutSeconds: 1.1, delimiters: "#" },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        };

        server.mockEndpoint().delete("/assistant/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build();

        const response = await client.assistants.delete({
            id: "id",
        });
        expect(response).toEqual({
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [
                    {
                        content: null,
                        role: "assistant",
                    },
                ],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [
                            {
                                type: "request-start",
                                blocking: false,
                            },
                        ],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: {
                                        position: -1,
                                    },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: {
                    type: "enabled",
                    budgetTokens: 1.1,
                },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: [
                        "\u3002",
                        "\uFF0C",
                        ".",
                        "!",
                        "?",
                        ";",
                        "\u060C",
                        "\u06D4",
                        "\u0964",
                        "\u0965",
                        "|",
                        "||",
                        ",",
                        ":",
                    ],
                    formatPlan: {
                        enabled: true,
                        numberToDigitsCutoff: 2025,
                    },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "\u3002",
                                    "\uFF0C",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "\u060C",
                                    "\u06D4",
                                    "\u0964",
                                    "\u0965",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: {
                                    enabled: true,
                                    numberToDigitsCutoff: 2025,
                                },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [
                {
                    provider: "twilio",
                    timeout: 60,
                    record: false,
                    recordingChannels: "mono",
                },
            ],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: {
                    key: "value",
                },
            },
            credentials: [
                {
                    provider: "11labs",
                    apiKey: "apiKey",
                    name: "name",
                },
            ],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [
                        {
                            type: "oneOf",
                            key: "key",
                            oneOf: ["oneOf"],
                        },
                    ],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: {
                key: "value",
            },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: {
                    enabled: true,
                },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
                structuredDataPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    schema: {
                        type: "string",
                    },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: {
                    enabled: true,
                    assistantName: "assistantName",
                    userName: "userName",
                },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    {
                        compliancePlan: {
                            forceStoreOnHipaaEnabled: false,
                        },
                        name: "name",
                        schema: {
                            type: "string",
                        },
                    },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    {
                        metrics: [
                            {
                                structuredOutputId: "structuredOutputId",
                                conditions: [
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                        ],
                    },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: {
                    provider: "vapi",
                },
                customEndpointingRules: [
                    {
                        type: "assistant",
                        regex: "regex",
                        timeoutSeconds: 1.1,
                    },
                ],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: {
                    key: "value",
                },
                backoffPlan: {
                    type: {
                        key: "value",
                    },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                    ],
                },
            },
            keypadInputPlan: {
                enabled: true,
                timeoutSeconds: 1.1,
                delimiters: "#",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        });
    });

    test("update", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });
        const rawRequestBody = {};
        const rawResponseBody = {
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [{ content: null, role: "assistant" }],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [{ type: "request-start", blocking: false }],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: { position: -1 },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: { key: "value" },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                                { key: "value" },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: { type: "enabled", budgetTokens: 1.1 },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: ["。", "，", ".", "!", "?", ";", "،", "۔", "।", "॥", "|", "||", ",", ":"],
                    formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "。",
                                    "，",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "،",
                                    "۔",
                                    "।",
                                    "॥",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [{ provider: "twilio", timeout: 60, record: false, recordingChannels: "mono" }],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: { key: "value" },
            },
            credentials: [{ provider: "11labs", apiKey: "apiKey", name: "name" }],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [{ type: "request-start", blocking: false }],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: { key: "value" },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                        { key: "value" },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: { position: -1 },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [{ type: "oneOf", key: "key", oneOf: ["oneOf"] }],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "。",
                                "，",
                                ".",
                                "!",
                                "?",
                                ";",
                                "،",
                                "۔",
                                "।",
                                "॥",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "。",
                                            "，",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "،",
                                            "۔",
                                            "।",
                                            "॥",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: { enabled: true, numberToDigitsCutoff: 2025 },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: { key: "value" },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: { enabled: true },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: { messages: [{ key: "value" }], enabled: true, timeoutSeconds: 1.1 },
                structuredDataPlan: {
                    messages: [{ key: "value" }],
                    enabled: true,
                    schema: { type: "string" },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [{ key: "value" }],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: { enabled: true, assistantName: "assistantName", userName: "userName" },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    { compliancePlan: { forceStoreOnHipaaEnabled: false }, name: "name", schema: { type: "string" } },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    { metrics: [{ structuredOutputId: "structuredOutputId", conditions: [{ key: "value" }] }] },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: { provider: "vapi" },
                customEndpointingRules: [{ type: "assistant", regex: "regex", timeoutSeconds: 1.1 }],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: { key: "value" },
                backoffPlan: {
                    type: { key: "value" },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [{ key: "value" }, { key: "value" }, { key: "value" }, { key: "value" }],
                },
            },
            keypadInputPlan: { enabled: true, timeoutSeconds: 1.1, delimiters: "#" },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        };

        server
            .mockEndpoint()
            .patch("/assistant/id")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.assistants.update({
            id: "id",
        });
        expect(response).toEqual({
            transcriber: {
                provider: "assembly-ai",
                language: "multi",
                confidenceThreshold: 0.4,
                formatTurns: true,
                endOfTurnConfidenceThreshold: 0.7,
                minEndOfTurnSilenceWhenConfident: 160,
                maxTurnSilence: 400,
                vadAssistedEndpointingEnabled: true,
                speechModel: "universal-streaming-english",
                realtimeUrl: "realtimeUrl",
                wordBoost: ["wordBoost"],
                keytermsPrompt: ["keytermsPrompt"],
                endUtteranceSilenceThreshold: 1.1,
                disablePartialTranscripts: true,
                fallbackPlan: {
                    transcribers: [
                        {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                        },
                    ],
                },
            },
            model: {
                provider: "anthropic",
                messages: [
                    {
                        content: null,
                        role: "assistant",
                    },
                ],
                tools: [
                    {
                        type: "apiRequest",
                        messages: [
                            {
                                type: "request-start",
                                blocking: false,
                            },
                        ],
                        method: "POST",
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        url: "url",
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                        rejectionPlan: {
                            conditions: [
                                {
                                    type: "regex",
                                    regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                    target: {
                                        position: -1,
                                    },
                                },
                            ],
                        },
                    },
                ],
                toolIds: ["toolIds"],
                knowledgeBase: {
                    provider: "custom-knowledge-base",
                    server: {
                        timeoutSeconds: 20,
                        credentialId: "550e8400-e29b-41d4-a716-446655440000",
                        staticIpAddressesEnabled: false,
                        backoffPlan: {
                            type: {
                                key: "value",
                            },
                            maxRetries: 0,
                            baseDelaySeconds: 1,
                            excludedStatusCodes: [
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                                {
                                    key: "value",
                                },
                            ],
                        },
                    },
                },
                model: "claude-3-opus-20240229",
                thinking: {
                    type: "enabled",
                    budgetTokens: 1.1,
                },
                temperature: 1.1,
                maxTokens: 1.1,
                emotionRecognitionEnabled: true,
                numFastTurns: 1.1,
            },
            voice: {
                provider: "azure",
                cachingEnabled: true,
                voiceId: "andrew",
                chunkPlan: {
                    enabled: true,
                    minCharacters: 30,
                    punctuationBoundaries: [
                        "\u3002",
                        "\uFF0C",
                        ".",
                        "!",
                        "?",
                        ";",
                        "\u060C",
                        "\u06D4",
                        "\u0964",
                        "\u0965",
                        "|",
                        "||",
                        ",",
                        ":",
                    ],
                    formatPlan: {
                        enabled: true,
                        numberToDigitsCutoff: 2025,
                    },
                },
                speed: 1.1,
                fallbackPlan: {
                    voices: [
                        {
                            provider: "azure",
                            cachingEnabled: true,
                            voiceId: "andrew",
                            chunkPlan: {
                                enabled: true,
                                minCharacters: 30,
                                punctuationBoundaries: [
                                    "\u3002",
                                    "\uFF0C",
                                    ".",
                                    "!",
                                    "?",
                                    ";",
                                    "\u060C",
                                    "\u06D4",
                                    "\u0964",
                                    "\u0965",
                                    "|",
                                    "||",
                                    ",",
                                    ":",
                                ],
                                formatPlan: {
                                    enabled: true,
                                    numberToDigitsCutoff: 2025,
                                },
                            },
                        },
                    ],
                },
            },
            firstMessage: "Hello! How can I help you today?",
            firstMessageInterruptionsEnabled: true,
            firstMessageMode: "assistant-speaks-first",
            voicemailDetection: "off",
            clientMessages: [
                "conversation-update",
                "function-call",
                "hang",
                "model-output",
                "speech-update",
                "status-update",
                "transfer-update",
                "transcript",
                "tool-calls",
                "user-interrupted",
                "voice-input",
                "workflow.node.started",
                "assistant.started",
            ],
            serverMessages: [
                "conversation-update",
                "end-of-call-report",
                "function-call",
                "hang",
                "speech-update",
                "status-update",
                "tool-calls",
                "transfer-destination-request",
                "handoff-destination-request",
                "user-interrupted",
                "assistant.started",
            ],
            maxDurationSeconds: 600,
            backgroundSound: "https://www.soundjay.com/ambient/sounds/people-in-lounge-1.mp3",
            modelOutputInMessagesEnabled: false,
            transportConfigurations: [
                {
                    provider: "twilio",
                    timeout: 60,
                    record: false,
                    recordingChannels: "mono",
                },
            ],
            observabilityPlan: {
                provider: "langfuse",
                promptName: "promptName",
                promptVersion: 1.1,
                traceName: "traceName",
                tags: ["tags"],
                metadata: {
                    key: "value",
                },
            },
            credentials: [
                {
                    provider: "11labs",
                    apiKey: "apiKey",
                    name: "name",
                },
            ],
            hooks: [
                {
                    on: "call.ending",
                    do: [
                        {
                            type: "tool",
                            tool: {
                                type: "apiRequest",
                                messages: [
                                    {
                                        type: "request-start",
                                        blocking: false,
                                    },
                                ],
                                method: "POST",
                                timeoutSeconds: 20,
                                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                                url: "url",
                                backoffPlan: {
                                    type: {
                                        key: "value",
                                    },
                                    maxRetries: 0,
                                    baseDelaySeconds: 1,
                                    excludedStatusCodes: [
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                        {
                                            key: "value",
                                        },
                                    ],
                                },
                                rejectionPlan: {
                                    conditions: [
                                        {
                                            type: "regex",
                                            regex: "\\\\b(cancel|stop|wait)\\\\b - Matches whole words",
                                            target: {
                                                position: -1,
                                            },
                                        },
                                    ],
                                },
                            },
                        },
                    ],
                    filters: [
                        {
                            type: "oneOf",
                            key: "key",
                            oneOf: ["oneOf"],
                        },
                    ],
                },
            ],
            name: "name",
            voicemailMessage: "voicemailMessage",
            endCallMessage: "endCallMessage",
            endCallPhrases: ["endCallPhrases"],
            compliancePlan: {
                hipaaEnabled: true,
                pciEnabled: true,
                securityFilterPlan: {
                    enabled: true,
                    filters: [{}],
                    mode: "sanitize",
                    replacementText: "replacementText",
                },
                recordingConsentPlan: {
                    type: "stay-on-line",
                    message:
                        "For quality purposes, this call may be recorded. Please stay on the line if you agree or end the call if you do not consent.",
                    voice: {
                        provider: "azure",
                        cachingEnabled: true,
                        voiceId: "andrew",
                        chunkPlan: {
                            enabled: true,
                            minCharacters: 30,
                            punctuationBoundaries: [
                                "\u3002",
                                "\uFF0C",
                                ".",
                                "!",
                                "?",
                                ";",
                                "\u060C",
                                "\u06D4",
                                "\u0964",
                                "\u0965",
                                "|",
                                "||",
                                ",",
                                ":",
                            ],
                            formatPlan: {
                                enabled: true,
                                numberToDigitsCutoff: 2025,
                            },
                        },
                        fallbackPlan: {
                            voices: [
                                {
                                    provider: "azure",
                                    cachingEnabled: true,
                                    voiceId: "andrew",
                                    chunkPlan: {
                                        enabled: true,
                                        minCharacters: 30,
                                        punctuationBoundaries: [
                                            "\u3002",
                                            "\uFF0C",
                                            ".",
                                            "!",
                                            "?",
                                            ";",
                                            "\u060C",
                                            "\u06D4",
                                            "\u0964",
                                            "\u0965",
                                            "|",
                                            "||",
                                            ",",
                                            ":",
                                        ],
                                        formatPlan: {
                                            enabled: true,
                                            numberToDigitsCutoff: 2025,
                                        },
                                    },
                                },
                            ],
                        },
                    },
                    waitSeconds: 3,
                },
            },
            metadata: {
                key: "value",
            },
            backgroundSpeechDenoisingPlan: {
                smartDenoisingPlan: {
                    enabled: true,
                },
                fourierDenoisingPlan: {
                    enabled: true,
                    mediaDetectionEnabled: true,
                    staticThreshold: -35,
                    baselineOffsetDb: -15,
                    windowSizeMs: 3000,
                    baselinePercentile: 85,
                },
            },
            analysisPlan: {
                summaryPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
                structuredDataPlan: {
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    schema: {
                        type: "string",
                    },
                    timeoutSeconds: 1.1,
                },
                successEvaluationPlan: {
                    rubric: "NumericScale",
                    messages: [
                        {
                            key: "value",
                        },
                    ],
                    enabled: true,
                    timeoutSeconds: 1.1,
                },
            },
            artifactPlan: {
                recordingEnabled: true,
                recordingFormat: "wav;l16",
                recordingUseCustomStorageEnabled: true,
                videoRecordingEnabled: false,
                fullMessageHistoryEnabled: false,
                pcapEnabled: true,
                pcapS3PathPrefix: "/pcaps",
                pcapUseCustomStorageEnabled: true,
                loggingEnabled: true,
                loggingUseCustomStorageEnabled: true,
                transcriptPlan: {
                    enabled: true,
                    assistantName: "assistantName",
                    userName: "userName",
                },
                recordingPath: "recordingPath",
                structuredOutputIds: ["structuredOutputIds"],
                structuredOutputs: [
                    {
                        compliancePlan: {
                            forceStoreOnHipaaEnabled: false,
                        },
                        name: "name",
                        schema: {
                            type: "string",
                        },
                    },
                ],
                scorecardIds: ["scorecardIds"],
                scorecards: [
                    {
                        metrics: [
                            {
                                structuredOutputId: "structuredOutputId",
                                conditions: [
                                    {
                                        key: "value",
                                    },
                                ],
                            },
                        ],
                    },
                ],
                loggingPath: "loggingPath",
            },
            startSpeakingPlan: {
                waitSeconds: 0.4,
                smartEndpointingPlan: {
                    provider: "vapi",
                },
                customEndpointingRules: [
                    {
                        type: "assistant",
                        regex: "regex",
                        timeoutSeconds: 1.1,
                    },
                ],
                transcriptionEndpointingPlan: {
                    onPunctuationSeconds: 0.1,
                    onNoPunctuationSeconds: 1.5,
                    onNumberSeconds: 0.5,
                },
            },
            stopSpeakingPlan: {
                numWords: 0,
                voiceSeconds: 0.2,
                backoffSeconds: 1,
                acknowledgementPhrases: [
                    "i understand",
                    "i see",
                    "i got it",
                    "i hear you",
                    "im listening",
                    "im with you",
                    "right",
                    "okay",
                    "ok",
                    "sure",
                    "alright",
                    "got it",
                    "understood",
                    "yeah",
                    "yes",
                    "uh-huh",
                    "mm-hmm",
                    "gotcha",
                    "mhmm",
                    "ah",
                    "yeah okay",
                    "yeah sure",
                ],
                interruptionPhrases: [
                    "stop",
                    "shut",
                    "up",
                    "enough",
                    "quiet",
                    "silence",
                    "but",
                    "dont",
                    "not",
                    "no",
                    "hold",
                    "wait",
                    "cut",
                    "pause",
                    "nope",
                    "nah",
                    "nevermind",
                    "never",
                    "bad",
                    "actually",
                ],
            },
            monitorPlan: {
                listenEnabled: false,
                listenAuthenticationEnabled: false,
                controlEnabled: false,
                controlAuthenticationEnabled: false,
                monitorIds: ["123e4567-e89b-12d3-a456-426614174000"],
            },
            credentialIds: ["credentialIds"],
            server: {
                timeoutSeconds: 20,
                credentialId: "550e8400-e29b-41d4-a716-446655440000",
                staticIpAddressesEnabled: false,
                encryptedPaths: ["encryptedPaths"],
                url: "url",
                headers: {
                    key: "value",
                },
                backoffPlan: {
                    type: {
                        key: "value",
                    },
                    maxRetries: 0,
                    baseDelaySeconds: 1,
                    excludedStatusCodes: [
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                        {
                            key: "value",
                        },
                    ],
                },
            },
            keypadInputPlan: {
                enabled: true,
                timeoutSeconds: 1.1,
                delimiters: "#",
            },
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
        });
    });
});
