Skip to content

Commit 96846af

Browse files
Fix ext files
1 parent 100f84b commit 96846af

File tree

255 files changed

+395
-394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+395
-394
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src/Regula.DocumentReader.WebClient/Api/DocumentReaderApi.cs

Lines changed: 46 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using System;
2-
using System.Collections.Generic;
2+
using System.Net.Http;
3+
using System.Text.Json;
34
using System.Threading;
45
using System.Threading.Tasks;
6+
using Microsoft.Extensions.Logging;
57
using Regula.DocumentReader.WebClient.Client;
68
using Regula.DocumentReader.WebClient.Model;
79
using Regula.DocumentReader.WebClient.Model.Ext;
@@ -10,95 +12,87 @@ namespace Regula.DocumentReader.WebClient.Api
1012
{
1113
public class DocumentReaderApi
1214
{
13-
private readonly DefaultApi _defaultApi;
15+
private readonly HealthcheckApi _healthcheckApi;
1416
private readonly ProcessApi _processApi;
1517

1618
public DocumentReaderApi(string basePath)
1719
{
18-
this._defaultApi = new DefaultApi(basePath);
19-
this._processApi = new ProcessApi(basePath);
20-
}
20+
var loggerFactory = LoggerFactory.Create(builder =>
21+
{
22+
builder.AddConsole();
23+
});
2124

22-
public Configuration Configuration
23-
{
24-
get => this._processApi.Configuration;
25-
set => this._processApi.Configuration = value;
26-
}
25+
ILogger<HealthcheckApi> healthcheckLogger = loggerFactory.CreateLogger<HealthcheckApi>();
26+
ILogger<ProcessApi> processLogger = loggerFactory.CreateLogger<ProcessApi>();
2727

28-
private string License { get; set; }
28+
var httpClient = new HttpClient
29+
{
30+
BaseAddress = new Uri(basePath)
31+
};
2932

33+
var jsonSerializerOptionsProvider = new JsonSerializerOptionsProvider(new JsonSerializerOptions());
3034

35+
var healthcheckApiEvents = new HealthcheckApiEvents();
36+
var processApiEvents = new ProcessApiEvents();
3137

32-
public RecognitionResponse Process(ProcessRequest processRequest)
33-
{
34-
return Process(processRequest, new Dictionary<String, String>(), default(string));
38+
this._healthcheckApi = new HealthcheckApi(
39+
healthcheckLogger,
40+
loggerFactory,
41+
httpClient,
42+
jsonSerializerOptionsProvider,
43+
healthcheckApiEvents
44+
);
45+
this._processApi = new ProcessApi(
46+
processLogger,
47+
loggerFactory,
48+
httpClient,
49+
jsonSerializerOptionsProvider,
50+
processApiEvents
51+
);
3552
}
3653

37-
public RecognitionResponse Process(ProcessRequest processRequest, Dictionary<String, String> headers)
38-
{
39-
return Process(processRequest, headers, default(string));
40-
}
41-
42-
public RecognitionResponse Process(ProcessRequest processRequest, String xRequestID)
43-
{
44-
return Process(processRequest, new Dictionary<String, String>(), xRequestID);
45-
}
46-
47-
public RecognitionResponse Process(ProcessRequest processRequest, Dictionary<String, String> headers, String xRequestID)
48-
{
49-
if (processRequest.SystemInfo == null)
50-
processRequest.SystemInfo = new ProcessSystemInfo(License);
51-
else
52-
processRequest.SystemInfo.License = License;
53-
54-
return new RecognitionResponse(this._processApi.ApiProcessWithHttpInfo(processRequest, headers, xRequestID));
55-
}
54+
private string License { get; set; }
5655

5756
public async Task<RecognitionResponse> ProcessAsync(ProcessRequest processRequest)
5857
{
59-
return await ProcessAsync(processRequest, new Dictionary<String, String>(), default(string));
60-
}
61-
62-
public async Task<RecognitionResponse> ProcessAsync(ProcessRequest processRequest, Dictionary<String, String> headers)
63-
{
64-
return await ProcessAsync(processRequest, headers, default(string));
58+
return await ProcessAsync(processRequest);
6559
}
6660

6761
public async Task<RecognitionResponse> ProcessAsync(ProcessRequest processRequest, String xRequestID)
6862
{
69-
return await ProcessAsync(processRequest, new Dictionary<String, String>(), xRequestID);
63+
return await ProcessAsync(processRequest, xRequestID);
7064
}
7165

72-
public async Task<RecognitionResponse> ProcessAsync(ProcessRequest processRequest, Dictionary<String, String> headers, String xRequestID, CancellationToken cancellationToken = default(CancellationToken))
66+
public async Task<RecognitionResponse> ProcessAsync(ProcessRequest processRequest, string xRequestID = default, CancellationToken cancellationToken = default)
7367
{
7468
if (processRequest.SystemInfo == null)
7569
processRequest.SystemInfo = new ProcessSystemInfo(License);
7670
else
7771
processRequest.SystemInfo.License = License;
7872

79-
var response = await this._processApi.ApiProcessWithHttpInfoAsync(processRequest, headers, xRequestID, cancellationToken);
73+
var response = await this._processApi.ApiProcessAsync(processRequest, xRequestID, cancellationToken);
8074

8175
return new RecognitionResponse(response);
8276
}
8377

84-
public DeviceInfo Ping(string xRequestID)
78+
public async Task<IPingApiResponse> PingAsync(string xRequestID)
8579
{
86-
return this._defaultApi.Ping(new Dictionary<String, String>(), xRequestID);
80+
return await this._healthcheckApi.PingAsync(xRequestID);
8781
}
8882

89-
public DeviceInfo Ping()
83+
public async Task<IPingApiResponse> PingAsync()
9084
{
91-
return this._defaultApi.Ping(new Dictionary<String, String>());
85+
return await this._healthcheckApi.PingAsync();
9286
}
93-
94-
public DeviceInfo Ping(string xRequestID, Dictionary<String, String> headers)
87+
88+
public async Task<IHealthzApiResponse> HealthAsync(string xRequestID)
9589
{
96-
return this._defaultApi.Ping(headers, xRequestID);
90+
return await this._healthcheckApi.HealthzAsync(xRequestID);
9791
}
98-
99-
public DeviceInfo Ping(Dictionary<String, String> headers)
92+
93+
public async Task<IHealthzApiResponse> HealthAsync()
10094
{
101-
return this._defaultApi.Ping(headers);
95+
return await this._healthcheckApi.HealthzAsync();
10296
}
10397

10498
public DocumentReaderApi WithLicense(string license)

src/Regula.DocumentReader.WebClient/Api/HealthcheckApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
66
*
7-
* The version of the OpenAPI document: 7.4.0
7+
* The version of the OpenAPI document: 7.6.0
88
* Generated by: https://github.com/openapitools/openapi-generator.git
99
*/
1010

src/Regula.DocumentReader.WebClient/Api/ProcessApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
66
*
7-
* The version of the OpenAPI document: 7.4.0
7+
* The version of the OpenAPI document: 7.6.0
88
* Generated by: https://github.com/openapitools/openapi-generator.git
99
*/
1010

src/Regula.DocumentReader.WebClient/Api/TransactionApi.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
66
*
7-
* The version of the OpenAPI document: 7.4.0
7+
* The version of the OpenAPI document: 7.6.0
88
* Generated by: https://github.com/openapitools/openapi-generator.git
99
*/
1010

src/Regula.DocumentReader.WebClient/Client/ApiException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
66
*
7-
* The version of the OpenAPI document: 7.4.0
7+
* The version of the OpenAPI document: 7.6.0
88
* Generated by: https://github.com/openapitools/openapi-generator.git
99
*/
1010

src/Regula.DocumentReader.WebClient/Client/ApiResponse`1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
66
*
7-
* The version of the OpenAPI document: 7.4.0
7+
* The version of the OpenAPI document: 7.6.0
88
* Generated by: https://github.com/openapitools/openapi-generator.git
99
*/
1010

src/Regula.DocumentReader.WebClient/Client/ClientUtils.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
55
*
6-
* The version of the OpenAPI document: 7.4.0
6+
* The version of the OpenAPI document: 7.6.0
77
* Generated by: https://github.com/openapitools/openapi-generator.git
88
*/
99

@@ -20,7 +20,6 @@
2020
using Regula.DocumentReader.WebClient.Model;
2121
using System.Runtime.CompilerServices;
2222

23-
[assembly: InternalsVisibleTo("Regula.DocumentReader.WebClient.Test")]
2423

2524
namespace Regula.DocumentReader.WebClient.Client
2625
{

src/Regula.DocumentReader.WebClient/Client/DateOnlyJsonConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
55
*
6-
* The version of the OpenAPI document: 7.4.0
6+
* The version of the OpenAPI document: 7.6.0
77
* Generated by: https://github.com/openapitools/openapi-generator.git
88
*/
99

src/Regula.DocumentReader.WebClient/Client/DateOnlyNullableJsonConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Documents recognition as easy as reading two bytes. # Clients: * [JavaScript](https://github.com/regulaforensics/DocumentReader-web-js-client) client for the browser and node.js based on axios * [Java](https://github.com/regulaforensics/DocumentReader-web-java-client) client compatible with jvm and android * [Python](https://github.com/regulaforensics/DocumentReader-web-python-client) 3.5+ client * [C#](https://github.com/regulaforensics/DocumentReader-web-csharp-client) client for .NET & .NET Core
55
*
6-
* The version of the OpenAPI document: 7.4.0
6+
* The version of the OpenAPI document: 7.6.0
77
* Generated by: https://github.com/openapitools/openapi-generator.git
88
*/
99

0 commit comments

Comments
 (0)