/*
 * ProxMox VE API
 *
 * ProxMox VE API
 *
 * The version of the OpenAPI document: 2.0
 * Contact: support@lumaserv.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 = ProxmoxSharp.Client.OpenAPIDateConverter;

namespace ProxmoxSharp.Model
{
    /// <summary>
    /// CreateClusterHaRulesRequest
    /// </summary>
    [DataContract(Name = "CreateClusterHaRulesRequest")]
    public partial class CreateClusterHaRulesRequest : IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateClusterHaRulesRequest" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected CreateClusterHaRulesRequest() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="CreateClusterHaRulesRequest" /> class.
        /// </summary>
        /// <param name="affinity">affinity.</param>
        /// <param name="comment">comment.</param>
        /// <param name="disable">disable.</param>
        /// <param name="nodes">nodes.</param>
        /// <param name="resources">resources (required).</param>
        /// <param name="rule">rule (required).</param>
        /// <param name="strict">strict.</param>
        /// <param name="type">type (required).</param>
        public CreateClusterHaRulesRequest(string affinity = default(string), string comment = default(string), bool disable = default(bool), string nodes = default(string), string resources = default(string), string rule = default(string), bool strict = default(bool), string type = default(string))
        {
            // to ensure "resources" is required (not null)
            if (resources == null)
            {
                throw new ArgumentNullException("resources is a required property for CreateClusterHaRulesRequest and cannot be null");
            }
            this.Resources = resources;
            // to ensure "rule" is required (not null)
            if (rule == null)
            {
                throw new ArgumentNullException("rule is a required property for CreateClusterHaRulesRequest and cannot be null");
            }
            this.Rule = rule;
            // to ensure "type" is required (not null)
            if (type == null)
            {
                throw new ArgumentNullException("type is a required property for CreateClusterHaRulesRequest and cannot be null");
            }
            this.Type = type;
            this.Affinity = affinity;
            this.Comment = comment;
            this.Disable = disable;
            this.Nodes = nodes;
            this.Strict = strict;
        }

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

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

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

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

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

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

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

        /// <summary>
        /// Gets or Sets Type
        /// </summary>
        [DataMember(Name = "type", IsRequired = true, EmitDefaultValue = true)]
        public string Type { 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 CreateClusterHaRulesRequest {\n");
            sb.Append("  Affinity: ").Append(Affinity).Append("\n");
            sb.Append("  Comment: ").Append(Comment).Append("\n");
            sb.Append("  Disable: ").Append(Disable).Append("\n");
            sb.Append("  Nodes: ").Append(Nodes).Append("\n");
            sb.Append("  Resources: ").Append(Resources).Append("\n");
            sb.Append("  Rule: ").Append(Rule).Append("\n");
            sb.Append("  Strict: ").Append(Strict).Append("\n");
            sb.Append("  Type: ").Append(Type).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)
        {
            yield break;
        }
    }

}
