// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.Vcd
{
    [VcdResourceType("vcd:index/nsxvFirewallRule:NsxvFirewallRule")]
    public partial class NsxvFirewallRule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// This firewall rule will be inserted above the referred one
        /// </summary>
        [Output("aboveRuleId")]
        public Output<string?> AboveRuleId { get; private set; } = null!;

        /// <summary>
        /// 'accept' or 'deny'. Default 'accept'
        /// </summary>
        [Output("action")]
        public Output<string?> Action { get; private set; } = null!;

        [Output("destination")]
        public Output<Outputs.NsxvFirewallRuleDestination> Destination { get; private set; } = null!;

        /// <summary>
        /// Edge gateway name in which Firewall Rule is located
        /// </summary>
        [Output("edgeGateway")]
        public Output<string> EdgeGateway { get; private set; } = null!;

        /// <summary>
        /// Whether the rule should be enabled. Default 'true'
        /// </summary>
        [Output("enabled")]
        public Output<bool?> Enabled { get; private set; } = null!;

        /// <summary>
        /// Whether logging should be enabled for this rule. Default 'false'
        /// </summary>
        [Output("loggingEnabled")]
        public Output<bool?> LoggingEnabled { get; private set; } = null!;

        /// <summary>
        /// Firewall rule name
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across
        /// different organizations
        /// </summary>
        [Output("org")]
        public Output<string?> Org { get; private set; } = null!;

        /// <summary>
        /// Optional. Allows to set custom rule tag
        /// </summary>
        [Output("ruleTag")]
        public Output<int> RuleTag { get; private set; } = null!;

        /// <summary>
        /// Read only. Possible values 'user', 'internal_high'
        /// </summary>
        [Output("ruleType")]
        public Output<string> RuleType { get; private set; } = null!;

        [Output("services")]
        public Output<ImmutableArray<Outputs.NsxvFirewallRuleService>> Services { get; private set; } = null!;

        [Output("source")]
        public Output<Outputs.NsxvFirewallRuleSource> Source { get; private set; } = null!;

        /// <summary>
        /// The name of VDC to use, optional if defined at provider level
        /// </summary>
        [Output("vdc")]
        public Output<string?> Vdc { get; private set; } = null!;


        /// <summary>
        /// Create a NsxvFirewallRule resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public NsxvFirewallRule(string name, NsxvFirewallRuleArgs args, CustomResourceOptions? options = null)
            : base("vcd:index/nsxvFirewallRule:NsxvFirewallRule", name, args ?? new NsxvFirewallRuleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private NsxvFirewallRule(string name, Input<string> id, NsxvFirewallRuleState? state = null, CustomResourceOptions? options = null)
            : base("vcd:index/nsxvFirewallRule:NsxvFirewallRule", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing NsxvFirewallRule resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static NsxvFirewallRule Get(string name, Input<string> id, NsxvFirewallRuleState? state = null, CustomResourceOptions? options = null)
        {
            return new NsxvFirewallRule(name, id, state, options);
        }
    }

    public sealed class NsxvFirewallRuleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// This firewall rule will be inserted above the referred one
        /// </summary>
        [Input("aboveRuleId")]
        public Input<string>? AboveRuleId { get; set; }

        /// <summary>
        /// 'accept' or 'deny'. Default 'accept'
        /// </summary>
        [Input("action")]
        public Input<string>? Action { get; set; }

        [Input("destination", required: true)]
        public Input<Inputs.NsxvFirewallRuleDestinationArgs> Destination { get; set; } = null!;

        /// <summary>
        /// Edge gateway name in which Firewall Rule is located
        /// </summary>
        [Input("edgeGateway", required: true)]
        public Input<string> EdgeGateway { get; set; } = null!;

        /// <summary>
        /// Whether the rule should be enabled. Default 'true'
        /// </summary>
        [Input("enabled")]
        public Input<bool>? Enabled { get; set; }

        /// <summary>
        /// Whether logging should be enabled for this rule. Default 'false'
        /// </summary>
        [Input("loggingEnabled")]
        public Input<bool>? LoggingEnabled { get; set; }

        /// <summary>
        /// Firewall rule name
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across
        /// different organizations
        /// </summary>
        [Input("org")]
        public Input<string>? Org { get; set; }

        /// <summary>
        /// Optional. Allows to set custom rule tag
        /// </summary>
        [Input("ruleTag")]
        public Input<int>? RuleTag { get; set; }

        /// <summary>
        /// Read only. Possible values 'user', 'internal_high'
        /// </summary>
        [Input("ruleType")]
        public Input<string>? RuleType { get; set; }

        [Input("services", required: true)]
        private InputList<Inputs.NsxvFirewallRuleServiceArgs>? _services;
        public InputList<Inputs.NsxvFirewallRuleServiceArgs> Services
        {
            get => _services ?? (_services = new InputList<Inputs.NsxvFirewallRuleServiceArgs>());
            set => _services = value;
        }

        [Input("source", required: true)]
        public Input<Inputs.NsxvFirewallRuleSourceArgs> Source { get; set; } = null!;

        /// <summary>
        /// The name of VDC to use, optional if defined at provider level
        /// </summary>
        [Input("vdc")]
        public Input<string>? Vdc { get; set; }

        public NsxvFirewallRuleArgs()
        {
        }
        public static new NsxvFirewallRuleArgs Empty => new NsxvFirewallRuleArgs();
    }

    public sealed class NsxvFirewallRuleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// This firewall rule will be inserted above the referred one
        /// </summary>
        [Input("aboveRuleId")]
        public Input<string>? AboveRuleId { get; set; }

        /// <summary>
        /// 'accept' or 'deny'. Default 'accept'
        /// </summary>
        [Input("action")]
        public Input<string>? Action { get; set; }

        [Input("destination")]
        public Input<Inputs.NsxvFirewallRuleDestinationGetArgs>? Destination { get; set; }

        /// <summary>
        /// Edge gateway name in which Firewall Rule is located
        /// </summary>
        [Input("edgeGateway")]
        public Input<string>? EdgeGateway { get; set; }

        /// <summary>
        /// Whether the rule should be enabled. Default 'true'
        /// </summary>
        [Input("enabled")]
        public Input<bool>? Enabled { get; set; }

        /// <summary>
        /// Whether logging should be enabled for this rule. Default 'false'
        /// </summary>
        [Input("loggingEnabled")]
        public Input<bool>? LoggingEnabled { get; set; }

        /// <summary>
        /// Firewall rule name
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across
        /// different organizations
        /// </summary>
        [Input("org")]
        public Input<string>? Org { get; set; }

        /// <summary>
        /// Optional. Allows to set custom rule tag
        /// </summary>
        [Input("ruleTag")]
        public Input<int>? RuleTag { get; set; }

        /// <summary>
        /// Read only. Possible values 'user', 'internal_high'
        /// </summary>
        [Input("ruleType")]
        public Input<string>? RuleType { get; set; }

        [Input("services")]
        private InputList<Inputs.NsxvFirewallRuleServiceGetArgs>? _services;
        public InputList<Inputs.NsxvFirewallRuleServiceGetArgs> Services
        {
            get => _services ?? (_services = new InputList<Inputs.NsxvFirewallRuleServiceGetArgs>());
            set => _services = value;
        }

        [Input("source")]
        public Input<Inputs.NsxvFirewallRuleSourceGetArgs>? Source { get; set; }

        /// <summary>
        /// The name of VDC to use, optional if defined at provider level
        /// </summary>
        [Input("vdc")]
        public Input<string>? Vdc { get; set; }

        public NsxvFirewallRuleState()
        {
        }
        public static new NsxvFirewallRuleState Empty => new NsxvFirewallRuleState();
    }
}
