Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ src/Regula.DocumentReader.WebClient/Model/AuthenticityCheckResultItem.cs
src/Regula.DocumentReader.WebClient/Model/AuthenticityCheckResultListInner.cs
src/Regula.DocumentReader.WebClient/Model/AuthenticityResult.cs
src/Regula.DocumentReader.WebClient/Model/AuthenticityResultType.cs
src/Regula.DocumentReader.WebClient/Model/BSIV2Item.cs
src/Regula.DocumentReader.WebClient/Model/BSIV2Result.cs
src/Regula.DocumentReader.WebClient/Model/BarCodeModuleType.cs
src/Regula.DocumentReader.WebClient/Model/BarcodePositionItem.cs
src/Regula.DocumentReader.WebClient/Model/BarcodePositionResult.cs
Expand Down
93 changes: 93 additions & 0 deletions src/Regula.DocumentReader.WebClient/Model/BSIV2Item.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Regula Document Reader Web API
*
* 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
*
* The version of the OpenAPI document: 8.1.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using FileParameter = Regula.DocumentReader.WebClient.Client.FileParameter;
using OpenAPIDateConverter = Regula.DocumentReader.WebClient.Client.OpenAPIDateConverter;

namespace Regula.DocumentReader.WebClient.Model
{
/// <summary>
/// BSIV2Item
/// </summary>
[DataContract(Name = "BSIV2Item")]
public partial class BSIV2Item : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="BSIV2Item" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BSIV2Item() { }
/// <summary>
/// Initializes a new instance of the <see cref="BSIV2Item" /> class.
/// </summary>
/// <param name="xMLBuffer">xMLBuffer (required).</param>
public BSIV2Item(string xMLBuffer = default(string))
{
// to ensure "xMLBuffer" is required (not null)
if (xMLBuffer == null)
{
throw new ArgumentNullException("xMLBuffer is a required property for BSIV2Item and cannot be null");
}
this.XMLBuffer = xMLBuffer;
}

/// <summary>
/// Gets or Sets XMLBuffer
/// </summary>
[DataMember(Name = "XML_buffer", IsRequired = true, EmitDefaultValue = true)]
public string XMLBuffer { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class BSIV2Item {\n");
sb.Append(" XMLBuffer: ").Append(XMLBuffer).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}

}
114 changes: 114 additions & 0 deletions src/Regula.DocumentReader.WebClient/Model/BSIV2Result.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Regula Document Reader Web API
*
* 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
*
* The version of the OpenAPI document: 8.1.0
* Generated by: https://github.com/openapitools/openapi-generator.git
*/


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using JsonSubTypes;
using System.ComponentModel.DataAnnotations;
using FileParameter = Regula.DocumentReader.WebClient.Client.FileParameter;
using OpenAPIDateConverter = Regula.DocumentReader.WebClient.Client.OpenAPIDateConverter;

namespace Regula.DocumentReader.WebClient.Model
{
/// <summary>
/// BSIV2Result
/// </summary>
[DataContract(Name = "BSIV2Result")]
public partial class BSIV2Result : ResultItem, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="BSIV2Result" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BSIV2Result() { }
/// <summary>
/// Initializes a new instance of the <see cref="BSIV2Result" /> class.
/// </summary>
/// <param name="xMLBuffer">xMLBuffer (required).</param>
/// <param name="bufLength">bufLength.</param>
/// <param name="light">light.</param>
/// <param name="listIdx">listIdx.</param>
/// <param name="pageIdx">pageIdx.</param>
/// <param name="resultType">resultType (required) (default to Result.BSI_XML_V2).</param>
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)
{
// to ensure "xMLBuffer" is required (not null)
if (xMLBuffer == null)
{
throw new ArgumentNullException("xMLBuffer is a required property for BSIV2Result and cannot be null");
}
this.XMLBuffer = xMLBuffer;
}

/// <summary>
/// Gets or Sets XMLBuffer
/// </summary>
[DataMember(Name = "XML_buffer", IsRequired = true, EmitDefaultValue = true)]
public string XMLBuffer { get; set; }

/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append("class BSIV2Result {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" XMLBuffer: ").Append(XMLBuffer).Append("\n");
sb.Append("}\n");
return sb.ToString();
}

/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public override string ToJson()
{
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
}

/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
return this.BaseValidate(validationContext);
}

/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
protected IEnumerable<ValidationResult> BaseValidate(ValidationContext validationContext)

Check warning on line 104 in src/Regula.DocumentReader.WebClient/Model/BSIV2Result.cs

View workflow job for this annotation

GitHub Actions / run_smoke_test

'BSIV2Result.BaseValidate(ValidationContext)' hides inherited member 'ResultItem.BaseValidate(ValidationContext)'. Use the new keyword if hiding was intended.
{
foreach (var x in base.BaseValidate(validationContext))
{
yield return x;
}
yield break;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,18 @@ public ContainerListListInner(MDLResult actualInstance)
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
}

/// <summary>
/// Initializes a new instance of the <see cref="ContainerListListInner" /> class
/// with the <see cref="BSIV2Result" /> class
/// </summary>
/// <param name="actualInstance">An instance of BSIV2Result.</param>
public ContainerListListInner(BSIV2Result actualInstance)
{
this.IsNullable = false;
this.SchemaType= "oneOf";
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
}


private Object _actualInstance;

Expand All @@ -377,6 +389,10 @@ public override Object ActualInstance
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(BSIV2Result) || value is BSIV2Result)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(BarcodePositionResult) || value is BarcodePositionResult)
{
this._actualInstance = value;
Expand Down Expand Up @@ -483,7 +499,7 @@ public override Object ActualInstance
}
else
{
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");
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");
}
}
}
Expand Down Expand Up @@ -758,6 +774,16 @@ public MDLResult GetMDLResult()
return (MDLResult)this.ActualInstance;
}

/// <summary>
/// Get the actual instance of `BSIV2Result`. If the actual instance is not `BSIV2Result`,
/// the InvalidClassException will be thrown
/// </summary>
/// <returns>An instance of BSIV2Result</returns>
public BSIV2Result GetBSIV2Result()
{
return (BSIV2Result)this.ActualInstance;
}

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand Down Expand Up @@ -816,6 +842,26 @@ public static ContainerListListInner FromJson(string jsonString)
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into AuthenticityResult: {1}", jsonString, exception.ToString()));
}

try
{
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
if (typeof(BSIV2Result).GetProperty("AdditionalProperties") == null)
{
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<BSIV2Result>(jsonString, ContainerListListInner.SerializerSettings));
}
else
{
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<BSIV2Result>(jsonString, ContainerListListInner.AdditionalPropertiesSerializerSettings));
}
matchedTypes.Add("BSIV2Result");
match++;
}
catch (Exception exception)
{
// deserialization failed, try the next one
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BSIV2Result: {1}", jsonString, exception.ToString()));
}

try
{
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected EncryptedRCLItem() { }
/// </summary>
/// <value>Base64 encoded data</value>
/*
<example>[B@ee2d3fa</example>
<example>[B@1b7f14f</example>
*/
[DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)]
public byte[] EncryptedRCL { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
/// </summary>
/// <value>Base64 encoded data</value>
/*
<example>[B@ee2d3fa</example>
<example>[B@1b7f14f</example>
*/
[DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)]
public byte[] EncryptedRCL { get; set; }
Expand Down Expand Up @@ -105,7 +105,7 @@
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
protected IEnumerable<ValidationResult> BaseValidate(ValidationContext validationContext)

Check warning on line 108 in src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs

View workflow job for this annotation

GitHub Actions / run_smoke_test

'EncryptedRCLResult.BaseValidate(ValidationContext)' hides inherited member 'ResultItem.BaseValidate(ValidationContext)'. Use the new keyword if hiding was intended.
{
foreach (var x in base.BaseValidate(validationContext))
{
Expand Down
2 changes: 1 addition & 1 deletion src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected LicenseItem() { }
/// </summary>
/// <value>Base64 encoded data</value>
/*
<example>[B@55b11357</example>
<example>[B@297ad10a</example>
*/
[DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)]
public byte[] License { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected LicenseResult() { }
/// </summary>
/// <value>Base64 encoded data</value>
/*
<example>[B@55b11357</example>
<example>[B@297ad10a</example>
*/
[DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)]
public byte[] License { get; set; }
Expand Down
Loading
Loading