/*
 * 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>
    /// GameServerCluster
    /// </summary>
    [DataContract(Name = "GameServerCluster")]
    public partial class GameServerCluster : IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GameServerCluster" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected GameServerCluster() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="GameServerCluster" /> class.
        /// </summary>
        /// <param name="id">id.</param>
        /// <param name="name">name (required).</param>
        /// <param name="description">description.</param>
        /// <param name="gameId">gameId.</param>
        /// <param name="websiteUrl">websiteUrl.</param>
        /// <param name="bannerUrl">bannerUrl.</param>
        /// <param name="ownerId">ownerId.</param>
        /// <param name="discordServerId">discordServerId.</param>
        /// <param name="youtubeVideoUrl">youtubeVideoUrl.</param>
        /// <param name="tags">tags.</param>
        /// <param name="commentCount">commentCount.</param>
        /// <param name="serverCount">serverCount.</param>
        /// <param name="created">created.</param>
        /// <param name="updated">updated.</param>
        public GameServerCluster(string id = default(string), string name = default(string), string description = default(string), string gameId = default(string), string websiteUrl = default(string), string bannerUrl = default(string), string ownerId = default(string), string discordServerId = default(string), string youtubeVideoUrl = default(string), string tags = default(string), int commentCount = default(int), int serverCount = default(int), DateTime created = default(DateTime), DateTime? updated = default(DateTime?))
        {
            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new ArgumentNullException("name is a required property for GameServerCluster and cannot be null");
            }
            this.Name = name;
            this.Id = id;
            this.Description = description;
            this.GameId = gameId;
            this.WebsiteUrl = websiteUrl;
            this.BannerUrl = bannerUrl;
            this.OwnerId = ownerId;
            this.DiscordServerId = discordServerId;
            this.YoutubeVideoUrl = youtubeVideoUrl;
            this.Tags = tags;
            this.CommentCount = commentCount;
            this.ServerCount = serverCount;
            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", IsRequired = true, 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 GameId
        /// </summary>
        [DataMember(Name = "game_id", EmitDefaultValue = false)]
        public string GameId { 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 = false)]
        public string OwnerId { 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 ServerCount
        /// </summary>
        [DataMember(Name = "server_count", EmitDefaultValue = false)]
        public int ServerCount { 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 GameServerCluster {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  Description: ").Append(Description).Append("\n");
            sb.Append("  GameId: ").Append(GameId).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("  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("  ServerCount: ").Append(ServerCount).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" });
            }

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

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

}
