"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotesConvertResponseV2026R0 = void 0;
exports.serializeNotesConvertResponseV2026R0TypeField = serializeNotesConvertResponseV2026R0TypeField;
exports.deserializeNotesConvertResponseV2026R0TypeField = deserializeNotesConvertResponseV2026R0TypeField;
exports.serializeNotesConvertResponseV2026R0 = serializeNotesConvertResponseV2026R0;
exports.deserializeNotesConvertResponseV2026R0 = deserializeNotesConvertResponseV2026R0;
exports.serializeNotesConvertResponseV2026R0Input = serializeNotesConvertResponseV2026R0Input;
exports.deserializeNotesConvertResponseV2026R0Input = deserializeNotesConvertResponseV2026R0Input;
const errors_1 = require("../../box/errors.js");
const json_1 = require("../../serialization/json.js");
const json_2 = require("../../serialization/json.js");
class NotesConvertResponseV2026R0 {
    constructor(fields) {
        /**
         * The Box resource type; always `file` for a Box file. */
        this.type = 'file';
        if (fields.type !== undefined) {
            this.type = fields.type;
        }
        if (fields.id !== undefined) {
            this.id = fields.id;
        }
        if (fields.rawData !== undefined) {
            this.rawData = fields.rawData;
        }
    }
}
exports.NotesConvertResponseV2026R0 = NotesConvertResponseV2026R0;
function serializeNotesConvertResponseV2026R0TypeField(val) {
    return val;
}
function deserializeNotesConvertResponseV2026R0TypeField(val) {
    if (val == 'file') {
        return val;
    }
    throw new errors_1.BoxSdkError({
        message: "Can't deserialize NotesConvertResponseV2026R0TypeField",
    });
}
function serializeNotesConvertResponseV2026R0(val) {
    return {
        ['type']: serializeNotesConvertResponseV2026R0TypeField(val.type),
        ['id']: val.id,
    };
}
function deserializeNotesConvertResponseV2026R0(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "NotesConvertResponseV2026R0"',
        });
    }
    if (val.type == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "type" of type "NotesConvertResponseV2026R0" to be defined',
        });
    }
    const type = deserializeNotesConvertResponseV2026R0TypeField(val.type);
    if (val.id == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "id" of type "NotesConvertResponseV2026R0" to be defined',
        });
    }
    if (!(0, json_1.sdIsString)(val.id)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "id" of type "NotesConvertResponseV2026R0"',
        });
    }
    const id = val.id;
    return { type: type, id: id };
}
function serializeNotesConvertResponseV2026R0Input(val) {
    return {
        ['type']: val.type == void 0
            ? val.type
            : serializeNotesConvertResponseV2026R0TypeField(val.type),
        ['id']: val.id,
    };
}
function deserializeNotesConvertResponseV2026R0Input(val) {
    if (!(0, json_2.sdIsMap)(val)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting a map for "NotesConvertResponseV2026R0Input"',
        });
    }
    const type = val.type == void 0
        ? void 0
        : deserializeNotesConvertResponseV2026R0TypeField(val.type);
    if (val.id == void 0) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting "id" of type "NotesConvertResponseV2026R0Input" to be defined',
        });
    }
    if (!(0, json_1.sdIsString)(val.id)) {
        throw new errors_1.BoxSdkError({
            message: 'Expecting string for "id" of type "NotesConvertResponseV2026R0Input"',
        });
    }
    const id = val.id;
    return { type: type, id: id };
}
//# sourceMappingURL=notesConvertResponseV2026R0.js.map