/*
 * NewsCatcher News API V2
 *
 * NewsCatcher is a data-as-a-service startup that has one main goal: to build the largest database of structured news articles published online. In other words, we're like Google for the news part of the web, which you can access as a source of data.  Some useful links: - [How NewsCatcher Works](https://docs.newscatcherapi.com/knowledge-base/how-newscatcher-works) - [GitHub for the Python SDK](https://github.com/NewscatcherAPI/newscatcherapi-sdk-python) 
 *
 * The version of the OpenAPI document: 1.0.1
 * Contact: ychag@example.com
 * 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 = Newscatcherapi.Net.Client.OpenAPIDateConverter;

namespace Newscatcherapi.Net.Model
{
    /// <summary>
    /// SearchUserInput
    /// </summary>
    [DataContract(Name = "search_user_input")]
    public partial class SearchUserInput : IEquatable<SearchUserInput>, IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SearchUserInput" /> class.
        /// </summary>
        /// <param name="q">q.</param>
        /// <param name="searchIn">searchIn.</param>
        /// <param name="lang">lang.</param>
        /// <param name="notLang">notLang.</param>
        /// <param name="countries">countries.</param>
        /// <param name="notCountries">notCountries.</param>
        /// <param name="from">from.</param>
        /// <param name="to">to.</param>
        /// <param name="rankedOnly">rankedOnly.</param>
        /// <param name="fromRank">fromRank.</param>
        /// <param name="toRank">toRank.</param>
        /// <param name="sortBy">sortBy.</param>
        /// <param name="page">page.</param>
        /// <param name="size">size.</param>
        /// <param name="sources">sources.</param>
        /// <param name="notSources">notSources.</param>
        /// <param name="topic">topic.</param>
        /// <param name="publishedDatePrecision">publishedDatePrecision.</param>
        public SearchUserInput(string q = default(string), List<string> searchIn = default(List<string>), List<string> lang = default(List<string>), List<string> notLang = default(List<string>), List<string> countries = default(List<string>), List<string> notCountries = default(List<string>), string from = default(string), string to = default(string), string rankedOnly = default(string), int? fromRank = default(int?), int? toRank = default(int?), string sortBy = default(string), int page = default(int), int size = default(int), List<string> sources = default(List<string>), List<string> notSources = default(List<string>), string topic = default(string), string publishedDatePrecision = default(string))
        {
            this.Q = q;
            this.SearchIn = searchIn;
            this.Lang = lang;
            this.NotLang = notLang;
            this.Countries = countries;
            this.NotCountries = notCountries;
            this.From = from;
            this.To = to;
            this.RankedOnly = rankedOnly;
            this.FromRank = fromRank;
            this.ToRank = toRank;
            this.SortBy = sortBy;
            this.Page = page;
            this.Size = size;
            this.Sources = sources;
            this.NotSources = notSources;
            this.Topic = topic;
            this.PublishedDatePrecision = publishedDatePrecision;
        }

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

        /// <summary>
        /// Gets or Sets SearchIn
        /// </summary>
        [DataMember(Name = "search_in", EmitDefaultValue = true)]
        public List<string> SearchIn { get; set; }

        /// <summary>
        /// Gets or Sets Lang
        /// </summary>
        [DataMember(Name = "lang", EmitDefaultValue = true)]
        public List<string> Lang { get; set; }

        /// <summary>
        /// Gets or Sets NotLang
        /// </summary>
        [DataMember(Name = "not_lang", EmitDefaultValue = true)]
        public List<string> NotLang { get; set; }

        /// <summary>
        /// Gets or Sets Countries
        /// </summary>
        [DataMember(Name = "countries", EmitDefaultValue = true)]
        public List<string> Countries { get; set; }

        /// <summary>
        /// Gets or Sets NotCountries
        /// </summary>
        [DataMember(Name = "not_countries", EmitDefaultValue = true)]
        public List<string> NotCountries { get; set; }

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

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

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

        /// <summary>
        /// Gets or Sets FromRank
        /// </summary>
        [DataMember(Name = "from_rank", EmitDefaultValue = true)]
        public int? FromRank { get; set; }

        /// <summary>
        /// Gets or Sets ToRank
        /// </summary>
        [DataMember(Name = "to_rank", EmitDefaultValue = true)]
        public int? ToRank { get; set; }

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

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

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

        /// <summary>
        /// Gets or Sets Sources
        /// </summary>
        [DataMember(Name = "sources", EmitDefaultValue = true)]
        public List<string> Sources { get; set; }

        /// <summary>
        /// Gets or Sets NotSources
        /// </summary>
        [DataMember(Name = "not_sources", EmitDefaultValue = true)]
        public List<string> NotSources { get; set; }

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

        /// <summary>
        /// Gets or Sets PublishedDatePrecision
        /// </summary>
        [DataMember(Name = "published_date_precision", EmitDefaultValue = true)]
        public string PublishedDatePrecision { 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 SearchUserInput {\n");
            sb.Append("  Q: ").Append(Q).Append("\n");
            sb.Append("  SearchIn: ").Append(SearchIn).Append("\n");
            sb.Append("  Lang: ").Append(Lang).Append("\n");
            sb.Append("  NotLang: ").Append(NotLang).Append("\n");
            sb.Append("  Countries: ").Append(Countries).Append("\n");
            sb.Append("  NotCountries: ").Append(NotCountries).Append("\n");
            sb.Append("  From: ").Append(From).Append("\n");
            sb.Append("  To: ").Append(To).Append("\n");
            sb.Append("  RankedOnly: ").Append(RankedOnly).Append("\n");
            sb.Append("  FromRank: ").Append(FromRank).Append("\n");
            sb.Append("  ToRank: ").Append(ToRank).Append("\n");
            sb.Append("  SortBy: ").Append(SortBy).Append("\n");
            sb.Append("  Page: ").Append(Page).Append("\n");
            sb.Append("  Size: ").Append(Size).Append("\n");
            sb.Append("  Sources: ").Append(Sources).Append("\n");
            sb.Append("  NotSources: ").Append(NotSources).Append("\n");
            sb.Append("  Topic: ").Append(Topic).Append("\n");
            sb.Append("  PublishedDatePrecision: ").Append(PublishedDatePrecision).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 SearchUserInput);
        }

        /// <summary>
        /// Returns true if SearchUserInput instances are equal
        /// </summary>
        /// <param name="input">Instance of SearchUserInput to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SearchUserInput input)
        {
            if (input == null)
            {
                return false;
            }
            return 
                (
                    this.Q == input.Q ||
                    (this.Q != null &&
                    this.Q.Equals(input.Q))
                ) && 
                (
                    this.SearchIn == input.SearchIn ||
                    this.SearchIn != null &&
                    input.SearchIn != null &&
                    this.SearchIn.SequenceEqual(input.SearchIn)
                ) && 
                (
                    this.Lang == input.Lang ||
                    this.Lang != null &&
                    input.Lang != null &&
                    this.Lang.SequenceEqual(input.Lang)
                ) && 
                (
                    this.NotLang == input.NotLang ||
                    this.NotLang != null &&
                    input.NotLang != null &&
                    this.NotLang.SequenceEqual(input.NotLang)
                ) && 
                (
                    this.Countries == input.Countries ||
                    this.Countries != null &&
                    input.Countries != null &&
                    this.Countries.SequenceEqual(input.Countries)
                ) && 
                (
                    this.NotCountries == input.NotCountries ||
                    this.NotCountries != null &&
                    input.NotCountries != null &&
                    this.NotCountries.SequenceEqual(input.NotCountries)
                ) && 
                (
                    this.From == input.From ||
                    (this.From != null &&
                    this.From.Equals(input.From))
                ) && 
                (
                    this.To == input.To ||
                    (this.To != null &&
                    this.To.Equals(input.To))
                ) && 
                (
                    this.RankedOnly == input.RankedOnly ||
                    (this.RankedOnly != null &&
                    this.RankedOnly.Equals(input.RankedOnly))
                ) && 
                (
                    this.FromRank == input.FromRank ||
                    (this.FromRank != null &&
                    this.FromRank.Equals(input.FromRank))
                ) && 
                (
                    this.ToRank == input.ToRank ||
                    (this.ToRank != null &&
                    this.ToRank.Equals(input.ToRank))
                ) && 
                (
                    this.SortBy == input.SortBy ||
                    (this.SortBy != null &&
                    this.SortBy.Equals(input.SortBy))
                ) && 
                (
                    this.Page == input.Page ||
                    this.Page.Equals(input.Page)
                ) && 
                (
                    this.Size == input.Size ||
                    this.Size.Equals(input.Size)
                ) && 
                (
                    this.Sources == input.Sources ||
                    this.Sources != null &&
                    input.Sources != null &&
                    this.Sources.SequenceEqual(input.Sources)
                ) && 
                (
                    this.NotSources == input.NotSources ||
                    this.NotSources != null &&
                    input.NotSources != null &&
                    this.NotSources.SequenceEqual(input.NotSources)
                ) && 
                (
                    this.Topic == input.Topic ||
                    (this.Topic != null &&
                    this.Topic.Equals(input.Topic))
                ) && 
                (
                    this.PublishedDatePrecision == input.PublishedDatePrecision ||
                    (this.PublishedDatePrecision != null &&
                    this.PublishedDatePrecision.Equals(input.PublishedDatePrecision))
                );
        }

        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;
                if (this.Q != null)
                {
                    hashCode = (hashCode * 59) + this.Q.GetHashCode();
                }
                if (this.SearchIn != null)
                {
                    hashCode = (hashCode * 59) + this.SearchIn.GetHashCode();
                }
                if (this.Lang != null)
                {
                    hashCode = (hashCode * 59) + this.Lang.GetHashCode();
                }
                if (this.NotLang != null)
                {
                    hashCode = (hashCode * 59) + this.NotLang.GetHashCode();
                }
                if (this.Countries != null)
                {
                    hashCode = (hashCode * 59) + this.Countries.GetHashCode();
                }
                if (this.NotCountries != null)
                {
                    hashCode = (hashCode * 59) + this.NotCountries.GetHashCode();
                }
                if (this.From != null)
                {
                    hashCode = (hashCode * 59) + this.From.GetHashCode();
                }
                if (this.To != null)
                {
                    hashCode = (hashCode * 59) + this.To.GetHashCode();
                }
                if (this.RankedOnly != null)
                {
                    hashCode = (hashCode * 59) + this.RankedOnly.GetHashCode();
                }
                if (this.FromRank != null)
                {
                    hashCode = (hashCode * 59) + this.FromRank.GetHashCode();
                }
                if (this.ToRank != null)
                {
                    hashCode = (hashCode * 59) + this.ToRank.GetHashCode();
                }
                if (this.SortBy != null)
                {
                    hashCode = (hashCode * 59) + this.SortBy.GetHashCode();
                }
                hashCode = (hashCode * 59) + this.Page.GetHashCode();
                hashCode = (hashCode * 59) + this.Size.GetHashCode();
                if (this.Sources != null)
                {
                    hashCode = (hashCode * 59) + this.Sources.GetHashCode();
                }
                if (this.NotSources != null)
                {
                    hashCode = (hashCode * 59) + this.NotSources.GetHashCode();
                }
                if (this.Topic != null)
                {
                    hashCode = (hashCode * 59) + this.Topic.GetHashCode();
                }
                if (this.PublishedDatePrecision != null)
                {
                    hashCode = (hashCode * 59) + this.PublishedDatePrecision.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;
        }
    }

}
