// *** 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 Cuemby.Equinix
{
    /// <summary>
    /// Resource `equinix.NetworkDeviceLink` allows creation and management of Equinix
    /// Network Edge virtual network device links.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Equinix = Cuemby.Equinix;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         // Example of device link with HA device pair
    ///         // where each device is in different metro
    ///         var test = new Equinix.NetworkDeviceLink("test", new Equinix.NetworkDeviceLinkArgs
    ///         {
    ///             Subnet = "192.168.40.64/27",
    ///             Devices = 
    ///             {
    ///                 new Equinix.Inputs.NetworkDeviceLinkDeviceArgs
    ///                 {
    ///                     Id = equinix_network_device.Test.Uuid,
    ///                     Asn = equinix_network_device.Test.Asn &gt; 0 ? equinix_network_device.Test.Asn : 22111,
    ///                     InterfaceId = 6,
    ///                 },
    ///                 new Equinix.Inputs.NetworkDeviceLinkDeviceArgs
    ///                 {
    ///                     Id = equinix_network_device.Test.Secondary_device[0].Uuid,
    ///                     Asn = equinix_network_device.Test.Secondary_device[0].Asn &gt; 0 ? equinix_network_device.Test.Secondary_device[0].Asn : 22333,
    ///                     InterfaceId = 7,
    ///                 },
    ///             },
    ///             Links = 
    ///             {
    ///                 new Equinix.Inputs.NetworkDeviceLinkLinkArgs
    ///                 {
    ///                     AccountNumber = equinix_network_device.Test.Account_number,
    ///                     SrcMetroCode = equinix_network_device.Test.Metro_code,
    ///                     DstMetroCode = equinix_network_device.Test.Secondary_device[0].Metro_code,
    ///                     Throughput = "50",
    ///                     ThroughputUnit = "Mbps",
    ///                 },
    ///             },
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// This resource can be imported using an existing ID
    /// 
    /// ```sh
    ///  $ pulumi import equinix:index/networkDeviceLink:NetworkDeviceLink example {existing_id}
    /// ```
    /// </summary>
    [EquinixResourceType("equinix:index/networkDeviceLink:NetworkDeviceLink")]
    public partial class NetworkDeviceLink : Pulumi.CustomResource
    {
        /// <summary>
        /// definition of one or more devices belonging to the
        /// device link. See Device section below for more details.
        /// </summary>
        [Output("devices")]
        public Output<ImmutableArray<Outputs.NetworkDeviceLinkDevice>> Devices { get; private set; } = null!;

        /// <summary>
        /// definition of one or more, inter metro, connections belonging
        /// to the device link. See Link section below for more details.
        /// </summary>
        [Output("links")]
        public Output<ImmutableArray<Outputs.NetworkDeviceLinkLink>> Links { get; private set; } = null!;

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

        /// <summary>
        /// device link provisioning status on a given device. One of `PROVISIONING`,
        /// `PROVISIONED`, `DEPROVISIONING`, `DEPROVISIONED`, `FAILED`.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// device link subnet in CIDR format. Not required for link
        /// between self configured devices.
        /// </summary>
        [Output("subnet")]
        public Output<string?> Subnet { get; private set; } = null!;

        /// <summary>
        /// Device link unique identifier.
        /// </summary>
        [Output("uuid")]
        public Output<string> Uuid { get; private set; } = null!;


        /// <summary>
        /// Create a NetworkDeviceLink 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 NetworkDeviceLink(string name, NetworkDeviceLinkArgs args, CustomResourceOptions? options = null)
            : base("equinix:index/networkDeviceLink:NetworkDeviceLink", name, args ?? new NetworkDeviceLinkArgs(), MakeResourceOptions(options, ""))
        {
        }

        private NetworkDeviceLink(string name, Input<string> id, NetworkDeviceLinkState? state = null, CustomResourceOptions? options = null)
            : base("equinix:index/networkDeviceLink:NetworkDeviceLink", 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/cuemby",
            };
            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 NetworkDeviceLink 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 NetworkDeviceLink Get(string name, Input<string> id, NetworkDeviceLinkState? state = null, CustomResourceOptions? options = null)
        {
            return new NetworkDeviceLink(name, id, state, options);
        }
    }

    public sealed class NetworkDeviceLinkArgs : Pulumi.ResourceArgs
    {
        [Input("devices", required: true)]
        private InputList<Inputs.NetworkDeviceLinkDeviceArgs>? _devices;

        /// <summary>
        /// definition of one or more devices belonging to the
        /// device link. See Device section below for more details.
        /// </summary>
        public InputList<Inputs.NetworkDeviceLinkDeviceArgs> Devices
        {
            get => _devices ?? (_devices = new InputList<Inputs.NetworkDeviceLinkDeviceArgs>());
            set => _devices = value;
        }

        [Input("links")]
        private InputList<Inputs.NetworkDeviceLinkLinkArgs>? _links;

        /// <summary>
        /// definition of one or more, inter metro, connections belonging
        /// to the device link. See Link section below for more details.
        /// </summary>
        public InputList<Inputs.NetworkDeviceLinkLinkArgs> Links
        {
            get => _links ?? (_links = new InputList<Inputs.NetworkDeviceLinkLinkArgs>());
            set => _links = value;
        }

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

        /// <summary>
        /// device link subnet in CIDR format. Not required for link
        /// between self configured devices.
        /// </summary>
        [Input("subnet")]
        public Input<string>? Subnet { get; set; }

        public NetworkDeviceLinkArgs()
        {
        }
    }

    public sealed class NetworkDeviceLinkState : Pulumi.ResourceArgs
    {
        [Input("devices")]
        private InputList<Inputs.NetworkDeviceLinkDeviceGetArgs>? _devices;

        /// <summary>
        /// definition of one or more devices belonging to the
        /// device link. See Device section below for more details.
        /// </summary>
        public InputList<Inputs.NetworkDeviceLinkDeviceGetArgs> Devices
        {
            get => _devices ?? (_devices = new InputList<Inputs.NetworkDeviceLinkDeviceGetArgs>());
            set => _devices = value;
        }

        [Input("links")]
        private InputList<Inputs.NetworkDeviceLinkLinkGetArgs>? _links;

        /// <summary>
        /// definition of one or more, inter metro, connections belonging
        /// to the device link. See Link section below for more details.
        /// </summary>
        public InputList<Inputs.NetworkDeviceLinkLinkGetArgs> Links
        {
            get => _links ?? (_links = new InputList<Inputs.NetworkDeviceLinkLinkGetArgs>());
            set => _links = value;
        }

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

        /// <summary>
        /// device link provisioning status on a given device. One of `PROVISIONING`,
        /// `PROVISIONED`, `DEPROVISIONING`, `DEPROVISIONED`, `FAILED`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// device link subnet in CIDR format. Not required for link
        /// between self configured devices.
        /// </summary>
        [Input("subnet")]
        public Input<string>? Subnet { get; set; }

        /// <summary>
        /// Device link unique identifier.
        /// </summary>
        [Input("uuid")]
        public Input<string>? Uuid { get; set; }

        public NetworkDeviceLinkState()
        {
        }
    }
}
