"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Organizations = void 0;
class Organizations {
    constructor(client) {
        this.client = client;
    }
    async createOrganization(parameters, callback) {
        const config = {
            url: '/organizations',
            method: 'POST',
            params: {
                displayName: parameters.displayName,
                desc: parameters.desc,
                name: parameters.name,
                website: parameters.website,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganization(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateOrganization(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}`,
            method: 'PUT',
            params: {
                name: parameters.name,
                displayName: parameters.displayName,
                desc: parameters.desc,
                website: parameters.website,
                'prefs/associatedDomain': parameters.associatedDomain,
                'prefs/externalMembersDisabled': parameters.externalMembersDisabled,
                'prefs/googleAppsVersion': parameters.googleAppsVersion,
                'prefs/boardVisibilityRestrict/org': parameters.org,
                'prefs/boardVisibilityRestrict/private': parameters.private,
                'prefs/boardVisibilityRestrict/public': parameters.public,
                'prefs/orgInviteRestrict': parameters.orgInviteRestrict,
                'prefs/permissionLevel': parameters.permissionLevel,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteOrganization(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationField(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/${parameters.field}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationActions(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/actions`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationBoards(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/boards`,
            method: 'GET',
            params: {
                filter: parameters.filter,
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationExports(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/exports`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async exportOrganizationCSV(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/exports`,
            method: 'POST',
            params: {
                attachments: parameters.attachments,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationMembers(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/members`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateOrganizationMember(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/members`,
            method: 'PUT',
            params: {
                email: parameters.email,
                fullName: parameters.fullName,
                type: parameters.type,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationMemberships(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/memberships`,
            method: 'GET',
            params: {
                filter: parameters.filter,
                member: parameters.member,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationMembership(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/memberships/${parameters.idMembership}`,
            method: 'GET',
            params: {
                member: parameters.member,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationPluginData(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/pluginData`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationTags(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/tags`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async createOrganizationTag(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/tags`,
            method: 'POST',
        };
        return this.client.sendRequest(config, callback);
    }
    async addOrganizationMember(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/members/${parameters.idMember}`,
            method: 'PUT',
            params: {
                type: parameters.type,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteOrganizationMember(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/members/${parameters.idMember}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async updateOrganizationDeactivateStatus(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/members/${parameters.idMember}/deactivated`,
            method: 'PUT',
            params: {
                value: parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    /** Set the logo image for a Workspace */
    async setOrganizationLogo(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/logo`,
            method: 'POST',
            params: {
                file: parameters.file,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteOrganizationLogo(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/logo`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteOrganizationMemberFromAll(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/members/${parameters.idMember}/all`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteOrganizationAssociatedDomain(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/prefs/associatedDomain`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteOrganizationInvites(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/prefs/orgInviteRestrict`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteOrganizationTag(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/tags/${parameters.idTag}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async getOrganizationNewBillableGuestBoard(parameters, callback) {
        const config = {
            url: `/organizations/${parameters.id}/newBillableGuests/${parameters.idBoard}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
}
exports.Organizations = Organizations;
