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

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

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

        const rawResponseBody = {
            results: [
                {
                    status: "scheduled",
                    endedReason: "campaign.scheduled.ended-by-user",
                    name: "Q2 Sales Campaign",
                    assistantId: "assistantId",
                    workflowId: "workflowId",
                    squadId: "squadId",
                    phoneNumberId: "phoneNumberId",
                    dialPlan: [
                        {
                            phoneNumberId: "phoneNumberId",
                            customers: [
                                {
                                    assistantOverrides: {
                                        transcriber: {
                                            provider: "assembly-ai",
                                            confidenceThreshold: 0.4,
                                            formatTurns: true,
                                            endOfTurnConfidenceThreshold: 0.7,
                                            minEndOfTurnSilenceWhenConfident: 160,
                                            maxTurnSilence: 400,
                                            vadAssistedEndpointingEnabled: true,
                                            fallbackPlan: {
                                                transcribers: [
                                                    {
                                                        provider: "assembly-ai",
                                                        confidenceThreshold: 0.4,
                                                        formatTurns: true,
                                                        endOfTurnConfidenceThreshold: 0.7,
                                                        minEndOfTurnSilenceWhenConfident: 160,
                                                        maxTurnSilence: 400,
                                                        vadAssistedEndpointingEnabled: true,
                                                    },
                                                ],
                                            },
                                        },
                                        model: {
                                            provider: "anthropic",
                                            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 },
                                                            },
                                                        ],
                                                    },
                                                },
                                            ],
                                            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",
                                        },
                                        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 },
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                        firstMessage: "Hello! How can I help you today?",
                                        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 }],
                                        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 },
                                                                    },
                                                                ],
                                                            },
                                                        },
                                                    },
                                                ],
                                            },
                                        ],
                                        "tools:append": [
                                            {
                                                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 },
                                                        },
                                                    ],
                                                },
                                            },
                                        ],
                                        compliancePlan: {
                                            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,
                                            },
                                        },
                                        backgroundSpeechDenoisingPlan: {
                                            fourierDenoisingPlan: {
                                                mediaDetectionEnabled: true,
                                                staticThreshold: -35,
                                                baselineOffsetDb: -15,
                                                windowSizeMs: 3000,
                                                baselinePercentile: 85,
                                            },
                                        },
                                        artifactPlan: {
                                            recordingEnabled: true,
                                            recordingUseCustomStorageEnabled: true,
                                            videoRecordingEnabled: false,
                                            fullMessageHistoryEnabled: false,
                                            pcapEnabled: true,
                                            pcapS3PathPrefix: "/pcaps",
                                            pcapUseCustomStorageEnabled: true,
                                            loggingEnabled: true,
                                            loggingUseCustomStorageEnabled: true,
                                            transcriptPlan: { enabled: true },
                                            structuredOutputs: [
                                                {
                                                    compliancePlan: { forceStoreOnHipaaEnabled: false },
                                                    name: "name",
                                                    schema: { type: "string" },
                                                },
                                            ],
                                        },
                                        startSpeakingPlan: {
                                            waitSeconds: 0.4,
                                            smartEndpointingPlan: { provider: "vapi" },
                                            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"],
                                        },
                                        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" },
                                                ],
                                            },
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    schedulePlan: { earliestAt: "2024-01-15T09:30:00Z" },
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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 },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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 },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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 }],
                                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 },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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 },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: { enabled: true },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: { forceStoreOnHipaaEnabled: false },
                                            name: "name",
                                            schema: { type: "string" },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: { provider: "vapi" },
                                    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"],
                                },
                                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" },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                    id: "id",
                    orgId: "orgId",
                    createdAt: "2024-01-15T09:30:00Z",
                    updatedAt: "2024-01-15T09:30:00Z",
                    calls: { key: "value" },
                    callsCounterScheduled: 1.1,
                    callsCounterQueued: 1.1,
                    callsCounterInProgress: 1.1,
                    callsCounterEndedVoicemail: 1.1,
                    callsCounterEnded: 1.1,
                },
            ],
            metadata: {
                itemsPerPage: 1.1,
                totalItems: 1.1,
                currentPage: 1.1,
                itemsBeyondRetention: true,
                createdAtLe: "2024-01-15T09:30:00Z",
                createdAtGe: "2024-01-15T09:30:00Z",
            },
        };

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

        const response = await client.campaigns.campaignControllerFindAll();
        expect(response).toEqual({
            results: [
                {
                    status: "scheduled",
                    endedReason: "campaign.scheduled.ended-by-user",
                    name: "Q2 Sales Campaign",
                    assistantId: "assistantId",
                    workflowId: "workflowId",
                    squadId: "squadId",
                    phoneNumberId: "phoneNumberId",
                    dialPlan: [
                        {
                            phoneNumberId: "phoneNumberId",
                            customers: [
                                {
                                    assistantOverrides: {
                                        transcriber: {
                                            provider: "assembly-ai",
                                            confidenceThreshold: 0.4,
                                            formatTurns: true,
                                            endOfTurnConfidenceThreshold: 0.7,
                                            minEndOfTurnSilenceWhenConfident: 160,
                                            maxTurnSilence: 400,
                                            vadAssistedEndpointingEnabled: true,
                                            fallbackPlan: {
                                                transcribers: [
                                                    {
                                                        provider: "assembly-ai",
                                                        confidenceThreshold: 0.4,
                                                        formatTurns: true,
                                                        endOfTurnConfidenceThreshold: 0.7,
                                                        minEndOfTurnSilenceWhenConfident: 160,
                                                        maxTurnSilence: 400,
                                                        vadAssistedEndpointingEnabled: true,
                                                    },
                                                ],
                                            },
                                        },
                                        model: {
                                            provider: "anthropic",
                                            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,
                                                                },
                                                            },
                                                        ],
                                                    },
                                                },
                                            ],
                                            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",
                                        },
                                        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,
                                                            },
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                        firstMessage: "Hello! How can I help you today?",
                                        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,
                                            },
                                        ],
                                        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,
                                                                        },
                                                                    },
                                                                ],
                                                            },
                                                        },
                                                    },
                                                ],
                                            },
                                        ],
                                        "tools:append": [
                                            {
                                                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,
                                                            },
                                                        },
                                                    ],
                                                },
                                            },
                                        ],
                                        compliancePlan: {
                                            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,
                                            },
                                        },
                                        backgroundSpeechDenoisingPlan: {
                                            fourierDenoisingPlan: {
                                                mediaDetectionEnabled: true,
                                                staticThreshold: -35,
                                                baselineOffsetDb: -15,
                                                windowSizeMs: 3000,
                                                baselinePercentile: 85,
                                            },
                                        },
                                        artifactPlan: {
                                            recordingEnabled: true,
                                            recordingUseCustomStorageEnabled: true,
                                            videoRecordingEnabled: false,
                                            fullMessageHistoryEnabled: false,
                                            pcapEnabled: true,
                                            pcapS3PathPrefix: "/pcaps",
                                            pcapUseCustomStorageEnabled: true,
                                            loggingEnabled: true,
                                            loggingUseCustomStorageEnabled: true,
                                            transcriptPlan: {
                                                enabled: true,
                                            },
                                            structuredOutputs: [
                                                {
                                                    compliancePlan: {
                                                        forceStoreOnHipaaEnabled: false,
                                                    },
                                                    name: "name",
                                                    schema: {
                                                        type: "string",
                                                    },
                                                },
                                            ],
                                        },
                                        startSpeakingPlan: {
                                            waitSeconds: 0.4,
                                            smartEndpointingPlan: {
                                                provider: "vapi",
                                            },
                                            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"],
                                        },
                                        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",
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                },
                            ],
                        },
                    ],
                    schedulePlan: {
                        earliestAt: "2024-01-15T09:30:00Z",
                    },
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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,
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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,
                                    },
                                ],
                                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,
                                                                },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: {
                                        enabled: true,
                                    },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: {
                                                forceStoreOnHipaaEnabled: false,
                                            },
                                            name: "name",
                                            schema: {
                                                type: "string",
                                            },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: {
                                        provider: "vapi",
                                    },
                                    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"],
                                },
                                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",
                                            },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                    id: "id",
                    orgId: "orgId",
                    createdAt: "2024-01-15T09:30:00Z",
                    updatedAt: "2024-01-15T09:30:00Z",
                    calls: {
                        key: "value",
                    },
                    callsCounterScheduled: 1.1,
                    callsCounterQueued: 1.1,
                    callsCounterInProgress: 1.1,
                    callsCounterEndedVoicemail: 1.1,
                    callsCounterEnded: 1.1,
                },
            ],
            metadata: {
                itemsPerPage: 1.1,
                totalItems: 1.1,
                currentPage: 1.1,
                itemsBeyondRetention: true,
                createdAtLe: "2024-01-15T09:30:00Z",
                createdAtGe: "2024-01-15T09:30:00Z",
            },
        });
    });

    test("CampaignController_create", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });
        const rawRequestBody = { name: "Q2 Sales Campaign" };
        const rawResponseBody = {
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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 },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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 },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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 }],
                                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 },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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 },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: { enabled: true },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: { forceStoreOnHipaaEnabled: false },
                                            name: "name",
                                            schema: { type: "string" },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: { provider: "vapi" },
                                    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"],
                                },
                                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" },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: { earliestAt: "2024-01-15T09:30:00Z", latestAt: "2024-01-15T09:30:00Z" },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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 },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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 },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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 }],
                        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 },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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 },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: { enabled: true },
                            structuredOutputs: [
                                {
                                    compliancePlan: { forceStoreOnHipaaEnabled: false },
                                    name: "name",
                                    schema: { type: "string" },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: { provider: "vapi" },
                            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"],
                        },
                        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" },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: { key: "value" },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        };

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

        const response = await client.campaigns.campaignControllerCreate({
            name: "Q2 Sales Campaign",
        });
        expect(response).toEqual({
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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,
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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,
                                    },
                                ],
                                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,
                                                                },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: {
                                        enabled: true,
                                    },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: {
                                                forceStoreOnHipaaEnabled: false,
                                            },
                                            name: "name",
                                            schema: {
                                                type: "string",
                                            },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: {
                                        provider: "vapi",
                                    },
                                    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"],
                                },
                                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",
                                            },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: {
                earliestAt: "2024-01-15T09:30:00Z",
                latestAt: "2024-01-15T09:30:00Z",
            },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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,
                                                },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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,
                                            },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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,
                            },
                        ],
                        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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: {
                                enabled: true,
                            },
                            structuredOutputs: [
                                {
                                    compliancePlan: {
                                        forceStoreOnHipaaEnabled: false,
                                    },
                                    name: "name",
                                    schema: {
                                        type: "string",
                                    },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: {
                                provider: "vapi",
                            },
                            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"],
                        },
                        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",
                                    },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: {
                key: "value",
            },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        });
    });

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

        const rawResponseBody = {
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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 },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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 },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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 }],
                                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 },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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 },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: { enabled: true },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: { forceStoreOnHipaaEnabled: false },
                                            name: "name",
                                            schema: { type: "string" },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: { provider: "vapi" },
                                    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"],
                                },
                                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" },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: { earliestAt: "2024-01-15T09:30:00Z", latestAt: "2024-01-15T09:30:00Z" },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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 },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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 },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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 }],
                        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 },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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 },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: { enabled: true },
                            structuredOutputs: [
                                {
                                    compliancePlan: { forceStoreOnHipaaEnabled: false },
                                    name: "name",
                                    schema: { type: "string" },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: { provider: "vapi" },
                            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"],
                        },
                        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" },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: { key: "value" },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        };

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

        const response = await client.campaigns.campaignControllerFindOne({
            id: "id",
        });
        expect(response).toEqual({
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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,
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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,
                                    },
                                ],
                                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,
                                                                },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: {
                                        enabled: true,
                                    },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: {
                                                forceStoreOnHipaaEnabled: false,
                                            },
                                            name: "name",
                                            schema: {
                                                type: "string",
                                            },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: {
                                        provider: "vapi",
                                    },
                                    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"],
                                },
                                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",
                                            },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: {
                earliestAt: "2024-01-15T09:30:00Z",
                latestAt: "2024-01-15T09:30:00Z",
            },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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,
                                                },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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,
                                            },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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,
                            },
                        ],
                        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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: {
                                enabled: true,
                            },
                            structuredOutputs: [
                                {
                                    compliancePlan: {
                                        forceStoreOnHipaaEnabled: false,
                                    },
                                    name: "name",
                                    schema: {
                                        type: "string",
                                    },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: {
                                provider: "vapi",
                            },
                            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"],
                        },
                        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",
                                    },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: {
                key: "value",
            },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        });
    });

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

        const rawResponseBody = {
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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 },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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 },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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 }],
                                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 },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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 },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: { enabled: true },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: { forceStoreOnHipaaEnabled: false },
                                            name: "name",
                                            schema: { type: "string" },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: { provider: "vapi" },
                                    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"],
                                },
                                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" },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: { earliestAt: "2024-01-15T09:30:00Z", latestAt: "2024-01-15T09:30:00Z" },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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 },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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 },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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 }],
                        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 },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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 },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: { enabled: true },
                            structuredOutputs: [
                                {
                                    compliancePlan: { forceStoreOnHipaaEnabled: false },
                                    name: "name",
                                    schema: { type: "string" },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: { provider: "vapi" },
                            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"],
                        },
                        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" },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: { key: "value" },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        };

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

        const response = await client.campaigns.campaignControllerRemove({
            id: "id",
        });
        expect(response).toEqual({
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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,
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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,
                                    },
                                ],
                                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,
                                                                },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: {
                                        enabled: true,
                                    },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: {
                                                forceStoreOnHipaaEnabled: false,
                                            },
                                            name: "name",
                                            schema: {
                                                type: "string",
                                            },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: {
                                        provider: "vapi",
                                    },
                                    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"],
                                },
                                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",
                                            },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: {
                earliestAt: "2024-01-15T09:30:00Z",
                latestAt: "2024-01-15T09:30:00Z",
            },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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,
                                                },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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,
                                            },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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,
                            },
                        ],
                        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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: {
                                enabled: true,
                            },
                            structuredOutputs: [
                                {
                                    compliancePlan: {
                                        forceStoreOnHipaaEnabled: false,
                                    },
                                    name: "name",
                                    schema: {
                                        type: "string",
                                    },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: {
                                provider: "vapi",
                            },
                            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"],
                        },
                        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",
                                    },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: {
                key: "value",
            },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        });
    });

    test("CampaignController_update", async () => {
        const server = mockServerPool.createServer();
        const client = new VapiClient({ maxRetries: 0, token: "test", environment: server.baseUrl });
        const rawRequestBody = {};
        const rawResponseBody = {
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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 },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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 },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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 }],
                                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 },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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 },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: { enabled: true },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: { forceStoreOnHipaaEnabled: false },
                                            name: "name",
                                            schema: { type: "string" },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: { provider: "vapi" },
                                    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"],
                                },
                                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" },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: { earliestAt: "2024-01-15T09:30:00Z", latestAt: "2024-01-15T09:30:00Z" },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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 },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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 },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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 }],
                        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 },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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 },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: { enabled: true },
                            structuredOutputs: [
                                {
                                    compliancePlan: { forceStoreOnHipaaEnabled: false },
                                    name: "name",
                                    schema: { type: "string" },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: { provider: "vapi" },
                            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"],
                        },
                        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" },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: { key: "value" },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        };

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

        const response = await client.campaigns.campaignControllerUpdate({
            id: "id",
        });
        expect(response).toEqual({
            status: "scheduled",
            endedReason: "campaign.scheduled.ended-by-user",
            name: "Q2 Sales Campaign",
            assistantId: "assistantId",
            workflowId: "workflowId",
            squadId: "squadId",
            phoneNumberId: "phoneNumberId",
            dialPlan: [
                {
                    phoneNumberId: "phoneNumberId",
                    customers: [
                        {
                            assistantOverrides: {
                                transcriber: {
                                    provider: "assembly-ai",
                                    confidenceThreshold: 0.4,
                                    formatTurns: true,
                                    endOfTurnConfidenceThreshold: 0.7,
                                    minEndOfTurnSilenceWhenConfident: 160,
                                    maxTurnSilence: 400,
                                    vadAssistedEndpointingEnabled: true,
                                    fallbackPlan: {
                                        transcribers: [
                                            {
                                                provider: "assembly-ai",
                                                confidenceThreshold: 0.4,
                                                formatTurns: true,
                                                endOfTurnConfidenceThreshold: 0.7,
                                                minEndOfTurnSilenceWhenConfident: 160,
                                                maxTurnSilence: 400,
                                                vadAssistedEndpointingEnabled: true,
                                            },
                                        ],
                                    },
                                },
                                model: {
                                    provider: "anthropic",
                                    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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    ],
                                    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",
                                },
                                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,
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                },
                                firstMessage: "Hello! How can I help you today?",
                                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,
                                    },
                                ],
                                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,
                                                                },
                                                            },
                                                        ],
                                                    },
                                                },
                                            },
                                        ],
                                    },
                                ],
                                "tools:append": [
                                    {
                                        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,
                                                    },
                                                },
                                            ],
                                        },
                                    },
                                ],
                                compliancePlan: {
                                    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,
                                    },
                                },
                                backgroundSpeechDenoisingPlan: {
                                    fourierDenoisingPlan: {
                                        mediaDetectionEnabled: true,
                                        staticThreshold: -35,
                                        baselineOffsetDb: -15,
                                        windowSizeMs: 3000,
                                        baselinePercentile: 85,
                                    },
                                },
                                artifactPlan: {
                                    recordingEnabled: true,
                                    recordingUseCustomStorageEnabled: true,
                                    videoRecordingEnabled: false,
                                    fullMessageHistoryEnabled: false,
                                    pcapEnabled: true,
                                    pcapS3PathPrefix: "/pcaps",
                                    pcapUseCustomStorageEnabled: true,
                                    loggingEnabled: true,
                                    loggingUseCustomStorageEnabled: true,
                                    transcriptPlan: {
                                        enabled: true,
                                    },
                                    structuredOutputs: [
                                        {
                                            compliancePlan: {
                                                forceStoreOnHipaaEnabled: false,
                                            },
                                            name: "name",
                                            schema: {
                                                type: "string",
                                            },
                                        },
                                    ],
                                },
                                startSpeakingPlan: {
                                    waitSeconds: 0.4,
                                    smartEndpointingPlan: {
                                        provider: "vapi",
                                    },
                                    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"],
                                },
                                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",
                                            },
                                        ],
                                    },
                                },
                            },
                        },
                    ],
                },
            ],
            schedulePlan: {
                earliestAt: "2024-01-15T09:30:00Z",
                latestAt: "2024-01-15T09:30:00Z",
            },
            customers: [
                {
                    numberE164CheckEnabled: true,
                    extension: "extension",
                    assistantOverrides: {
                        transcriber: {
                            provider: "assembly-ai",
                            confidenceThreshold: 0.4,
                            formatTurns: true,
                            endOfTurnConfidenceThreshold: 0.7,
                            minEndOfTurnSilenceWhenConfident: 160,
                            maxTurnSilence: 400,
                            vadAssistedEndpointingEnabled: true,
                            fallbackPlan: {
                                transcribers: [
                                    {
                                        provider: "assembly-ai",
                                        confidenceThreshold: 0.4,
                                        formatTurns: true,
                                        endOfTurnConfidenceThreshold: 0.7,
                                        minEndOfTurnSilenceWhenConfident: 160,
                                        maxTurnSilence: 400,
                                        vadAssistedEndpointingEnabled: true,
                                    },
                                ],
                            },
                        },
                        model: {
                            provider: "anthropic",
                            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,
                                                },
                                            },
                                        ],
                                    },
                                },
                            ],
                            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",
                        },
                        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,
                                            },
                                        },
                                    },
                                ],
                            },
                        },
                        firstMessage: "Hello! How can I help you today?",
                        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,
                            },
                        ],
                        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,
                                                        },
                                                    },
                                                ],
                                            },
                                        },
                                    },
                                ],
                            },
                        ],
                        "tools:append": [
                            {
                                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,
                                            },
                                        },
                                    ],
                                },
                            },
                        ],
                        compliancePlan: {
                            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,
                            },
                        },
                        backgroundSpeechDenoisingPlan: {
                            fourierDenoisingPlan: {
                                mediaDetectionEnabled: true,
                                staticThreshold: -35,
                                baselineOffsetDb: -15,
                                windowSizeMs: 3000,
                                baselinePercentile: 85,
                            },
                        },
                        artifactPlan: {
                            recordingEnabled: true,
                            recordingUseCustomStorageEnabled: true,
                            videoRecordingEnabled: false,
                            fullMessageHistoryEnabled: false,
                            pcapEnabled: true,
                            pcapS3PathPrefix: "/pcaps",
                            pcapUseCustomStorageEnabled: true,
                            loggingEnabled: true,
                            loggingUseCustomStorageEnabled: true,
                            transcriptPlan: {
                                enabled: true,
                            },
                            structuredOutputs: [
                                {
                                    compliancePlan: {
                                        forceStoreOnHipaaEnabled: false,
                                    },
                                    name: "name",
                                    schema: {
                                        type: "string",
                                    },
                                },
                            ],
                        },
                        startSpeakingPlan: {
                            waitSeconds: 0.4,
                            smartEndpointingPlan: {
                                provider: "vapi",
                            },
                            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"],
                        },
                        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",
                                    },
                                ],
                            },
                        },
                    },
                    number: "number",
                    sipUri: "sipUri",
                    name: "name",
                    email: "email",
                    externalId: "externalId",
                },
            ],
            id: "id",
            orgId: "orgId",
            createdAt: "2024-01-15T09:30:00Z",
            updatedAt: "2024-01-15T09:30:00Z",
            calls: {
                key: "value",
            },
            callsCounterScheduled: 1.1,
            callsCounterQueued: 1.1,
            callsCounterInProgress: 1.1,
            callsCounterEndedVoicemail: 1.1,
            callsCounterEnded: 1.1,
        });
    });
});
