"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Checklists = void 0;
class Checklists {
    constructor(client) {
        this.client = client;
    }
    async createChecklist(parameters, callback) {
        const config = {
            url: '/checklists',
            method: 'POST',
            params: {
                idCard: parameters.idCard,
                name: parameters.name,
                pos: parameters.pos,
                idChecklistSource: parameters.idChecklistSource,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getChecklist(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}`,
            method: 'GET',
            params: {
                cards: parameters.cards,
                checkItems: parameters.checkItems,
                checkItem_fields: parameters.checkItemFields,
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateChecklist(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}`,
            method: 'PUT',
            params: {
                name: parameters.name,
                pos: parameters.pos,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteChecklist(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async getChecklistField(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/${parameters.field}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateChecklistField(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/${parameters.field}`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getChecklistBoard(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/board`,
            method: 'GET',
            params: {
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getChecklistCards(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/cards`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getChecklistCheckItems(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/checkItems`,
            method: 'GET',
            params: {
                filter: parameters.filter,
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async createChecklistCheckItems(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/checkItems`,
            method: 'POST',
            params: {
                name: parameters.name,
                pos: parameters.pos,
                checked: parameters.checked,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getChecklistCheckItem(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/checkItems/${parameters.idCheckItem}`,
            method: 'GET',
            params: {
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteChecklistCheckItem(parameters, callback) {
        const config = {
            url: `/checklists/${parameters.id}/checkItems/${parameters.idCheckItem}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
}
exports.Checklists = Checklists;
