import { serializeAiTaxonomyReference } from './aiTaxonomyReference.js';
import { deserializeAiTaxonomyReference } from './aiTaxonomyReference.js';
import { serializeAiTaxonomyFileReference } from './aiTaxonomyFileReference.js';
import { deserializeAiTaxonomyFileReference } from './aiTaxonomyFileReference.js';
import { BoxSdkError } from '../box/errors.js';
import { sdIsMap } from '../serialization/json.js';
export function serializeAiTaxonomySource(val) {
    if (val.type == 'taxonomy') {
        return serializeAiTaxonomyReference(val);
    }
    if (val.type == 'file') {
        return serializeAiTaxonomyFileReference(val);
    }
    throw new BoxSdkError({ message: 'unknown type' });
}
export function deserializeAiTaxonomySource(val) {
    if (!sdIsMap(val)) {
        throw new BoxSdkError({
            message: 'Expecting a map for "AiTaxonomySource"',
        });
    }
    if (val.type == 'taxonomy') {
        return deserializeAiTaxonomyReference(val);
    }
    if (val.type == 'file') {
        return deserializeAiTaxonomyFileReference(val);
    }
    throw new BoxSdkError({ message: "Can't deserialize AiTaxonomySource" });
}
//# sourceMappingURL=aiTaxonomySource.js.map