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)); }
internal override void InitializeFrom(JObject j) { base.InitializeFrom(j); Path = j.Value <string>("path"); Format = UtilJsonNet.GetEnumValue <ItemSourceFormat>(j, "format"); }