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
3 changes: 2 additions & 1 deletion .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ 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/BarCodeModuleType.cs
src/Regula.DocumentReader.WebClient/Model/BarcodePositionItem.cs
src/Regula.DocumentReader.WebClient/Model/BarcodePositionResult.cs
src/Regula.DocumentReader.WebClient/Model/BarcodeType.cs
src/Regula.DocumentReader.WebClient/Model/BcPDF417INFO.cs
src/Regula.DocumentReader.WebClient/Model/BcROIDETECT.cs
Expand Down Expand Up @@ -191,7 +193,6 @@ src/Regula.DocumentReader.WebClient/Model/RfidCertificateType.cs
src/Regula.DocumentReader.WebClient/Model/RfidDG1.cs
src/Regula.DocumentReader.WebClient/Model/RfidDataFile.cs
src/Regula.DocumentReader.WebClient/Model/RfidDataFileType.cs
src/Regula.DocumentReader.WebClient/Model/RfidDataGroupTypeTag.cs
src/Regula.DocumentReader.WebClient/Model/RfidDistinguishedName.cs
src/Regula.DocumentReader.WebClient/Model/RfidLocation.cs
src/Regula.DocumentReader.WebClient/Model/RfidOrigin.cs
Expand Down
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>
/// BarcodePositionItem
/// </summary>
[DataContract(Name = "BarcodePositionItem")]
public partial class BarcodePositionItem : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="BarcodePositionItem" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BarcodePositionItem() { }
/// <summary>
/// Initializes a new instance of the <see cref="BarcodePositionItem" /> class.
/// </summary>
/// <param name="barcodePosition">barcodePosition (required).</param>
public BarcodePositionItem(DocumentPosition barcodePosition = default(DocumentPosition))
{
// to ensure "barcodePosition" is required (not null)
if (barcodePosition == null)
{
throw new ArgumentNullException("barcodePosition is a required property for BarcodePositionItem and cannot be null");
}
this.BarcodePosition = barcodePosition;
}

/// <summary>
/// Gets or Sets BarcodePosition
/// </summary>
[DataMember(Name = "BarcodePosition", IsRequired = true, EmitDefaultValue = true)]
public DocumentPosition BarcodePosition { 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 BarcodePositionItem {\n");
sb.Append(" BarcodePosition: ").Append(BarcodePosition).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/BarcodePositionResult.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>
/// Contains information about barcode position on the input image, its center, angle, etc
/// </summary>
[DataContract(Name = "BarcodePositionResult")]
public partial class BarcodePositionResult : ResultItem, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="BarcodePositionResult" /> class.
/// </summary>
[JsonConstructorAttribute]
protected BarcodePositionResult() { }
/// <summary>
/// Initializes a new instance of the <see cref="BarcodePositionResult" /> class.
/// </summary>
/// <param name="barcodePosition">barcodePosition (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.BARCODE_POSITION).</param>
public BarcodePositionResult(DocumentPosition barcodePosition = default(DocumentPosition), int bufLength = default(int), int light = default(int), int listIdx = default(int), int pageIdx = default(int), Result resultType = Result.BARCODE_POSITION) : base(bufLength, light, listIdx, pageIdx, resultType)
{
// to ensure "barcodePosition" is required (not null)
if (barcodePosition == null)
{
throw new ArgumentNullException("barcodePosition is a required property for BarcodePositionResult and cannot be null");
}
this.BarcodePosition = barcodePosition;
}

/// <summary>
/// Gets or Sets BarcodePosition
/// </summary>
[DataMember(Name = "BarcodePosition", IsRequired = true, EmitDefaultValue = true)]
public DocumentPosition BarcodePosition { 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 BarcodePositionResult {\n");
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
sb.Append(" BarcodePosition: ").Append(BarcodePosition).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/BarcodePositionResult.cs

View workflow job for this annotation

GitHub Actions / run_smoke_test

'BarcodePositionResult.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 @@ -167,6 +167,18 @@ public ContainerListListInner(ImageQualityResult 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="BarcodePositionResult" /> class
/// </summary>
/// <param name="actualInstance">An instance of BarcodePositionResult.</param>
public ContainerListListInner(BarcodePositionResult actualInstance)
{
this.IsNullable = false;
this.SchemaType= "oneOf";
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="DocumentPositionResult" /> class
Expand Down Expand Up @@ -329,6 +341,10 @@ public override Object ActualInstance
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(BarcodePositionResult) || value is BarcodePositionResult)
{
this._actualInstance = value;
}
else if (value.GetType() == typeof(ByteArrayResult) || value is ByteArrayResult)
{
this._actualInstance = value;
Expand Down Expand Up @@ -419,7 +435,7 @@ public override Object ActualInstance
}
else
{
throw new ArgumentException("Invalid instance found. Must be the following types: AuthenticityResult, ByteArrayResult, ChosenDocumentTypeResult, DocBarCodeInfo, DocumentBinaryInfoResult, DocumentImageResult, DocumentPositionResult, DocumentTypesCandidatesResult, EncryptedRCLResult, FaceDetectionResult, GraphicsResult, ImageQualityResult, ImagesResult, LexicalAnalysisResult, LicenseResult, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult");
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");
}
}
}
Expand Down Expand Up @@ -534,6 +550,16 @@ public ImageQualityResult GetImageQualityResult()
return (ImageQualityResult)this.ActualInstance;
}

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

/// <summary>
/// Get the actual instance of `DocumentPositionResult`. If the actual instance is not `DocumentPositionResult`,
/// the InvalidClassException will be thrown
Expand Down Expand Up @@ -712,6 +738,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(BarcodePositionResult).GetProperty("AdditionalProperties") == null)
{
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<BarcodePositionResult>(jsonString, ContainerListListInner.SerializerSettings));
}
else
{
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<BarcodePositionResult>(jsonString, ContainerListListInner.AdditionalPropertiesSerializerSettings));
}
matchedTypes.Add("BarcodePositionResult");
match++;
}
catch (Exception exception)
{
// deserialization failed, try the next one
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into BarcodePositionResult: {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 @@ -46,8 +46,8 @@ protected DocumentPositionResult() { }
/// <param name="light">light.</param>
/// <param name="listIdx">listIdx.</param>
/// <param name="pageIdx">pageIdx.</param>
/// <param name="resultType">resultType (required) (default to Result.BARCODE_POSITION).</param>
public DocumentPositionResult(DocumentPosition documentPosition = default(DocumentPosition), int bufLength = default(int), int light = default(int), int listIdx = default(int), int pageIdx = default(int), Result resultType = Result.BARCODE_POSITION) : base(bufLength, light, listIdx, pageIdx, resultType)
/// <param name="resultType">resultType (required) (default to Result.DOCUMENT_POSITION).</param>
public DocumentPositionResult(DocumentPosition documentPosition = default(DocumentPosition), int bufLength = default(int), int light = default(int), int listIdx = default(int), int pageIdx = default(int), Result resultType = Result.DOCUMENT_POSITION) : base(bufLength, light, listIdx, pageIdx, resultType)
{
// to ensure "documentPosition" is required (not null)
if (documentPosition == null)
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@449b4f85</example>
<example>[B@1c224bac</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@449b4f85</example>
<example>[B@1c224bac</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@769d7d5d</example>
<example>[B@4333699a</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@769d7d5d</example>
<example>[B@4333699a</example>
*/
[DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)]
public byte[] License { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Regula.DocumentReader.WebClient/Model/ResultItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Regula.DocumentReader.WebClient.Model
[JsonSubtypes.KnownSubType(typeof(LicenseResult), "50")]
[JsonSubtypes.KnownSubType(typeof(GraphicsResult), "6")]
[JsonSubtypes.KnownSubType(typeof(MRZPositionResult), "61")]
[JsonSubtypes.KnownSubType(typeof(DocumentPositionResult), "62")]
[JsonSubtypes.KnownSubType(typeof(BarcodePositionResult), "62")]
[JsonSubtypes.KnownSubType(typeof(MRZTestQualityResult), "7")]
[JsonSubtypes.KnownSubType(typeof(DocumentTypesCandidatesResult), "8")]
[JsonSubtypes.KnownSubType(typeof(DocumentPositionResult), "85")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ namespace Regula.DocumentReader.WebClient.Model
public enum RfidApplicationType
{
/// <summary>
/// Enum UNSPECIFIED for value: 0
/// Enum ROOT_FILES for value: 0
/// </summary>
UNSPECIFIED = 0,
ROOT_FILES = 0,

/// <summary>
/// Enum E_PASSPORT for value: 1
Expand Down Expand Up @@ -75,12 +75,7 @@ public enum RfidApplicationType
/// <summary>
/// Enum eDTC_PC for value: 8
/// </summary>
eDTC_PC = 8,

/// <summary>
/// Enum ROOT_FILES for value: 0
/// </summary>
ROOT_FILES = 0
eDTC_PC = 8
}

}
Loading
Loading