UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

30 lines 1.06 kB
import { serializeUserBase } from './userBase.js'; import { deserializeUserBase } from './userBase.js'; import { serializeGroupBase } from './groupBase.js'; import { deserializeGroupBase } from './groupBase.js'; import { BoxSdkError } from '../box/errors.js'; import { sdIsMap } from '../serialization/json.js'; export function serializeAiAgentAllowedEntity(val) { if (val.type == 'user') { return serializeUserBase(val); } if (val.type == 'group') { return serializeGroupBase(val); } throw new BoxSdkError({ message: 'unknown type' }); } export function deserializeAiAgentAllowedEntity(val) { if (!sdIsMap(val)) { throw new BoxSdkError({ message: 'Expecting a map for "AiAgentAllowedEntity"', }); } if (val.type == 'user') { return deserializeUserBase(val); } if (val.type == 'group') { return deserializeGroupBase(val); } throw new BoxSdkError({ message: "Can't deserialize AiAgentAllowedEntity" }); } //# sourceMappingURL=aiAgentAllowedEntity.js.map