/*
 * 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("Marketplace Get Account Info", async () => {
    const testHttpClient = createTestHTTPClient("get-account-info");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.marketplace.getAccountInfo({
        integrationConfigurationId: "<id>",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        url: "https://friendly-pleasure.info",
        contact: {
            email: "Horace_Bernhard@yahoo.com",
        },
    });
});
test("Marketplace Get Member", async () => {
    const testHttpClient = createTestHTTPClient("get-member");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.marketplace.getMember({
        integrationConfigurationId: "<id>",
        memberId: "<id>",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        id: "<id>",
        role: "ADMIN",
    });
});
test("Marketplace Create Event", async () => {
    const testHttpClient = createTestHTTPClient("create-event");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.createEvent({
        integrationConfigurationId: "<id>",
        requestBody: {
            event: {
                type: "installation.updated",
            },
        },
    });
});
test("Marketplace Submit Billing Data", async () => {
    const testHttpClient = createTestHTTPClient("submit-billing-data");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.submitBillingData({
        integrationConfigurationId: "<id>",
        requestBody: {
            timestamp: new Date("2025-09-29T02:38:01.476Z"),
            eod: new Date("2023-12-28T23:46:57.523Z"),
            period: {
                start: new Date("2023-06-25T19:04:50.518Z"),
                end: new Date("2024-10-17T01:18:36.230Z"),
            },
            billing: {
                items: [
                    {
                        billingPlanId: "<id>",
                        name: "<value>",
                        price: "511.92",
                        quantity: 328.54,
                        units: "<value>",
                        total: "<value>",
                    },
                    {
                        billingPlanId: "<id>",
                        name: "<value>",
                        price: "4.49",
                        quantity: 3113.17,
                        units: "<value>",
                        total: "<value>",
                    },
                    {
                        billingPlanId: "<id>",
                        name: "<value>",
                        price: "896.30",
                        quantity: 8536.32,
                        units: "<value>",
                        total: "<value>",
                    },
                ],
            },
            usage: [
                {
                    name: "<value>",
                    type: "rate",
                    units: "<value>",
                    dayValue: 9439.22,
                    periodValue: 6958.71,
                },
                {
                    name: "<value>",
                    type: "total",
                    units: "<value>",
                    dayValue: 9892.22,
                    periodValue: 4749.62,
                },
                {
                    name: "<value>",
                    type: "rate",
                    units: "<value>",
                    dayValue: 7119.53,
                    periodValue: 6310.47,
                },
            ],
        },
    });
});
test("Marketplace Submit Invoice", async () => {
    const testHttpClient = createTestHTTPClient("submit-invoice");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.marketplace.submitInvoice({
        integrationConfigurationId: "<id>",
        requestBody: {
            invoiceDate: new Date("2023-06-05T08:54:16.353Z"),
            period: {
                start: new Date("2023-07-26T14:15:15.601Z"),
                end: new Date("2025-10-08T09:35:48.520Z"),
            },
            items: [
                {
                    billingPlanId: "<id>",
                    name: "<value>",
                    price: "905.89",
                    quantity: 1684.76,
                    units: "<value>",
                    total: "<value>",
                },
                {
                    billingPlanId: "<id>",
                    name: "<value>",
                    price: "84.05",
                    quantity: 9130.95,
                    units: "<value>",
                    total: "<value>",
                },
            ],
        },
    });
    expect(result).toBeDefined();
    expect(result).toEqual({});
});
test("Marketplace Get Invoice", async () => {
    const testHttpClient = createTestHTTPClient("get-invoice");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.marketplace.getInvoice({
        integrationConfigurationId: "<id>",
        invoiceId: "<id>",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        invoiceId: "<id>",
        state: "invoiced",
        invoiceDate: "<value>",
        period: {
            start: "<value>",
            end: "<value>",
        },
        items: [
            {
                billingPlanId: "<id>",
                name: "<value>",
                price: "813.89",
                quantity: 2100.54,
                units: "<value>",
                total: "<value>",
            },
        ],
        total: "<value>",
        created: "<value>",
        updated: "<value>",
    });
});
test("Marketplace Update Invoice", async () => {
    const testHttpClient = createTestHTTPClient("update-invoice");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.updateInvoice({
        integrationConfigurationId: "<id>",
        invoiceId: "<id>",
        requestBody: {
            action: "refund",
            reason: "<value>",
            total: "<value>",
        },
    });
});
test("Marketplace Submit Prepayment Balances", async () => {
    const testHttpClient = createTestHTTPClient("submit-prepayment-balances");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.submitPrepaymentBalances({
        integrationConfigurationId: "<id>",
    });
});
test("Marketplace Update Resource Secrets", async () => {
    const testHttpClient = createTestHTTPClient("update-resource-secrets");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.updateResourceSecrets({
        integrationConfigurationId: "<id>",
        integrationProductIdOrSlug: "<value>",
        resourceId: "<id>",
        requestBody: {
            secrets: [],
        },
    });
});
test("Marketplace Update Resource Secrets By Id", async () => {
    const testHttpClient = createTestHTTPClient("update-resource-secrets-by-id");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.updateResourceSecretsById({
        integrationConfigurationId: "<id>",
        resourceId: "<id>",
    });
});
test("Marketplace Import Resource", async () => {
    const testHttpClient = createTestHTTPClient("import-resource");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.marketplace.importResource({
        integrationConfigurationId: "<id>",
        resourceId: "<id>",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        name: "<value>",
    });
});
test("Marketplace Exchange Sso Token", async () => {
    const testHttpClient = createTestHTTPClient("exchange-sso-token");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
    });
    const result = await vercel.marketplace.exchangeSsoToken({
        code: "<value>",
        clientId: "<id>",
        clientSecret: "<value>",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        idToken: "<value>",
        accessToken: "<value>",
        tokenType: "<value>",
    });
});
test("Marketplace Post /V1 /Installations/{integration Configuration Id}/resources/{resource Id}/experimentation/items", async () => {
    const testHttpClient = createTestHTTPClient("post_/v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.createInstallationIntegrationConfiguration({
        integrationConfigurationId: "<id>",
        resourceId: "<id>",
    });
});
test("Marketplace Patch /V1 /Installations/{integration Configuration Id}/resources/{resource Id}/experimentation/items/{item Id}", async () => {
    const testHttpClient = createTestHTTPClient("patch_/v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items/{itemId}");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.updateInstallationIntegrationConfiguration({
        integrationConfigurationId: "<id>",
        resourceId: "<id>",
        itemId: "<id>",
    });
});
test("Marketplace Delete /V1 /Installations/{integration Configuration Id}/resources/{resource Id}/experimentation/items/{item Id}", async () => {
    const testHttpClient = createTestHTTPClient("delete_/v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/items/{itemId}");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    await vercel.marketplace.deleteInstallationIntegrationConfiguration({
        integrationConfigurationId: "<id>",
        resourceId: "<id>",
        itemId: "<id>",
    });
});
test("Marketplace Put /V1 /Installations/{integration Configuration Id}/resources/{resource Id}/experimentation/edge Config", async () => {
    const testHttpClient = createTestHTTPClient("put_/v1/installations/{integrationConfigurationId}/resources/{resourceId}/experimentation/edge-config");
    const vercel = new Vercel({
        serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
        httpClient: testHttpClient,
        bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
    });
    const result = await vercel.marketplace
        .updateInstallationIntegrationEdgeConfig({
        integrationConfigurationId: "<id>",
        resourceId: "<id>",
    });
    expect(result).toBeDefined();
    expect(result).toEqual({
        items: {
            "key": true,
            "key1": "<value>",
        },
        updatedAt: 8687.23,
        digest: "<value>",
    });
});
//# sourceMappingURL=marketplace.test.js.map