"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Enterprises = void 0;
class Enterprises {
    constructor(client) {
        this.client = client;
    }
    async getEnterprise(parameters, callback) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
        const config = {
            url: `/enterprises/${parameters.id}`,
            method: 'GET',
            params: {
                fields: parameters.fields,
                members: parameters.members,
                member_fields: (_a = parameters.memberFields) !== null && _a !== void 0 ? _a : (_b = parameters.member) === null || _b === void 0 ? void 0 : _b.fields,
                member_filter: (_c = parameters.memberFilter) !== null && _c !== void 0 ? _c : (_d = parameters.member) === null || _d === void 0 ? void 0 : _d.filter,
                member_sort: (_e = parameters.memberSort) !== null && _e !== void 0 ? _e : (_f = parameters.member) === null || _f === void 0 ? void 0 : _f.sort,
                member_sortBy: parameters.memberSortBy,
                member_sortOrder: parameters.memberSortOrder,
                member_startIndex: (_g = parameters.memberStartIndex) !== null && _g !== void 0 ? _g : (_h = parameters.member) === null || _h === void 0 ? void 0 : _h.startIndex,
                member_count: (_j = parameters.memberCount) !== null && _j !== void 0 ? _j : (_k = parameters.member) === null || _k === void 0 ? void 0 : _k.count,
                organizations: parameters.organizations,
                organization_fields: (_l = parameters.organizationFields) !== null && _l !== void 0 ? _l : (_m = parameters.organization) === null || _m === void 0 ? void 0 : _m.fields,
                organization_paid_accounts: (_o = parameters.organizationPaidAccounts) !== null && _o !== void 0 ? _o : (_p = parameters.organization) === null || _p === void 0 ? void 0 : _p.paidAccounts,
                organization_memberships: (_q = parameters.organizationMemberships) !== null && _q !== void 0 ? _q : (_r = parameters.organization) === null || _r === void 0 ? void 0 : _r.memberships,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterpriseAuditLog(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/auditlog`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterpriseAdmins(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/admins`,
            method: 'GET',
            params: {
                fields: parameters.fields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterpriseSignupUrl(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/signupUrl`,
            method: 'GET',
            params: {
                authenticate: parameters.authenticate,
                confirmationAccepted: parameters.confirmationAccepted,
                returnUrl: parameters.returnUrl,
                tosAccepted: parameters.tosAccepted,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterpriseMembers(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/members`,
            method: 'GET',
            params: {
                fields: parameters.fields,
                filter: parameters.filter,
                sort: parameters.sort,
                sortBy: parameters.sortBy,
                sortOrder: parameters.sortOrder,
                startIndex: parameters.startIndex,
                count: parameters.count,
                organization_fields: parameters.organizationFields,
                board_fields: parameters.boardFields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterpriseMember(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/members/${parameters.idMember}`,
            method: 'GET',
            params: {
                fields: parameters.fields,
                organization_fields: parameters.organizationFields,
                board_fields: parameters.boardFields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterpriseTransferrableOrganization(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/transferrable/organization/${parameters.idOrganization}`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterprisesIdClaimableOrganizations(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/claimableOrganizations`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async getEnterprisesIdPendingOrganizations(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/pendingOrganizations`,
            method: 'GET',
        };
        return this.client.sendRequest(config, callback);
    }
    async createEnterpriseToken(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/tokens`,
            method: 'POST',
            params: {
                expiration: parameters.expiration,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async transferOrganizationToEnterprise(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/organizations`,
            method: 'PUT',
            params: {
                idOrganization: parameters.idOrganization,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async updateEnterpriseMemberLicense(parameters, callback) {
        var _a;
        const config = {
            url: `/enterprises/${parameters.id}/members/${parameters.idMember}/licensed`,
            method: 'PUT',
            params: {
                value: (_a = parameters.values) !== null && _a !== void 0 ? _a : parameters.value,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async deactivateEnterpriseMember(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/members/${parameters.idMember}/deactivated`,
            method: 'PUT',
            params: {
                value: parameters.value,
                fields: parameters.fields,
                organization_fields: parameters.organizationFields,
                board_fields: parameters.boardFields,
            },
        };
        return this.client.sendRequest(config, callback);
    }
    async makeEnterpriseMemberAdmin(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/admins/${parameters.idMember}`,
            method: 'PUT',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteEnterpriseMemberAdmin(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/admins/${parameters.idMember}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
    async deleteEnterpriseOrganization(parameters, callback) {
        const config = {
            url: `/enterprises/${parameters.id}/organizations/${parameters.idOrg}`,
            method: 'DELETE',
        };
        return this.client.sendRequest(config, callback);
    }
}
exports.Enterprises = Enterprises;
