/*
 * 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("Aliases List Deployment Aliases", async () => {
    const testHttpClient = createTestHTTPClient("listDeploymentAliases");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.aliases.listDeploymentAliases({
        id: "dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        aliases: [],
    });
});
test("Aliases Assign Alias", async () => {
    const testHttpClient = createTestHTTPClient("assignAlias");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.aliases.assignAlias({
        id: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
        requestBody: {
            alias: "my-alias.vercel.app",
            redirect: null,
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        uid: "2WjyKQmM8ZnGcJsPWMrHRHrE",
        alias: "my-alias.vercel.app",
        created: new Date("2017-04-26T23:00:34.232Z"),
        oldDeploymentId: "dpl_FjvFJncQHQcZMznrUm9EoB8sFuPa",
    });
});
test("Aliases List Aliases", async () => {
    const testHttpClient = createTestHTTPClient("listAliases");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.aliases.listAliases({
        domain: "my-test-domain.com",
        from: 1540095775951,
        limit: 10,
        projectId: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
        since: 1540095775941,
        until: 1540095775951,
        rollbackDeploymentId: "dpl_XXX",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        aliases: [
            {
                alias: "my-alias.vercel.app",
                created: new Date("2017-04-26T23:00:34.232Z"),
                createdAt: 1540095775941,
                creator: {
                    uid: "96SnxkFiMyVKsK3pnoHfx3Hz",
                    email: "john-doe@gmail.com",
                    username: "john-doe",
                },
                deletedAt: 1540095775941,
                deployment: {
                    id: "dpl_5m8CQaRBm3FnWRW1od3wKTpaECPx",
                    url: "my-instant-deployment-3ij3cxz9qr.now.sh",
                    meta: "{}",
                },
                deploymentId: "dpl_5m8CQaRBm3FnWRW1od3wKTpaECPx",
                projectId: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
                uid: "<id>",
                updatedAt: 1540095775941,
            },
        ],
        pagination: {
            count: 20,
            next: 1540095775951,
            prev: 1540095775951,
        },
    });
});
test("Aliases Get Alias", async () => {
    const testHttpClient = createTestHTTPClient("getAlias");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.aliases.getAlias({
        from: 1540095775951,
        idOrAlias: "example.vercel.app",
        projectId: "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
        since: 1540095775941,
        until: 1540095775951,
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        "alias": "my-alias.vercel.app",
        "created": "2017-04-26T23:00:34.232Z",
        "createdAt": 1540095775941,
        "creator": {
            "uid": "96SnxkFiMyVKsK3pnoHfx3Hz",
            "email": "john-doe@gmail.com",
            "username": "john-doe",
        },
        "deletedAt": 1540095775941,
        "deployment": {
            "id": "dpl_5m8CQaRBm3FnWRW1od3wKTpaECPx",
            "url": "my-instant-deployment-3ij3cxz9qr.now.sh",
            "meta": "{}",
        },
        "deploymentId": "dpl_5m8CQaRBm3FnWRW1od3wKTpaECPx",
        "projectId": "prj_12HKQaOmR5t5Uy6vdcQsNIiZgHGB",
        "uid": "<id>",
        "updatedAt": 1540095775941,
    });
});
test("Aliases Delete Alias", async () => {
    const testHttpClient = createTestHTTPClient("deleteAlias");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.aliases.deleteAlias({
        aliasId: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        status: "SUCCESS",
    });
});
test("Aliases Patch Url Protection Bypass", async () => {
    const testHttpClient = createTestHTTPClient("patchUrlProtectionBypass");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.aliases.patchUrlProtectionBypass({
        id: "<id>",
        teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
        slug: "my-team-url-slug",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        "key": "<value>",
        "key1": "<value>",
    });
});
//# sourceMappingURL=aliases.test.js.map