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