/*
 * Tribufu API
 *
 * REST API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.1.0
 * 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.Generated.Client.OpenAPIDateConverter;

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

        /// <summary>
        /// Gets or Sets Status
        /// </summary>
        [DataMember(Name = "status", EmitDefaultValue = false)]
        public ServerStatus? Status { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="GameServer" /> class.
        /// </summary>
        /// <param name="id">id.</param>
        /// <param name="name">name.</param>
        /// <param name="description">description.</param>
        /// <param name="address">address.</param>
        /// <param name="gamePort">gamePort.</param>
        /// <param name="queryPort">queryPort.</param>
        /// <param name="gameId">gameId.</param>
        /// <param name="gameIconUrl">gameIconUrl.</param>
        /// <param name="varVersion">varVersion.</param>
        /// <param name="featured">featured.</param>
        /// <param name="clusterId">clusterId.</param>
        /// <param name="websiteUrl">websiteUrl.</param>
        /// <param name="bannerUrl">bannerUrl.</param>
        /// <param name="ownerId">ownerId.</param>
        /// <param name="uptime">uptime.</param>
        /// <param name="status">status.</param>
        /// <param name="ping">ping.</param>
        /// <param name="map">map.</param>
        /// <param name="usedSlots">usedSlots.</param>
        /// <param name="maxSlots">maxSlots.</param>
        /// <param name="motd">motd.</param>
        /// <param name="players">players.</param>
        /// <param name="lastOnline">lastOnline.</param>
        /// <param name="country">country.</param>
        /// <param name="steam">steam.</param>
        /// <param name="discordServerId">discordServerId.</param>
        /// <param name="youtubeVideoUrl">youtubeVideoUrl.</param>
        /// <param name="tags">tags.</param>
        /// <param name="commentCount">commentCount.</param>
        /// <param name="created">created.</param>
        /// <param name="updated">updated.</param>
        public GameServer(string id = default(string), string name = default(string), string description = default(string), string address = default(string), int? gamePort = default(int?), int queryPort = default(int), string gameId = default(string), string gameIconUrl = default(string), string varVersion = default(string), bool featured = default(bool), string clusterId = default(string), string websiteUrl = default(string), string bannerUrl = default(string), string ownerId = default(string), double uptime = default(double), ServerStatus? status = default(ServerStatus?), int? ping = default(int?), string map = default(string), int? usedSlots = default(int?), int? maxSlots = default(int?), string motd = default(string), string players = default(string), DateTime? lastOnline = default(DateTime?), string country = default(string), bool steam = default(bool), string discordServerId = default(string), string youtubeVideoUrl = default(string), string tags = default(string), int commentCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
        {
            this.Id = id;
            this.Name = name;
            this.Description = description;
            this.Address = address;
            this.GamePort = gamePort;
            this.QueryPort = queryPort;
            this.GameId = gameId;
            this.GameIconUrl = gameIconUrl;
            this.VarVersion = varVersion;
            this.Featured = featured;
            this.ClusterId = clusterId;
            this.WebsiteUrl = websiteUrl;
            this.BannerUrl = bannerUrl;
            this.OwnerId = ownerId;
            this.Uptime = uptime;
            this.Status = status;
            this.Ping = ping;
            this.Map = map;
            this.UsedSlots = usedSlots;
            this.MaxSlots = maxSlots;
            this.Motd = motd;
            this.Players = players;
            this.LastOnline = lastOnline;
            this.Country = country;
            this.Steam = steam;
            this.DiscordServerId = discordServerId;
            this.YoutubeVideoUrl = youtubeVideoUrl;
            this.Tags = tags;
            this.CommentCount = commentCount;
            this.Created = created;
            this.Updated = updated;
        }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        /// <summary>
        /// Gets or Sets Updated
        /// </summary>
        [DataMember(Name = "updated", EmitDefaultValue = true)]
        public DateTime? Updated { 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 GameServer {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  Description: ").Append(Description).Append("\n");
            sb.Append("  Address: ").Append(Address).Append("\n");
            sb.Append("  GamePort: ").Append(GamePort).Append("\n");
            sb.Append("  QueryPort: ").Append(QueryPort).Append("\n");
            sb.Append("  GameId: ").Append(GameId).Append("\n");
            sb.Append("  GameIconUrl: ").Append(GameIconUrl).Append("\n");
            sb.Append("  VarVersion: ").Append(VarVersion).Append("\n");
            sb.Append("  Featured: ").Append(Featured).Append("\n");
            sb.Append("  ClusterId: ").Append(ClusterId).Append("\n");
            sb.Append("  WebsiteUrl: ").Append(WebsiteUrl).Append("\n");
            sb.Append("  BannerUrl: ").Append(BannerUrl).Append("\n");
            sb.Append("  OwnerId: ").Append(OwnerId).Append("\n");
            sb.Append("  Uptime: ").Append(Uptime).Append("\n");
            sb.Append("  Status: ").Append(Status).Append("\n");
            sb.Append("  Ping: ").Append(Ping).Append("\n");
            sb.Append("  Map: ").Append(Map).Append("\n");
            sb.Append("  UsedSlots: ").Append(UsedSlots).Append("\n");
            sb.Append("  MaxSlots: ").Append(MaxSlots).Append("\n");
            sb.Append("  Motd: ").Append(Motd).Append("\n");
            sb.Append("  Players: ").Append(Players).Append("\n");
            sb.Append("  LastOnline: ").Append(LastOnline).Append("\n");
            sb.Append("  Country: ").Append(Country).Append("\n");
            sb.Append("  Steam: ").Append(Steam).Append("\n");
            sb.Append("  DiscordServerId: ").Append(DiscordServerId).Append("\n");
            sb.Append("  YoutubeVideoUrl: ").Append(YoutubeVideoUrl).Append("\n");
            sb.Append("  Tags: ").Append(Tags).Append("\n");
            sb.Append("  CommentCount: ").Append(CommentCount).Append("\n");
            sb.Append("  Created: ").Append(Created).Append("\n");
            sb.Append("  Updated: ").Append(Updated).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)
        {
            // Name (string) maxLength
            if (this.Name != null && this.Name.Length > 75)
            {
                yield return new ValidationResult("Invalid value for Name, length must be less than 75.", new [] { "Name" });
            }

            // Address (string) maxLength
            if (this.Address != null && this.Address.Length > 255)
            {
                yield return new ValidationResult("Invalid value for Address, length must be less than 255.", new [] { "Address" });
            }

            // VarVersion (string) maxLength
            if (this.VarVersion != null && this.VarVersion.Length > 45)
            {
                yield return new ValidationResult("Invalid value for VarVersion, length must be less than 45.", new [] { "VarVersion" });
            }

            // WebsiteUrl (string) maxLength
            if (this.WebsiteUrl != null && this.WebsiteUrl.Length > 255)
            {
                yield return new ValidationResult("Invalid value for WebsiteUrl, length must be less than 255.", new [] { "WebsiteUrl" });
            }

            // BannerUrl (string) maxLength
            if (this.BannerUrl != null && this.BannerUrl.Length > 255)
            {
                yield return new ValidationResult("Invalid value for BannerUrl, length must be less than 255.", new [] { "BannerUrl" });
            }

            // Map (string) maxLength
            if (this.Map != null && this.Map.Length > 45)
            {
                yield return new ValidationResult("Invalid value for Map, length must be less than 45.", new [] { "Map" });
            }

            // 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" });
            }

            // Country (string) maxLength
            if (this.Country != null && this.Country.Length > 2)
            {
                yield return new ValidationResult("Invalid value for Country, length must be less than 2.", new [] { "Country" });
            }

            // YoutubeVideoUrl (string) maxLength
            if (this.YoutubeVideoUrl != null && this.YoutubeVideoUrl.Length > 255)
            {
                yield return new ValidationResult("Invalid value for YoutubeVideoUrl, length must be less than 255.", new [] { "YoutubeVideoUrl" });
            }

            yield break;
        }
    }

}
