// *** 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;
using Pulumi;

namespace Pulumiverse.Fortios
{
    /// <summary>
    /// Configure system NTP information.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Fortios = Pulumiverse.Fortios;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var trname = new Fortios.SystemNtp("trname", new()
    ///     {
    ///         Ntpsync = "enable",
    ///         ServerMode = "disable",
    ///         SourceIp = "0.0.0.0",
    ///         SourceIp6 = "::",
    ///         Syncinterval = 1,
    ///         Type = "fortiguard",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// System Ntp can be imported using any of these accepted formats
    /// 
    /// ```sh
    ///  $ pulumi import fortios:index/systemNtp:SystemNtp labelname SystemNtp
    /// ```
    /// 
    ///  If you do not want to import arguments of block$ export "FORTIOS_IMPORT_TABLE"="false"
    /// 
    /// ```sh
    ///  $ pulumi import fortios:index/systemNtp:SystemNtp labelname SystemNtp
    /// ```
    /// 
    ///  $ unset "FORTIOS_IMPORT_TABLE"
    /// </summary>
    [FortiosResourceType("fortios:index/systemNtp:SystemNtp")]
    public partial class SystemNtp : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Enable/disable authentication. Valid values: `enable`, `disable`.
        /// </summary>
        [Output("authentication")]
        public Output<string> Authentication { get; private set; } = null!;

        /// <summary>
        /// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -&gt; [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -&gt; [ a10, a2 ].
        /// </summary>
        [Output("dynamicSortSubtable")]
        public Output<string?> DynamicSortSubtable { get; private set; } = null!;

        /// <summary>
        /// FortiGate interface(s) with NTP server mode enabled. Devices on your network can contact these interfaces for NTP services. The structure of `interface` block is documented below.
        /// </summary>
        [Output("interfaces")]
        public Output<ImmutableArray<Outputs.SystemNtpInterface>> Interfaces { get; private set; } = null!;

        /// <summary>
        /// Key for authentication.
        /// </summary>
        [Output("key")]
        public Output<string?> Key { get; private set; } = null!;

        /// <summary>
        /// Key ID for authentication.
        /// </summary>
        [Output("keyId")]
        public Output<int> KeyId { get; private set; } = null!;

        /// <summary>
        /// Key type for authentication (MD5, SHA1). Valid values: `MD5`, `SHA1`.
        /// </summary>
        [Output("keyType")]
        public Output<string> KeyType { get; private set; } = null!;

        /// <summary>
        /// Configure the FortiGate to connect to any available third-party NTP server. The structure of `ntpserver` block is documented below.
        /// </summary>
        [Output("ntpservers")]
        public Output<ImmutableArray<Outputs.SystemNtpNtpserver>> Ntpservers { get; private set; } = null!;

        /// <summary>
        /// Enable/disable setting the FortiGate system time by synchronizing with an NTP Server. Valid values: `enable`, `disable`.
        /// </summary>
        [Output("ntpsync")]
        public Output<string> Ntpsync { get; private set; } = null!;

        /// <summary>
        /// Enable/disable FortiGate NTP Server Mode. Your FortiGate becomes an NTP server for other devices on your network. The FortiGate relays NTP requests to its configured NTP server. Valid values: `enable`, `disable`.
        /// </summary>
        [Output("serverMode")]
        public Output<string> ServerMode { get; private set; } = null!;

        /// <summary>
        /// Source IP address for communication to the NTP server.
        /// </summary>
        [Output("sourceIp")]
        public Output<string> SourceIp { get; private set; } = null!;

        /// <summary>
        /// Source IPv6 address for communication to the NTP server.
        /// </summary>
        [Output("sourceIp6")]
        public Output<string> SourceIp6 { get; private set; } = null!;

        /// <summary>
        /// NTP synchronization interval (1 - 1440 min).
        /// </summary>
        [Output("syncinterval")]
        public Output<int> Syncinterval { get; private set; } = null!;

        /// <summary>
        /// Use the FortiGuard NTP server or any other available NTP Server. Valid values: `fortiguard`, `custom`.
        /// </summary>
        [Output("type")]
        public Output<string> Type { get; private set; } = null!;

        /// <summary>
        /// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
        /// </summary>
        [Output("vdomparam")]
        public Output<string?> Vdomparam { get; private set; } = null!;


        /// <summary>
        /// Create a SystemNtp 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 SystemNtp(string name, SystemNtpArgs? args = null, CustomResourceOptions? options = null)
            : base("fortios:index/systemNtp:SystemNtp", name, args ?? new SystemNtpArgs(), MakeResourceOptions(options, ""))
        {
        }

        private SystemNtp(string name, Input<string> id, SystemNtpState? state = null, CustomResourceOptions? options = null)
            : base("fortios:index/systemNtp:SystemNtp", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/pulumiverse/pulumi-fortios",
                AdditionalSecretOutputs =
                {
                    "key",
                },
            };
            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 SystemNtp 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 SystemNtp Get(string name, Input<string> id, SystemNtpState? state = null, CustomResourceOptions? options = null)
        {
            return new SystemNtp(name, id, state, options);
        }
    }

    public sealed class SystemNtpArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Enable/disable authentication. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("authentication")]
        public Input<string>? Authentication { get; set; }

        /// <summary>
        /// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -&gt; [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -&gt; [ a10, a2 ].
        /// </summary>
        [Input("dynamicSortSubtable")]
        public Input<string>? DynamicSortSubtable { get; set; }

        [Input("interfaces")]
        private InputList<Inputs.SystemNtpInterfaceArgs>? _interfaces;

        /// <summary>
        /// FortiGate interface(s) with NTP server mode enabled. Devices on your network can contact these interfaces for NTP services. The structure of `interface` block is documented below.
        /// </summary>
        public InputList<Inputs.SystemNtpInterfaceArgs> Interfaces
        {
            get => _interfaces ?? (_interfaces = new InputList<Inputs.SystemNtpInterfaceArgs>());
            set => _interfaces = value;
        }

        [Input("key")]
        private Input<string>? _key;

        /// <summary>
        /// Key for authentication.
        /// </summary>
        public Input<string>? Key
        {
            get => _key;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _key = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Key ID for authentication.
        /// </summary>
        [Input("keyId")]
        public Input<int>? KeyId { get; set; }

        /// <summary>
        /// Key type for authentication (MD5, SHA1). Valid values: `MD5`, `SHA1`.
        /// </summary>
        [Input("keyType")]
        public Input<string>? KeyType { get; set; }

        [Input("ntpservers")]
        private InputList<Inputs.SystemNtpNtpserverArgs>? _ntpservers;

        /// <summary>
        /// Configure the FortiGate to connect to any available third-party NTP server. The structure of `ntpserver` block is documented below.
        /// </summary>
        public InputList<Inputs.SystemNtpNtpserverArgs> Ntpservers
        {
            get => _ntpservers ?? (_ntpservers = new InputList<Inputs.SystemNtpNtpserverArgs>());
            set => _ntpservers = value;
        }

        /// <summary>
        /// Enable/disable setting the FortiGate system time by synchronizing with an NTP Server. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("ntpsync")]
        public Input<string>? Ntpsync { get; set; }

        /// <summary>
        /// Enable/disable FortiGate NTP Server Mode. Your FortiGate becomes an NTP server for other devices on your network. The FortiGate relays NTP requests to its configured NTP server. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("serverMode")]
        public Input<string>? ServerMode { get; set; }

        /// <summary>
        /// Source IP address for communication to the NTP server.
        /// </summary>
        [Input("sourceIp")]
        public Input<string>? SourceIp { get; set; }

        /// <summary>
        /// Source IPv6 address for communication to the NTP server.
        /// </summary>
        [Input("sourceIp6")]
        public Input<string>? SourceIp6 { get; set; }

        /// <summary>
        /// NTP synchronization interval (1 - 1440 min).
        /// </summary>
        [Input("syncinterval")]
        public Input<int>? Syncinterval { get; set; }

        /// <summary>
        /// Use the FortiGuard NTP server or any other available NTP Server. Valid values: `fortiguard`, `custom`.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
        /// </summary>
        [Input("vdomparam")]
        public Input<string>? Vdomparam { get; set; }

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

    public sealed class SystemNtpState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Enable/disable authentication. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("authentication")]
        public Input<string>? Authentication { get; set; }

        /// <summary>
        /// Sort sub-tables, please do not set this parameter when configuring static sub-tables. Options: [ false, true, natural, alphabetical ]. false: Default value, do not sort tables; true/natural: sort tables in natural order. For example: [ a10, a2 ] -&gt; [ a2, a10 ]; alphabetical: sort tables in alphabetical order. For example: [ a10, a2 ] -&gt; [ a10, a2 ].
        /// </summary>
        [Input("dynamicSortSubtable")]
        public Input<string>? DynamicSortSubtable { get; set; }

        [Input("interfaces")]
        private InputList<Inputs.SystemNtpInterfaceGetArgs>? _interfaces;

        /// <summary>
        /// FortiGate interface(s) with NTP server mode enabled. Devices on your network can contact these interfaces for NTP services. The structure of `interface` block is documented below.
        /// </summary>
        public InputList<Inputs.SystemNtpInterfaceGetArgs> Interfaces
        {
            get => _interfaces ?? (_interfaces = new InputList<Inputs.SystemNtpInterfaceGetArgs>());
            set => _interfaces = value;
        }

        [Input("key")]
        private Input<string>? _key;

        /// <summary>
        /// Key for authentication.
        /// </summary>
        public Input<string>? Key
        {
            get => _key;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _key = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        /// <summary>
        /// Key ID for authentication.
        /// </summary>
        [Input("keyId")]
        public Input<int>? KeyId { get; set; }

        /// <summary>
        /// Key type for authentication (MD5, SHA1). Valid values: `MD5`, `SHA1`.
        /// </summary>
        [Input("keyType")]
        public Input<string>? KeyType { get; set; }

        [Input("ntpservers")]
        private InputList<Inputs.SystemNtpNtpserverGetArgs>? _ntpservers;

        /// <summary>
        /// Configure the FortiGate to connect to any available third-party NTP server. The structure of `ntpserver` block is documented below.
        /// </summary>
        public InputList<Inputs.SystemNtpNtpserverGetArgs> Ntpservers
        {
            get => _ntpservers ?? (_ntpservers = new InputList<Inputs.SystemNtpNtpserverGetArgs>());
            set => _ntpservers = value;
        }

        /// <summary>
        /// Enable/disable setting the FortiGate system time by synchronizing with an NTP Server. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("ntpsync")]
        public Input<string>? Ntpsync { get; set; }

        /// <summary>
        /// Enable/disable FortiGate NTP Server Mode. Your FortiGate becomes an NTP server for other devices on your network. The FortiGate relays NTP requests to its configured NTP server. Valid values: `enable`, `disable`.
        /// </summary>
        [Input("serverMode")]
        public Input<string>? ServerMode { get; set; }

        /// <summary>
        /// Source IP address for communication to the NTP server.
        /// </summary>
        [Input("sourceIp")]
        public Input<string>? SourceIp { get; set; }

        /// <summary>
        /// Source IPv6 address for communication to the NTP server.
        /// </summary>
        [Input("sourceIp6")]
        public Input<string>? SourceIp6 { get; set; }

        /// <summary>
        /// NTP synchronization interval (1 - 1440 min).
        /// </summary>
        [Input("syncinterval")]
        public Input<int>? Syncinterval { get; set; }

        /// <summary>
        /// Use the FortiGuard NTP server or any other available NTP Server. Valid values: `fortiguard`, `custom`.
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// Specifies the vdom to which the resource will be applied when the FortiGate unit is running in VDOM mode. Only one vdom can be specified. If you want to inherit the vdom configuration of the provider, please do not set this parameter.
        /// </summary>
        [Input("vdomparam")]
        public Input<string>? Vdomparam { get; set; }

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