// This file was auto-generated by Fern from our API Definition.

import * as Intercom from "../../../src/api/index";
import { IntercomClient } from "../../../src/Client";
import { mockServerPool } from "../../mock-server/MockServerPool";

describe("HelpCenterClient", () => {
    test("listAllCollections (1)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = {
            type: "list",
            pages: {
                type: "pages",
                page: 1,
                next: { per_page: 2, starting_after: "your-cursor-from-response" },
                per_page: 20,
                total_pages: 1,
            },
            total_count: 2,
            data: [
                {
                    id: "159",
                    workspace_id: "this_is_an_id96_that_should_be_at_least_4",
                    name: "English collection title",
                    description: "english collection description",
                    created_at: 1734537309,
                    updated_at: 1734537309,
                    url: "http://help-center.test/myapp-96/collection-17",
                    icon: "bookmark",
                    order: 17,
                    default_locale: "en",
                    parent_id: "6871118",
                    help_center_id: 79,
                },
                {
                    id: "160",
                    workspace_id: "this_is_an_id96_that_should_be_at_least_4",
                    name: "English section title",
                    description: "Default language description",
                    created_at: 1734537309,
                    updated_at: 1734537309,
                    url: "http://help-center.test/myapp-96/section-1",
                    icon: "bookmark",
                    order: 1,
                    default_locale: "en",
                    parent_id: "159",
                    help_center_id: 1,
                },
            ],
        };
        server
            .mockEndpoint()
            .get("/help_center/collections")
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.listAllCollections();
        expect(response).toEqual({
            type: "list",
            pages: {
                type: "pages",
                page: 1,
                next: {
                    per_page: 2,
                    starting_after: "your-cursor-from-response",
                },
                per_page: 20,
                total_pages: 1,
            },
            total_count: 2,
            data: [
                {
                    id: "159",
                    workspace_id: "this_is_an_id96_that_should_be_at_least_4",
                    name: "English collection title",
                    description: "english collection description",
                    created_at: 1734537309,
                    updated_at: 1734537309,
                    url: "http://help-center.test/myapp-96/collection-17",
                    icon: "bookmark",
                    order: 17,
                    default_locale: "en",
                    parent_id: "6871118",
                    help_center_id: 79,
                },
                {
                    id: "160",
                    workspace_id: "this_is_an_id96_that_should_be_at_least_4",
                    name: "English section title",
                    description: "Default language description",
                    created_at: 1734537309,
                    updated_at: 1734537309,
                    url: "http://help-center.test/myapp-96/section-1",
                    icon: "bookmark",
                    order: 1,
                    default_locale: "en",
                    parent_id: "159",
                    help_center_id: 1,
                },
            ],
        });
    });

    test("listAllCollections (2)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] };
        server
            .mockEndpoint()
            .get("/help_center/collections")
            .respondWith()
            .statusCode(401)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.listAllCollections();
        }).rejects.toThrow(Intercom.unstable.UnauthorizedError);
    });

    test("createCollection (1)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = { name: "Thanks for everything" };
        const rawResponseBody = {
            id: "165",
            workspace_id: "this_is_an_id100_that_should_be_at_least_",
            name: "Thanks for everything",
            description: "",
            created_at: 1734537312,
            updated_at: 1734537312,
            url: "http://help-center.test/myapp-100/",
            icon: "book-bookmark",
            order: 1,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: { type: "group_content", name: "Collection name", description: " Collection description" },
                bg: { type: "group_content", name: "Collection name", description: " Collection description" },
                bs: { type: "group_content", name: "Collection name", description: " Collection description" },
                ca: { type: "group_content", name: "Collection name", description: " Collection description" },
                cs: { type: "group_content", name: "Collection name", description: " Collection description" },
                da: { type: "group_content", name: "Collection name", description: " Collection description" },
                de: { type: "group_content", name: "Collection name", description: " Collection description" },
                el: { type: "group_content", name: "Collection name", description: " Collection description" },
                en: { type: "group_content", name: "Collection name", description: " Collection description" },
                es: { type: "group_content", name: "Collection name", description: " Collection description" },
                et: { type: "group_content", name: "Collection name", description: " Collection description" },
                fi: { type: "group_content", name: "Collection name", description: " Collection description" },
                fr: { type: "group_content", name: "Collection name", description: " Collection description" },
                he: { type: "group_content", name: "Collection name", description: " Collection description" },
                hr: { type: "group_content", name: "Collection name", description: " Collection description" },
                hu: { type: "group_content", name: "Collection name", description: " Collection description" },
                id: { type: "group_content", name: "Collection name", description: " Collection description" },
                it: { type: "group_content", name: "Collection name", description: " Collection description" },
                ja: { type: "group_content", name: "Collection name", description: " Collection description" },
                ko: { type: "group_content", name: "Collection name", description: " Collection description" },
                lt: { type: "group_content", name: "Collection name", description: " Collection description" },
                lv: { type: "group_content", name: "Collection name", description: " Collection description" },
                mn: { type: "group_content", name: "Collection name", description: " Collection description" },
                nb: { type: "group_content", name: "Collection name", description: " Collection description" },
                nl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pt: { type: "group_content", name: "Collection name", description: " Collection description" },
                ro: { type: "group_content", name: "Collection name", description: " Collection description" },
                ru: { type: "group_content", name: "Collection name", description: " Collection description" },
                sl: { type: "group_content", name: "Collection name", description: " Collection description" },
                sr: { type: "group_content", name: "Collection name", description: " Collection description" },
                sv: { type: "group_content", name: "Collection name", description: " Collection description" },
                tr: { type: "group_content", name: "Collection name", description: " Collection description" },
                vi: { type: "group_content", name: "Collection name", description: " Collection description" },
                "pt-BR": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-CN": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-TW": { type: "group_content", name: "Collection name", description: " Collection description" },
            },
            parent_id: "6871118",
            help_center_id: 81,
        };
        server
            .mockEndpoint()
            .post("/help_center/collections")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.createCollection({
            name: "Thanks for everything",
        });
        expect(response).toEqual({
            id: "165",
            workspace_id: "this_is_an_id100_that_should_be_at_least_",
            name: "Thanks for everything",
            description: "",
            created_at: 1734537312,
            updated_at: 1734537312,
            url: "http://help-center.test/myapp-100/",
            icon: "book-bookmark",
            order: 1,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bg: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ca: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                cs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                da: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                de: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                el: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                en: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                es: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                et: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                he: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hu: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                id: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                it: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ja: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ko: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                mn: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nb: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ro: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ru: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                tr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                vi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "pt-BR": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-CN": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-TW": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
            },
            parent_id: "6871118",
            help_center_id: 81,
        });
    });

    test("createCollection (2)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = { name: "collection 51", description: "Missing required parameter" };
        const rawResponseBody = {
            id: "165",
            workspace_id: "this_is_an_id100_that_should_be_at_least_",
            name: "Thanks for everything",
            description: "",
            created_at: 1734537312,
            updated_at: 1734537312,
            url: "http://help-center.test/myapp-100/",
            icon: "book-bookmark",
            order: 1,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: { type: "group_content", name: "Collection name", description: " Collection description" },
                bg: { type: "group_content", name: "Collection name", description: " Collection description" },
                bs: { type: "group_content", name: "Collection name", description: " Collection description" },
                ca: { type: "group_content", name: "Collection name", description: " Collection description" },
                cs: { type: "group_content", name: "Collection name", description: " Collection description" },
                da: { type: "group_content", name: "Collection name", description: " Collection description" },
                de: { type: "group_content", name: "Collection name", description: " Collection description" },
                el: { type: "group_content", name: "Collection name", description: " Collection description" },
                en: { type: "group_content", name: "Collection name", description: " Collection description" },
                es: { type: "group_content", name: "Collection name", description: " Collection description" },
                et: { type: "group_content", name: "Collection name", description: " Collection description" },
                fi: { type: "group_content", name: "Collection name", description: " Collection description" },
                fr: { type: "group_content", name: "Collection name", description: " Collection description" },
                he: { type: "group_content", name: "Collection name", description: " Collection description" },
                hr: { type: "group_content", name: "Collection name", description: " Collection description" },
                hu: { type: "group_content", name: "Collection name", description: " Collection description" },
                id: { type: "group_content", name: "Collection name", description: " Collection description" },
                it: { type: "group_content", name: "Collection name", description: " Collection description" },
                ja: { type: "group_content", name: "Collection name", description: " Collection description" },
                ko: { type: "group_content", name: "Collection name", description: " Collection description" },
                lt: { type: "group_content", name: "Collection name", description: " Collection description" },
                lv: { type: "group_content", name: "Collection name", description: " Collection description" },
                mn: { type: "group_content", name: "Collection name", description: " Collection description" },
                nb: { type: "group_content", name: "Collection name", description: " Collection description" },
                nl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pt: { type: "group_content", name: "Collection name", description: " Collection description" },
                ro: { type: "group_content", name: "Collection name", description: " Collection description" },
                ru: { type: "group_content", name: "Collection name", description: " Collection description" },
                sl: { type: "group_content", name: "Collection name", description: " Collection description" },
                sr: { type: "group_content", name: "Collection name", description: " Collection description" },
                sv: { type: "group_content", name: "Collection name", description: " Collection description" },
                tr: { type: "group_content", name: "Collection name", description: " Collection description" },
                vi: { type: "group_content", name: "Collection name", description: " Collection description" },
                "pt-BR": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-CN": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-TW": { type: "group_content", name: "Collection name", description: " Collection description" },
            },
            parent_id: "6871118",
            help_center_id: 81,
        };
        server
            .mockEndpoint()
            .post("/help_center/collections")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.createCollection({
            name: "collection 51",
            description: "Missing required parameter",
        });
        expect(response).toEqual({
            id: "165",
            workspace_id: "this_is_an_id100_that_should_be_at_least_",
            name: "Thanks for everything",
            description: "",
            created_at: 1734537312,
            updated_at: 1734537312,
            url: "http://help-center.test/myapp-100/",
            icon: "book-bookmark",
            order: 1,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bg: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ca: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                cs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                da: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                de: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                el: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                en: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                es: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                et: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                he: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hu: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                id: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                it: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ja: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ko: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                mn: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nb: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ro: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ru: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                tr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                vi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "pt-BR": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-CN": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-TW": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
            },
            parent_id: "6871118",
            help_center_id: 81,
        });
    });

    test("createCollection (3)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = { name: "name" };
        const rawResponseBody = { key: "value" };
        server
            .mockEndpoint()
            .post("/help_center/collections")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(400)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.createCollection({
                name: "name",
            });
        }).rejects.toThrow(Intercom.unstable.BadRequestError);
    });

    test("createCollection (4)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = { name: "name" };
        const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] };
        server
            .mockEndpoint()
            .post("/help_center/collections")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(401)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.createCollection({
                name: "name",
            });
        }).rejects.toThrow(Intercom.unstable.UnauthorizedError);
    });

    test("retrieveCollection (1)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = {
            id: "170",
            workspace_id: "this_is_an_id106_that_should_be_at_least_",
            name: "English collection title",
            description: "english collection description",
            created_at: 1734537315,
            updated_at: 1734537315,
            url: "http://help-center.test/myapp-106/collection-22",
            icon: "bookmark",
            order: 22,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: { type: "group_content", name: "Collection name", description: " Collection description" },
                bg: { type: "group_content", name: "Collection name", description: " Collection description" },
                bs: { type: "group_content", name: "Collection name", description: " Collection description" },
                ca: { type: "group_content", name: "Collection name", description: " Collection description" },
                cs: { type: "group_content", name: "Collection name", description: " Collection description" },
                da: { type: "group_content", name: "Collection name", description: " Collection description" },
                de: { type: "group_content", name: "Collection name", description: " Collection description" },
                el: { type: "group_content", name: "Collection name", description: " Collection description" },
                en: { type: "group_content", name: "Collection name", description: " Collection description" },
                es: { type: "group_content", name: "Collection name", description: " Collection description" },
                et: { type: "group_content", name: "Collection name", description: " Collection description" },
                fi: { type: "group_content", name: "Collection name", description: " Collection description" },
                fr: { type: "group_content", name: "Collection name", description: " Collection description" },
                he: { type: "group_content", name: "Collection name", description: " Collection description" },
                hr: { type: "group_content", name: "Collection name", description: " Collection description" },
                hu: { type: "group_content", name: "Collection name", description: " Collection description" },
                id: { type: "group_content", name: "Collection name", description: " Collection description" },
                it: { type: "group_content", name: "Collection name", description: " Collection description" },
                ja: { type: "group_content", name: "Collection name", description: " Collection description" },
                ko: { type: "group_content", name: "Collection name", description: " Collection description" },
                lt: { type: "group_content", name: "Collection name", description: " Collection description" },
                lv: { type: "group_content", name: "Collection name", description: " Collection description" },
                mn: { type: "group_content", name: "Collection name", description: " Collection description" },
                nb: { type: "group_content", name: "Collection name", description: " Collection description" },
                nl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pt: { type: "group_content", name: "Collection name", description: " Collection description" },
                ro: { type: "group_content", name: "Collection name", description: " Collection description" },
                ru: { type: "group_content", name: "Collection name", description: " Collection description" },
                sl: { type: "group_content", name: "Collection name", description: " Collection description" },
                sr: { type: "group_content", name: "Collection name", description: " Collection description" },
                sv: { type: "group_content", name: "Collection name", description: " Collection description" },
                tr: { type: "group_content", name: "Collection name", description: " Collection description" },
                vi: { type: "group_content", name: "Collection name", description: " Collection description" },
                "pt-BR": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-CN": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-TW": { type: "group_content", name: "Collection name", description: " Collection description" },
            },
            parent_id: "6871118",
            help_center_id: 84,
        };
        server
            .mockEndpoint()
            .get("/help_center/collections/1")
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.retrieveCollection({
            id: 1,
        });
        expect(response).toEqual({
            id: "170",
            workspace_id: "this_is_an_id106_that_should_be_at_least_",
            name: "English collection title",
            description: "english collection description",
            created_at: 1734537315,
            updated_at: 1734537315,
            url: "http://help-center.test/myapp-106/collection-22",
            icon: "bookmark",
            order: 22,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bg: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ca: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                cs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                da: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                de: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                el: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                en: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                es: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                et: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                he: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hu: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                id: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                it: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ja: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ko: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                mn: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nb: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ro: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ru: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                tr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                vi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "pt-BR": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-CN": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-TW": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
            },
            parent_id: "6871118",
            help_center_id: 84,
        });
    });

    test("retrieveCollection (2)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] };
        server
            .mockEndpoint()
            .get("/help_center/collections/1")
            .respondWith()
            .statusCode(401)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.retrieveCollection({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.UnauthorizedError);
    });

    test("retrieveCollection (3)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { key: "value" };
        server
            .mockEndpoint()
            .get("/help_center/collections/1")
            .respondWith()
            .statusCode(404)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.retrieveCollection({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.NotFoundError);
    });

    test("updateCollection (1)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = { name: "Update collection name" };
        const rawResponseBody = {
            id: "176",
            workspace_id: "this_is_an_id112_that_should_be_at_least_",
            name: "Update collection name",
            description: "english collection description",
            created_at: 1734537318,
            updated_at: 1734537319,
            url: "http://help-center.test/myapp-112/collection-25",
            icon: "folder",
            order: 25,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: { type: "group_content", name: "Collection name", description: " Collection description" },
                bg: { type: "group_content", name: "Collection name", description: " Collection description" },
                bs: { type: "group_content", name: "Collection name", description: " Collection description" },
                ca: { type: "group_content", name: "Collection name", description: " Collection description" },
                cs: { type: "group_content", name: "Collection name", description: " Collection description" },
                da: { type: "group_content", name: "Collection name", description: " Collection description" },
                de: { type: "group_content", name: "Collection name", description: " Collection description" },
                el: { type: "group_content", name: "Collection name", description: " Collection description" },
                en: { type: "group_content", name: "Collection name", description: " Collection description" },
                es: { type: "group_content", name: "Collection name", description: " Collection description" },
                et: { type: "group_content", name: "Collection name", description: " Collection description" },
                fi: { type: "group_content", name: "Collection name", description: " Collection description" },
                fr: { type: "group_content", name: "Collection name", description: " Collection description" },
                he: { type: "group_content", name: "Collection name", description: " Collection description" },
                hr: { type: "group_content", name: "Collection name", description: " Collection description" },
                hu: { type: "group_content", name: "Collection name", description: " Collection description" },
                id: { type: "group_content", name: "Collection name", description: " Collection description" },
                it: { type: "group_content", name: "Collection name", description: " Collection description" },
                ja: { type: "group_content", name: "Collection name", description: " Collection description" },
                ko: { type: "group_content", name: "Collection name", description: " Collection description" },
                lt: { type: "group_content", name: "Collection name", description: " Collection description" },
                lv: { type: "group_content", name: "Collection name", description: " Collection description" },
                mn: { type: "group_content", name: "Collection name", description: " Collection description" },
                nb: { type: "group_content", name: "Collection name", description: " Collection description" },
                nl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pt: { type: "group_content", name: "Collection name", description: " Collection description" },
                ro: { type: "group_content", name: "Collection name", description: " Collection description" },
                ru: { type: "group_content", name: "Collection name", description: " Collection description" },
                sl: { type: "group_content", name: "Collection name", description: " Collection description" },
                sr: { type: "group_content", name: "Collection name", description: " Collection description" },
                sv: { type: "group_content", name: "Collection name", description: " Collection description" },
                tr: { type: "group_content", name: "Collection name", description: " Collection description" },
                vi: { type: "group_content", name: "Collection name", description: " Collection description" },
                "pt-BR": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-CN": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-TW": { type: "group_content", name: "Collection name", description: " Collection description" },
            },
            parent_id: "6871118",
            help_center_id: 87,
        };
        server
            .mockEndpoint()
            .put("/help_center/collections/1")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.updateCollection({
            id: 1,
            name: "Update collection name",
        });
        expect(response).toEqual({
            id: "176",
            workspace_id: "this_is_an_id112_that_should_be_at_least_",
            name: "Update collection name",
            description: "english collection description",
            created_at: 1734537318,
            updated_at: 1734537319,
            url: "http://help-center.test/myapp-112/collection-25",
            icon: "folder",
            order: 25,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bg: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ca: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                cs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                da: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                de: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                el: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                en: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                es: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                et: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                he: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hu: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                id: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                it: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ja: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ko: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                mn: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nb: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ro: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ru: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                tr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                vi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "pt-BR": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-CN": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-TW": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
            },
            parent_id: "6871118",
            help_center_id: 87,
        });
    });

    test("updateCollection (2)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = { name: "Update collection name" };
        const rawResponseBody = {
            id: "176",
            workspace_id: "this_is_an_id112_that_should_be_at_least_",
            name: "Update collection name",
            description: "english collection description",
            created_at: 1734537318,
            updated_at: 1734537319,
            url: "http://help-center.test/myapp-112/collection-25",
            icon: "folder",
            order: 25,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: { type: "group_content", name: "Collection name", description: " Collection description" },
                bg: { type: "group_content", name: "Collection name", description: " Collection description" },
                bs: { type: "group_content", name: "Collection name", description: " Collection description" },
                ca: { type: "group_content", name: "Collection name", description: " Collection description" },
                cs: { type: "group_content", name: "Collection name", description: " Collection description" },
                da: { type: "group_content", name: "Collection name", description: " Collection description" },
                de: { type: "group_content", name: "Collection name", description: " Collection description" },
                el: { type: "group_content", name: "Collection name", description: " Collection description" },
                en: { type: "group_content", name: "Collection name", description: " Collection description" },
                es: { type: "group_content", name: "Collection name", description: " Collection description" },
                et: { type: "group_content", name: "Collection name", description: " Collection description" },
                fi: { type: "group_content", name: "Collection name", description: " Collection description" },
                fr: { type: "group_content", name: "Collection name", description: " Collection description" },
                he: { type: "group_content", name: "Collection name", description: " Collection description" },
                hr: { type: "group_content", name: "Collection name", description: " Collection description" },
                hu: { type: "group_content", name: "Collection name", description: " Collection description" },
                id: { type: "group_content", name: "Collection name", description: " Collection description" },
                it: { type: "group_content", name: "Collection name", description: " Collection description" },
                ja: { type: "group_content", name: "Collection name", description: " Collection description" },
                ko: { type: "group_content", name: "Collection name", description: " Collection description" },
                lt: { type: "group_content", name: "Collection name", description: " Collection description" },
                lv: { type: "group_content", name: "Collection name", description: " Collection description" },
                mn: { type: "group_content", name: "Collection name", description: " Collection description" },
                nb: { type: "group_content", name: "Collection name", description: " Collection description" },
                nl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pl: { type: "group_content", name: "Collection name", description: " Collection description" },
                pt: { type: "group_content", name: "Collection name", description: " Collection description" },
                ro: { type: "group_content", name: "Collection name", description: " Collection description" },
                ru: { type: "group_content", name: "Collection name", description: " Collection description" },
                sl: { type: "group_content", name: "Collection name", description: " Collection description" },
                sr: { type: "group_content", name: "Collection name", description: " Collection description" },
                sv: { type: "group_content", name: "Collection name", description: " Collection description" },
                tr: { type: "group_content", name: "Collection name", description: " Collection description" },
                vi: { type: "group_content", name: "Collection name", description: " Collection description" },
                "pt-BR": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-CN": { type: "group_content", name: "Collection name", description: " Collection description" },
                "zh-TW": { type: "group_content", name: "Collection name", description: " Collection description" },
            },
            parent_id: "6871118",
            help_center_id: 87,
        };
        server
            .mockEndpoint()
            .put("/help_center/collections/1")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.updateCollection({
            id: 1,
            name: "Update collection name",
        });
        expect(response).toEqual({
            id: "176",
            workspace_id: "this_is_an_id112_that_should_be_at_least_",
            name: "Update collection name",
            description: "english collection description",
            created_at: 1734537318,
            updated_at: 1734537319,
            url: "http://help-center.test/myapp-112/collection-25",
            icon: "folder",
            order: 25,
            default_locale: "en",
            translated_content: {
                type: "group_translated_content",
                ar: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bg: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                bs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ca: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                cs: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                da: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                de: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                el: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                en: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                es: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                et: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                fr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                he: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                hu: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                id: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                it: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ja: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ko: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                lv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                mn: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nb: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                nl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                pt: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ro: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                ru: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sl: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                sv: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                tr: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                vi: {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "pt-BR": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-CN": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
                "zh-TW": {
                    type: "group_content",
                    name: "Collection name",
                    description: " Collection description",
                },
            },
            parent_id: "6871118",
            help_center_id: 87,
        });
    });

    test("updateCollection (3)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = {};
        const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] };
        server
            .mockEndpoint()
            .put("/help_center/collections/1")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(401)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.updateCollection({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.UnauthorizedError);
    });

    test("updateCollection (4)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });
        const rawRequestBody = {};
        const rawResponseBody = { key: "value" };
        server
            .mockEndpoint()
            .put("/help_center/collections/1")
            .jsonBody(rawRequestBody)
            .respondWith()
            .statusCode(404)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.updateCollection({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.NotFoundError);
    });

    test("deleteCollection (1)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { id: "182", object: "collection", deleted: true };
        server
            .mockEndpoint()
            .delete("/help_center/collections/1")
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.deleteCollection({
            id: 1,
        });
        expect(response).toEqual({
            id: "182",
            object: "collection",
            deleted: true,
        });
    });

    test("deleteCollection (2)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] };
        server
            .mockEndpoint()
            .delete("/help_center/collections/1")
            .respondWith()
            .statusCode(401)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.deleteCollection({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.UnauthorizedError);
    });

    test("deleteCollection (3)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { key: "value" };
        server
            .mockEndpoint()
            .delete("/help_center/collections/1")
            .respondWith()
            .statusCode(404)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.deleteCollection({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.NotFoundError);
    });

    test("retrieveHelpCenter (1)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = {
            id: "93",
            workspace_id: "this_is_an_id124_that_should_be_at_least_",
            created_at: 1734537325,
            updated_at: 1734537325,
            identifier: "help-center-1",
            website_turned_on: false,
            display_name: "Intercom Help Center",
            url: "https://help.mycompany.com",
            custom_domain: "help.mycompany.com",
        };
        server
            .mockEndpoint()
            .get("/help_center/help_centers/1")
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.retrieveHelpCenter({
            id: 1,
        });
        expect(response).toEqual({
            id: "93",
            workspace_id: "this_is_an_id124_that_should_be_at_least_",
            created_at: 1734537325,
            updated_at: 1734537325,
            identifier: "help-center-1",
            website_turned_on: false,
            display_name: "Intercom Help Center",
            url: "https://help.mycompany.com",
            custom_domain: "help.mycompany.com",
        });
    });

    test("retrieveHelpCenter (2)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] };
        server
            .mockEndpoint()
            .get("/help_center/help_centers/1")
            .respondWith()
            .statusCode(401)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.retrieveHelpCenter({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.UnauthorizedError);
    });

    test("retrieveHelpCenter (3)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { key: "value" };
        server
            .mockEndpoint()
            .get("/help_center/help_centers/1")
            .respondWith()
            .statusCode(404)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.retrieveHelpCenter({
                id: 1,
            });
        }).rejects.toThrow(Intercom.unstable.NotFoundError);
    });

    test("listHelpCenters (1)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = {
            type: "list",
            data: [
                {
                    id: "123",
                    workspace_id: "hfi1bx4l",
                    created_at: 1672928359,
                    updated_at: 1672928610,
                    identifier: "intercom",
                    website_turned_on: true,
                    display_name: "Intercom Help Center",
                    url: "https://help.mycompany.com",
                    custom_domain: "help.mycompany.com",
                },
            ],
        };
        server
            .mockEndpoint()
            .get("/help_center/help_centers")
            .respondWith()
            .statusCode(200)
            .jsonBody(rawResponseBody)
            .build();

        const response = await client.unstable.helpCenter.listHelpCenters();
        expect(response).toEqual({
            type: "list",
            data: [
                {
                    id: "123",
                    workspace_id: "hfi1bx4l",
                    created_at: 1672928359,
                    updated_at: 1672928610,
                    identifier: "intercom",
                    website_turned_on: true,
                    display_name: "Intercom Help Center",
                    url: "https://help.mycompany.com",
                    custom_domain: "help.mycompany.com",
                },
            ],
        });
    });

    test("listHelpCenters (2)", async () => {
        const server = mockServerPool.createServer();
        const client = new IntercomClient({
            maxRetries: 0,
            token: "test",
            version: "2.14",
            environment: server.baseUrl,
        });

        const rawResponseBody = { type: "type", errors: [{ code: "code" }, { code: "code" }] };
        server
            .mockEndpoint()
            .get("/help_center/help_centers")
            .respondWith()
            .statusCode(401)
            .jsonBody(rawResponseBody)
            .build();

        await expect(async () => {
            return await client.unstable.helpCenter.listHelpCenters();
        }).rejects.toThrow(Intercom.unstable.UnauthorizedError);
    });
});
