Skip to content

Commit a145e3a

Browse files
committed
Merge pull request #6 from AshleyPoole/automatic-analyzer
Merge automatic-analyzer improvements into master
2 parents ed39141 + 75f7aed commit a145e3a

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

SSLLabsApiWrapper/Domain/ResponsePopulation.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Net;
32
using Newtonsoft.Json;
43
using SSLLabsApiWrapper.Models;
54
using SSLLabsApiWrapper.Models.Response;
@@ -23,7 +22,7 @@ public Info InfoModel(WebResponseModel webResponse, Info infoModel)
2322

2423
infoModel = JsonConvert.DeserializeObject<Info>(webResponse.Payloay, JsonSerializerSettings);
2524
infoModel.Header = PopulateHeader(infoModel.Header, webResponse);
26-
infoModel.Wrapper.ApiCommandUrl = webResponse.Url;
25+
infoModel.Wrapper = PopulateWrapper(infoModel.Wrapper, webResponse);
2726

2827
return infoModel;
2928
}
@@ -32,7 +31,7 @@ public Analyze AnalyzeModel(WebResponseModel webResponse, Analyze analyzeModel)
3231
{
3332
analyzeModel = JsonConvert.DeserializeObject<Analyze>(webResponse.Payloay, JsonSerializerSettings);
3433
analyzeModel.Header = PopulateHeader(analyzeModel.Header, webResponse);
35-
analyzeModel.Wrapper.ApiCommandUrl = webResponse.Url;
34+
analyzeModel.Wrapper = PopulateWrapper(analyzeModel.Wrapper, webResponse);
3635

3736
if (analyzeModel.status == "ERROR") { analyzeModel.Errors.Add(new Error() { message = analyzeModel.statusMessage }); }
3837

@@ -43,7 +42,7 @@ public Endpoint EndpointModel(WebResponseModel webResponse, Endpoint endpointMod
4342
{
4443
endpointModel = JsonConvert.DeserializeObject<Endpoint>(webResponse.Payloay, JsonSerializerSettings);
4544
endpointModel.Header = PopulateHeader(endpointModel.Header, webResponse);
46-
endpointModel.Wrapper.ApiCommandUrl = webResponse.Url;
45+
endpointModel.Wrapper = PopulateWrapper(endpointModel.Wrapper, webResponse);
4746

4847
return endpointModel;
4948
}
@@ -52,7 +51,7 @@ public StatusCodes StatusCodesModel(WebResponseModel webResponse, StatusCodes st
5251
{
5352
statusCodes = JsonConvert.DeserializeObject<StatusCodes>(webResponse.Payloay, JsonSerializerSettings);
5453
statusCodes.Header = PopulateHeader(statusCodes.Header, webResponse);
55-
statusCodes.Wrapper.ApiCommandUrl = webResponse.Url;
54+
statusCodes.Wrapper = PopulateWrapper(statusCodes.Wrapper, webResponse);
5655

5756
return statusCodes;
5857
}
@@ -64,5 +63,13 @@ public Header PopulateHeader(Header header, WebResponseModel webResponse)
6463

6564
return header;
6665
}
66+
67+
public Wrapper PopulateWrapper(Wrapper wrapper, WebResponseModel webResponse)
68+
{
69+
wrapper.ApiCommandUrl = webResponse.Url;
70+
wrapper.ApiRawResponse = webResponse.Payloay;
71+
72+
return wrapper;
73+
}
6774
}
6875
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace SSLLabsApiWrapper.Models.Response.BaseSubModels
2+
{
3+
public class Wrapper
4+
{
5+
public int ApiPassCount { get; set; }
6+
public string ApiCommandUrl { get; set; }
7+
public string ApiRawResponse { get; set; }
8+
}
9+
}

0 commit comments

Comments
 (0)