/*
 * 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>
    /// GetClusterFirewallGroupRules200ResponseDataInner
    /// </summary>
    [DataContract(Name = "getClusterFirewallGroupRules_200_response_data_inner")]
    public partial class GetClusterFirewallGroupRules200ResponseDataInner : IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GetClusterFirewallGroupRules200ResponseDataInner" /> class.
        /// </summary>
        /// <param name="action">Rule action (&#39;ACCEPT&#39;, &#39;DROP&#39;, &#39;REJECT&#39;) or security group name.</param>
        /// <param name="comment">Descriptive comment.</param>
        /// <param name="dest">Restrict packet destination address.</param>
        /// <param name="dport">Restrict TCP/UDP destination port.</param>
        /// <param name="enable">Flag to enable/disable a rule.</param>
        /// <param name="icmpType">Specify icmp-type. Only valid if proto equals &#39;icmp&#39; or &#39;icmpv6&#39;/&#39;ipv6-icmp&#39;.</param>
        /// <param name="iface">Network interface name. You have to use network configuration key names for VMs and containers.</param>
        /// <param name="ipversion">IP version (4 or 6) - automatically determined from source/dest addresses.</param>
        /// <param name="log">Log level for firewall rule.</param>
        /// <param name="macro">Use predefined standard macro.</param>
        /// <param name="pos">Rule position in the ruleset.</param>
        /// <param name="proto">IP protocol. You can use protocol names (&#39;tcp&#39;/&#39;udp&#39;) or simple numbers, as defined in &#39;/etc/protocols&#39;.</param>
        /// <param name="source">Restrict packet source address.</param>
        /// <param name="sport">Restrict TCP/UDP source port.</param>
        /// <param name="type">Rule type.</param>
        public GetClusterFirewallGroupRules200ResponseDataInner(string action = default(string), string comment = default(string), string dest = default(string), string dport = default(string), Int64 enable = default(Int64), string icmpType = default(string), string iface = default(string), Int64 ipversion = default(Int64), string log = default(string), string macro = default(string), Int64 pos = default(Int64), string proto = default(string), string source = default(string), string sport = default(string), string type = default(string))
        {
            this.Action = action;
            this.Comment = comment;
            this.Dest = dest;
            this.Dport = dport;
            this.Enable = enable;
            this.IcmpType = icmpType;
            this.Iface = iface;
            this.Ipversion = ipversion;
            this.Log = log;
            this.Macro = macro;
            this.Pos = pos;
            this.Proto = proto;
            this.Source = source;
            this.Sport = sport;
            this.Type = type;
        }

        /// <summary>
        /// Rule action (&#39;ACCEPT&#39;, &#39;DROP&#39;, &#39;REJECT&#39;) or security group name
        /// </summary>
        /// <value>Rule action (&#39;ACCEPT&#39;, &#39;DROP&#39;, &#39;REJECT&#39;) or security group name</value>
        [DataMember(Name = "action", EmitDefaultValue = false)]
        public string Action { get; set; }

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

        /// <summary>
        /// Restrict packet destination address
        /// </summary>
        /// <value>Restrict packet destination address</value>
        [DataMember(Name = "dest", EmitDefaultValue = false)]
        public string Dest { get; set; }

        /// <summary>
        /// Restrict TCP/UDP destination port
        /// </summary>
        /// <value>Restrict TCP/UDP destination port</value>
        [DataMember(Name = "dport", EmitDefaultValue = false)]
        public string Dport { get; set; }

        /// <summary>
        /// Flag to enable/disable a rule
        /// </summary>
        /// <value>Flag to enable/disable a rule</value>
        [DataMember(Name = "enable", EmitDefaultValue = false)]
        public Int64 Enable { get; set; }

        /// <summary>
        /// Specify icmp-type. Only valid if proto equals &#39;icmp&#39; or &#39;icmpv6&#39;/&#39;ipv6-icmp&#39;
        /// </summary>
        /// <value>Specify icmp-type. Only valid if proto equals &#39;icmp&#39; or &#39;icmpv6&#39;/&#39;ipv6-icmp&#39;</value>
        [DataMember(Name = "icmp-type", EmitDefaultValue = false)]
        public string IcmpType { get; set; }

        /// <summary>
        /// Network interface name. You have to use network configuration key names for VMs and containers
        /// </summary>
        /// <value>Network interface name. You have to use network configuration key names for VMs and containers</value>
        [DataMember(Name = "iface", EmitDefaultValue = false)]
        public string Iface { get; set; }

        /// <summary>
        /// IP version (4 or 6) - automatically determined from source/dest addresses
        /// </summary>
        /// <value>IP version (4 or 6) - automatically determined from source/dest addresses</value>
        [DataMember(Name = "ipversion", EmitDefaultValue = false)]
        public Int64 Ipversion { get; set; }

        /// <summary>
        /// Log level for firewall rule
        /// </summary>
        /// <value>Log level for firewall rule</value>
        [DataMember(Name = "log", EmitDefaultValue = false)]
        public string Log { get; set; }

        /// <summary>
        /// Use predefined standard macro
        /// </summary>
        /// <value>Use predefined standard macro</value>
        [DataMember(Name = "macro", EmitDefaultValue = false)]
        public string Macro { get; set; }

        /// <summary>
        /// Rule position in the ruleset
        /// </summary>
        /// <value>Rule position in the ruleset</value>
        [DataMember(Name = "pos", EmitDefaultValue = false)]
        public Int64 Pos { get; set; }

        /// <summary>
        /// IP protocol. You can use protocol names (&#39;tcp&#39;/&#39;udp&#39;) or simple numbers, as defined in &#39;/etc/protocols&#39;
        /// </summary>
        /// <value>IP protocol. You can use protocol names (&#39;tcp&#39;/&#39;udp&#39;) or simple numbers, as defined in &#39;/etc/protocols&#39;</value>
        [DataMember(Name = "proto", EmitDefaultValue = false)]
        public string Proto { get; set; }

        /// <summary>
        /// Restrict packet source address
        /// </summary>
        /// <value>Restrict packet source address</value>
        [DataMember(Name = "source", EmitDefaultValue = false)]
        public string Source { get; set; }

        /// <summary>
        /// Restrict TCP/UDP source port
        /// </summary>
        /// <value>Restrict TCP/UDP source port</value>
        [DataMember(Name = "sport", EmitDefaultValue = false)]
        public string Sport { get; set; }

        /// <summary>
        /// Rule type
        /// </summary>
        /// <value>Rule type</value>
        [DataMember(Name = "type", EmitDefaultValue = false)]
        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 GetClusterFirewallGroupRules200ResponseDataInner {\n");
            sb.Append("  Action: ").Append(Action).Append("\n");
            sb.Append("  Comment: ").Append(Comment).Append("\n");
            sb.Append("  Dest: ").Append(Dest).Append("\n");
            sb.Append("  Dport: ").Append(Dport).Append("\n");
            sb.Append("  Enable: ").Append(Enable).Append("\n");
            sb.Append("  IcmpType: ").Append(IcmpType).Append("\n");
            sb.Append("  Iface: ").Append(Iface).Append("\n");
            sb.Append("  Ipversion: ").Append(Ipversion).Append("\n");
            sb.Append("  Log: ").Append(Log).Append("\n");
            sb.Append("  Macro: ").Append(Macro).Append("\n");
            sb.Append("  Pos: ").Append(Pos).Append("\n");
            sb.Append("  Proto: ").Append(Proto).Append("\n");
            sb.Append("  Source: ").Append(Source).Append("\n");
            sb.Append("  Sport: ").Append(Sport).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;
        }
    }

}
