Skip to content

Commit fb7fb9f

Browse files
committed
Commit: 0e837c52
1 parent b3dbcfa commit fb7fb9f

11 files changed

Lines changed: 287 additions & 6 deletions

File tree

.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ src/Regula.DocumentReader.WebClient/Model/AuthenticityCheckResultItem.cs
3030
src/Regula.DocumentReader.WebClient/Model/AuthenticityCheckResultListInner.cs
3131
src/Regula.DocumentReader.WebClient/Model/AuthenticityResult.cs
3232
src/Regula.DocumentReader.WebClient/Model/AuthenticityResultType.cs
33+
src/Regula.DocumentReader.WebClient/Model/BSIV2Item.cs
34+
src/Regula.DocumentReader.WebClient/Model/BSIV2Result.cs
3335
src/Regula.DocumentReader.WebClient/Model/BarCodeModuleType.cs
3436
src/Regula.DocumentReader.WebClient/Model/BarcodePositionItem.cs
3537
src/Regula.DocumentReader.WebClient/Model/BarcodePositionResult.cs
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+
/// BSIV2Item
31+
/// </summary>
32+
[DataContract(Name = "BSIV2Item")]
33+
public partial class BSIV2Item : IValidatableObject
34+
{
35+
/// <summary>
36+
/// Initializes a new instance of the <see cref="BSIV2Item" /> class.
37+
/// </summary>
38+
[JsonConstructorAttribute]
39+
protected BSIV2Item() { }
40+
/// <summary>
41+
/// Initializes a new instance of the <see cref="BSIV2Item" /> class.
42+
/// </summary>
43+
/// <param name="xMLBuffer">xMLBuffer (required).</param>
44+
public BSIV2Item(string xMLBuffer = default(string))
45+
{
46+
// to ensure "xMLBuffer" is required (not null)
47+
if (xMLBuffer == null)
48+
{
49+
throw new ArgumentNullException("xMLBuffer is a required property for BSIV2Item and cannot be null");
50+
}
51+
this.XMLBuffer = xMLBuffer;
52+
}
53+
54+
/// <summary>
55+
/// Gets or Sets XMLBuffer
56+
/// </summary>
57+
[DataMember(Name = "XML_buffer", IsRequired = true, EmitDefaultValue = true)]
58+
public string XMLBuffer { 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 BSIV2Item {\n");
68+
sb.Append(" XMLBuffer: ").Append(XMLBuffer).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+
/// BSIV2Result
32+
/// </summary>
33+
[DataContract(Name = "BSIV2Result")]
34+
public partial class BSIV2Result : ResultItem, IValidatableObject
35+
{
36+
/// <summary>
37+
/// Initializes a new instance of the <see cref="BSIV2Result" /> class.
38+
/// </summary>
39+
[JsonConstructorAttribute]
40+
protected BSIV2Result() { }
41+
/// <summary>
42+
/// Initializes a new instance of the <see cref="BSIV2Result" /> class.
43+
/// </summary>
44+
/// <param name="xMLBuffer">xMLBuffer (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.BSI_XML_V2).</param>
50+
public BSIV2Result(string xMLBuffer = default(string), int bufLength = default(int), int light = default(int), int listIdx = default(int), int pageIdx = default(int), Result resultType = Result.BSI_XML_V2) : base(bufLength, light, listIdx, pageIdx, resultType)
51+
{
52+
// to ensure "xMLBuffer" is required (not null)
53+
if (xMLBuffer == null)
54+
{
55+
throw new ArgumentNullException("xMLBuffer is a required property for BSIV2Result and cannot be null");
56+
}
57+
this.XMLBuffer = xMLBuffer;
58+
}
59+
60+
/// <summary>
61+
/// Gets or Sets XMLBuffer
62+
/// </summary>
63+
[DataMember(Name = "XML_buffer", IsRequired = true, EmitDefaultValue = true)]
64+
public string XMLBuffer { 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 BSIV2Result {\n");
74+
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
75+
sb.Append(" XMLBuffer: ").Append(XMLBuffer).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/ContainerListListInner.cs

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

362+
/// <summary>
363+
/// Initializes a new instance of the <see cref="ContainerListListInner" /> class
364+
/// with the <see cref="BSIV2Result" /> class
365+
/// </summary>
366+
/// <param name="actualInstance">An instance of BSIV2Result.</param>
367+
public ContainerListListInner(BSIV2Result actualInstance)
368+
{
369+
this.IsNullable = false;
370+
this.SchemaType= "oneOf";
371+
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
372+
}
373+
362374

363375
private Object _actualInstance;
364376

@@ -377,6 +389,10 @@ public override Object ActualInstance
377389
{
378390
this._actualInstance = value;
379391
}
392+
else if (value.GetType() == typeof(BSIV2Result) || value is BSIV2Result)
393+
{
394+
this._actualInstance = value;
395+
}
380396
else if (value.GetType() == typeof(BarcodePositionResult) || value is BarcodePositionResult)
381397
{
382398
this._actualInstance = value;
@@ -483,7 +499,7 @@ public override Object ActualInstance
483499
}
484500
else
485501
{
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");
502+
throw new ArgumentException("Invalid instance found. Must be the following types: AuthenticityResult, BSIV2Result, 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");
487503
}
488504
}
489505
}
@@ -758,6 +774,16 @@ public MDLResult GetMDLResult()
758774
return (MDLResult)this.ActualInstance;
759775
}
760776

777+
/// <summary>
778+
/// Get the actual instance of `BSIV2Result`. If the actual instance is not `BSIV2Result`,
779+
/// the InvalidClassException will be thrown
780+
/// </summary>
781+
/// <returns>An instance of BSIV2Result</returns>
782+
public BSIV2Result GetBSIV2Result()
783+
{
784+
return (BSIV2Result)this.ActualInstance;
785+
}
786+
761787
/// <summary>
762788
/// Returns the string presentation of the object
763789
/// </summary>
@@ -816,6 +842,26 @@ public static ContainerListListInner FromJson(string jsonString)
816842
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AuthenticityResult: {1}", jsonString, exception.ToString()));
817843
}
818844

845+
try
846+
{
847+
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
848+
if (typeof(BSIV2Result).GetProperty("AdditionalProperties") == null)
849+
{
850+
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<BSIV2Result>(jsonString, ContainerListListInner.SerializerSettings));
851+
}
852+
else
853+
{
854+
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<BSIV2Result>(jsonString, ContainerListListInner.AdditionalPropertiesSerializerSettings));
855+
}
856+
matchedTypes.Add("BSIV2Result");
857+
match++;
858+
}
859+
catch (Exception exception)
860+
{
861+
// deserialization failed, try the next one
862+
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BSIV2Result: {1}", jsonString, exception.ToString()));
863+
}
864+
819865
try
820866
{
821867
// 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@ee2d3fa</example>
59+
<example>[B@1b7f14f</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@ee2d3fa</example>
65+
<example>[B@1b7f14f</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@55b11357</example>
59+
<example>[B@297ad10a</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@55b11357</example>
65+
<example>[B@297ad10a</example>
6666
*/
6767
[DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)]
6868
public byte[] License { get; set; }

0 commit comments

Comments
 (0)