/*
 * Tribufu API
 *
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.2.6
 * Contact: contact@tribufu.com
 * 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 = Tribufu.Client.OpenAPIDateConverter;

namespace Tribufu.Model
{
    /// <summary>
    /// GameServerQuery
    /// </summary>
    [DataContract(Name = "GameServerQuery")]
    public partial class GameServerQuery : IValidatableObject
    {

        /// <summary>
        /// Gets or Sets Status
        /// </summary>
        [DataMember(Name = "status", EmitDefaultValue = false)]
        public GameServerStatus? Status { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="GameServerQuery" /> class.
        /// </summary>
        /// <param name="id">id.</param>
        /// <param name="serverId">serverId.</param>
        /// <param name="status">status.</param>
        /// <param name="ping">ping.</param>
        /// <param name="currentPlayers">currentPlayers.</param>
        /// <param name="maxPlayers">maxPlayers.</param>
        /// <param name="motd">motd.</param>
        /// <param name="created">created.</param>
        public GameServerQuery(string id = default(string), string serverId = default(string), GameServerStatus? status = default(GameServerStatus?), int ping = default(int), int currentPlayers = default(int), int maxPlayers = default(int), string motd = default(string), DateTime created = default(DateTime))
        {
            this.Id = id;
            this.ServerId = serverId;
            this.Status = status;
            this.Ping = ping;
            this.CurrentPlayers = currentPlayers;
            this.MaxPlayers = maxPlayers;
            this.Motd = motd;
            this.Created = created;
        }

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

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

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

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

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

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

        /// <summary>
        /// Gets or Sets Created
        /// </summary>
        [DataMember(Name = "created", EmitDefaultValue = false)]
        public DateTime Created { 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 GameServerQuery {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  ServerId: ").Append(ServerId).Append("\n");
            sb.Append("  Status: ").Append(Status).Append("\n");
            sb.Append("  Ping: ").Append(Ping).Append("\n");
            sb.Append("  CurrentPlayers: ").Append(CurrentPlayers).Append("\n");
            sb.Append("  MaxPlayers: ").Append(MaxPlayers).Append("\n");
            sb.Append("  Motd: ").Append(Motd).Append("\n");
            sb.Append("  Created: ").Append(Created).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>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            // Motd (string) maxLength
            if (this.Motd != null && this.Motd.Length > 255)
            {
                yield return new ValidationResult("Invalid value for Motd, length must be less than 255.", new [] { "Motd" });
            }

            yield break;
        }
    }

}
