"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeSharedLinkPermissionsV2025R0 = serializeSharedLinkPermissionsV2025R0;
exports.deserializeSharedLinkPermissionsV2025R0 = deserializeSharedLinkPermissionsV2025R0;
const errors_1 = require("../../box/errors");
const json_1 = require("../../serialization/json");
const json_2 = require("../../serialization/json");
function serializeSharedLinkPermissionsV2025R0(val) {
    return {
        ['shared_links_option']: val.sharedLinksOption,
        ['default_shared_link_type']: val.defaultSharedLinkType,
        ['notes_shared_link_option']: val.notesSharedLinkOption,
        ['default_notes_shared_link_type']: val.defaultNotesSharedLinkType,
    };
}
function deserializeSharedLinkPermissionsV2025R0(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "SharedLinkPermissionsV2025R0"',
        });
    }
    if (!(val.shared_links_option == void 0) &&
        !(0, json_1.sdIsString)(val.shared_links_option)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "shared_links_option" of type "SharedLinkPermissionsV2025R0"',
        });
    }
    const sharedLinksOption = val.shared_links_option == void 0 ? void 0 : val.shared_links_option;
    if (!(val.default_shared_link_type == void 0) &&
        !(0, json_1.sdIsString)(val.default_shared_link_type)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "default_shared_link_type" of type "SharedLinkPermissionsV2025R0"',
        });
    }
    const defaultSharedLinkType = val.default_shared_link_type == void 0
        ? void 0
        : val.default_shared_link_type;
    if (!(val.notes_shared_link_option == void 0) &&
        !(0, json_1.sdIsString)(val.notes_shared_link_option)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "notes_shared_link_option" of type "SharedLinkPermissionsV2025R0"',
        });
    }
    const notesSharedLinkOption = val.notes_shared_link_option == void 0
        ? void 0
        : val.notes_shared_link_option;
    if (!(val.default_notes_shared_link_type == void 0) &&
        !(0, json_1.sdIsString)(val.default_notes_shared_link_type)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "default_notes_shared_link_type" of type "SharedLinkPermissionsV2025R0"',
        });
    }
    const defaultNotesSharedLinkType = val.default_notes_shared_link_type == void 0
        ? void 0
        : val.default_notes_shared_link_type;
    return {
        sharedLinksOption: sharedLinksOption,
        defaultSharedLinkType: defaultSharedLinkType,
        notesSharedLinkOption: notesSharedLinkOption,
        defaultNotesSharedLinkType: defaultNotesSharedLinkType,
    };
}
//# sourceMappingURL=sharedLinkPermissionsV2025R0.js.map