Skip to content

Commit a21701a

Browse files
Merge pull request #158 from regulaforensics/sp-20990-fix-autheticity-type
SP-20990 fix autheticity
2 parents 7d2223e + f4aae3e commit a21701a

File tree

4 files changed

+126
-30
lines changed

4 files changed

+126
-30
lines changed

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

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,38 @@
99
*/
1010

1111
using System;
12-
using System.Linq;
1312
using System.IO;
1413
using System.Text;
15-
using System.Text.RegularExpressions;
16-
using System.Collections;
1714
using System.Collections.Generic;
18-
using System.Collections.ObjectModel;
1915
using System.Runtime.Serialization;
2016
using Newtonsoft.Json;
21-
using Newtonsoft.Json.Converters;
2217
using JsonSubTypes;
2318
using System.ComponentModel.DataAnnotations;
24-
using OpenAPIDateConverter = Regula.DocumentReader.WebClient.Client.OpenAPIDateConverter;
19+
using Regula.DocumentReader.WebClient.Model.Ext.Autheticity;
2520

2621
namespace Regula.DocumentReader.WebClient.Model
2722
{
2823
/// <summary>
2924
/// Common fields for all authenticity result objects
3025
/// </summary>
3126
[DataContract]
32-
[JsonConverter(typeof(JsonSubtypes), "type")]
33-
[JsonSubtypes.KnownSubType(typeof(PhotoIdentResult), "PhotoIdentResult")]
34-
[JsonSubtypes.KnownSubType(typeof(OCRSecurityTextResult), "OCRSecurityTextResult")]
35-
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), "SecurityFeatureResult")]
36-
[JsonSubtypes.KnownSubType(typeof(IdentResult), "IdentResult")]
37-
[JsonSubtypes.KnownSubType(typeof(FiberResult), "FiberResult")]
27+
[JsonConverter(typeof(JsonSubtypes), "Type")]
28+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.UV_LUMINESCENCE)]
29+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.IR_B900)]
30+
[JsonSubtypes.KnownSubType(typeof(IdentResult), AuthenticityResultType.IMAGE_PATTERN)]
31+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.AXIAL_PROTECTION)]
32+
[JsonSubtypes.KnownSubType(typeof(FiberResult), AuthenticityResultType.UV_FIBERS)]
33+
[JsonSubtypes.KnownSubType(typeof(IdentResult), AuthenticityResultType.IR_VISIBILITY)]
34+
[JsonSubtypes.KnownSubType(typeof(OCRSecurityTextResult), AuthenticityResultType.OCR_SECURITY_TEXT)]
35+
[JsonSubtypes.KnownSubType(typeof(ImageIdentChecks), AuthenticityResultType.IPI)]
36+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.PHOTO_EMBED_TYPE)]
37+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.HOLOGRAMS)]
38+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.OVI)]
39+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.PHOTO_AREA)]
40+
[JsonSubtypes.KnownSubType(typeof(IdentResult), AuthenticityResultType.PORTRAIT_COMPARISON)]
41+
[JsonSubtypes.KnownSubType(typeof(SecurityFeatureResult), AuthenticityResultType.BARCODE_FORMAT_CHECK)]
42+
[JsonSubtypes.KnownSubType(typeof(IdentResult), AuthenticityResultType.KINEGRAM)]
43+
[JsonSubtypes.KnownSubType(typeof(IdentResult), AuthenticityResultType.LETTER_SCREEN)]
3844
public partial class AuthenticityCheckResultItem : IEquatable<AuthenticityCheckResultItem>, IValidatableObject
3945
{
4046
/// <summary>

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public partial class ImageQA : IEquatable<ImageQA>, IValidatableObject
4040
/// <param name="glaresCheck">This option enables glares check while performing image quality validation..</param>
4141
/// <param name="colornessCheck">This option enables colorness check while performing image quality validation..</param>
4242
/// <param name="documentPositionIndent">This parameter specifies the necessary margin. Default 0..</param>
43-
public ImageQA(double brightnessThreshold = default(double), int dpiThreshold = default(int), int angleThreshold = default(int), bool? focusCheck = default(bool?), bool? glaresCheck = default(bool?), bool? colornessCheck = default(bool?), int documentPositionIndent = default(int))
43+
/// <param name="expectedPass">This parameter controls the quality checks that the image should pass to be considered a valid input during the scanning process..</param>
44+
public ImageQA(double brightnessThreshold = default(double), int dpiThreshold = default(int), int angleThreshold = default(int), bool? focusCheck = default(bool?), bool? glaresCheck = default(bool?), bool? colornessCheck = default(bool?), int documentPositionIndent = default(int), List<InputImageQualityChecks> expectedPass = default(List<InputImageQualityChecks>))
4445
{
4546
this.BrightnessThreshold = brightnessThreshold;
4647
this.DpiThreshold = dpiThreshold;
@@ -49,6 +50,7 @@ public partial class ImageQA : IEquatable<ImageQA>, IValidatableObject
4950
this.GlaresCheck = glaresCheck;
5051
this.ColornessCheck = colornessCheck;
5152
this.DocumentPositionIndent = documentPositionIndent;
53+
this.ExpectedPass = expectedPass;
5254
}
5355

5456
/// <summary>
@@ -100,6 +102,13 @@ public partial class ImageQA : IEquatable<ImageQA>, IValidatableObject
100102
[DataMember(Name="documentPositionIndent", EmitDefaultValue=false)]
101103
public int DocumentPositionIndent { get; set; }
102104

105+
/// <summary>
106+
/// This parameter controls the quality checks that the image should pass to be considered a valid input during the scanning process.
107+
/// </summary>
108+
/// <value>This parameter controls the quality checks that the image should pass to be considered a valid input during the scanning process.</value>
109+
[DataMember(Name="expectedPass", EmitDefaultValue=false)]
110+
public List<InputImageQualityChecks> ExpectedPass { get; set; }
111+
103112
/// <summary>
104113
/// Returns the string presentation of the object
105114
/// </summary>
@@ -115,6 +124,7 @@ public override string ToString()
115124
sb.Append(" GlaresCheck: ").Append(GlaresCheck).Append("\n");
116125
sb.Append(" ColornessCheck: ").Append(ColornessCheck).Append("\n");
117126
sb.Append(" DocumentPositionIndent: ").Append(DocumentPositionIndent).Append("\n");
127+
sb.Append(" ExpectedPass: ").Append(ExpectedPass).Append("\n");
118128
sb.Append("}\n");
119129
return sb.ToString();
120130
}
@@ -183,6 +193,12 @@ public bool Equals(ImageQA input)
183193
this.DocumentPositionIndent == input.DocumentPositionIndent ||
184194
(this.DocumentPositionIndent != null &&
185195
this.DocumentPositionIndent.Equals(input.DocumentPositionIndent))
196+
) &&
197+
(
198+
this.ExpectedPass == input.ExpectedPass ||
199+
this.ExpectedPass != null &&
200+
input.ExpectedPass != null &&
201+
this.ExpectedPass.SequenceEqual(input.ExpectedPass)
186202
);
187203
}
188204

@@ -209,6 +225,8 @@ public override int GetHashCode()
209225
hashCode = hashCode * 59 + this.ColornessCheck.GetHashCode();
210226
if (this.DocumentPositionIndent != null)
211227
hashCode = hashCode * 59 + this.DocumentPositionIndent.GetHashCode();
228+
if (this.ExpectedPass != null)
229+
hashCode = hashCode * 59 + this.ExpectedPass.GetHashCode();
212230
return hashCode;
213231
}
214232
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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: 7.2.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+
/// <summary>
28+
/// Input image quality checks for the document processing
29+
/// </summary>
30+
/// <value>Input image quality checks for the document processing</value>
31+
32+
[JsonConverter(typeof(StringEnumConverter))]
33+
34+
public enum InputImageQualityChecks
35+
{
36+
/// <summary>
37+
/// Enum Glares for value: glaresCheck
38+
/// </summary>
39+
[EnumMember(Value = "glaresCheck")]
40+
Glares = 1,
41+
42+
/// <summary>
43+
/// Enum Focus for value: focusCheck
44+
/// </summary>
45+
[EnumMember(Value = "focusCheck")]
46+
Focus = 2,
47+
48+
/// <summary>
49+
/// Enum Resolution for value: dpiThreshold
50+
/// </summary>
51+
[EnumMember(Value = "dpiThreshold")]
52+
Resolution = 3,
53+
54+
/// <summary>
55+
/// Enum Colorness for value: colornessCheck
56+
/// </summary>
57+
[EnumMember(Value = "colornessCheck")]
58+
Colorness = 4,
59+
60+
/// <summary>
61+
/// Enum Perspective for value: perspectiveCheck
62+
/// </summary>
63+
[EnumMember(Value = "perspectiveCheck")]
64+
Perspective = 5,
65+
66+
/// <summary>
67+
/// Enum Bounds for value: documentPosition
68+
/// </summary>
69+
[EnumMember(Value = "documentPosition")]
70+
Bounds = 6,
71+
72+
/// <summary>
73+
/// Enum Portrait for value: portraitCheck
74+
/// </summary>
75+
[EnumMember(Value = "portraitCheck")]
76+
Portrait = 7,
77+
78+
/// <summary>
79+
/// Enum Brightness for value: brightnessCheck
80+
/// </summary>
81+
[EnumMember(Value = "brightnessCheck")]
82+
Brightness = 8
83+
84+
}
85+
86+
}

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

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,20 @@ public partial class ProcessRequestImage : IEquatable<ProcessRequestImage>, IVa
3333
/// <summary>
3434
/// Initializes a new instance of the <see cref="ProcessRequestImage" /> class.
3535
/// </summary>
36-
[JsonConstructorAttribute]
37-
protected ProcessRequestImage() { }
38-
/// <summary>
39-
/// Initializes a new instance of the <see cref="ProcessRequestImage" /> class.
40-
/// </summary>
41-
/// <param name="imageData">imageData (required).</param>
36+
/// <param name="imageData">imageData.</param>
4237
/// <param name="light">light.</param>
4338
/// <param name="pageIdx">page/image number.</param>
4439
public ProcessRequestImage(ImageData imageData = default(ImageData), int light = default(int), int pageIdx = default(int))
4540
{
46-
// to ensure "imageData" is required (not null)
47-
if (imageData == null)
48-
{
49-
throw new InvalidDataException("imageData is a required property for ProcessRequestImage and cannot be null");
50-
}
51-
else
52-
{
53-
this.ImageData = imageData;
54-
}
55-
41+
this.ImageData = imageData;
5642
this.Light = light;
5743
this.PageIdx = pageIdx;
5844
}
5945

6046
/// <summary>
6147
/// Gets or Sets ImageData
6248
/// </summary>
63-
[DataMember(Name="ImageData", EmitDefaultValue=true)]
49+
[DataMember(Name="ImageData", EmitDefaultValue=false)]
6450
public ImageData ImageData { get; set; }
6551

6652
/// <summary>

0 commit comments

Comments
 (0)