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 @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,18 @@ public ContainerListListInner(VDSDataResult 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="MDLResult" /> class
/// </summary>
/// <param name="actualInstance">An instance of MDLResult.</param>
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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}
}
}
Expand Down Expand Up @@ -732,6 +748,16 @@ public VDSDataResult GetVDSDataResult()
return (VDSDataResult)this.ActualInstance;
}

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

/// <summary>
/// Returns the string presentation of the object
/// </summary>
Expand Down Expand Up @@ -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<MDLResult>(jsonString, ContainerListListInner.SerializerSettings));
}
else
{
newContainerListListInner = new ContainerListListInner(JsonConvert.DeserializeObject<MDLResult>(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
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@27e6ab90</example>
<example>[B@15773356</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@27e6ab90</example>
<example>[B@15773356</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@5713fdbb</example>
<example>[B@65112c5d</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@5713fdbb</example>
<example>[B@65112c5d</example>
*/
[DataMember(Name = "License", IsRequired = true, EmitDefaultValue = true)]
public byte[] License { get; set; }
Expand Down
93 changes: 93 additions & 0 deletions src/Regula.DocumentReader.WebClient/Model/MDLItem.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>
/// MDLItem
/// </summary>
[DataContract(Name = "MDLItem")]
public partial class MDLItem : IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="MDLItem" /> class.
/// </summary>
[JsonConstructorAttribute]
protected MDLItem() { }
/// <summary>
/// Initializes a new instance of the <see cref="MDLItem" /> class.
/// </summary>
/// <param name="mDLParsedResponse">mDLParsedResponse (required).</param>
public MDLItem(Dictionary<string, Object> mDLParsedResponse = default(Dictionary<string, Object>))
{
// 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;
}

/// <summary>
/// Gets or Sets MDLParsedResponse
/// </summary>
[DataMember(Name = "MDLParsedResponse", IsRequired = true, EmitDefaultValue = true)]
public Dictionary<string, Object> MDLParsedResponse { 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 MDLItem {\n");
sb.Append(" MDLParsedResponse: ").Append(MDLParsedResponse).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/MDLResult.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>
/// MDLResult
/// </summary>
[DataContract(Name = "MDLResult")]
public partial class MDLResult : ResultItem, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="MDLResult" /> class.
/// </summary>
[JsonConstructorAttribute]
protected MDLResult() { }
/// <summary>
/// Initializes a new instance of the <see cref="MDLResult" /> class.
/// </summary>
/// <param name="mDLParsedResponse">mDLParsedResponse (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.MDL_DEVICE_PARSED_RESPONSE).</param>
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)
{
// 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;
}

/// <summary>
/// Gets or Sets MDLParsedResponse
/// </summary>
[DataMember(Name = "MDLParsedResponse", IsRequired = true, EmitDefaultValue = true)]
public Dictionary<string, Object> MDLParsedResponse { 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 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();
}

/// <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)
{
foreach (var x in base.BaseValidate(validationContext))
{
yield return x;
}
yield break;
}
}

}
1 change: 1 addition & 0 deletions src/Regula.DocumentReader.WebClient/Model/ResultItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
Loading