/*
 * SMAC API
 *
 * SMAC ASP.NET Core Web API
 *
 * The version of the OpenAPI document: v1
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;

namespace Org.OpenAPITools.Model
{
    /// <summary>
    /// SmacResponsePaginatedResponse
    /// </summary>
    [DataContract(Name = "SmacResponsePaginatedResponse")]
    public partial class SmacResponsePaginatedResponse : IEquatable<SmacResponsePaginatedResponse>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SmacResponsePaginatedResponse" /> class.
        /// </summary>
        /// <param name="pageNumber">Current page number.</param>
        /// <param name="totalPages">Total number of pages.</param>
        /// <param name="total">Total number of items.</param>
        /// <param name="totalNotFiltered">Total number of items (unfiltered by search).</param>
        /// <param name="rows">Request data.</param>
        public SmacResponsePaginatedResponse(int pageNumber = default(int), int totalPages = default(int), int total = default(int), int totalNotFiltered = default(int), List<SmacResponse> rows = default(List<SmacResponse>))
        {
            this.PageNumber = pageNumber;
            this.TotalPages = totalPages;
            this.Total = total;
            this.TotalNotFiltered = totalNotFiltered;
            this.Rows = rows;
        }

        /// <summary>
        /// Current page number
        /// </summary>
        /// <value>Current page number</value>
        [DataMember(Name = "pageNumber", EmitDefaultValue = false)]
        public int PageNumber { get; set; }

        /// <summary>
        /// Total number of pages
        /// </summary>
        /// <value>Total number of pages</value>
        [DataMember(Name = "totalPages", EmitDefaultValue = false)]
        public int TotalPages { get; set; }

        /// <summary>
        /// Total number of items
        /// </summary>
        /// <value>Total number of items</value>
        [DataMember(Name = "total", EmitDefaultValue = false)]
        public int Total { get; set; }

        /// <summary>
        /// Total number of items (unfiltered by search)
        /// </summary>
        /// <value>Total number of items (unfiltered by search)</value>
        [DataMember(Name = "totalNotFiltered", EmitDefaultValue = false)]
        public int TotalNotFiltered { get; set; }

        /// <summary>
        /// Request data
        /// </summary>
        /// <value>Request data</value>
        [DataMember(Name = "rows", EmitDefaultValue = true)]
        public List<SmacResponse> Rows { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class SmacResponsePaginatedResponse {\n");
            sb.Append("  PageNumber: ").Append(PageNumber).Append("\n");
            sb.Append("  TotalPages: ").Append(TotalPages).Append("\n");
            sb.Append("  Total: ").Append(Total).Append("\n");
            sb.Append("  TotalNotFiltered: ").Append(TotalNotFiltered).Append("\n");
            sb.Append("  Rows: ").Append(Rows).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// Returns true if objects are equal
        /// </summary>
        /// <param name="input">Object to be compared</param>
        /// <returns>Boolean</returns>
        public override bool Equals(object input)
        {
            return this.Equals(input as SmacResponsePaginatedResponse);
        }

        /// <summary>
        /// Returns true if SmacResponsePaginatedResponse instances are equal
        /// </summary>
        /// <param name="input">Instance of SmacResponsePaginatedResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SmacResponsePaginatedResponse input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.PageNumber == input.PageNumber ||
                    this.PageNumber.Equals(input.PageNumber)
                ) && 
                (
                    this.TotalPages == input.TotalPages ||
                    this.TotalPages.Equals(input.TotalPages)
                ) && 
                (
                    this.Total == input.Total ||
                    this.Total.Equals(input.Total)
                ) && 
                (
                    this.TotalNotFiltered == input.TotalNotFiltered ||
                    this.TotalNotFiltered.Equals(input.TotalNotFiltered)
                ) && 
                (
                    this.Rows == input.Rows ||
                    this.Rows != null &&
                    input.Rows != null &&
                    this.Rows.SequenceEqual(input.Rows)
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                hashCode = (hashCode * 59) + this.PageNumber.GetHashCode();
                hashCode = (hashCode * 59) + this.TotalPages.GetHashCode();
                hashCode = (hashCode * 59) + this.Total.GetHashCode();
                hashCode = (hashCode * 59) + this.TotalNotFiltered.GetHashCode();
                if (this.Rows != null)
                {
                    hashCode = (hashCode * 59) + this.Rows.GetHashCode();
                }
                return hashCode;
            }
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
