Skip to content

Commit 37605b2

Browse files
committed
Adding wrapper class to base model
1 parent 5854119 commit 37605b2

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

SSLLWrapper/Interfaces/IBaseResponse.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ public interface IBaseResponse
88
Header Header { get; set; }
99
bool HasErrorOccurred { get; set; }
1010
List<Error> Errors { get; set; }
11+
Wrapper Wrapper { get; set; }
1112
}
1213
}

SSLLWrapper/Models/Response/BaseModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ public class BaseModel : IBaseResponse
99
public Header Header { get; set; }
1010
public bool HasErrorOccurred { get; set; }
1111
public List<Error> Errors { get; set; }
12+
public Wrapper Wrapper { get; set; }
1213

1314
public BaseModel()
1415
{
1516
Header = new Header();
1617
Errors = new List<Error>();
18+
Wrapper = new Wrapper();
1719
this.HasErrorOccurred = false;
1820
}
1921
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace SSLLWrapper.Models.Response.BaseSubModels
2+
{
3+
public class Wrapper
4+
{
5+
public int ApiPassCount { get; set; }
6+
public string ApiCommandUrl { get; set; }
7+
}
8+
}

SSLLWrapper/SSLLService.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ public Analyze AutomaticAnalyze(string host, int maxWaitInterval, int sleepInter
137137

138138
public Analyze AutomaticAnalyze(string host, Publish publish, ClearCache clearCache, FromCache fromCache, All all, int maxWaitInterval, int sleepInterval)
139139
{
140-
var startTime = DateTime.Now;
140+
var startTime = DateTime.Now;
141141
var sleepIntervalMilliseconds = sleepInterval * 1000;
142+
var apiPassCount = 1;
142143
var analyzeModel = Analyze(host, publish, clearCache, fromCache, all);
143144

144145
// Ignoring cache settings after first request to prevent loop
@@ -148,9 +149,12 @@ public Analyze AutomaticAnalyze(string host, Publish publish, ClearCache clearCa
148149
while (analyzeModel.HasErrorOccurred == false && analyzeModel.status != "READY" && (DateTime.Now - startTime).TotalSeconds < maxWaitInterval)
149150
{
150151
Thread.Sleep(sleepIntervalMilliseconds);
152+
apiPassCount ++;
151153
analyzeModel = Analyze(host, publish, clearCache, fromCache, all);
152154
}
153155

156+
analyzeModel.Wrapper.ApiPassCount = apiPassCount;
157+
154158
return analyzeModel;
155159
}
156160

SSLLWrapper/SSLLWrapper.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<ItemGroup>
4747
<Compile Include="External\SSLLabsApi.cs" />
4848
<Compile Include="Interfaces\IBaseResponse.cs" />
49+
<Compile Include="Models\Response\BaseSubModels\Wrapper.cs" />
4950
<Compile Include="Models\Response\StatusCodes.cs" />
5051
<Compile Include="Models\WebResponseModel.cs" />
5152
<Compile Include="SSLLService.cs" />

0 commit comments

Comments
 (0)