"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.serializeHubDocumentBlockV2025R0 = serializeHubDocumentBlockV2025R0;
exports.deserializeHubDocumentBlockV2025R0 = deserializeHubDocumentBlockV2025R0;
const errors_1 = require("../../box/errors.js");
const json_1 = require("../../serialization/json.js");
const json_2 = require("../../serialization/json.js");
function serializeHubDocumentBlockV2025R0(val) {
    return { ['id']: val.id, ['parent_id']: val.parentId };
}
function deserializeHubDocumentBlockV2025R0(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "HubDocumentBlockV2025R0"',
        });
    }
    if (val.id == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "id" of type "HubDocumentBlockV2025R0" to be defined',
        });
    }
    if (!(0, json_1.sdIsString)(val.id)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "id" of type "HubDocumentBlockV2025R0"',
        });
    }
    const id = val.id;
    if (!(val.parent_id == void 0) && !(0, json_1.sdIsString)(val.parent_id)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "parent_id" of type "HubDocumentBlockV2025R0"',
        });
    }
    const parentId = val.parent_id == void 0 ? void 0 : val.parent_id;
    return { id: id, parentId: parentId };
}
//# sourceMappingURL=hubDocumentBlockV2025R0.js.map