Skip to content

Commit 10853f7

Browse files
committed
Adding ignore value to enum for clearCache and fromCache as well as bug fix
1 parent 2b4f0a6 commit 10853f7

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

SSLLWrapper/ApiService.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ public enum Publish
2626
public enum ClearCache
2727
{
2828
On,
29-
Off
29+
Off,
30+
Ignore
3031
}
3132

3233
public enum FromCache
3334
{
3435
On,
35-
Off
36+
Off,
37+
Ignore
3638
}
3739

3840
public enum All
@@ -67,7 +69,7 @@ public Info Info()
6769
var webResponse = _api.MakeGetRequest(requestModel);
6870

6971
// Binding result to model
70-
_responsePopulationHelper.InfoModel(webResponse, infoModel);
72+
infoModel = _responsePopulationHelper.InfoModel(webResponse, infoModel);
7173

7274
if (infoModel.engineVersion != null)
7375
{
@@ -89,7 +91,7 @@ public Info Info()
8991
public Analyze Analyze(string host)
9092
{
9193
// overloaded method to provide a default set of options
92-
return Analyze(host, Publish.Off, ClearCache.On, FromCache.Off, All.On);
94+
return Analyze(host, Publish.Off, ClearCache.On, FromCache.Ignore, All.On);
9395
}
9496

9597
public Analyze Analyze(string host, Publish publish, ClearCache clearCache, FromCache fromCache, All all)
@@ -114,7 +116,7 @@ public Analyze Analyze(string host, Publish publish, ClearCache clearCache, From
114116
var webResponse = _api.MakeGetRequest(requestModel);
115117

116118
// Binding result to model
117-
_responsePopulationHelper.AnalyzeModel(webResponse, analyzeModel);
119+
analyzeModel = _responsePopulationHelper.AnalyzeModel(webResponse, analyzeModel);
118120
}
119121
catch (Exception ex)
120122
{
@@ -155,7 +157,7 @@ public Endpoint GetEndpointData(string host, string s, FromCache fromCache)
155157
var webResponse = _api.MakeGetRequest(requestModel);
156158

157159
// Binding result to model
158-
_responsePopulationHelper.EndpointModel(webResponse, endpointModel);
160+
endpointModel = _responsePopulationHelper.EndpointModel(webResponse, endpointModel);
159161
}
160162
catch (Exception ex)
161163
{
@@ -182,7 +184,7 @@ public StatusDetails GetStatusCodes()
182184
var webResponse = _api.MakeGetRequest(requestModel);
183185

184186
// Binding result to model
185-
_responsePopulationHelper.StatusDetailsModel(webResponse, statusDetailsModel);
187+
statusDetailsModel = _responsePopulationHelper.StatusDetailsModel(webResponse, statusDetailsModel);
186188
}
187189
catch (Exception ex)
188190
{

SSLLWrapper/Helpers/RequestModelHelper.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ public RequestModel AnalyzeProperties(string apiBaseUrl, string action, string h
1818

1919
requestModel.Parameters.Add("host", host);
2020
requestModel.Parameters.Add("publish", publish);
21-
requestModel.Parameters.Add("clearCache", clearCache);
22-
//requestModel.Parameters.Add("fromCache", fromCache); // Temp commenting out
2321
requestModel.Parameters.Add("all", all);
2422

23+
if (clearCache != "ignore") { requestModel.Parameters.Add("clearCache", clearCache); }
24+
if (fromCache != "ignore") { requestModel.Parameters.Add("fromCache", fromCache); }
25+
2526
return requestModel;
2627
}
2728

0 commit comments

Comments
 (0)