"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeCollaborationPermissionsV2025R0 = serializeCollaborationPermissionsV2025R0;
exports.deserializeCollaborationPermissionsV2025R0 = deserializeCollaborationPermissionsV2025R0;
const errors_1 = require("../../box/errors");
const json_1 = require("../../serialization/json");
const json_2 = require("../../serialization/json");
function serializeCollaborationPermissionsV2025R0(val) {
    return {
        ['is_co_owner_role_enabled']: val.isCoOwnerRoleEnabled,
        ['is_editor_role_enabled']: val.isEditorRoleEnabled,
        ['is_previewer_role_enabled']: val.isPreviewerRoleEnabled,
        ['is_previewer_uploader_role_enabled']: val.isPreviewerUploaderRoleEnabled,
        ['is_uploader_role_enabled']: val.isUploaderRoleEnabled,
        ['is_viewer_role_enabled']: val.isViewerRoleEnabled,
        ['is_viewer_uploader_role_enabled']: val.isViewerUploaderRoleEnabled,
    };
}
function deserializeCollaborationPermissionsV2025R0(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "CollaborationPermissionsV2025R0"',
        });
    }
    if (!(val.is_co_owner_role_enabled == void 0) &&
        !(0, json_1.sdIsBoolean)(val.is_co_owner_role_enabled)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_co_owner_role_enabled" of type "CollaborationPermissionsV2025R0"',
        });
    }
    const isCoOwnerRoleEnabled = val.is_co_owner_role_enabled == void 0
        ? void 0
        : val.is_co_owner_role_enabled;
    if (!(val.is_editor_role_enabled == void 0) &&
        !(0, json_1.sdIsBoolean)(val.is_editor_role_enabled)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_editor_role_enabled" of type "CollaborationPermissionsV2025R0"',
        });
    }
    const isEditorRoleEnabled = val.is_editor_role_enabled == void 0 ? void 0 : val.is_editor_role_enabled;
    if (!(val.is_previewer_role_enabled == void 0) &&
        !(0, json_1.sdIsBoolean)(val.is_previewer_role_enabled)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_previewer_role_enabled" of type "CollaborationPermissionsV2025R0"',
        });
    }
    const isPreviewerRoleEnabled = val.is_previewer_role_enabled == void 0
        ? void 0
        : val.is_previewer_role_enabled;
    if (!(val.is_previewer_uploader_role_enabled == void 0) &&
        !(0, json_1.sdIsBoolean)(val.is_previewer_uploader_role_enabled)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_previewer_uploader_role_enabled" of type "CollaborationPermissionsV2025R0"',
        });
    }
    const isPreviewerUploaderRoleEnabled = val.is_previewer_uploader_role_enabled == void 0
        ? void 0
        : val.is_previewer_uploader_role_enabled;
    if (!(val.is_uploader_role_enabled == void 0) &&
        !(0, json_1.sdIsBoolean)(val.is_uploader_role_enabled)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_uploader_role_enabled" of type "CollaborationPermissionsV2025R0"',
        });
    }
    const isUploaderRoleEnabled = val.is_uploader_role_enabled == void 0
        ? void 0
        : val.is_uploader_role_enabled;
    if (!(val.is_viewer_role_enabled == void 0) &&
        !(0, json_1.sdIsBoolean)(val.is_viewer_role_enabled)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_viewer_role_enabled" of type "CollaborationPermissionsV2025R0"',
        });
    }
    const isViewerRoleEnabled = val.is_viewer_role_enabled == void 0 ? void 0 : val.is_viewer_role_enabled;
    if (!(val.is_viewer_uploader_role_enabled == void 0) &&
        !(0, json_1.sdIsBoolean)(val.is_viewer_uploader_role_enabled)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting boolean for "is_viewer_uploader_role_enabled" of type "CollaborationPermissionsV2025R0"',
        });
    }
    const isViewerUploaderRoleEnabled = val.is_viewer_uploader_role_enabled == void 0
        ? void 0
        : val.is_viewer_uploader_role_enabled;
    return {
        isCoOwnerRoleEnabled: isCoOwnerRoleEnabled,
        isEditorRoleEnabled: isEditorRoleEnabled,
        isPreviewerRoleEnabled: isPreviewerRoleEnabled,
        isPreviewerUploaderRoleEnabled: isPreviewerUploaderRoleEnabled,
        isUploaderRoleEnabled: isUploaderRoleEnabled,
        isViewerRoleEnabled: isViewerRoleEnabled,
        isViewerUploaderRoleEnabled: isViewerUploaderRoleEnabled,
    };
}
//# sourceMappingURL=collaborationPermissionsV2025R0.js.map