/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { expect, test } from "vitest";
import { Vercel } from "../index.js";
import { createTestHTTPClient } from "./testclient.js";
test("Logdrains Delete Configurable Log Drain", async () => {
    const testHttpClient = createTestHTTPClient("deleteConfigurableLogDrain");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.logDrains.deleteConfigurableLogDrain({
        id: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
test("Logdrains Get Integration Log Drains", async () => {
    const testHttpClient = createTestHTTPClient("getIntegrationLogDrains");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.logDrains.getIntegrationLogDrains({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual([
        {
            clientId: "oac_xRhY4LAB7yLhUADD69EvV7ct",
            configurationId: "icfg_cuwj0AdCdH3BwWT4LPijCC7t",
            createdAt: 1558531915505,
            id: "ld_nBuA7zCID8g4QZ8g",
            deliveryFormat: "json",
            name: "My first log drain",
            ownerId: "kr1PsOIzqEL5Xg6M4VZcZosf",
            projectId: "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
            projectIds: [
                "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
            ],
            url: "https://example.com/log-drain",
            sources: [
                "build",
            ],
            createdFrom: "integration",
            headers: {
                "0": "{",
                "1": "\"",
                "2": "A",
                "3": "u",
                "4": "t",
                "5": "h",
                "6": "o",
                "7": "r",
                "8": "i",
                "9": "z",
                "10": "a",
                "11": "t",
                "12": "i",
                "13": "o",
                "14": "n",
                "15": "\"",
                "16": ":",
                "17": " ",
                "18": "\"",
                "19": "B",
                "20": "e",
                "21": "a",
                "22": "r",
                "23": "e",
                "24": "r",
                "25": " ",
                "26": "1",
                "27": "2",
                "28": "3",
                "29": "\"",
                "30": "}",
            },
            environments: [
                "production",
            ],
            branch: "feature/*",
            samplingRate: 0.5,
        },
    ]);
});
test("Logdrains Create Log Drain", async () => {
    const testHttpClient = createTestHTTPClient("createLogDrain");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.logDrains.createLogDrain({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            name: "My first log drain",
            secret: "a1Xsfd325fXcs",
            deliveryFormat: "json",
            url: "https://example.com/log-drain",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        clientId: "oac_xRhY4LAB7yLhUADD69EvV7ct",
        configurationId: "icfg_cuwj0AdCdH3BwWT4LPijCC7t",
        createdAt: 1558531915505,
        id: "ld_nBuA7zCID8g4QZ8g",
        deliveryFormat: "json",
        name: "My first log drain",
        ownerId: "kr1PsOIzqEL5Xg6M4VZcZosf",
        projectId: "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
        projectIds: [
            "AbCgVkqoxXeXCDWehVir51LHGrrcWL4mkYm14W6UBPWQeb",
        ],
        url: "https://example.com/log-drain",
        sources: [
            "external",
        ],
        createdFrom: "integration",
        headers: {
            "0": "{",
            "1": "\"",
            "2": "A",
            "3": "u",
            "4": "t",
            "5": "h",
            "6": "o",
            "7": "r",
            "8": "i",
            "9": "z",
            "10": "a",
            "11": "t",
            "12": "i",
            "13": "o",
            "14": "n",
            "15": "\"",
            "16": ":",
            "17": " ",
            "18": "\"",
            "19": "B",
            "20": "e",
            "21": "a",
            "22": "r",
            "23": "e",
            "24": "r",
            "25": " ",
            "26": "1",
            "27": "2",
            "28": "3",
            "29": "\"",
            "30": "}",
        },
        environments: [
            "production",
        ],
        branch: "feature/*",
        samplingRate: 0.5,
    });
});
test("Logdrains Delete Integration Log Drain", async () => {
    const testHttpClient = createTestHTTPClient("deleteIntegrationLogDrain");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.logDrains.deleteIntegrationLogDrain({
        id: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
//# sourceMappingURL=logdrains.test.js.map