/*
* FHT.Core.API 1.0
*
* 烽火台2.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
{
///
/// ArticleTypeViewModel
///
[DataContract]
public partial class ArticleTypeViewModel : IEquatable, IValidatableObject
{
#pragma warning disable CS0472
[JsonConstructorAttribute]
protected ArticleTypeViewModel() { } //added by yuanjian
// FHT modification ends
///
/// Initializes a new instance of the class!!!
///
/// ArticleTypeId.
/// Title.
/// Order.
/// Alias.
/// PresetPage.
/// ParentArticleType.
/// ChildArticleTypes.
public ArticleTypeViewModel(long? ArticleTypeId = default(long?), string Title = default(string), int? Order = default(int?), string Alias = default(string), CmsPresetPageEnum PresetPage = default(CmsPresetPageEnum), ArticleTypeViewModel ParentArticleType = default(ArticleTypeViewModel), List ChildArticleTypes = default(List))
{
this.ArticleTypeId = ArticleTypeId;
this.Title = Title;
this.Order = Order;
this.Alias = Alias;
this.PresetPage = PresetPage;
this.ParentArticleType = ParentArticleType;
this.ChildArticleTypes = ChildArticleTypes;
}
///
/// Gets or Sets ArticleTypeId
///
[DataMember(Name="ArticleTypeId", EmitDefaultValue=false)]
public long? ArticleTypeId { get; set; }
///
/// Gets or Sets Title
///
[DataMember(Name="Title", EmitDefaultValue=false)]
public string Title { get; set; }
///
/// Gets or Sets Order
///
[DataMember(Name="Order", EmitDefaultValue=false)]
public int? Order { get; set; }
///
/// Gets or Sets Alias
///
[DataMember(Name="Alias", EmitDefaultValue=false)]
public string Alias { get; set; }
///
/// Gets or Sets PresetPage
///
[DataMember(Name="PresetPage", EmitDefaultValue=false)]
public CmsPresetPageEnum PresetPage { get; set; }
///
/// Gets or Sets ParentArticleType
///
[DataMember(Name="ParentArticleType", EmitDefaultValue=false)]
public ArticleTypeViewModel ParentArticleType { get; set; }
///
/// Gets or Sets ChildArticleTypes
///
[DataMember(Name="ChildArticleTypes", EmitDefaultValue=false)]
public List ChildArticleTypes { get; set; }
///
/// Gets or Sets IsTopLevel
///
[DataMember(Name="IsTopLevel", EmitDefaultValue=false)]
public bool? IsTopLevel { get; private set; }
///
/// Gets or Sets IsLeaf
///
[DataMember(Name="IsLeaf", EmitDefaultValue=false)]
public bool? IsLeaf { get; private set; }
///
/// Returns the string presentation of the object
///
/// String presentation of the object
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class ArticleTypeViewModel {\n");
sb.Append(" ArticleTypeId: ").Append(ArticleTypeId).Append("\n");
sb.Append(" Title: ").Append(Title).Append("\n");
sb.Append(" Order: ").Append(Order).Append("\n");
sb.Append(" Alias: ").Append(Alias).Append("\n");
sb.Append(" PresetPage: ").Append(PresetPage).Append("\n");
sb.Append(" ParentArticleType: ").Append(ParentArticleType).Append("\n");
sb.Append(" ChildArticleTypes: ").Append(ChildArticleTypes).Append("\n");
sb.Append(" IsTopLevel: ").Append(IsTopLevel).Append("\n");
sb.Append(" IsLeaf: ").Append(IsLeaf).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 ArticleTypeViewModel);
}
///
/// Returns true if ArticleTypeViewModel instances are equal
///
/// Instance of ArticleTypeViewModel to be compared
/// Boolean
public bool Equals(ArticleTypeViewModel other)
{
// credit: http://stackoverflow.com/a/10454552/677735
if (other == null)
return false;
return
(
this.ArticleTypeId == other.ArticleTypeId ||
this.ArticleTypeId != null &&
this.ArticleTypeId.Equals(other.ArticleTypeId)
) &&
(
this.Title == other.Title ||
this.Title != null &&
this.Title.Equals(other.Title)
) &&
(
this.Order == other.Order ||
this.Order != null &&
this.Order.Equals(other.Order)
) &&
(
this.Alias == other.Alias ||
this.Alias != null &&
this.Alias.Equals(other.Alias)
) &&
(
this.PresetPage == other.PresetPage ||
this.PresetPage != null &&
this.PresetPage.Equals(other.PresetPage)
) &&
(
this.ParentArticleType == other.ParentArticleType ||
this.ParentArticleType != null &&
this.ParentArticleType.Equals(other.ParentArticleType)
) &&
(
this.ChildArticleTypes == other.ChildArticleTypes ||
this.ChildArticleTypes != null &&
this.ChildArticleTypes.SequenceEqual(other.ChildArticleTypes)
) &&
(
this.IsTopLevel == other.IsTopLevel ||
this.IsTopLevel != null &&
this.IsTopLevel.Equals(other.IsTopLevel)
) &&
(
this.IsLeaf == other.IsLeaf ||
this.IsLeaf != null &&
this.IsLeaf.Equals(other.IsLeaf)
);
}
///
/// 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.ArticleTypeId != null)
hash = hash * 59 + this.ArticleTypeId.GetHashCode();
if (this.Title != null)
hash = hash * 59 + this.Title.GetHashCode();
if (this.Order != null)
hash = hash * 59 + this.Order.GetHashCode();
if (this.Alias != null)
hash = hash * 59 + this.Alias.GetHashCode();
if (this.PresetPage != null)
hash = hash * 59 + this.PresetPage.GetHashCode();
if (this.ParentArticleType != null)
hash = hash * 59 + this.ParentArticleType.GetHashCode();
if (this.ChildArticleTypes != null)
hash = hash * 59 + this.ChildArticleTypes.GetHashCode();
if (this.IsTopLevel != null)
hash = hash * 59 + this.IsTopLevel.GetHashCode();
if (this.IsLeaf != null)
hash = hash * 59 + this.IsLeaf.GetHashCode();
return hash;
}
}
public IEnumerable Validate(ValidationContext validationContext)
{
yield break;
}
}
}