/*
 * 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",
                "edge",
            ],
            createdFrom: "integration",
            headers: {
                "key": "<value>",
                "key1": "<value>",
                "key2": "<value>",
            },
            environments: [
                "production",
            ],
            branch: "feature/*",
            samplingRate: 0.5,
            source: {
                kind: "integration",
                integrationId: "<id>",
                integrationConfigurationId: "<id>",
            },
        },
        {
            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",
                "edge",
            ],
            createdFrom: "integration",
            headers: {
                "key": "<value>",
                "key1": "<value>",
                "key2": "<value>",
            },
            environments: [
                "production",
            ],
            branch: "feature/*",
            samplingRate: 0.5,
            source: {
                kind: "integration",
                integrationId: "<id>",
                integrationConfigurationId: "<id>",
            },
        },
    ]);
});
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_3bwCLgxL8qt5kjRLcv2Dit7F",
        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",
            "edge",
        ],
        createdFrom: "integration",
        headers: {
            "Authorization": "Bearer 123",
        },
        environments: [
            "production",
        ],
        branch: "feature/*",
        samplingRate: 0.5,
        source: {
            kind: "integration",
            integrationId: "<id>",
            integrationConfigurationId: "<id>",
        },
    });
});
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",
    });
});
test("Logdrains Get Configurable Log Drain", async () => {
    const testHttpClient = createTestHTTPClient("getConfigurableLogDrain");
    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.getConfigurableLogDrain({
        id: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        createdFrom: "<value>",
    });
});
test("Logdrains Get All Log Drains", async () => {
    const testHttpClient = createTestHTTPClient("getAllLogDrains");
    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.getAllLogDrains({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        drains: [
            {
                id: "<id>",
                ownerId: "<id>",
                name: "<value>",
                createdAt: 7495.57,
                updatedAt: 4759.82,
                source: {
                    kind: "self-served",
                },
            },
        ],
    });
});
test("Logdrains Create Configurable Log Drain", async () => {
    const testHttpClient = createTestHTTPClient("createConfigurableLogDrain");
    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.createConfigurableLogDrain({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            deliveryFormat: "json",
            url: "https://wavy-meander.net",
            sources: [],
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({});
});
//# sourceMappingURL=logdrains.test.js.map