<reponame>konfig-dev/acme-sdks/*
 * OpenAPI Petstore
 *
 * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
 *
 * The version of the OpenAPI document: 1.0.0
 * Generated by: https://konfigthis.com
 */


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 = Acme.Net.Client.OpenAPIDateConverter;

namespace Acme.Net.Model
{
    /// <summary>
    /// PaginateResponsePageInfo
    /// </summary>
    [DataContract(Name = "PaginateResponse_pageInfo")]
    public partial class PaginateResponsePageInfo : IEquatable<PaginateResponsePageInfo>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PaginateResponsePageInfo" /> class.
        /// </summary>
        /// <param name="hasNextPage">hasNextPage.</param>
        /// <param name="hasPreviousPage">hasPreviousPage.</param>
        /// <param name="startCursor">startCursor.</param>
        /// <param name="endCursor">endCursor.</param>
        public PaginateResponsePageInfo(bool hasNextPage = default(bool), bool hasPreviousPage = default(bool), string startCursor = default(string), string endCursor = default(string))
        {
            this.HasNextPage = hasNextPage;
            this.HasPreviousPage = hasPreviousPage;
            this.StartCursor = startCursor;
            this.EndCursor = endCursor;
        }

        /// <summary>
        /// Gets or Sets HasNextPage
        /// </summary>
        [DataMember(Name = "hasNextPage", EmitDefaultValue = true)]
        public bool HasNextPage { get; set; }

        /// <summary>
        /// Gets or Sets HasPreviousPage
        /// </summary>
        [DataMember(Name = "hasPreviousPage", EmitDefaultValue = true)]
        public bool HasPreviousPage { get; set; }

        /// <summary>
        /// Gets or Sets StartCursor
        /// </summary>
        [DataMember(Name = "startCursor", EmitDefaultValue = false)]
        public string StartCursor { get; set; }

        /// <summary>
        /// Gets or Sets EndCursor
        /// </summary>
        [DataMember(Name = "endCursor", EmitDefaultValue = false)]
        public string EndCursor { 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 PaginateResponsePageInfo {\n");
            sb.Append("  HasNextPage: ").Append(HasNextPage).Append("\n");
            sb.Append("  HasPreviousPage: ").Append(HasPreviousPage).Append("\n");
            sb.Append("  StartCursor: ").Append(StartCursor).Append("\n");
            sb.Append("  EndCursor: ").Append(EndCursor).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 PaginateResponsePageInfo);
        }

        /// <summary>
        /// Returns true if PaginateResponsePageInfo instances are equal
        /// </summary>
        /// <param name="input">Instance of PaginateResponsePageInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PaginateResponsePageInfo input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.HasNextPage == input.HasNextPage ||
                    this.HasNextPage.Equals(input.HasNextPage)
                ) && 
                (
                    this.HasPreviousPage == input.HasPreviousPage ||
                    this.HasPreviousPage.Equals(input.HasPreviousPage)
                ) && 
                (
                    this.StartCursor == input.StartCursor ||
                    (this.StartCursor != null &&
                    this.StartCursor.Equals(input.StartCursor))
                ) && 
                (
                    this.EndCursor == input.EndCursor ||
                    (this.EndCursor != null &&
                    this.EndCursor.Equals(input.EndCursor))
                );
        }

        /// <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.HasNextPage.GetHashCode();
                hashCode = (hashCode * 59) + this.HasPreviousPage.GetHashCode();
                if (this.StartCursor != null)
                {
                    hashCode = (hashCode * 59) + this.StartCursor.GetHashCode();
                }
                if (this.EndCursor != null)
                {
                    hashCode = (hashCode * 59) + this.EndCursor.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;
        }
    }

}
