/* * FHT.Core.API 1.0 * * ̨group.apiVersion:1.0 * * OpenAPI spec version: v1 * Contact: fht@fht360.com * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using System; using System.Linq; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; namespace IO.Swagger.Model { #pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' /// /// AuthenticationInputModel /// [DataContract] public partial class AuthenticationInputModel : IEquatable, IValidatableObject //Mark 555 { /// /// FHT.Core.CommonTypes.ProcessingStatus, FHT.Core.CommonTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null /// /// FHT.Core.CommonTypes.ProcessingStatus, FHT.Core.CommonTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [DataMember(Name="Status", EmitDefaultValue=false)] public ProcessingStatusEnum? Status { get; set; } /// /// 2. Initializes a new instance of the class. /// [JsonConstructorAttribute] protected AuthenticationInputModel() { } /// /// Not Enum: Gets or Sets AuthenticationId /// [DataMember(Name="AuthenticationId", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-range=必须不小于1, x-range-min=1, x-isnullable=true} public int? AuthenticationId { get; set; } /// /// Not Enum: Gets or Sets RealName /// [DataMember(Name="RealName", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入申请人, x-string-length=申请人长度必须为1到5个字符, x-string-length-min=1, x-string-length-max=5, x-display-name=申请人} public string RealName { get; set; } /// /// Not Enum: Gets or Sets IdCardNumber /// [DataMember(Name="IdCardNumber", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入身份证号, x-display-name=身份证号, x-regex=^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$|^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X|x)$, x-regex-regex=^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$, x-modifiers=[CultureInvariant]} public string IdCardNumber { get; set; } /// /// Not Enum: Gets or Sets PhotoIdUrl /// [DataMember(Name="PhotoIdUrl", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入身份证附件, x-min-length=Impossible, x-string-length-min=2, x-display-name=身份证附件} public string PhotoIdUrl { get; set; } /// /// Not Enum: Gets or Sets BackPhotoIdUrl /// [DataMember(Name="BackPhotoIdUrl", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入身份证背面附件, x-min-length=Impossible, x-string-length-min=2, x-display-name=身份证背面附件} public string BackPhotoIdUrl { get; set; } /// /// Not Enum: Gets or Sets LicenseNo /// [DataMember(Name="LicenseNo", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入营业执照号, x-display-name=营业执照号, x-regex=^[0-9]{15}$|^[0-9]{18}$, x-regex-regex=^[0-9]{15}$|^[0-9]{18}$, x-modifiers=[CultureInvariant]} public string LicenseNo { get; set; } /// /// Not Enum: Gets or Sets LicenseUrl /// [DataMember(Name="LicenseUrl", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入营业执照附件, x-min-length=Impossible, x-string-length-min=2, x-display-name=营业执照附件} public string LicenseUrl { get; set; } /// /// Not Enum: Gets or Sets Capital /// [DataMember(Name="Capital", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入注册资金, x-range=注册资金必须不小于1, x-range-min=1, x-display-name=注册资金, x-regex=注册资金必须为数字, x-isnullable=true, x-regex-regex=^[0-9]*$} public int? Capital { get; set; } /// /// Returns the string presentation of the object /// /// String presentation of the object public override string ToString() { var sb = new StringBuilder(); sb.Append("class AuthenticationInputModel {\n"); sb.Append(" AuthenticationId: ").Append(AuthenticationId).Append("\n"); sb.Append(" RealName: ").Append(RealName).Append("\n"); sb.Append(" IdCardNumber: ").Append(IdCardNumber).Append("\n"); sb.Append(" PhotoIdUrl: ").Append(PhotoIdUrl).Append("\n"); sb.Append(" BackPhotoIdUrl: ").Append(BackPhotoIdUrl).Append("\n"); sb.Append(" LicenseNo: ").Append(LicenseNo).Append("\n"); sb.Append(" LicenseUrl: ").Append(LicenseUrl).Append("\n"); sb.Append(" Capital: ").Append(Capital).Append("\n"); sb.Append(" Status: ").Append(Status).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } /// /// Returns true if objects are equal /// /// Object to be compared /// Boolean public override bool Equals(object obj) { // credit: http://stackoverflow.com/a/10454552/677735 return this.Equals(obj as AuthenticationInputModel); } /// /// Returns true if AuthenticationInputModel instances are equal /// /// Instance of AuthenticationInputModel to be compared /// Boolean public bool Equals(AuthenticationInputModel other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) return false; return ( this.AuthenticationId == other.AuthenticationId || this.AuthenticationId != null && this.AuthenticationId.Equals(other.AuthenticationId) ) && ( this.RealName == other.RealName || this.RealName != null && this.RealName.Equals(other.RealName) ) && ( this.IdCardNumber == other.IdCardNumber || this.IdCardNumber != null && this.IdCardNumber.Equals(other.IdCardNumber) ) && ( this.PhotoIdUrl == other.PhotoIdUrl || this.PhotoIdUrl != null && this.PhotoIdUrl.Equals(other.PhotoIdUrl) ) && ( this.BackPhotoIdUrl == other.BackPhotoIdUrl || this.BackPhotoIdUrl != null && this.BackPhotoIdUrl.Equals(other.BackPhotoIdUrl) ) && ( this.LicenseNo == other.LicenseNo || this.LicenseNo != null && this.LicenseNo.Equals(other.LicenseNo) ) && ( this.LicenseUrl == other.LicenseUrl || this.LicenseUrl != null && this.LicenseUrl.Equals(other.LicenseUrl) ) && ( this.Capital == other.Capital || this.Capital != null && this.Capital.Equals(other.Capital) ) && ( this.Status == other.Status || this.Status != null && this.Status.Equals(other.Status) ); } /// /// Gets the hash code /// /// Hash code public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks etc, of course :) if (this.AuthenticationId != null) hash = hash * 59 + this.AuthenticationId.GetHashCode(); if (this.RealName != null) hash = hash * 59 + this.RealName.GetHashCode(); if (this.IdCardNumber != null) hash = hash * 59 + this.IdCardNumber.GetHashCode(); if (this.PhotoIdUrl != null) hash = hash * 59 + this.PhotoIdUrl.GetHashCode(); if (this.BackPhotoIdUrl != null) hash = hash * 59 + this.BackPhotoIdUrl.GetHashCode(); if (this.LicenseNo != null) hash = hash * 59 + this.LicenseNo.GetHashCode(); if (this.LicenseUrl != null) hash = hash * 59 + this.LicenseUrl.GetHashCode(); if (this.Capital != null) hash = hash * 59 + this.Capital.GetHashCode(); if (this.Status != null) hash = hash * 59 + this.Status.GetHashCode(); return hash; } } public IEnumerable Validate(ValidationContext validationContext) { // AuthenticationId (int?) maximum if(this.AuthenticationId > (int?)2147483647) { yield return new ValidationResult("Invalid value for AuthenticationId, must be a value less than or equal to 2147483647.", new [] { "AuthenticationId" }); } // AuthenticationId (int?) minimum if(this.AuthenticationId < (int?)1) { yield return new ValidationResult("Invalid value for AuthenticationId, must be a value greater than or equal to 1.", new [] { "AuthenticationId" }); } // RealName (string) maxLength if(this.RealName != null && this.RealName.Length > 5) { yield return new ValidationResult("Invalid value for RealName, length must be less than 5.", new [] { "RealName" }); } // RealName (string) minLength if(this.RealName != null && this.RealName.Length < 1) { yield return new ValidationResult("Invalid value for RealName, length must be greater than 1.", new [] { "RealName" }); } // IdCardNumber (string) pattern Regex regexIdCardNumber = new Regex(@"^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$|^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X|x)$", RegexOptions.CultureInvariant); if (false == regexIdCardNumber.Match(this.IdCardNumber).Success) { yield return new ValidationResult(@"Invalid value for IdCardNumber, must match a pattern of /^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$|^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X|x)$/.", new [] { "IdCardNumber" }); } // LicenseNo (string) pattern Regex regexLicenseNo = new Regex(@"^[0-9]{15}$|^[0-9]{18}$", RegexOptions.CultureInvariant); if (false == regexLicenseNo.Match(this.LicenseNo).Success) { yield return new ValidationResult(@"Invalid value for LicenseNo, must match a pattern of /^[0-9]{15}$|^[0-9]{18}$/.", new [] { "LicenseNo" }); } // Capital (int?) maximum if(this.Capital > (int?)2147483647) { yield return new ValidationResult("Invalid value for Capital, must be a value less than or equal to 2147483647.", new [] { "Capital" }); } // Capital (int?) minimum if(this.Capital < (int?)1) { yield return new ValidationResult("Invalid value for Capital, must be a value greater than or equal to 1.", new [] { "Capital" }); } yield break; } } #pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' }