/*
 * 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("Access Groups Read Access Group Id", async () => {
    const testHttpClient = createTestHTTPClient("readAccessGroup-id");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.readAccessGroup({
        idOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        isDsyncManaged: false,
        name: "my-access-group",
        createdAt: "1588720733602",
        teamId: "team_123a6c5209bc3778245d011443644c8d27dc2c50",
        updatedAt: "1588720733602",
        accessGroupId: "ag_123a6c5209bc3778245d011443644c8d27dc2c50",
        membersCount: 5,
        projectsCount: 2,
        teamRoles: [
            "DEVELOPER",
            "BILLING",
        ],
        teamPermissions: [
            "CreateProject",
        ],
    });
});
test("Access Groups Read Access Group Name", async () => {
    const testHttpClient = createTestHTTPClient("readAccessGroup-name");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.readAccessGroup({
        idOrName: "My Access Group",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        isDsyncManaged: false,
        name: "my-access-group",
        createdAt: "1588720733602",
        teamId: "team_123a6c5209bc3778245d011443644c8d27dc2c50",
        updatedAt: "1588720733602",
        accessGroupId: "ag_123a6c5209bc3778245d011443644c8d27dc2c50",
        membersCount: 5,
        projectsCount: 2,
        teamRoles: [
            "DEVELOPER",
            "BILLING",
        ],
        teamPermissions: [
            "CreateProject",
        ],
    });
});
test("Access Groups Update Access Group", async () => {
    const testHttpClient = createTestHTTPClient("updateAccessGroup");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.updateAccessGroup({
        idOrName: "<value>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            name: "My access group",
            projects: [
                {
                    projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
                    role: "ADMIN",
                },
            ],
            membersToAdd: [
                "usr_1a2b3c4d5e6f7g8h9i0j",
                "usr_2b3c4d5e6f7g8h9i0j1k",
            ],
            membersToRemove: [
                "usr_1a2b3c4d5e6f7g8h9i0j",
                "usr_2b3c4d5e6f7g8h9i0j1k",
            ],
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        name: "my-access-group",
        createdAt: "1588720733602",
        teamId: "team_123a6c5209bc3778245d011443644c8d27dc2c50",
        updatedAt: "1588720733602",
        accessGroupId: "ag_123a6c5209bc3778245d011443644c8d27dc2c50",
        membersCount: 5,
        projectsCount: 2,
        teamRoles: [
            "DEVELOPER",
            "BILLING",
        ],
        teamPermissions: [
            "CreateProject",
        ],
    });
});
test("Access Groups Delete Access Group", async () => {
    const testHttpClient = createTestHTTPClient("deleteAccessGroup");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.accessGroups.deleteAccessGroup({
        idOrName: "<value>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
test("Access Groups List Access Group Members", async () => {
    const testHttpClient = createTestHTTPClient("listAccessGroupMembers");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.listAccessGroupMembers({
        idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
        limit: 20,
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        members: [
            {
                email: "Jaida_Rogahn@yahoo.com",
                uid: "<id>",
                username: "Karianne_Bernier",
                teamRole: "VIEWER",
            },
        ],
        pagination: {
            count: 3878.47,
            next: "<value>",
        },
    });
});
test("Access Groups List Access Groups", async () => {
    const testHttpClient = createTestHTTPClient("listAccessGroups");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.listAccessGroups({
        projectId: "prj_pavWOn1iLObbx3RowVvzmPrTWyTf",
        search: "example",
        membersLimit: 20,
        projectsLimit: 20,
        limit: 20,
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({});
});
test("Access Groups Create Access Group", async () => {
    const testHttpClient = createTestHTTPClient("createAccessGroup");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.createAccessGroup({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            name: "My access group",
            projects: [
                {
                    projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
                    role: "ADMIN",
                },
            ],
            membersToAdd: [
                "usr_1a2b3c4d5e6f7g8h9i0j",
                "usr_2b3c4d5e6f7g8h9i0j1k",
            ],
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        membersCount: 591.78,
        projectsCount: 3787.91,
        name: "my-access-group",
        createdAt: "1588720733602",
        teamId: "team_123a6c5209bc3778245d011443644c8d27dc2c50",
        updatedAt: "1588720733602",
        accessGroupId: "ag_123a6c5209bc3778245d011443644c8d27dc2c50",
        teamRoles: [
            "DEVELOPER",
            "BILLING",
        ],
        teamPermissions: [
            "CreateProject",
        ],
    });
});
test("Access Groups List Access Group Projects", async () => {
    const testHttpClient = createTestHTTPClient("listAccessGroupProjects");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.listAccessGroupProjects({
        idOrName: "ag_pavWOn1iLObbXLRiwVvzmPrTWyTf",
        limit: 20,
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        projects: [],
        pagination: {
            count: 7604.02,
            next: "<value>",
        },
    });
});
test("Access Groups Create Access Group Project", async () => {
    const testHttpClient = createTestHTTPClient("createAccessGroupProject");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.createAccessGroupProject({
        accessGroupIdOrName: "<value>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
            role: "ADMIN",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "<id>",
        accessGroupId: "<id>",
        projectId: "<id>",
        role: "PROJECT_VIEWER",
        createdAt: "1726948284257",
        updatedAt: "1744388503945",
    });
});
test("Access Groups Read Access Group Project Id", async () => {
    const testHttpClient = createTestHTTPClient("readAccessGroupProject-id");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.readAccessGroupProject({
        accessGroupIdOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "<id>",
        accessGroupId: "<id>",
        projectId: "<id>",
        role: "ADMIN",
        createdAt: "1715344910813",
        updatedAt: "1744396168862",
    });
});
test("Access Groups Read Access Group Project Name", async () => {
    const testHttpClient = createTestHTTPClient("readAccessGroupProject-name");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.readAccessGroupProject({
        accessGroupIdOrName: "My Access Group",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "<id>",
        accessGroupId: "<id>",
        projectId: "<id>",
        role: "PROJECT_DEVELOPER",
        createdAt: "1739615073482",
        updatedAt: "1744327200176",
    });
});
test("Access Groups Read Access Group Project", async () => {
    const testHttpClient = createTestHTTPClient("readAccessGroupProject");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.readAccessGroupProject({
        accessGroupIdOrName: "<value>",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "<id>",
        accessGroupId: "<id>",
        projectId: "<id>",
        role: "PROJECT_DEVELOPER",
        createdAt: "1741430060404",
        updatedAt: "1744396619853",
    });
});
test("Access Groups Update Access Group Project Id", async () => {
    const testHttpClient = createTestHTTPClient("updateAccessGroupProject-id");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.updateAccessGroupProject({
        accessGroupIdOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            role: "ADMIN",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "<id>",
        accessGroupId: "<id>",
        projectId: "<id>",
        role: "ADMIN",
        createdAt: "1715136753218",
        updatedAt: "1744362874326",
    });
});
test("Access Groups Update Access Group Project Name", async () => {
    const testHttpClient = createTestHTTPClient("updateAccessGroupProject-name");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.updateAccessGroupProject({
        accessGroupIdOrName: "My Access Group",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            role: "ADMIN",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "<id>",
        accessGroupId: "<id>",
        projectId: "<id>",
        role: "ADMIN",
        createdAt: "1716648820605",
        updatedAt: "1744328935382",
    });
});
test("Access Groups Update Access Group Project", async () => {
    const testHttpClient = createTestHTTPClient("updateAccessGroupProject");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.accessGroups.updateAccessGroupProject({
        accessGroupIdOrName: "<value>",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            role: "ADMIN",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "<id>",
        accessGroupId: "<id>",
        projectId: "<id>",
        role: "ADMIN",
        createdAt: "1736314214978",
        updatedAt: "1744397001817",
    });
});
test("Access Groups Delete Access Group Project Id", async () => {
    const testHttpClient = createTestHTTPClient("deleteAccessGroupProject-id");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.accessGroups.deleteAccessGroupProject({
        accessGroupIdOrName: "ag_1a2b3c4d5e6f7g8h9i0j",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
test("Access Groups Delete Access Group Project Name", async () => {
    const testHttpClient = createTestHTTPClient("deleteAccessGroupProject-name");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.accessGroups.deleteAccessGroupProject({
        accessGroupIdOrName: "My Access Group",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
test("Access Groups Delete Access Group Project", async () => {
    const testHttpClient = createTestHTTPClient("deleteAccessGroupProject");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.accessGroups.deleteAccessGroupProject({
        accessGroupIdOrName: "<value>",
        projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
});
//# sourceMappingURL=accessgroups.test.js.map