public override async Task <int> RunAsync(string[] args) { if (!Node.IsSet && !Authorization.IsSet) { throw new ArgumentNullException("You must provide the target bot (node) for this action. Use '-n' [--node] (or '-a' [--authorization]) parameters"); } if (!Model.IsSet) { throw new ArgumentNullException("You must provide the model type. Use '-m' [--model] parameter"); } HandlerAsync handler = null; switch (Model.Value) { case ExportModel.NLPModel: handler = new NLPExportHandler { Node = Node, Authorization = Authorization, OutputFilePath = OutputFilePath }; break; default: break; } if (handler != null) { return(await handler.RunAsync(args)); } return(-1); }
public override async Task <int> RunAsync(string[] args) { if (!Node.IsSet && !Authorization.IsSet) { throw new ArgumentNullException("You must provide the target bot (node) for this action. Use '-n' [--node] (or '-a' [--authorization]) parameters"); } if (!OutputFilePath.IsSet) { throw new ArgumentNullException("You must provide the target output path for this action. Use '-o' [--output] parameter"); } HandlerAsync handler = null; switch (Model.Value) { case ExportModel.NLPModel: handler = NLPExportHandler.GetInstance(this); break; case ExportModel.Builder: var bucket = BucketExportHandler.GetInstance(this); bucket.Key = "blip_portal:builder_working_flow"; handler = bucket; break; default: break; } if (handler != null) { return(await handler.RunAsync(args)); } return(-1); }