/*
 * 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("Teams Request Access To Team", async () => {
    const testHttpClient = createTestHTTPClient("requestAccessToTeam");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.requestAccessToTeam({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        requestBody: {
            joinedFrom: {
                origin: "github",
                commitId: "f498d25d8bd654b578716203be73084b31130cd7",
                repoId: "67753070",
                repoPath: "jane-doe/example",
                gitUserId: 103053343,
                gitUserLogin: "jane-doe",
            },
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamSlug: "<value>",
        teamName: "<value>",
        github: {},
        gitlab: {},
        bitbucket: {},
    });
});
test("Teams Get Team Access Request", async () => {
    const testHttpClient = createTestHTTPClient("getTeamAccessRequest");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.getTeamAccessRequest({
        userId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamSlug: "my-team",
        teamName: "My Team",
        confirmed: false,
        joinedFrom: {
            origin: "import",
        },
        accessRequestedAt: 1588720733602,
        github: {},
        gitlab: {},
        bitbucket: {},
    });
});
test("Teams Join Team", async () => {
    const testHttpClient = createTestHTTPClient("joinTeam");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.joinTeam({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        requestBody: {
            inviteCode: "fisdh38aejkeivn34nslfore9vjtn4ls",
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teamId: "team_LLHUOMOoDlqOp8wPE4kFo9pE",
        slug: "my-team",
        name: "My Team",
        from: "email",
    });
});
test("Teams Update Team Member", async () => {
    const testHttpClient = createTestHTTPClient("updateTeamMember");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.updateTeamMember({
        uid: "ndfasllgPyCtREAqxxdyFKb",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        requestBody: {
            confirmed: true,
            projects: [
                {
                    projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
                    role: "ADMIN",
                },
                {
                    projectId: "prj_ndlgr43fadlPyCtREAqxxdyFK",
                    role: "ADMIN",
                },
            ],
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        id: "<id>",
    });
});
test("Teams Remove Team Member", async () => {
    const testHttpClient = createTestHTTPClient("removeTeamMember");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.removeTeamMember({
        uid: "ndlgr43fadlPyCtREAqxxdyFK",
        newDefaultTeamId: "team_nllPyCtREAqxxdyFKbbMDlxd",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        id: "<id>",
    });
});
test("Teams Get Team", async () => {
    const testHttpClient = createTestHTTPClient("getTeam");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.getTeam({
        slug: "my-team-url-slug",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        "key": "<value>",
    });
});
test("Teams Patch Team", async () => {
    const testHttpClient = createTestHTTPClient("patchTeam");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.patchTeam({
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            description: "Our mission is to make cloud computing accessible to everyone",
            emailDomain: "example.com",
            name: "My Team",
            previewDeploymentSuffix: "example.dev",
            regenerateInviteCode: true,
            saml: {
                enforced: true,
            },
            slug: "my-team",
            enablePreviewFeedback: "on",
            enableProductionFeedback: "on",
            sensitiveEnvironmentVariablePolicy: "on",
            remoteCaching: {
                enabled: true,
            },
            hideIpAddresses: false,
            hideIpAddressesInLogDrains: false,
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        "key": "<value>",
    });
});
test("Teams Get Teams", async () => {
    const testHttpClient = createTestHTTPClient("getTeams");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.getTeams({
        limit: 20,
        since: 1540095775951,
        until: 1540095775951,
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        teams: [
            {},
            {},
        ],
        pagination: {
            count: 20,
            next: 1540095775951,
            prev: 1540095775951,
        },
    });
});
test("Teams Create Team", async () => {
    const testHttpClient = createTestHTTPClient("createTeam");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.createTeam({
        slug: "a-random-team",
        name: "A Random Team",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        id: "team_nLlpyC6RE1qxqglFKbrMxlud",
        slug: "<value>",
        billing: {},
    });
});
test("Teams Delete Team", async () => {
    const testHttpClient = createTestHTTPClient("deleteTeam");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.deleteTeam({
        newDefaultTeamId: "team_LLHUOMOoDlqOp8wPE4kFo9pE",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {},
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        id: "team_LLHUOMOoDlqOp8wPE4kFo9pE",
        newDefaultTeamIdError: true,
    });
});
test("Teams Delete Team Invite Code", async () => {
    const testHttpClient = createTestHTTPClient("deleteTeamInviteCode");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.teams.deleteTeamInviteCode({
        inviteId: "2wn2hudbr4chb1ecywo9dvzo7g9sscs6mzcz8htdde0txyom4l",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        id: "<id>",
    });
});
//# sourceMappingURL=teams.test.js.map