Skip to content

Commit 8f7d7c7

Browse files
authored
add mrz filter (#19)
1 parent c203ef6 commit 8f7d7c7

File tree

4 files changed

+71
-3
lines changed

4 files changed

+71
-3
lines changed

.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ src/Regula.DocumentReader.WebClient/Model/ImagesFieldValue.cs
4444
src/Regula.DocumentReader.WebClient/Model/ImagesResult.cs
4545
src/Regula.DocumentReader.WebClient/Model/LexicalAnalysisResult.cs
4646
src/Regula.DocumentReader.WebClient/Model/ListVerifiedFields.cs
47+
src/Regula.DocumentReader.WebClient/Model/MRZFormat.cs
4748
src/Regula.DocumentReader.WebClient/Model/OCRSecurityTextResult.cs
4849
src/Regula.DocumentReader.WebClient/Model/OneCandidate.cs
4950
src/Regula.DocumentReader.WebClient/Model/OriginalSymbol.cs
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Regula Document Reader Web API
3+
*
4+
* 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
5+
*
6+
* The version of the OpenAPI document: 5.5.0
7+
*
8+
* Generated by: https://github.com/openapitools/openapi-generator.git
9+
*/
10+
11+
using System;
12+
using System.Linq;
13+
using System.IO;
14+
using System.Text;
15+
using System.Text.RegularExpressions;
16+
using System.Collections;
17+
using System.Collections.Generic;
18+
using System.Collections.ObjectModel;
19+
using System.Runtime.Serialization;
20+
using Newtonsoft.Json;
21+
using Newtonsoft.Json.Converters;
22+
using System.ComponentModel.DataAnnotations;
23+
using OpenAPIDateConverter = Regula.DocumentReader.WebClient.Client.OpenAPIDateConverter;
24+
25+
namespace Regula.DocumentReader.WebClient.Model
26+
{
27+
public class MRZFormat
28+
{
29+
30+
31+
public const string IDL = "1x30";
32+
33+
34+
public const string ID1 = "3x30";
35+
36+
37+
public const string ID2 = "2x36";
38+
39+
40+
public const string ID3 = "2x44";
41+
42+
43+
public const string CAN = "1x6";
44+
45+
46+
public const string ID1_2_30 = "2x30";
47+
48+
}
49+
}

src/Regula.DocumentReader.WebClient/Model/ProcessParams.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ protected ProcessParams() { }
6565
/// <param name="shiftExpiryDate">This option allows shifting the date of expiry into the future or past for number of months specified. This is useful, for example, in some cases when document might be still valid for some period after original expiration date to prevent negative validity status for such documents. Or by shifting the date to the past will set negative validity for the documents that is about to expire in a specified number of months..</param>
6666
/// <param name="minimalHolderAge">This options allows specifying the minimal age in years of the document holder for the document to be considered valid..</param>
6767
/// <param name="returnUncroppedImage">This option allows returning input images in output if enabled..</param>
68-
public ProcessParams(string scenario = default(string), List<int> resultTypeOutput = default(List<int>), bool doublePageSpread = default(bool), bool generateDoublePageSpreadImage = default(bool), List<int> fieldTypesFilter = default(List<int>), string dateFormat = default(string), int measureSystem = default(int), int imageDpiOutMax = default(int), bool alreadyCropped = default(bool), Dictionary<string, Object> customParams = default(Dictionary<string, Object>), bool log = default(bool), string logLevel = default(string), int forceDocID = default(int), bool matchTextFieldMask = default(bool), bool fastDocDetect = default(bool), bool updateOCRValidityByGlare = default(bool), bool checkRequiredTextFields = default(bool), bool returnCroppedBarcode = default(bool), ImageQA imageQA = default(ImageQA), int forceDocFormat = default(int), bool noGraphics = default(bool), float documentAreaMin = default(float), bool depersonalizeLog = default(bool), bool multiDocOnImage = default(bool), int shiftExpiryDate = default(int), int minimalHolderAge = default(int), bool returnUncroppedImage = default(bool))
68+
/// <param name="mrzFormatsFilter">This option allows limiting MRZ formats to be recognized by specifying them in array..</param>
69+
public ProcessParams(string scenario = default(string), List<int> resultTypeOutput = default(List<int>), bool doublePageSpread = default(bool), bool generateDoublePageSpreadImage = default(bool), List<int> fieldTypesFilter = default(List<int>), string dateFormat = default(string), int measureSystem = default(int), int imageDpiOutMax = default(int), bool alreadyCropped = default(bool), Dictionary<string, Object> customParams = default(Dictionary<string, Object>), bool log = default(bool), string logLevel = default(string), int forceDocID = default(int), bool matchTextFieldMask = default(bool), bool fastDocDetect = default(bool), bool updateOCRValidityByGlare = default(bool), bool checkRequiredTextFields = default(bool), bool returnCroppedBarcode = default(bool), ImageQA imageQA = default(ImageQA), int forceDocFormat = default(int), bool noGraphics = default(bool), float documentAreaMin = default(float), bool depersonalizeLog = default(bool), bool multiDocOnImage = default(bool), int shiftExpiryDate = default(int), int minimalHolderAge = default(int), bool returnUncroppedImage = default(bool), List<MRZFormat> mrzFormatsFilter = default(List<MRZFormat>))
6970
{
7071
// to ensure "scenario" is required (not null)
7172
if (scenario == null)
@@ -103,6 +104,7 @@ protected ProcessParams() { }
103104
this.ShiftExpiryDate = shiftExpiryDate;
104105
this.MinimalHolderAge = minimalHolderAge;
105106
this.ReturnUncroppedImage = returnUncroppedImage;
107+
this.MrzFormatsFilter = mrzFormatsFilter;
106108
}
107109

108110
/// <summary>
@@ -289,6 +291,13 @@ protected ProcessParams() { }
289291
[DataMember(Name="returnUncroppedImage", EmitDefaultValue=false)]
290292
public bool ReturnUncroppedImage { get; set; }
291293

294+
/// <summary>
295+
/// This option allows limiting MRZ formats to be recognized by specifying them in array.
296+
/// </summary>
297+
/// <value>This option allows limiting MRZ formats to be recognized by specifying them in array.</value>
298+
[DataMember(Name="mrzFormatsFilter", EmitDefaultValue=false)]
299+
public List<MRZFormat> MrzFormatsFilter { get; set; }
300+
292301
/// <summary>
293302
/// Returns the string presentation of the object
294303
/// </summary>
@@ -324,6 +333,7 @@ public override string ToString()
324333
sb.Append(" ShiftExpiryDate: ").Append(ShiftExpiryDate).Append("\n");
325334
sb.Append(" MinimalHolderAge: ").Append(MinimalHolderAge).Append("\n");
326335
sb.Append(" ReturnUncroppedImage: ").Append(ReturnUncroppedImage).Append("\n");
336+
sb.Append(" MrzFormatsFilter: ").Append(MrzFormatsFilter).Append("\n");
327337
sb.Append("}\n");
328338
return sb.ToString();
329339
}
@@ -495,6 +505,12 @@ public bool Equals(ProcessParams input)
495505
this.ReturnUncroppedImage == input.ReturnUncroppedImage ||
496506
(this.ReturnUncroppedImage != null &&
497507
this.ReturnUncroppedImage.Equals(input.ReturnUncroppedImage))
508+
) &&
509+
(
510+
this.MrzFormatsFilter == input.MrzFormatsFilter ||
511+
this.MrzFormatsFilter != null &&
512+
input.MrzFormatsFilter != null &&
513+
this.MrzFormatsFilter.SequenceEqual(input.MrzFormatsFilter)
498514
);
499515
}
500516

@@ -561,6 +577,8 @@ public override int GetHashCode()
561577
hashCode = hashCode * 59 + this.MinimalHolderAge.GetHashCode();
562578
if (this.ReturnUncroppedImage != null)
563579
hashCode = hashCode * 59 + this.ReturnUncroppedImage.GetHashCode();
580+
if (this.MrzFormatsFilter != null)
581+
hashCode = hashCode * 59 + this.MrzFormatsFilter.GetHashCode();
564582
return hashCode;
565583
}
566584
}

update-models.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Light=int,Result=int,VerificationResult=int,RfidLocation=int,\
55
DocumentTypeRecognitionResult=int,ProcessingStatus=int,Source=string,CheckResult=int,\
66
LCID=int,DocumentType=int,MeasureSystem=int,SecurityFeatureType=int,CheckDiagnose=int,\
77
Critical=int,Visibility=int,AuthenticityResultType=int,ImageQualityCheckType=int,\
8-
LogLevel=string"\
8+
LogLevel=string,MRZFormat=string"\
99
\
1010
&& docker run --user "$(id -u):$(id -g)" --rm -v "${PWD}:/client" -v "$DOCS_DEFINITION_FOLDER:/definitions" \
1111
openapitools/openapi-generator-cli:v5.0.0-beta2 generate \
@@ -16,4 +16,4 @@ openapitools/openapi-generator-cli:v5.0.0-beta2 generate \
1616
openapitools/openapi-generator-cli:v5.0.0-beta2 generate \
1717
-i /definitions/index.yml -g csharp -o /client/ \
1818
-c /client/csharp-generator-config.json -t /client/generator-templates/ \
19-
--import-mappings $ENUM_MAPPINGS
19+
--import-mappings $ENUM_MAPPINGS

0 commit comments

Comments
 (0)