/*
* 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'
///
/// AccountRegisterInputModel
///
[DataContract]
public partial class AccountRegisterInputModel : IEquatable, IValidatableObject //Mark 555
{
///
/// FHT.Core.CommonTypes.Gender, FHT.Core.CommonTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
///
/// FHT.Core.CommonTypes.Gender, FHT.Core.CommonTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[DataMember(Name="Gender", EmitDefaultValue=false)]
public
GenderEnum?
Gender { get; set; }
///
/// 2. Initializes a new instance of the class.
///
[JsonConstructorAttribute]
protected AccountRegisterInputModel() { }
///
/// Not Enum: Gets or Sets Mobile
///
[DataMember(Name="Mobile", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入账号, x-display-name=账号, x-regex=^1[3456789]\\d{9}$, x-regex-regex=^1[3456789]\d{9}$, x-modifiers=[CultureInvariant]}
public string Mobile { get; set; }
///
/// Not Enum: Gets or Sets Password
///
[DataMember(Name="Password", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入密码, x-string-length=密码必须是6到20位, x-string-length-min=6, x-string-length-max=20, x-display-name=密码, x-regex=^\\S*$, x-regex-regex=^\S*$, x-modifiers=[CultureInvariant]}
public string Password { get; set; }
///
/// Not Enum: Gets or Sets Code
///
[DataMember(Name="Code", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入验证码, x-string-length=验证码必须为6位, x-string-length-min=6, x-string-length-max=6, x-display-name=验证码}
public string Code { get; set; }
///
/// Not Enum: Gets or Sets RealName
///
[DataMember(Name="RealName", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入姓名, x-display-name=姓名, x-regex=^[\\u4E00-\\u9FA5]{2,4}$, x-sensitive-word=true, x-regex-regex=^[\u4E00-\u9FA5]{2,4}$, x-modifiers=[CultureInvariant]}
public string RealName { get; set; }
///
/// Not Enum: Gets or Sets BirthYear
///
[DataMember(Name="BirthYear", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-range=出生年份必须不小于1900, x-range-min=1900, x-display-name=出生年份, x-isnullable=true}
public int? BirthYear { get; set; }
///
/// Not Enum: Gets or Sets TermsAccepted
///
[DataMember(Name="TermsAccepted", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=必须输入服务协议, x-display-name=服务协议, x-isnullable=false}
public bool? TermsAccepted { get; set; }
///
/// Not Enum: Gets or Sets Profession
///
[DataMember(Name="Profession", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入职位, x-string-length=职位必须是2到10位, x-string-length-min=2, x-string-length-max=10, x-display-name=职位, x-regex=^[A-Za-z\\u4E00-\\u9FA5]*$, x-sensitive-word=true, x-regex-regex=^[A-Za-z\u4E00-\u9FA5]*$, x-modifiers=[CultureInvariant]}
public string Profession { get; set; }
///
/// Not Enum: Gets or Sets IndustryId
///
[DataMember(Name="IndustryId", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-range=行业必须不小于1, x-range-min=1, x-display-name=行业, x-isnullable=true}
public int? IndustryId { get; set; }
///
/// Not Enum: Gets or Sets AvatarUrl
///
[DataMember(Name="AvatarUrl", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-string-length-max=200, x-display-name=头像, x-max-length=头像最长不超过200字}
public string AvatarUrl { get; set; }
///
/// Not Enum: Gets or Sets CompanyId
///
[DataMember(Name="CompanyId", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-range=公司ID必须不小于1, x-range-min=1, x-display-name=公司ID, x-isnullable=true}
public int? CompanyId { get; set; }
///
/// Not Enum: Gets or Sets CompanyName
///
[DataMember(Name="CompanyName", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入企业名称, x-string-length=企业名称必须是2到20位, x-string-length-min=2, x-string-length-max=20, x-display-name=企业名称, x-regex=^[A-Za-z\\u4E00-\\u9FA5][A-Za-z0-9\\(\\)\\(\\)\\u4E00-\\u9FA5]*$, x-sensitive-word=true, x-regex-regex=^[A-Za-z\u4E00-\u9FA5][A-Za-z0-9\(\)\(\)\u4E00-\u9FA5]*$, x-modifiers=[CultureInvariant]}
public string CompanyName { get; set; }
///
/// Not Enum: Gets or Sets Region
///
[DataMember(Name="Region", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {}
public RegionInputModel Region { 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 AccountRegisterInputModel {\n");
sb.Append(" Mobile: ").Append(Mobile).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" RealName: ").Append(RealName).Append("\n");
sb.Append(" BirthYear: ").Append(BirthYear).Append("\n");
sb.Append(" Gender: ").Append(Gender).Append("\n");
sb.Append(" TermsAccepted: ").Append(TermsAccepted).Append("\n");
sb.Append(" Profession: ").Append(Profession).Append("\n");
sb.Append(" IndustryId: ").Append(IndustryId).Append("\n");
sb.Append(" AvatarUrl: ").Append(AvatarUrl).Append("\n");
sb.Append(" CompanyId: ").Append(CompanyId).Append("\n");
sb.Append(" CompanyName: ").Append(CompanyName).Append("\n");
sb.Append(" Region: ").Append(Region).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 AccountRegisterInputModel);
}
///
/// Returns true if AccountRegisterInputModel instances are equal
///
/// Instance of AccountRegisterInputModel to be compared
/// Boolean
public bool Equals(AccountRegisterInputModel other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.Mobile == other.Mobile ||
this.Mobile != null &&
this.Mobile.Equals(other.Mobile)
) &&
(
this.Password == other.Password ||
this.Password != null &&
this.Password.Equals(other.Password)
) &&
(
this.Code == other.Code ||
this.Code != null &&
this.Code.Equals(other.Code)
) &&
(
this.RealName == other.RealName ||
this.RealName != null &&
this.RealName.Equals(other.RealName)
) &&
(
this.BirthYear == other.BirthYear ||
this.BirthYear != null &&
this.BirthYear.Equals(other.BirthYear)
) &&
(
this.Gender == other.Gender ||
this.Gender != null &&
this.Gender.Equals(other.Gender)
) &&
(
this.TermsAccepted == other.TermsAccepted ||
this.TermsAccepted != null &&
this.TermsAccepted.Equals(other.TermsAccepted)
) &&
(
this.Profession == other.Profession ||
this.Profession != null &&
this.Profession.Equals(other.Profession)
) &&
(
this.IndustryId == other.IndustryId ||
this.IndustryId != null &&
this.IndustryId.Equals(other.IndustryId)
) &&
(
this.AvatarUrl == other.AvatarUrl ||
this.AvatarUrl != null &&
this.AvatarUrl.Equals(other.AvatarUrl)
) &&
(
this.CompanyId == other.CompanyId ||
this.CompanyId != null &&
this.CompanyId.Equals(other.CompanyId)
) &&
(
this.CompanyName == other.CompanyName ||
this.CompanyName != null &&
this.CompanyName.Equals(other.CompanyName)
) &&
(
this.Region == other.Region ||
this.Region != null &&
this.Region.Equals(other.Region)
);
}
///
/// 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.Mobile != null)
hash = hash * 59 + this.Mobile.GetHashCode();
if (this.Password != null)
hash = hash * 59 + this.Password.GetHashCode();
if (this.Code != null)
hash = hash * 59 + this.Code.GetHashCode();
if (this.RealName != null)
hash = hash * 59 + this.RealName.GetHashCode();
if (this.BirthYear != null)
hash = hash * 59 + this.BirthYear.GetHashCode();
if (this.Gender != null)
hash = hash * 59 + this.Gender.GetHashCode();
if (this.TermsAccepted != null)
hash = hash * 59 + this.TermsAccepted.GetHashCode();
if (this.Profession != null)
hash = hash * 59 + this.Profession.GetHashCode();
if (this.IndustryId != null)
hash = hash * 59 + this.IndustryId.GetHashCode();
if (this.AvatarUrl != null)
hash = hash * 59 + this.AvatarUrl.GetHashCode();
if (this.CompanyId != null)
hash = hash * 59 + this.CompanyId.GetHashCode();
if (this.CompanyName != null)
hash = hash * 59 + this.CompanyName.GetHashCode();
if (this.Region != null)
hash = hash * 59 + this.Region.GetHashCode();
return hash;
}
}
public IEnumerable Validate(ValidationContext validationContext)
{
// Mobile (string) pattern
Regex regexMobile = new Regex(@"^1[3456789]\\d{9}$", RegexOptions.CultureInvariant);
if (false == regexMobile.Match(this.Mobile).Success)
{
yield return new ValidationResult(@"Invalid value for Mobile, must match a pattern of /^1[3456789]\\d{9}$/.", new [] { "Mobile" });
}
// Password (string) maxLength
if(this.Password != null && this.Password.Length > 20)
{
yield return new ValidationResult("Invalid value for Password, length must be less than 20.", new [] { "Password" });
}
// Password (string) minLength
if(this.Password != null && this.Password.Length < 6)
{
yield return new ValidationResult("Invalid value for Password, length must be greater than 6.", new [] { "Password" });
}
// Password (string) pattern
Regex regexPassword = new Regex(@"^\\S*$", RegexOptions.CultureInvariant);
if (false == regexPassword.Match(this.Password).Success)
{
yield return new ValidationResult(@"Invalid value for Password, must match a pattern of /^\\S*$/.", new [] { "Password" });
}
// Code (string) maxLength
if(this.Code != null && this.Code.Length > 6)
{
yield return new ValidationResult("Invalid value for Code, length must be less than 6.", new [] { "Code" });
}
// Code (string) minLength
if(this.Code != null && this.Code.Length < 6)
{
yield return new ValidationResult("Invalid value for Code, length must be greater than 6.", new [] { "Code" });
}
// RealName (string) pattern
Regex regexRealName = new Regex(@"^[\\u4E00-\\u9FA5]{2,4}$", RegexOptions.CultureInvariant);
if (false == regexRealName.Match(this.RealName).Success)
{
yield return new ValidationResult(@"Invalid value for RealName, must match a pattern of /^[\\u4E00-\\u9FA5]{2,4}$/.", new [] { "RealName" });
}
// BirthYear (int?) maximum
if(this.BirthYear > (int?)2147483647)
{
yield return new ValidationResult("Invalid value for BirthYear, must be a value less than or equal to 2147483647.", new [] { "BirthYear" });
}
// BirthYear (int?) minimum
if(this.BirthYear < (int?)1900)
{
yield return new ValidationResult("Invalid value for BirthYear, must be a value greater than or equal to 1900.", new [] { "BirthYear" });
}
// Profession (string) maxLength
if(this.Profession != null && this.Profession.Length > 10)
{
yield return new ValidationResult("Invalid value for Profession, length must be less than 10.", new [] { "Profession" });
}
// Profession (string) minLength
if(this.Profession != null && this.Profession.Length < 2)
{
yield return new ValidationResult("Invalid value for Profession, length must be greater than 2.", new [] { "Profession" });
}
// Profession (string) pattern
Regex regexProfession = new Regex(@"^[A-Za-z\\u4E00-\\u9FA5]*$", RegexOptions.CultureInvariant);
if (false == regexProfession.Match(this.Profession).Success)
{
yield return new ValidationResult(@"Invalid value for Profession, must match a pattern of /^[A-Za-z\\u4E00-\\u9FA5]*$/.", new [] { "Profession" });
}
// IndustryId (int?) maximum
if(this.IndustryId > (int?)2147483647)
{
yield return new ValidationResult("Invalid value for IndustryId, must be a value less than or equal to 2147483647.", new [] { "IndustryId" });
}
// IndustryId (int?) minimum
if(this.IndustryId < (int?)1)
{
yield return new ValidationResult("Invalid value for IndustryId, must be a value greater than or equal to 1.", new [] { "IndustryId" });
}
// CompanyId (int?) maximum
if(this.CompanyId > (int?)2147483647)
{
yield return new ValidationResult("Invalid value for CompanyId, must be a value less than or equal to 2147483647.", new [] { "CompanyId" });
}
// CompanyId (int?) minimum
if(this.CompanyId < (int?)1)
{
yield return new ValidationResult("Invalid value for CompanyId, must be a value greater than or equal to 1.", new [] { "CompanyId" });
}
// CompanyName (string) maxLength
if(this.CompanyName != null && this.CompanyName.Length > 20)
{
yield return new ValidationResult("Invalid value for CompanyName, length must be less than 20.", new [] { "CompanyName" });
}
// CompanyName (string) minLength
if(this.CompanyName != null && this.CompanyName.Length < 2)
{
yield return new ValidationResult("Invalid value for CompanyName, length must be greater than 2.", new [] { "CompanyName" });
}
// CompanyName (string) pattern
Regex regexCompanyName = new Regex(@"^[A-Za-z\\u4E00-\\u9FA5][A-Za-z0-9\\(\\)\\(\\)\\u4E00-\\u9FA5]*$", RegexOptions.CultureInvariant);
if (false == regexCompanyName.Match(this.CompanyName).Success)
{
yield return new ValidationResult(@"Invalid value for CompanyName, must match a pattern of /^[A-Za-z\\u4E00-\\u9FA5][A-Za-z0-9\\(\\)\\(\\)\\u4E00-\\u9FA5]*$/.", new [] { "CompanyName" });
}
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'
}