/*
* 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'
///
/// ChangeUserPasswordInputModel
///
[DataContract]
public partial class ChangeUserPasswordInputModel : IEquatable, IValidatableObject //Mark 555
{
///
/// 2. Initializes a new instance of the class.
///
[JsonConstructorAttribute]
protected ChangeUserPasswordInputModel() { }
///
/// Not Enum: Gets or Sets OldPassword
///
[DataMember(Name="OldPassword", 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=旧密码}
public string OldPassword { get; set; }
///
/// Not Enum: Gets or Sets NewPassword
///
[DataMember(Name="NewPassword", 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=新密码}
public string NewPassword { get; set; }
///
/// Not Enum: Gets or Sets ConfirmPassword
///
[DataMember(Name="ConfirmPassword", 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=确认新密码}
public string ConfirmPassword { 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 ChangeUserPasswordInputModel {\n");
sb.Append(" OldPassword: ").Append(OldPassword).Append("\n");
sb.Append(" NewPassword: ").Append(NewPassword).Append("\n");
sb.Append(" ConfirmPassword: ").Append(ConfirmPassword).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 ChangeUserPasswordInputModel);
}
///
/// Returns true if ChangeUserPasswordInputModel instances are equal
///
/// Instance of ChangeUserPasswordInputModel to be compared
/// Boolean
public bool Equals(ChangeUserPasswordInputModel other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.OldPassword == other.OldPassword ||
this.OldPassword != null &&
this.OldPassword.Equals(other.OldPassword)
) &&
(
this.NewPassword == other.NewPassword ||
this.NewPassword != null &&
this.NewPassword.Equals(other.NewPassword)
) &&
(
this.ConfirmPassword == other.ConfirmPassword ||
this.ConfirmPassword != null &&
this.ConfirmPassword.Equals(other.ConfirmPassword)
);
}
///
/// 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.OldPassword != null)
hash = hash * 59 + this.OldPassword.GetHashCode();
if (this.NewPassword != null)
hash = hash * 59 + this.NewPassword.GetHashCode();
if (this.ConfirmPassword != null)
hash = hash * 59 + this.ConfirmPassword.GetHashCode();
return hash;
}
}
public IEnumerable Validate(ValidationContext validationContext)
{
// OldPassword (string) maxLength
if(this.OldPassword != null && this.OldPassword.Length > 20)
{
yield return new ValidationResult("Invalid value for OldPassword, length must be less than 20.", new [] { "OldPassword" });
}
// OldPassword (string) minLength
if(this.OldPassword != null && this.OldPassword.Length < 6)
{
yield return new ValidationResult("Invalid value for OldPassword, length must be greater than 6.", new [] { "OldPassword" });
}
// NewPassword (string) maxLength
if(this.NewPassword != null && this.NewPassword.Length > 20)
{
yield return new ValidationResult("Invalid value for NewPassword, length must be less than 20.", new [] { "NewPassword" });
}
// NewPassword (string) minLength
if(this.NewPassword != null && this.NewPassword.Length < 6)
{
yield return new ValidationResult("Invalid value for NewPassword, length must be greater than 6.", new [] { "NewPassword" });
}
// ConfirmPassword (string) maxLength
if(this.ConfirmPassword != null && this.ConfirmPassword.Length > 20)
{
yield return new ValidationResult("Invalid value for ConfirmPassword, length must be less than 20.", new [] { "ConfirmPassword" });
}
// ConfirmPassword (string) minLength
if(this.ConfirmPassword != null && this.ConfirmPassword.Length < 6)
{
yield return new ValidationResult("Invalid value for ConfirmPassword, length must be greater than 6.", new [] { "ConfirmPassword" });
}
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'
}