diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 55e0511..2a27cfb 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -135,6 +135,8 @@ src/Regula.DocumentReader.WebClient/Model/LivenessParams.cs src/Regula.DocumentReader.WebClient/Model/LogLevel.cs src/Regula.DocumentReader.WebClient/Model/MDLDeviceEngagement.cs src/Regula.DocumentReader.WebClient/Model/MDLDeviceRetrieval.cs +src/Regula.DocumentReader.WebClient/Model/MDLItem.cs +src/Regula.DocumentReader.WebClient/Model/MDLResult.cs src/Regula.DocumentReader.WebClient/Model/MDLServerRetrieval.cs src/Regula.DocumentReader.WebClient/Model/MRZDetectorResult.cs src/Regula.DocumentReader.WebClient/Model/MRZFormat.cs diff --git a/src/Regula.DocumentReader.WebClient/Model/ContainerListListInner.cs b/src/Regula.DocumentReader.WebClient/Model/ContainerListListInner.cs index 3be3e9b..ebc6a02 100644 --- a/src/Regula.DocumentReader.WebClient/Model/ContainerListListInner.cs +++ b/src/Regula.DocumentReader.WebClient/Model/ContainerListListInner.cs @@ -347,6 +347,18 @@ public ContainerListListInner(VDSDataResult actualInstance) this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); } + /// + /// Initializes a new instance of the class + /// with the class + /// + /// An instance of MDLResult. + public ContainerListListInner(MDLResult actualInstance) + { + this.IsNullable = false; + this.SchemaType= "oneOf"; + this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null."); + } + private Object _actualInstance; @@ -425,6 +437,10 @@ public override Object ActualInstance { this._actualInstance = value; } + else if (value.GetType() == typeof(MDLResult) || value is MDLResult) + { + this._actualInstance = value; + } else if (value.GetType() == typeof(MRZDetectorResult) || value is MRZDetectorResult) { this._actualInstance = value; @@ -467,7 +483,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, MRZDetectorResult, MRZPositionResult, MRZTestQualityResult, RFIDGraphicsInfoResult, RFIDTextDataResult, StatusResult, TextDataResult, TextResult, VDSDataResult, VDSNCDataResult"); + 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"); } } } @@ -732,6 +748,16 @@ public VDSDataResult GetVDSDataResult() return (VDSDataResult)this.ActualInstance; } + /// + /// Get the actual instance of `MDLResult`. If the actual instance is not `MDLResult`, + /// the InvalidClassException will be thrown + /// + /// An instance of MDLResult + public MDLResult GetMDLResult() + { + return (MDLResult)this.ActualInstance; + } + /// /// Returns the string presentation of the object /// @@ -1090,6 +1116,26 @@ public static ContainerListListInner FromJson(string jsonString) System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into LicenseResult: {1}", jsonString, exception.ToString())); } + try + { + // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize + if (typeof(MDLResult).GetProperty("AdditionalProperties") == null) + { + newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject(jsonString, ContainerListListInner.SerializerSettings)); + } + else + { + newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject(jsonString, ContainerListListInner.AdditionalPropertiesSerializerSettings)); + } + matchedTypes.Add("MDLResult"); + match++; + } + catch (Exception exception) + { + // deserialization failed, try the next one + System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into MDLResult: {1}", jsonString, exception.ToString())); + } + try { // if it does not contains "AdditionalProperties", use SerializerSettings to deserialize diff --git a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs index 97df41c..73a7483 100644 --- a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs +++ b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLItem.cs @@ -56,7 +56,7 @@ protected EncryptedRCLItem() { } /// /// Base64 encoded data /* - [B@27e6ab90 + [B@15773356 */ [DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)] public byte[] EncryptedRCL { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs index 3c0645a..34b3dba 100644 --- a/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs +++ b/src/Regula.DocumentReader.WebClient/Model/EncryptedRCLResult.cs @@ -62,7 +62,7 @@ protected EncryptedRCLResult() { } /// /// Base64 encoded data /* - [B@27e6ab90 + [B@15773356 */ [DataMember(Name = "EncryptedRCL", IsRequired = true, EmitDefaultValue = true)] public byte[] EncryptedRCL { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs b/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs index e0d9e24..822774d 100644 --- a/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs +++ b/src/Regula.DocumentReader.WebClient/Model/LicenseItem.cs @@ -56,7 +56,7 @@ protected LicenseItem() { } /// /// Base64 encoded data /* - [B@5713fdbb + [B@65112c5d */ [DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)] public byte[] License { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs b/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs index 13a3e9b..5b49f95 100644 --- a/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs +++ b/src/Regula.DocumentReader.WebClient/Model/LicenseResult.cs @@ -62,7 +62,7 @@ protected LicenseResult() { } /// /// Base64 encoded data /* - [B@5713fdbb + [B@65112c5d */ [DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)] public byte[] License { get; set; } diff --git a/src/Regula.DocumentReader.WebClient/Model/MDLItem.cs b/src/Regula.DocumentReader.WebClient/Model/MDLItem.cs new file mode 100644 index 0000000..746c53a --- /dev/null +++ b/src/Regula.DocumentReader.WebClient/Model/MDLItem.cs @@ -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 +{ + /// + /// MDLItem + /// + [DataContract(Name = "MDLItem")] + public partial class MDLItem : IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MDLItem() { } + /// + /// Initializes a new instance of the class. + /// + /// mDLParsedResponse (required). + public MDLItem(Dictionary mDLParsedResponse = default(Dictionary)) + { + // to ensure "mDLParsedResponse" is required (not null) + if (mDLParsedResponse == null) + { + throw new ArgumentNullException("mDLParsedResponse is a required property for MDLItem and cannot be null"); + } + this.MDLParsedResponse = mDLParsedResponse; + } + + /// + /// Gets or Sets MDLParsedResponse + /// + [DataMember(Name = "MDLParsedResponse", IsRequired = true, EmitDefaultValue = true)] + public Dictionary MDLParsedResponse { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MDLItem {\n"); + sb.Append(" MDLParsedResponse: ").Append(MDLParsedResponse).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public virtual string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + yield break; + } + } + +} diff --git a/src/Regula.DocumentReader.WebClient/Model/MDLResult.cs b/src/Regula.DocumentReader.WebClient/Model/MDLResult.cs new file mode 100644 index 0000000..1b4298e --- /dev/null +++ b/src/Regula.DocumentReader.WebClient/Model/MDLResult.cs @@ -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 +{ + /// + /// MDLResult + /// + [DataContract(Name = "MDLResult")] + public partial class MDLResult : ResultItem, IValidatableObject + { + /// + /// Initializes a new instance of the class. + /// + [JsonConstructorAttribute] + protected MDLResult() { } + /// + /// Initializes a new instance of the class. + /// + /// mDLParsedResponse (required). + /// bufLength. + /// light. + /// listIdx. + /// pageIdx. + /// resultType (required) (default to Result.MDL_DEVICE_PARSED_RESPONSE). + public MDLResult(Dictionary mDLParsedResponse = default(Dictionary), 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) + { + // to ensure "mDLParsedResponse" is required (not null) + if (mDLParsedResponse == null) + { + throw new ArgumentNullException("mDLParsedResponse is a required property for MDLResult and cannot be null"); + } + this.MDLParsedResponse = mDLParsedResponse; + } + + /// + /// Gets or Sets MDLParsedResponse + /// + [DataMember(Name = "MDLParsedResponse", IsRequired = true, EmitDefaultValue = true)] + public Dictionary MDLParsedResponse { get; set; } + + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("class MDLResult {\n"); + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); + sb.Append(" MDLParsedResponse: ").Append(MDLParsedResponse).Append("\n"); + sb.Append("}\n"); + return sb.ToString(); + } + + /// + /// Returns the JSON string presentation of the object + /// + /// JSON string presentation of the object + public override string ToJson() + { + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + return this.BaseValidate(validationContext); + } + + /// + /// To validate all properties of the instance + /// + /// Validation context + /// Validation Result + protected IEnumerable BaseValidate(ValidationContext validationContext) + { + foreach (var x in base.BaseValidate(validationContext)) + { + yield return x; + } + yield break; + } + } + +} diff --git a/src/Regula.DocumentReader.WebClient/Model/ResultItem.cs b/src/Regula.DocumentReader.WebClient/Model/ResultItem.cs index c8d0095..76b9ef1 100644 --- a/src/Regula.DocumentReader.WebClient/Model/ResultItem.cs +++ b/src/Regula.DocumentReader.WebClient/Model/ResultItem.cs @@ -39,6 +39,7 @@ namespace Regula.DocumentReader.WebClient.Model [JsonSubtypes.KnownSubType(typeof(DocumentBinaryInfoResult), "104")] [JsonSubtypes.KnownSubType(typeof(RFIDGraphicsInfoResult), "105")] [JsonSubtypes.KnownSubType(typeof(ByteArrayResult), "109")] + [JsonSubtypes.KnownSubType(typeof(MDLResult), "121")] [JsonSubtypes.KnownSubType(typeof(VDSNCDataResult), "124")] [JsonSubtypes.KnownSubType(typeof(VDSDataResult), "125")] [JsonSubtypes.KnownSubType(typeof(LexicalAnalysisResult), "15")]