box-node-sdk
Version:
Official SDK for Box Platform APIs
28 lines • 1.07 kB
JavaScript
import { serializeAiAgentReference } from './aiAgentReference.js';
import { deserializeAiAgentReference } from './aiAgentReference.js';
import { serializeAiAgentAsk } from './aiAgentAsk.js';
import { deserializeAiAgentAsk } from './aiAgentAsk.js';
import { BoxSdkError } from '../box/errors.js';
import { sdIsMap } from '../serialization/json.js';
export function serializeAiAskAgent(val) {
if (val.type == 'ai_agent_id') {
return serializeAiAgentReference(val);
}
if (val.type == 'ai_agent_ask') {
return serializeAiAgentAsk(val);
}
throw new BoxSdkError({ message: 'unknown type' });
}
export function deserializeAiAskAgent(val) {
if (!sdIsMap(val)) {
throw new BoxSdkError({ message: 'Expecting a map for "AiAskAgent"' });
}
if (val.type == 'ai_agent_id') {
return deserializeAiAgentReference(val);
}
if (val.type == 'ai_agent_ask') {
return deserializeAiAgentAsk(val);
}
throw new BoxSdkError({ message: "Can't deserialize AiAskAgent" });
}
//# sourceMappingURL=aiAskAgent.js.map