Skip to content

Commit 244df93

Browse files
committed
Commit: 2f86e9bd
1 parent 22e3015 commit 244df93

File tree

9 files changed

+261
-5
lines changed

9 files changed

+261
-5
lines changed

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ src/Regula.DocumentReader.WebClient/Model/LivenessParams.cs
135135
src/Regula.DocumentReader.WebClient/Model/LogLevel.cs
136136
src/Regula.DocumentReader.WebClient/Model/MDLDeviceEngagement.cs
137137
src/Regula.DocumentReader.WebClient/Model/MDLDeviceRetrieval.cs
138+
src/Regula.DocumentReader.WebClient/Model/MDLItem.cs
139+
src/Regula.DocumentReader.WebClient/Model/MDLResult.cs
138140
src/Regula.DocumentReader.WebClient/Model/MDLServerRetrieval.cs
139141
src/Regula.DocumentReader.WebClient/Model/MRZDetectorResult.cs
140142
src/Regula.DocumentReader.WebClient/Model/MRZFormat.cs

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

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,18 @@ public ContainerListListInner(VDSDataResult actualInstance)
347347
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
348348
}
349349

350+
/// <summary>
351+
/// Initializes a new instance of the <see cref="ContainerListListInner" /> class
352+
/// with the <see cref="MDLResult" /> class
353+
/// </summary>
354+
/// <param name="actualInstance">An instance of MDLResult.</param>
355+
public ContainerListListInner(MDLResult actualInstance)
356+
{
357+
this.IsNullable = false;
358+
this.SchemaType= "oneOf";
359+
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
360+
}
361+
350362

351363
private Object _actualInstance;
352364

@@ -425,6 +437,10 @@ public override Object ActualInstance
425437
{
426438
this._actualInstance = value;
427439
}
440+
else if (value.GetType() == typeof(MDLResult) || value is MDLResult)
441+
{
442+
this._actualInstance = value;
443+
}
428444
else if (value.GetType() == typeof(MRZDetectorResult) || value is MRZDetectorResult)
429445
{
430446
this._actualInstance = value;
@@ -467,7 +483,7 @@ public override Object ActualInstance
467483
}
468484
else
469485
{
470-
throw new ArgumentException("Invalid instance found. Must be the following types: AuthenticityResult, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult");
486+
throw new ArgumentException("Invalid instance found. Must be the following types: AuthenticityResult, BarcodePositionResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MDLResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult");
471487
}
472488
}
473489
}
@@ -732,6 +748,16 @@ public VDSDataResult GetVDSDataResult()
732748
return (VDSDataResult)this.ActualInstance;
733749
}
734750

751+
/// <summary>
752+
/// Get the actual instance of `MDLResult`. If the actual instance is not `MDLResult`,
753+
/// the InvalidClassException will be thrown
754+
/// </summary>
755+
/// <returns>An instance of MDLResult</returns>
756+
public MDLResult GetMDLResult()
757+
{
758+
return (MDLResult)this.ActualInstance;
759+
}
760+
735761
/// <summary>
736762
/// Returns the string presentation of the object
737763
/// </summary>
@@ -1090,6 +1116,26 @@ public static ContainerListListInner FromJson(string jsonString)
10901116
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into LicenseResult: {1}", jsonString, exception.ToString()));
10911117
}
10921118

1119+
try
1120+
{
1121+
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
1122+
if (typeof(MDLResult).GetProperty("AdditionalProperties") == null)
1123+
{
1124+
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<MDLResult>(jsonString, ContainerListListInner.SerializerSettings));
1125+
}
1126+
else
1127+
{
1128+
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<MDLResult>(jsonString, ContainerListListInner.AdditionalPropertiesSerializerSettings));
1129+
}
1130+
matchedTypes.Add("MDLResult");
1131+
match++;
1132+
}
1133+
catch (Exception exception)
1134+
{
1135+
// deserialization failed, try the next one
1136+
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MDLResult: {1}", jsonString, exception.ToString()));
1137+
}
1138+
10931139
try
10941140
{
10951141
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected EncryptedRCLItem() { }
5656
/// </summary>
5757
/// <value>Base64 encoded data</value>
5858
/*
59-
<example>[B@27e6ab90</example>
59+
<example>[B@15773356</example>
6060
*/
6161
[DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)]
6262
public byte[] EncryptedRCL { get; set; }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected EncryptedRCLResult() { }
6262
/// </summary>
6363
/// <value>Base64 encoded data</value>
6464
/*
65-
<example>[B@27e6ab90</example>
65+
<example>[B@15773356</example>
6666
*/
6767
[DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)]
6868
public byte[] EncryptedRCL { get; set; }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected LicenseItem() { }
5656
/// </summary>
5757
/// <value>Base64 encoded data</value>
5858
/*
59-
<example>[B@5713fdbb</example>
59+
<example>[B@65112c5d</example>
6060
*/
6161
[DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)]
6262
public byte[] License { get; set; }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected LicenseResult() { }
6262
/// </summary>
6363
/// <value>Base64 encoded data</value>
6464
/*
65-
<example>[B@5713fdbb</example>
65+
<example>[B@65112c5d</example>
6666
*/
6767
[DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)]
6868
public byte[] License { get; set; }
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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: 8.1.0
7+
* Generated by: https://github.com/openapitools/openapi-generator.git
8+
*/
9+
10+
11+
using System;
12+
using System.Collections;
13+
using System.Collections.Generic;
14+
using System.Collections.ObjectModel;
15+
using System.Linq;
16+
using System.IO;
17+
using System.Runtime.Serialization;
18+
using System.Text;
19+
using System.Text.RegularExpressions;
20+
using Newtonsoft.Json;
21+
using Newtonsoft.Json.Converters;
22+
using Newtonsoft.Json.Linq;
23+
using System.ComponentModel.DataAnnotations;
24+
using FileParameter = Regula.DocumentReader.WebClient.Client.FileParameter;
25+
using OpenAPIDateConverter = Regula.DocumentReader.WebClient.Client.OpenAPIDateConverter;
26+
27+
namespace Regula.DocumentReader.WebClient.Model
28+
{
29+
/// <summary>
30+
/// MDLItem
31+
/// </summary>
32+
[DataContract(Name = "MDLItem")]
33+
public partial class MDLItem : IValidatableObject
34+
{
35+
/// <summary>
36+
/// Initializes a new instance of the <see cref="MDLItem" /> class.
37+
/// </summary>
38+
[JsonConstructorAttribute]
39+
protected MDLItem() { }
40+
/// <summary>
41+
/// Initializes a new instance of the <see cref="MDLItem" /> class.
42+
/// </summary>
43+
/// <param name="mDLParsedResponse">mDLParsedResponse (required).</param>
44+
public MDLItem(Dictionary<string, Object> mDLParsedResponse = default(Dictionary<string, Object>))
45+
{
46+
// to ensure "mDLParsedResponse" is required (not null)
47+
if (mDLParsedResponse == null)
48+
{
49+
throw new ArgumentNullException("mDLParsedResponse is a required property for MDLItem and cannot be null");
50+
}
51+
this.MDLParsedResponse = mDLParsedResponse;
52+
}
53+
54+
/// <summary>
55+
/// Gets or Sets MDLParsedResponse
56+
/// </summary>
57+
[DataMember(Name = "MDLParsedResponse", IsRequired = true, EmitDefaultValue = true)]
58+
public Dictionary<string, Object> MDLParsedResponse { get; set; }
59+
60+
/// <summary>
61+
/// Returns the string presentation of the object
62+
/// </summary>
63+
/// <returns>String presentation of the object</returns>
64+
public override string ToString()
65+
{
66+
StringBuilder sb = new StringBuilder();
67+
sb.Append("class MDLItem {\n");
68+
sb.Append(" MDLParsedResponse: ").Append(MDLParsedResponse).Append("\n");
69+
sb.Append("}\n");
70+
return sb.ToString();
71+
}
72+
73+
/// <summary>
74+
/// Returns the JSON string presentation of the object
75+
/// </summary>
76+
/// <returns>JSON string presentation of the object</returns>
77+
public virtual string ToJson()
78+
{
79+
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
80+
}
81+
82+
/// <summary>
83+
/// To validate all properties of the instance
84+
/// </summary>
85+
/// <param name="validationContext">Validation context</param>
86+
/// <returns>Validation Result</returns>
87+
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
88+
{
89+
yield break;
90+
}
91+
}
92+
93+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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: 8.1.0
7+
* Generated by: https://github.com/openapitools/openapi-generator.git
8+
*/
9+
10+
11+
using System;
12+
using System.Collections;
13+
using System.Collections.Generic;
14+
using System.Collections.ObjectModel;
15+
using System.Linq;
16+
using System.IO;
17+
using System.Runtime.Serialization;
18+
using System.Text;
19+
using System.Text.RegularExpressions;
20+
using Newtonsoft.Json;
21+
using Newtonsoft.Json.Converters;
22+
using Newtonsoft.Json.Linq;
23+
using JsonSubTypes;
24+
using System.ComponentModel.DataAnnotations;
25+
using FileParameter = Regula.DocumentReader.WebClient.Client.FileParameter;
26+
using OpenAPIDateConverter = Regula.DocumentReader.WebClient.Client.OpenAPIDateConverter;
27+
28+
namespace Regula.DocumentReader.WebClient.Model
29+
{
30+
/// <summary>
31+
/// MDLResult
32+
/// </summary>
33+
[DataContract(Name = "MDLResult")]
34+
public partial class MDLResult : ResultItem, IValidatableObject
35+
{
36+
/// <summary>
37+
/// Initializes a new instance of the <see cref="MDLResult" /> class.
38+
/// </summary>
39+
[JsonConstructorAttribute]
40+
protected MDLResult() { }
41+
/// <summary>
42+
/// Initializes a new instance of the <see cref="MDLResult" /> class.
43+
/// </summary>
44+
/// <param name="mDLParsedResponse">mDLParsedResponse (required).</param>
45+
/// <param name="bufLength">bufLength.</param>
46+
/// <param name="light">light.</param>
47+
/// <param name="listIdx">listIdx.</param>
48+
/// <param name="pageIdx">pageIdx.</param>
49+
/// <param name="resultType">resultType (required) (default to Result.MDL_DEVICE_PARSED_RESPONSE).</param>
50+
public MDLResult(Dictionary<string, Object> mDLParsedResponse = default(Dictionary<string, Object>), int bufLength = default(int), int light = default(int), int listIdx = default(int), int pageIdx = default(int), Result resultType = Result.MDL_DEVICE_PARSED_RESPONSE) : base(bufLength, light, listIdx, pageIdx, resultType)
51+
{
52+
// to ensure "mDLParsedResponse" is required (not null)
53+
if (mDLParsedResponse == null)
54+
{
55+
throw new ArgumentNullException("mDLParsedResponse is a required property for MDLResult and cannot be null");
56+
}
57+
this.MDLParsedResponse = mDLParsedResponse;
58+
}
59+
60+
/// <summary>
61+
/// Gets or Sets MDLParsedResponse
62+
/// </summary>
63+
[DataMember(Name = "MDLParsedResponse", IsRequired = true, EmitDefaultValue = true)]
64+
public Dictionary<string, Object> MDLParsedResponse { get; set; }
65+
66+
/// <summary>
67+
/// Returns the string presentation of the object
68+
/// </summary>
69+
/// <returns>String presentation of the object</returns>
70+
public override string ToString()
71+
{
72+
StringBuilder sb = new StringBuilder();
73+
sb.Append("class MDLResult {\n");
74+
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
75+
sb.Append(" MDLParsedResponse: ").Append(MDLParsedResponse).Append("\n");
76+
sb.Append("}\n");
77+
return sb.ToString();
78+
}
79+
80+
/// <summary>
81+
/// Returns the JSON string presentation of the object
82+
/// </summary>
83+
/// <returns>JSON string presentation of the object</returns>
84+
public override string ToJson()
85+
{
86+
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
87+
}
88+
89+
/// <summary>
90+
/// To validate all properties of the instance
91+
/// </summary>
92+
/// <param name="validationContext">Validation context</param>
93+
/// <returns>Validation Result</returns>
94+
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
95+
{
96+
return this.BaseValidate(validationContext);
97+
}
98+
99+
/// <summary>
100+
/// To validate all properties of the instance
101+
/// </summary>
102+
/// <param name="validationContext">Validation context</param>
103+
/// <returns>Validation Result</returns>
104+
protected IEnumerable<ValidationResult> BaseValidate(ValidationContext validationContext)
105+
{
106+
foreach (var x in base.BaseValidate(validationContext))
107+
{
108+
yield return x;
109+
}
110+
yield break;
111+
}
112+
}
113+
114+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace Regula.DocumentReader.WebClient.Model
3939
[JsonSubtypes.KnownSubType(typeof(DocumentBinaryInfoResult), "104")]
4040
[JsonSubtypes.KnownSubType(typeof(RFIDGraphicsInfoResult), "105")]
4141
[JsonSubtypes.KnownSubType(typeof(ByteArrayResult), "109")]
42+
[JsonSubtypes.KnownSubType(typeof(MDLResult), "121")]
4243
[JsonSubtypes.KnownSubType(typeof(VDSNCDataResult), "124")]
4344
[JsonSubtypes.KnownSubType(typeof(VDSDataResult), "125")]
4445
[JsonSubtypes.KnownSubType(typeof(LexicalAnalysisResult), "15")]

0 commit comments

Comments
 (0)