Beispiel #1
0
        public IActionResult Get(string taskName)
        {
            var taskList = _taskLocator.GetTaskHolderList();
            var task     = taskList.FirstOrDefault(t => t.Key == taskName);

            if (task == null)
            {
                return(NotFound());
            }

            var definition = task.Task.GetTaskParameterDefinition();

            if (definition.Any(d => d.Type == TaskParameterType.CustomConsole))
            {
                return(BadRequest("This task is only enabled for console client"));
            }

            var jsonDefinition = UtilJsonNet.Serialize(definition);

            return(Ok(jsonDefinition));
        }
Beispiel #2
0
 internal override void InitializeFrom(JObject j)
 {
     base.InitializeFrom(j);
     Path   = j.Value <string>("path");
     Format = UtilJsonNet.GetEnumValue <ItemSourceFormat>(j, "format");
 }