1
1
using System ;
2
- using System . Net ;
3
2
using Newtonsoft . Json ;
4
3
using SSLLabsApiWrapper . Models ;
5
4
using SSLLabsApiWrapper . Models . Response ;
@@ -23,7 +22,7 @@ public Info InfoModel(WebResponseModel webResponse, Info infoModel)
23
22
24
23
infoModel = JsonConvert . DeserializeObject < Info > ( webResponse . Payloay , JsonSerializerSettings ) ;
25
24
infoModel . Header = PopulateHeader ( infoModel . Header , webResponse ) ;
26
- infoModel . Wrapper . ApiCommandUrl = webResponse . Url ;
25
+ infoModel . Wrapper = PopulateWrapper ( infoModel . Wrapper , webResponse ) ;
27
26
28
27
return infoModel ;
29
28
}
@@ -32,7 +31,7 @@ public Analyze AnalyzeModel(WebResponseModel webResponse, Analyze analyzeModel)
32
31
{
33
32
analyzeModel = JsonConvert . DeserializeObject < Analyze > ( webResponse . Payloay , JsonSerializerSettings ) ;
34
33
analyzeModel . Header = PopulateHeader ( analyzeModel . Header , webResponse ) ;
35
- analyzeModel . Wrapper . ApiCommandUrl = webResponse . Url ;
34
+ analyzeModel . Wrapper = PopulateWrapper ( analyzeModel . Wrapper , webResponse ) ;
36
35
37
36
if ( analyzeModel . status == "ERROR" ) { analyzeModel . Errors . Add ( new Error ( ) { message = analyzeModel . statusMessage } ) ; }
38
37
@@ -43,7 +42,7 @@ public Endpoint EndpointModel(WebResponseModel webResponse, Endpoint endpointMod
43
42
{
44
43
endpointModel = JsonConvert . DeserializeObject < Endpoint > ( webResponse . Payloay , JsonSerializerSettings ) ;
45
44
endpointModel . Header = PopulateHeader ( endpointModel . Header , webResponse ) ;
46
- endpointModel . Wrapper . ApiCommandUrl = webResponse . Url ;
45
+ endpointModel . Wrapper = PopulateWrapper ( endpointModel . Wrapper , webResponse ) ;
47
46
48
47
return endpointModel ;
49
48
}
@@ -52,7 +51,7 @@ public StatusCodes StatusCodesModel(WebResponseModel webResponse, StatusCodes st
52
51
{
53
52
statusCodes = JsonConvert . DeserializeObject < StatusCodes > ( webResponse . Payloay , JsonSerializerSettings ) ;
54
53
statusCodes . Header = PopulateHeader ( statusCodes . Header , webResponse ) ;
55
- statusCodes . Wrapper . ApiCommandUrl = webResponse . Url ;
54
+ statusCodes . Wrapper = PopulateWrapper ( statusCodes . Wrapper , webResponse ) ;
56
55
57
56
return statusCodes ;
58
57
}
@@ -64,5 +63,13 @@ public Header PopulateHeader(Header header, WebResponseModel webResponse)
64
63
65
64
return header ;
66
65
}
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
+ }
67
74
}
68
75
}
0 commit comments