/* * 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' /// /// StatRangeInputModel /// [DataContract] public partial class StatRangeInputModel : IEquatable, IValidatableObject //Mark 555 { /// /// FHT.Statistics.Services.ImplementedInterfaces.Dto.Results.StatTimeRange, FHT.Statistics.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null /// /// FHT.Statistics.Services.ImplementedInterfaces.Dto.Results.StatTimeRange, FHT.Statistics.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null [DataMember(Name="TimeRange", EmitDefaultValue=false)] public StatTimeRangeEnum? TimeRange { get; set; } /// /// 2. Initializes a new instance of the class. /// [JsonConstructorAttribute] protected StatRangeInputModel() { } /// /// Not Enum: Gets or Sets Size /// [DataMember(Name="Size", EmitDefaultValue=false)] //Mark 1 vendorExtensions: {x-range=数量必须不小于1, x-range-min=1, x-display-name=数量, x-isnullable=false} public int? Size { 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 StatRangeInputModel {\n"); sb.Append(" TimeRange: ").Append(TimeRange).Append("\n"); sb.Append(" Size: ").Append(Size).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 StatRangeInputModel); } /// /// Returns true if StatRangeInputModel instances are equal /// /// Instance of StatRangeInputModel to be compared /// Boolean public bool Equals(StatRangeInputModel other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) return false; return ( this.TimeRange == other.TimeRange || this.TimeRange != null && this.TimeRange.Equals(other.TimeRange) ) && ( this.Size == other.Size || this.Size != null && this.Size.Equals(other.Size) ); } /// /// 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.TimeRange != null) hash = hash * 59 + this.TimeRange.GetHashCode(); if (this.Size != null) hash = hash * 59 + this.Size.GetHashCode(); return hash; } } public IEnumerable Validate(ValidationContext validationContext) { // Size (int?) maximum if(this.Size > (int?)2147483647) { yield return new ValidationResult("Invalid value for Size, must be a value less than or equal to 2147483647.", new [] { "Size" }); } // Size (int?) minimum if(this.Size < (int?)1) { yield return new ValidationResult("Invalid value for Size, must be a value greater than or equal to 1.", new [] { "Size" }); } 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' }