public Analyze Analyze(string host, Publish publish, StartNew startNew, FromCache fromCache, int?maxHours, All all, IgnoreMismatch ignoreMismatch) { var analyzeModel = new Analyze(); // Checking host is valid before continuing if (!_urlValidation.IsValid(host)) { analyzeModel.HasErrorOccurred = true; analyzeModel.Errors.Add(new Error { message = "Host does not pass preflight validation. No Api call has been made." }); return(analyzeModel); } // Building request model var requestModel = _requestModelFactory.NewAnalyzeRequestModel(ApiUrl, "analyze", host, publish.ToString().ToLower(), startNew.ToString().ToLower(), fromCache.ToString().ToLower(), maxHours, all.ToString().ToLower(), ignoreMismatch.ToString().ToLower()); try { var webResponse = _apiProvider.MakeGetRequest(requestModel); analyzeModel = _responsePopulation.AnalyzeModel(webResponse, analyzeModel); } catch (Exception ex) { analyzeModel.HasErrorOccurred = true; analyzeModel.Errors.Add(new Error { message = ex.ToString() }); } // Checking if errors have occoured either from ethier api or wrapper if (analyzeModel.Errors.Count != 0 && !analyzeModel.HasErrorOccurred) { analyzeModel.HasErrorOccurred = true; } return(analyzeModel); }