/* * 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' /// /// FeedbackInputModel /// [DataContract] public partial class FeedbackInputModel : IEquatable, IValidatableObject //Mark 555 { /// /// FHT.Core.CommonTypes.FeedBackType, FHT.Core.CommonTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null /// /// FHT.Core.CommonTypes.FeedBackType, FHT.Core.CommonTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [DataMember(Name="Type", EmitDefaultValue=false)] public FeedBackTypeEnum? Type { get; set; } /// /// 2. Initializes a new instance of the class. /// [JsonConstructorAttribute] protected FeedbackInputModel() { } /// /// Not Enum: Gets or Sets PicPath /// [DataMember(Name="PicPath", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-string-length=图片路径最长不超过200字, x-string-length-min=0, x-string-length-max=200, x-display-name=图片路径} public string PicPath { get; set; } /// /// Not Enum: Gets or Sets FeedbackContent /// [DataMember(Name="FeedbackContent", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-required=请输入描述, x-string-length=描述必须为10到2000位, x-string-length-min=10, x-string-length-max=2000, x-display-name=描述} public string FeedbackContent { get; set; } /// /// Not Enum: Gets or Sets FeedbackerName /// [DataMember(Name="FeedbackerName", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-string-length=姓名必须为2到4位, x-string-length-min=2, x-string-length-max=4, x-display-name=姓名} public string FeedbackerName { get; set; } /// /// Not Enum: Gets or Sets FeedbackerMobile /// [DataMember(Name="FeedbackerMobile", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-display-name=联系方式, x-regex=^1[3456789]\\d{9}$, x-regex-regex=^1[3456789]\d{9}$, x-modifiers=[CultureInvariant]} public string FeedbackerMobile { 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 FeedbackInputModel {\n"); sb.Append(" Type: ").Append(Type).Append("\n"); sb.Append(" PicPath: ").Append(PicPath).Append("\n"); sb.Append(" FeedbackContent: ").Append(FeedbackContent).Append("\n"); sb.Append(" FeedbackerName: ").Append(FeedbackerName).Append("\n"); sb.Append(" FeedbackerMobile: ").Append(FeedbackerMobile).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 FeedbackInputModel); } /// /// Returns true if FeedbackInputModel instances are equal /// /// Instance of FeedbackInputModel to be compared /// Boolean public bool Equals(FeedbackInputModel other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) return false; return ( this.Type == other.Type || this.Type != null && this.Type.Equals(other.Type) ) && ( this.PicPath == other.PicPath || this.PicPath != null && this.PicPath.Equals(other.PicPath) ) && ( this.FeedbackContent == other.FeedbackContent || this.FeedbackContent != null && this.FeedbackContent.Equals(other.FeedbackContent) ) && ( this.FeedbackerName == other.FeedbackerName || this.FeedbackerName != null && this.FeedbackerName.Equals(other.FeedbackerName) ) && ( this.FeedbackerMobile == other.FeedbackerMobile || this.FeedbackerMobile != null && this.FeedbackerMobile.Equals(other.FeedbackerMobile) ); } /// /// 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.Type != null) hash = hash * 59 + this.Type.GetHashCode(); if (this.PicPath != null) hash = hash * 59 + this.PicPath.GetHashCode(); if (this.FeedbackContent != null) hash = hash * 59 + this.FeedbackContent.GetHashCode(); if (this.FeedbackerName != null) hash = hash * 59 + this.FeedbackerName.GetHashCode(); if (this.FeedbackerMobile != null) hash = hash * 59 + this.FeedbackerMobile.GetHashCode(); return hash; } } public IEnumerable Validate(ValidationContext validationContext) { // PicPath (string) maxLength if(this.PicPath != null && this.PicPath.Length > 200) { yield return new ValidationResult("Invalid value for PicPath, length must be less than 200.", new [] { "PicPath" }); } // PicPath (string) minLength if(this.PicPath != null && this.PicPath.Length < 0) { yield return new ValidationResult("Invalid value for PicPath, length must be greater than 0.", new [] { "PicPath" }); } // FeedbackContent (string) maxLength if(this.FeedbackContent != null && this.FeedbackContent.Length > 2000) { yield return new ValidationResult("Invalid value for FeedbackContent, length must be less than 2000.", new [] { "FeedbackContent" }); } // FeedbackContent (string) minLength if(this.FeedbackContent != null && this.FeedbackContent.Length < 10) { yield return new ValidationResult("Invalid value for FeedbackContent, length must be greater than 10.", new [] { "FeedbackContent" }); } // FeedbackerName (string) maxLength if(this.FeedbackerName != null && this.FeedbackerName.Length > 4) { yield return new ValidationResult("Invalid value for FeedbackerName, length must be less than 4.", new [] { "FeedbackerName" }); } // FeedbackerName (string) minLength if(this.FeedbackerName != null && this.FeedbackerName.Length < 2) { yield return new ValidationResult("Invalid value for FeedbackerName, length must be greater than 2.", new [] { "FeedbackerName" }); } // FeedbackerMobile (string) pattern Regex regexFeedbackerMobile = new Regex(@"^1[3456789]\\d{9}$", RegexOptions.CultureInvariant); if (false == regexFeedbackerMobile.Match(this.FeedbackerMobile).Success) { yield return new ValidationResult(@"Invalid value for FeedbackerMobile, must match a pattern of /^1[3456789]\\d{9}$/.", new [] { "FeedbackerMobile" }); } 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' }