UNPKG

box-node-sdk

Version:

Official SDK for Box Platform APIs

87 lines 3.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AiAgentTextGen = void 0; exports.serializeAiAgentTextGenTypeField = serializeAiAgentTextGenTypeField; exports.deserializeAiAgentTextGenTypeField = deserializeAiAgentTextGenTypeField; exports.serializeAiAgentTextGen = serializeAiAgentTextGen; exports.deserializeAiAgentTextGen = deserializeAiAgentTextGen; exports.serializeAiAgentTextGenInput = serializeAiAgentTextGenInput; exports.deserializeAiAgentTextGenInput = deserializeAiAgentTextGenInput; const aiAgentBasicGenTool_1 = require("./aiAgentBasicGenTool"); const aiAgentBasicGenTool_2 = require("./aiAgentBasicGenTool"); const errors_1 = require("../box/errors"); const json_1 = require("../serialization/json"); class AiAgentTextGen { constructor(fields) { /** * The type of AI agent used for generating text. */ this.type = 'ai_agent_text_gen'; if (fields.type !== undefined) { this.type = fields.type; } if (fields.basicGen !== undefined) { this.basicGen = fields.basicGen; } if (fields.rawData !== undefined) { this.rawData = fields.rawData; } } } exports.AiAgentTextGen = AiAgentTextGen; function serializeAiAgentTextGenTypeField(val) { return val; } function deserializeAiAgentTextGenTypeField(val) { if (val == 'ai_agent_text_gen') { return val; } throw new errors_1.BoxSdkError({ message: "Can't deserialize AiAgentTextGenTypeField", }); } function serializeAiAgentTextGen(val) { return { ['type']: serializeAiAgentTextGenTypeField(val.type), ['basic_gen']: val.basicGen == void 0 ? val.basicGen : (0, aiAgentBasicGenTool_1.serializeAiAgentBasicGenTool)(val.basicGen), }; } function deserializeAiAgentTextGen(val) { if (!(0, json_1.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "AiAgentTextGen"' }); } if (val.type == void 0) { throw new errors_1.BoxSdkError({ message: 'Expecting "type" of type "AiAgentTextGen" to be defined', }); } const type = deserializeAiAgentTextGenTypeField(val.type); const basicGen = val.basic_gen == void 0 ? void 0 : (0, aiAgentBasicGenTool_2.deserializeAiAgentBasicGenTool)(val.basic_gen); return { type: type, basicGen: basicGen }; } function serializeAiAgentTextGenInput(val) { return { ['type']: val.type == void 0 ? val.type : serializeAiAgentTextGenTypeField(val.type), ['basic_gen']: val.basicGen == void 0 ? val.basicGen : (0, aiAgentBasicGenTool_1.serializeAiAgentBasicGenTool)(val.basicGen), }; } function deserializeAiAgentTextGenInput(val) { if (!(0, json_1.sdIsMap)(val)) { throw new errors_1.BoxSdkError({ message: 'Expecting a map for "AiAgentTextGenInput"', }); } const type = val.type == void 0 ? void 0 : deserializeAiAgentTextGenTypeField(val.type); const basicGen = val.basic_gen == void 0 ? void 0 : (0, aiAgentBasicGenTool_2.deserializeAiAgentBasicGenTool)(val.basic_gen); return { type: type, basicGen: basicGen }; } //# sourceMappingURL=aiAgentTextGen.js.map