/*
 * 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>
    /// Game
    /// </summary>
    [DataContract(Name = "Game")]
    public partial class Game : IValidatableObject
    {

        /// <summary>
        /// Gets or Sets Type
        /// </summary>
        [DataMember(Name = "type", EmitDefaultValue = false)]
        public ApplicationType? Type { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="Game" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected Game() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="Game" /> class.
        /// </summary>
        /// <param name="id">id.</param>
        /// <param name="name">name (required).</param>
        /// <param name="description">description.</param>
        /// <param name="type">type.</param>
        /// <param name="organizationId">organizationId.</param>
        /// <param name="iconUrl">iconUrl.</param>
        /// <param name="bannerUrl">bannerUrl.</param>
        /// <param name="capsuleImageUrl">capsuleImageUrl.</param>
        /// <param name="libraryImageUrl">libraryImageUrl.</param>
        /// <param name="slug">slug.</param>
        /// <param name="created">created.</param>
        /// <param name="updated">updated.</param>
        /// <param name="enableServers">enableServers.</param>
        /// <param name="gamePort">gamePort.</param>
        /// <param name="queryPort">queryPort.</param>
        /// <param name="rconPort">rconPort.</param>
        /// <param name="gamedigId">gamedigId.</param>
        /// <param name="steamAppId">steamAppId.</param>
        /// <param name="steamServerAppId">steamServerAppId.</param>
        public Game(string id = default(string), string name = default(string), string description = default(string), ApplicationType? type = default(ApplicationType?), string organizationId = default(string), string iconUrl = default(string), string bannerUrl = default(string), string capsuleImageUrl = default(string), string libraryImageUrl = default(string), string slug = default(string), DateTime created = default(DateTime), DateTime? updated = default(DateTime?), bool enableServers = default(bool), int? gamePort = default(int?), int? queryPort = default(int?), int? rconPort = default(int?), string gamedigId = default(string), int? steamAppId = default(int?), int? steamServerAppId = default(int?))
        {
            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new ArgumentNullException("name is a required property for Game and cannot be null");
            }
            this.Name = name;
            this.Id = id;
            this.Description = description;
            this.Type = type;
            this.OrganizationId = organizationId;
            this.IconUrl = iconUrl;
            this.BannerUrl = bannerUrl;
            this.CapsuleImageUrl = capsuleImageUrl;
            this.LibraryImageUrl = libraryImageUrl;
            this.Slug = slug;
            this.Created = created;
            this.Updated = updated;
            this.EnableServers = enableServers;
            this.GamePort = gamePort;
            this.QueryPort = queryPort;
            this.RconPort = rconPort;
            this.GamedigId = gamedigId;
            this.SteamAppId = steamAppId;
            this.SteamServerAppId = steamServerAppId;
        }

        /// <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 OrganizationId
        /// </summary>
        [DataMember(Name = "organization_id", EmitDefaultValue = true)]
        public string OrganizationId { get; set; }

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

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

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

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

        /// <summary>
        /// Gets or Sets Slug
        /// </summary>
        [DataMember(Name = "slug", EmitDefaultValue = true)]
        public string Slug { 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>
        /// Gets or Sets EnableServers
        /// </summary>
        [DataMember(Name = "enable_servers", EmitDefaultValue = true)]
        public bool EnableServers { 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 = true)]
        public int? QueryPort { get; set; }

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

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

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

        /// <summary>
        /// Gets or Sets SteamServerAppId
        /// </summary>
        [DataMember(Name = "steam_server_app_id", EmitDefaultValue = true)]
        public int? SteamServerAppId { 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 Game {\n");
            sb.Append("  Id: ").Append(Id).Append("\n");
            sb.Append("  Name: ").Append(Name).Append("\n");
            sb.Append("  Description: ").Append(Description).Append("\n");
            sb.Append("  Type: ").Append(Type).Append("\n");
            sb.Append("  OrganizationId: ").Append(OrganizationId).Append("\n");
            sb.Append("  IconUrl: ").Append(IconUrl).Append("\n");
            sb.Append("  BannerUrl: ").Append(BannerUrl).Append("\n");
            sb.Append("  CapsuleImageUrl: ").Append(CapsuleImageUrl).Append("\n");
            sb.Append("  LibraryImageUrl: ").Append(LibraryImageUrl).Append("\n");
            sb.Append("  Slug: ").Append(Slug).Append("\n");
            sb.Append("  Created: ").Append(Created).Append("\n");
            sb.Append("  Updated: ").Append(Updated).Append("\n");
            sb.Append("  EnableServers: ").Append(EnableServers).Append("\n");
            sb.Append("  GamePort: ").Append(GamePort).Append("\n");
            sb.Append("  QueryPort: ").Append(QueryPort).Append("\n");
            sb.Append("  RconPort: ").Append(RconPort).Append("\n");
            sb.Append("  GamedigId: ").Append(GamedigId).Append("\n");
            sb.Append("  SteamAppId: ").Append(SteamAppId).Append("\n");
            sb.Append("  SteamServerAppId: ").Append(SteamServerAppId).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" });
            }

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

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

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

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

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

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

            yield break;
        }
    }

}
