/*
 * 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("Edge Config Get Edge Configs", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfigs");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfigs({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual([
        {
            sizeInBytes: 2670.91,
            itemCount: 9219.58,
        },
        {
            sizeInBytes: 2670.91,
            itemCount: 9219.58,
        },
    ]);
});
test("Edge Config Create Edge Config", async () => {
    const testHttpClient = createTestHTTPClient("createEdgeConfig");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.createEdgeConfig({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            slug: "<value>",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        createdAt: 5448.83,
        updatedAt: 4236.55,
        id: "<id>",
        slug: "<value>",
        ownerId: "<id>",
        digest: "<value>",
        sizeInBytes: 9972.06,
        itemCount: 9113.46,
    });
});
test("Edge Config Get Edge Config", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfig");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfig({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        createdAt: 6458.94,
        updatedAt: 4375.87,
        id: "<id>",
        slug: "<value>",
        ownerId: "<id>",
        digest: "<value>",
        sizeInBytes: 3866.06,
        itemCount: 4529.9,
    });
});
test("Edge Config Update Edge Config", async () => {
    const testHttpClient = createTestHTTPClient("updateEdgeConfig");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.updateEdgeConfig({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            slug: "<value>",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        createdAt: 8917.73,
        updatedAt: 9636.63,
        id: "<id>",
        slug: "<value>",
        ownerId: "<id>",
        digest: "<value>",
        sizeInBytes: 7731.03,
        itemCount: 3563.67,
    });
});
test("Edge Config Delete Edge Config", async () => {
    const testHttpClient = createTestHTTPClient("deleteEdgeConfig");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.edgeConfig.deleteEdgeConfig({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
test("Edge Config Get Edge Config Items", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfigItems");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfigItems({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual([]);
});
test("Edge Config Get Edge Config Schema", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfigSchema");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfigSchema({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({});
});
test("Edge Config Patch Edge Config Schema", async () => {
    const testHttpClient = createTestHTTPClient("patchEdgeConfigSchema");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.patchEdgeConfigSchema({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            definition: "<value>",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({});
});
test("Edge Config Delete Edge Config Schema", async () => {
    const testHttpClient = createTestHTTPClient("deleteEdgeConfigSchema");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.edgeConfig.deleteEdgeConfigSchema({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
test("Edge Config Get Edge Config Item", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfigItem");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfigItem({
        edgeConfigId: "<id>",
        edgeConfigItemKey: "<value>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        key: "<key>",
        value: {
            "0": {
                "key": false,
                "key1": {},
                "key2": {
                    "key": {},
                    "key1": "<value>",
                },
            },
            "1": true,
            "2": {},
        },
        edgeConfigId: "<id>",
        createdAt: 8897.2,
        updatedAt: 3673.26,
    });
});
test("Edge Config Get Edge Config Tokens", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfigTokens");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfigTokens({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        token: "<value>",
        label: "<value>",
        id: "<id>",
        edgeConfigId: "<id>",
        createdAt: 7767.4,
    });
});
test("Edge Config Delete Edge Config Tokens", async () => {
    const testHttpClient = createTestHTTPClient("deleteEdgeConfigTokens");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.edgeConfig.deleteEdgeConfigTokens({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            tokens: [
                "<value 1>",
                "<value 2>",
                "<value 3>",
            ],
        },
    });
});
test("Edge Config Get Edge Config Token", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfigToken");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfigToken({
        edgeConfigId: "<id>",
        token: "<value>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        token: "<value>",
        label: "<value>",
        id: "<id>",
        edgeConfigId: "<id>",
        createdAt: 2212.78,
    });
});
test("Edge Config Create Edge Config Token", async () => {
    const testHttpClient = createTestHTTPClient("createEdgeConfigToken");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.createEdgeConfigToken({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            label: "<value>",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        token: "<value>",
        id: "<id>",
    });
});
test("Edge Config Get Edge Config Backups", async () => {
    const testHttpClient = createTestHTTPClient("getEdgeConfigBackups");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.getEdgeConfigBackups({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        backups: [
            {
                id: "<id>",
                lastModified: 3645.28,
            },
            {
                id: "<id>",
                lastModified: 3645.28,
            },
        ],
        pagination: {
            hasNext: true,
        },
    });
});
test("Edge Config Patch Edge Config Items", async () => {
    const testHttpClient = createTestHTTPClient("patchEdgeConfigItems");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.edgeConfig.patchEdgeConfigItems({
        edgeConfigId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        status: "<value>",
    });
});
//# sourceMappingURL=edgeconfig.test.js.map