import { BoxSdkError } from '../box/errors.js';
import { sdIsString } from '../serialization/json.js';
import { sdIsMap } from '../serialization/json.js';
export function serializeAiExtractFieldOption(val) {
    return { ['key']: val.key };
}
export function deserializeAiExtractFieldOption(val) {
    if (!sdIsMap(val)) {
        throw new BoxSdkError({
            message: 'Expecting a map for "AiExtractFieldOption"',
        });
    }
    if (val.key == void 0) {
        throw new BoxSdkError({
            message: 'Expecting "key" of type "AiExtractFieldOption" to be defined',
        });
    }
    if (!sdIsString(val.key)) {
        throw new BoxSdkError({
            message: 'Expecting string for "key" of type "AiExtractFieldOption"',
        });
    }
    const key = val.key;
    return { key: key };
}
//# sourceMappingURL=aiExtractFieldOption.js.map