"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Boards = void 0;
class Boards {
    constructor(client) {
        this.client = client;
    }
    async getBoardMemberships(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/memberships`,
            method: 'GET',
            params: {
                filter: parameters.filter,
                activity: parameters.activity,
                orgMemberType: parameters.orgMemberType,
                member: parameters.member,
                member_fields: parameters.memberFields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoard(parameters, callback) {
        var _a, _b, _c, _d, _e, _f, _g;
        const config = {
            url: `/boards/${parameters.id}`,
            method: 'GET',
            params: {
                actions: parameters.actions,
                boardStars: parameters.boardStars,
                cards: parameters.cards,
                card_fields: (_a = parameters.card) === null || _a === void 0 ? void 0 : _a.fields,
                card_list: (_b = parameters.card) === null || _b === void 0 ? void 0 : _b.list,
                card_members: (_c = parameters.card) === null || _c === void 0 ? void 0 : _c.members,
                card_stickers: (_d = parameters.card) === null || _d === void 0 ? void 0 : _d.stickers,
                card_attachments: (_e = parameters.card) === null || _e === void 0 ? void 0 : _e.attachments,
                card_pluginData: (_f = parameters.cardPluginData) !== null && _f !== void 0 ? _f : (_g = parameters.card) === null || _g === void 0 ? void 0 : _g.pluginData,
                checklists: parameters.checklists,
                customFields: parameters.customFields,
                fields: parameters.fields,
                labels: parameters.labels,
                lists: parameters.lists,
                members: parameters.members,
                memberships: parameters.memberships,
                pluginData: parameters.pluginData,
                organization: parameters.organization,
                organization_pluginData: parameters.organizationPluginData,
                myPrefs: parameters.myPrefs,
                tags: parameters.tags,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateBoard(parameters, callback) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
        const config = {
            url: `/boards/${parameters.id}`,
            method: 'PUT',
            params: {
                name: parameters.name,
                desc: parameters.desc,
                closed: parameters.closed,
                subscribed: parameters.subscribed,
                idOrganization: parameters.idOrganization,
                'prefs/permissionLevel': (_a = parameters.permissionLevel) !== null && _a !== void 0 ? _a : (_b = parameters.prefs) === null || _b === void 0 ? void 0 : _b.permissionLevel,
                'prefs/selfJoin': (_c = parameters.selfJoin) !== null && _c !== void 0 ? _c : (_d = parameters.prefs) === null || _d === void 0 ? void 0 : _d.selfJoin,
                'prefs/cardCovers': (_e = parameters.cardCovers) !== null && _e !== void 0 ? _e : (_f = parameters.prefs) === null || _f === void 0 ? void 0 : _f.cardCovers,
                'prefs/hideVotes': (_g = parameters.hideVotes) !== null && _g !== void 0 ? _g : (_h = parameters.prefs) === null || _h === void 0 ? void 0 : _h.hideVotes,
                'prefs/invitations': (_j = parameters.invitations) !== null && _j !== void 0 ? _j : (_k = parameters.prefs) === null || _k === void 0 ? void 0 : _k.invitations,
                'prefs/voting': (_l = parameters.voting) !== null && _l !== void 0 ? _l : (_m = parameters.prefs) === null || _m === void 0 ? void 0 : _m.voting,
                'prefs/comments': (_o = parameters.comments) !== null && _o !== void 0 ? _o : (_p = parameters.prefs) === null || _p === void 0 ? void 0 : _p.comments,
                'prefs/background': (_q = parameters.background) !== null && _q !== void 0 ? _q : (_r = parameters.prefs) === null || _r === void 0 ? void 0 : _r.background,
                'prefs/cardAging': (_s = parameters.cardAging) !== null && _s !== void 0 ? _s : (_t = parameters.prefs) === null || _t === void 0 ? void 0 : _t.cardAging,
                'prefs/calendarFeedEnabled': (_u = parameters.calendarFeedEnabled) !== null && _u !== void 0 ? _u : (_v = parameters.prefs) === null || _v === void 0 ? void 0 : _v.calendarFeedEnabled,
                'labelNames/green': (_w = parameters.green) !== null && _w !== void 0 ? _w : (_x = parameters.labelNames) === null || _x === void 0 ? void 0 : _x.green,
                'labelNames/yellow': (_y = parameters.yellow) !== null && _y !== void 0 ? _y : (_z = parameters.labelNames) === null || _z === void 0 ? void 0 : _z.yellow,
                'labelNames/orange': (_0 = parameters.orange) !== null && _0 !== void 0 ? _0 : (_1 = parameters.labelNames) === null || _1 === void 0 ? void 0 : _1.orange,
                'labelNames/red': (_2 = parameters.red) !== null && _2 !== void 0 ? _2 : (_3 = parameters.labelNames) === null || _3 === void 0 ? void 0 : _3.red,
                'labelNames/purple': (_4 = parameters.purple) !== null && _4 !== void 0 ? _4 : (_5 = parameters.labelNames) === null || _5 === void 0 ? void 0 : _5.purple,
                'labelNames/blue': (_6 = parameters.blue) !== null && _6 !== void 0 ? _6 : (_7 = parameters.labelNames) === null || _7 === void 0 ? void 0 : _7.blue,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteBoard(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}`,
            method: 'DELETE',
            data: parameters.body,
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardField(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/${parameters.field}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardActions(parameters, callback) {
        const config = {
            url: `/boards/${parameters.boardId}/actions`,
            method: 'GET',
            params: {
                filter: parameters.filter,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardCard(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/cards/${parameters.idCard}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardStars(parameters, callback) {
        const config = {
            url: `/boards/${parameters.boardId}/boardStars`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardChecklists(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/checklists`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async createBoardChecklist(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/checklists`,
            method: 'POST',
            params: {
                name: parameters.name,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardCards(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/cards`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardCardsFilter(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/cards/${parameters.filter}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardCustomFields(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/customFields`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardLabels(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/labels`,
            method: 'GET',
            params: {
                fields: parameters.fields,
                limit: parameters.limit,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async createBoardLabel(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/labels`,
            method: 'POST',
            params: {
                name: parameters.name,
                color: parameters.color,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardLists(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/lists`,
            method: 'GET',
            params: {
                cards: parameters.cards,
                card_fields: parameters.cardFields,
                filter: parameters.filter,
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async createBoardList(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/lists`,
            method: 'POST',
            params: {
                name: parameters.name,
                pos: parameters.pos,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardListsFilter(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/lists/${parameters.filter}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getBoardMembers(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/members`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async inviteMember(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/members`,
            method: 'PUT',
            params: {
                email: parameters.email,
                type: parameters.type,
            },
            data: {
                fullName: parameters.fullName,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async addMemberToBoard(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/members/${parameters.idMember}`,
            method: 'PUT',
            params: {
                type: parameters.type,
                allowBillableGuest: parameters.allowBillableGuest,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async removeMemberFromBoard(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/members/${parameters.idMember}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateMemberOnBoard(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/memberships/${parameters.idMembership}`,
            method: 'PUT',
            params: {
                type: parameters.type,
                member_fields: parameters.memberFields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateEmailPosition(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/myPrefs/emailPosition`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async changeEmailList(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/myPrefs/idEmailList`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateShowListGuide(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/myPrefs/showListGuide`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateShowSidebar(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/myPrefs/showSidebar`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateShowSidebarActivity(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/myPrefs/showSidebarActivity`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateShowSidebarBoardActions(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/myPrefs/showSidebarBoardActions`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateShowSidebarMembers(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/myPrefs/showSidebarMembers`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async createBoard(parameters, callback) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
        const config = {
            url: '/boards/',
            method: 'POST',
            params: {
                name: parameters.name,
                defaultLabels: parameters.defaultLabels,
                defaultLists: parameters.defaultLists,
                desc: parameters.desc,
                idOrganization: parameters.idOrganization,
                idBoardSource: parameters.idBoardSource,
                keepFromSource: parameters.keepFromSource,
                powerUps: parameters.powerUps,
                prefs_permissionLevel: (_a = parameters.prefsPermissionLevel) !== null && _a !== void 0 ? _a : (_b = parameters.prefs) === null || _b === void 0 ? void 0 : _b.permissionLevel,
                prefs_voting: (_c = parameters.prefsVoting) !== null && _c !== void 0 ? _c : (_d = parameters.prefs) === null || _d === void 0 ? void 0 : _d.voting,
                prefs_comments: (_e = parameters.prefsComments) !== null && _e !== void 0 ? _e : (_f = parameters.prefs) === null || _f === void 0 ? void 0 : _f.comments,
                prefs_invitations: (_g = parameters.prefsInvitations) !== null && _g !== void 0 ? _g : (_h = parameters.prefs) === null || _h === void 0 ? void 0 : _h.invitations,
                prefs_selfJoin: (_j = parameters.prefsSelfJoin) !== null && _j !== void 0 ? _j : (_k = parameters.prefs) === null || _k === void 0 ? void 0 : _k.selfJoin,
                prefs_cardCovers: (_l = parameters.prefsCardCovers) !== null && _l !== void 0 ? _l : (_m = parameters.prefs) === null || _m === void 0 ? void 0 : _m.cardCovers,
                prefs_background: (_o = parameters.prefsBackground) !== null && _o !== void 0 ? _o : (_p = parameters.prefs) === null || _p === void 0 ? void 0 : _p.background,
                prefs_cardAging: (_q = parameters.prefsCardAging) !== null && _q !== void 0 ? _q : (_r = parameters.prefs) === null || _r === void 0 ? void 0 : _r.cardAging,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async createCalendarKey(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/calendarKey/generate`,
            method: 'POST',
        };
        return this.client.sendRequest(config, callback);
    }
    async createEmailKey(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/emailKey/generate`,
            method: 'POST',
        };
        return this.client.sendRequest(config, callback);
    }
    async createIdTags(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/idTags`,
            method: 'POST',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async markAsViewed(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/markedAsViewed`,
            method: 'POST',
        };
        return this.client.sendRequest(config, callback, { methodName: 'markAsViewed' });
    }
    async createPowerUp(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/powerUps`,
            method: 'POST',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deletePowerUp(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/powerUps/${parameters.powerUp}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnabledPowerUps(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/boardPlugins`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async enablePowerUp(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/boardPlugins`,
            method: 'POST',
            params: {
                idPlugin: parameters.idPlugin,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async disablePowerUp(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/boardPlugins/${parameters.idPlugin}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async getPowerUps(parameters, callback) {
        const config = {
            url: `/boards/${parameters.id}/plugins`,
            method: 'GET',
            params: {
                filter: parameters.filter,
            },
        };
        return this.client.sendRequest(config, callback);
    }
}
exports.Boards = Boards;
