"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExternalUsersManager = exports.SubmitJobToDeleteExternalUsersV2025R0Headers = exports.SubmitJobToDeleteExternalUsersV2025R0Optionals = void 0;
const externalUsersSubmitDeleteJobResponseV2025R0_1 = require("../schemas/v2025R0/externalUsersSubmitDeleteJobResponseV2025R0");
const externalUsersSubmitDeleteJobRequestV2025R0_1 = require("../schemas/v2025R0/externalUsersSubmitDeleteJobRequestV2025R0");
const network_1 = require("../networking/network");
const fetchOptions_1 = require("../networking/fetchOptions");
const utils_1 = require("../internal/utils");
const utils_2 = require("../internal/utils");
class SubmitJobToDeleteExternalUsersV2025R0Optionals {
    headers = new SubmitJobToDeleteExternalUsersV2025R0Headers({});
    cancellationToken = void 0;
    constructor(fields) {
        if (fields.headers !== undefined) {
            this.headers = fields.headers;
        }
        if (fields.cancellationToken !== undefined) {
            this.cancellationToken = fields.cancellationToken;
        }
    }
}
exports.SubmitJobToDeleteExternalUsersV2025R0Optionals = SubmitJobToDeleteExternalUsersV2025R0Optionals;
class SubmitJobToDeleteExternalUsersV2025R0Headers {
    /**
     * Version header. */
    boxVersion = '2025.0';
    /**
     * Extra headers that will be included in the HTTP request. */
    extraHeaders = {};
    constructor(fields) {
        if (fields.boxVersion !== undefined) {
            this.boxVersion = fields.boxVersion;
        }
        if (fields.extraHeaders !== undefined) {
            this.extraHeaders = fields.extraHeaders;
        }
    }
}
exports.SubmitJobToDeleteExternalUsersV2025R0Headers = SubmitJobToDeleteExternalUsersV2025R0Headers;
class ExternalUsersManager {
    auth;
    networkSession = new network_1.NetworkSession({});
    constructor(fields) {
        if (fields.auth !== undefined) {
            this.auth = fields.auth;
        }
        if (fields.networkSession !== undefined) {
            this.networkSession = fields.networkSession;
        }
    }
    /**
     * Delete external users from current user enterprise. This will remove each
     * external user from all invited collaborations within the current enterprise.
     * @param {ExternalUsersSubmitDeleteJobRequestV2025R0} requestBody Request body of submitJobToDeleteExternalUsersV2025R0 method
     * @param {SubmitJobToDeleteExternalUsersV2025R0OptionalsInput} optionalsInput
     * @returns {Promise<ExternalUsersSubmitDeleteJobResponseV2025R0>}
     */
    async submitJobToDeleteExternalUsersV2025R0(requestBody, optionalsInput = {}) {
        const optionals = new SubmitJobToDeleteExternalUsersV2025R0Optionals({
            headers: optionalsInput.headers,
            cancellationToken: optionalsInput.cancellationToken,
        });
        const headers = optionals.headers;
        const cancellationToken = optionals.cancellationToken;
        const headersMap = (0, utils_1.prepareParams)({
            ...{ ['box-version']: (0, utils_2.toString)(headers.boxVersion) },
            ...headers.extraHeaders,
        });
        const response = await this.networkSession.networkClient.fetch(new fetchOptions_1.FetchOptions({
            url: ''.concat(this.networkSession.baseUrls.baseUrl, '/2.0/external_users/submit_delete_job'),
            method: 'POST',
            headers: headersMap,
            data: (0, externalUsersSubmitDeleteJobRequestV2025R0_1.serializeExternalUsersSubmitDeleteJobRequestV2025R0)(requestBody),
            contentType: 'application/json',
            responseFormat: 'json',
            auth: this.auth,
            networkSession: this.networkSession,
            cancellationToken: cancellationToken,
        }));
        return {
            ...(0, externalUsersSubmitDeleteJobResponseV2025R0_1.deserializeExternalUsersSubmitDeleteJobResponseV2025R0)(response.data),
            rawData: response.data,
        };
    }
}
exports.ExternalUsersManager = ExternalUsersManager;
//# sourceMappingURL=externalUsers.js.map