# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = ['AccountArgs', 'Account']

@pulumi.input_type
class AccountArgs:
    def __init__(__self__, *,
                 password: pulumi.Input[_builtins.str],
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 tunnel_medium_type: Optional[pulumi.Input[_builtins.int]] = None,
                 tunnel_type: Optional[pulumi.Input[_builtins.int]] = None):
        """
        The set of arguments for constructing a Account resource.
        :param pulumi.Input[_builtins.str] password: The password for this RADIUS account. For MAC-based authentication, this must match the username (the MAC address). For regular users, this should be a secure password following your organization's password policies.
        :param pulumi.Input[_builtins.str] name: The username for this RADIUS account. For regular users, this can be any unique identifier. For MAC-based authentication, this must be the device's MAC address in uppercase with no separators (e.g., '001122334455').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network (VLAN) to assign to clients authenticating with this account. This is used in conjunction with the tunnel attributes to provide VLAN assignment via RADIUS.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this RADIUS account should be created. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.int] tunnel_medium_type: The RADIUS tunnel medium type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.2). Common values:
                 * `6` - 802 (includes Ethernet, Token Ring, FDDI) (default)
                 * `1` - IPv4
                 * `2` - IPv6
               
               Only change this if you need specific tunneling behavior.
        :param pulumi.Input[_builtins.int] tunnel_type: The RADIUS tunnel type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.1). Common values:
                 * `13` - VLAN (default)
                 * `1` - Point-to-Point Protocol (PPTP)
                 * `9` - Point-to-Point Protocol (L2TP)
               
               Only change this if you need specific tunneling behavior.
        """
        pulumi.set(__self__, "password", password)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if network_id is not None:
            pulumi.set(__self__, "network_id", network_id)
        if site is not None:
            pulumi.set(__self__, "site", site)
        if tunnel_medium_type is not None:
            pulumi.set(__self__, "tunnel_medium_type", tunnel_medium_type)
        if tunnel_type is not None:
            pulumi.set(__self__, "tunnel_type", tunnel_type)

    @_builtins.property
    @pulumi.getter
    def password(self) -> pulumi.Input[_builtins.str]:
        """
        The password for this RADIUS account. For MAC-based authentication, this must match the username (the MAC address). For regular users, this should be a secure password following your organization's password policies.
        """
        return pulumi.get(self, "password")

    @password.setter
    def password(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "password", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The username for this RADIUS account. For regular users, this can be any unique identifier. For MAC-based authentication, this must be the device's MAC address in uppercase with no separators (e.g., '001122334455').
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="networkId")
    def network_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the network (VLAN) to assign to clients authenticating with this account. This is used in conjunction with the tunnel attributes to provide VLAN assignment via RADIUS.
        """
        return pulumi.get(self, "network_id")

    @network_id.setter
    def network_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "network_id", value)

    @_builtins.property
    @pulumi.getter
    def site(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the UniFi site where this RADIUS account should be created. If not specified, the default site will be used.
        """
        return pulumi.get(self, "site")

    @site.setter
    def site(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "site", value)

    @_builtins.property
    @pulumi.getter(name="tunnelMediumType")
    def tunnel_medium_type(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The RADIUS tunnel medium type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.2). Common values:
          * `6` - 802 (includes Ethernet, Token Ring, FDDI) (default)
          * `1` - IPv4
          * `2` - IPv6

        Only change this if you need specific tunneling behavior.
        """
        return pulumi.get(self, "tunnel_medium_type")

    @tunnel_medium_type.setter
    def tunnel_medium_type(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "tunnel_medium_type", value)

    @_builtins.property
    @pulumi.getter(name="tunnelType")
    def tunnel_type(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The RADIUS tunnel type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.1). Common values:
          * `13` - VLAN (default)
          * `1` - Point-to-Point Protocol (PPTP)
          * `9` - Point-to-Point Protocol (L2TP)

        Only change this if you need specific tunneling behavior.
        """
        return pulumi.get(self, "tunnel_type")

    @tunnel_type.setter
    def tunnel_type(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "tunnel_type", value)


@pulumi.input_type
class _AccountState:
    def __init__(__self__, *,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 password: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 tunnel_medium_type: Optional[pulumi.Input[_builtins.int]] = None,
                 tunnel_type: Optional[pulumi.Input[_builtins.int]] = None):
        """
        Input properties used for looking up and filtering Account resources.
        :param pulumi.Input[_builtins.str] name: The username for this RADIUS account. For regular users, this can be any unique identifier. For MAC-based authentication, this must be the device's MAC address in uppercase with no separators (e.g., '001122334455').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network (VLAN) to assign to clients authenticating with this account. This is used in conjunction with the tunnel attributes to provide VLAN assignment via RADIUS.
        :param pulumi.Input[_builtins.str] password: The password for this RADIUS account. For MAC-based authentication, this must match the username (the MAC address). For regular users, this should be a secure password following your organization's password policies.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this RADIUS account should be created. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.int] tunnel_medium_type: The RADIUS tunnel medium type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.2). Common values:
                 * `6` - 802 (includes Ethernet, Token Ring, FDDI) (default)
                 * `1` - IPv4
                 * `2` - IPv6
               
               Only change this if you need specific tunneling behavior.
        :param pulumi.Input[_builtins.int] tunnel_type: The RADIUS tunnel type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.1). Common values:
                 * `13` - VLAN (default)
                 * `1` - Point-to-Point Protocol (PPTP)
                 * `9` - Point-to-Point Protocol (L2TP)
               
               Only change this if you need specific tunneling behavior.
        """
        if name is not None:
            pulumi.set(__self__, "name", name)
        if network_id is not None:
            pulumi.set(__self__, "network_id", network_id)
        if password is not None:
            pulumi.set(__self__, "password", password)
        if site is not None:
            pulumi.set(__self__, "site", site)
        if tunnel_medium_type is not None:
            pulumi.set(__self__, "tunnel_medium_type", tunnel_medium_type)
        if tunnel_type is not None:
            pulumi.set(__self__, "tunnel_type", tunnel_type)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The username for this RADIUS account. For regular users, this can be any unique identifier. For MAC-based authentication, this must be the device's MAC address in uppercase with no separators (e.g., '001122334455').
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="networkId")
    def network_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the network (VLAN) to assign to clients authenticating with this account. This is used in conjunction with the tunnel attributes to provide VLAN assignment via RADIUS.
        """
        return pulumi.get(self, "network_id")

    @network_id.setter
    def network_id(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "network_id", value)

    @_builtins.property
    @pulumi.getter
    def password(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The password for this RADIUS account. For MAC-based authentication, this must match the username (the MAC address). For regular users, this should be a secure password following your organization's password policies.
        """
        return pulumi.get(self, "password")

    @password.setter
    def password(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "password", value)

    @_builtins.property
    @pulumi.getter
    def site(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the UniFi site where this RADIUS account should be created. If not specified, the default site will be used.
        """
        return pulumi.get(self, "site")

    @site.setter
    def site(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "site", value)

    @_builtins.property
    @pulumi.getter(name="tunnelMediumType")
    def tunnel_medium_type(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The RADIUS tunnel medium type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.2). Common values:
          * `6` - 802 (includes Ethernet, Token Ring, FDDI) (default)
          * `1` - IPv4
          * `2` - IPv6

        Only change this if you need specific tunneling behavior.
        """
        return pulumi.get(self, "tunnel_medium_type")

    @tunnel_medium_type.setter
    def tunnel_medium_type(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "tunnel_medium_type", value)

    @_builtins.property
    @pulumi.getter(name="tunnelType")
    def tunnel_type(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The RADIUS tunnel type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.1). Common values:
          * `13` - VLAN (default)
          * `1` - Point-to-Point Protocol (PPTP)
          * `9` - Point-to-Point Protocol (L2TP)

        Only change this if you need specific tunneling behavior.
        """
        return pulumi.get(self, "tunnel_type")

    @tunnel_type.setter
    def tunnel_type(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "tunnel_type", value)


@pulumi.type_token("unifi:index/account:Account")
class Account(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 password: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 tunnel_medium_type: Optional[pulumi.Input[_builtins.int]] = None,
                 tunnel_type: Optional[pulumi.Input[_builtins.int]] = None,
                 __props__=None):
        """
        The `Account` resource manages RADIUS user accounts in the UniFi controller's built-in RADIUS server.

        This resource is used for:
          * WPA2/WPA3-Enterprise wireless authentication
          * 802.1X wired authentication
          * MAC-based device authentication
          * VLAN assignment through RADIUS attributes

        Important Notes:
        1. For MAC-based authentication:
           * Use the device's MAC address as both username and password
           * Convert MAC address to uppercase with no separators (e.g., '00:11:22:33:44:55' becomes '001122334455')
        2. VLAN Assignment:
           * If no VLAN is specified in the profile, clients will use the network's untagged VLAN
           * VLAN assignment uses standard RADIUS tunnel attributes

        Limitations:
          * MAC-based authentication works only for wireless and wired clients
          * L2TP remote access VPN is not supported with MAC authentication
          * Accounts must be unique within a site

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] name: The username for this RADIUS account. For regular users, this can be any unique identifier. For MAC-based authentication, this must be the device's MAC address in uppercase with no separators (e.g., '001122334455').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network (VLAN) to assign to clients authenticating with this account. This is used in conjunction with the tunnel attributes to provide VLAN assignment via RADIUS.
        :param pulumi.Input[_builtins.str] password: The password for this RADIUS account. For MAC-based authentication, this must match the username (the MAC address). For regular users, this should be a secure password following your organization's password policies.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this RADIUS account should be created. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.int] tunnel_medium_type: The RADIUS tunnel medium type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.2). Common values:
                 * `6` - 802 (includes Ethernet, Token Ring, FDDI) (default)
                 * `1` - IPv4
                 * `2` - IPv6
               
               Only change this if you need specific tunneling behavior.
        :param pulumi.Input[_builtins.int] tunnel_type: The RADIUS tunnel type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.1). Common values:
                 * `13` - VLAN (default)
                 * `1` - Point-to-Point Protocol (PPTP)
                 * `9` - Point-to-Point Protocol (L2TP)
               
               Only change this if you need specific tunneling behavior.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AccountArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `Account` resource manages RADIUS user accounts in the UniFi controller's built-in RADIUS server.

        This resource is used for:
          * WPA2/WPA3-Enterprise wireless authentication
          * 802.1X wired authentication
          * MAC-based device authentication
          * VLAN assignment through RADIUS attributes

        Important Notes:
        1. For MAC-based authentication:
           * Use the device's MAC address as both username and password
           * Convert MAC address to uppercase with no separators (e.g., '00:11:22:33:44:55' becomes '001122334455')
        2. VLAN Assignment:
           * If no VLAN is specified in the profile, clients will use the network's untagged VLAN
           * VLAN assignment uses standard RADIUS tunnel attributes

        Limitations:
          * MAC-based authentication works only for wireless and wired clients
          * L2TP remote access VPN is not supported with MAC authentication
          * Accounts must be unique within a site

        :param str resource_name: The name of the resource.
        :param AccountArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(AccountArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 password: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 tunnel_medium_type: Optional[pulumi.Input[_builtins.int]] = None,
                 tunnel_type: Optional[pulumi.Input[_builtins.int]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = AccountArgs.__new__(AccountArgs)

            __props__.__dict__["name"] = name
            __props__.__dict__["network_id"] = network_id
            if password is None and not opts.urn:
                raise TypeError("Missing required property 'password'")
            __props__.__dict__["password"] = None if password is None else pulumi.Output.secret(password)
            __props__.__dict__["site"] = site
            __props__.__dict__["tunnel_medium_type"] = tunnel_medium_type
            __props__.__dict__["tunnel_type"] = tunnel_type
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["password"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(Account, __self__).__init__(
            'unifi:index/account:Account',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            network_id: Optional[pulumi.Input[_builtins.str]] = None,
            password: Optional[pulumi.Input[_builtins.str]] = None,
            site: Optional[pulumi.Input[_builtins.str]] = None,
            tunnel_medium_type: Optional[pulumi.Input[_builtins.int]] = None,
            tunnel_type: Optional[pulumi.Input[_builtins.int]] = None) -> 'Account':
        """
        Get an existing Account resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] name: The username for this RADIUS account. For regular users, this can be any unique identifier. For MAC-based authentication, this must be the device's MAC address in uppercase with no separators (e.g., '001122334455').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network (VLAN) to assign to clients authenticating with this account. This is used in conjunction with the tunnel attributes to provide VLAN assignment via RADIUS.
        :param pulumi.Input[_builtins.str] password: The password for this RADIUS account. For MAC-based authentication, this must match the username (the MAC address). For regular users, this should be a secure password following your organization's password policies.
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this RADIUS account should be created. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.int] tunnel_medium_type: The RADIUS tunnel medium type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.2). Common values:
                 * `6` - 802 (includes Ethernet, Token Ring, FDDI) (default)
                 * `1` - IPv4
                 * `2` - IPv6
               
               Only change this if you need specific tunneling behavior.
        :param pulumi.Input[_builtins.int] tunnel_type: The RADIUS tunnel type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.1). Common values:
                 * `13` - VLAN (default)
                 * `1` - Point-to-Point Protocol (PPTP)
                 * `9` - Point-to-Point Protocol (L2TP)
               
               Only change this if you need specific tunneling behavior.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _AccountState.__new__(_AccountState)

        __props__.__dict__["name"] = name
        __props__.__dict__["network_id"] = network_id
        __props__.__dict__["password"] = password
        __props__.__dict__["site"] = site
        __props__.__dict__["tunnel_medium_type"] = tunnel_medium_type
        __props__.__dict__["tunnel_type"] = tunnel_type
        return Account(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        The username for this RADIUS account. For regular users, this can be any unique identifier. For MAC-based authentication, this must be the device's MAC address in uppercase with no separators (e.g., '001122334455').
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="networkId")
    def network_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The ID of the network (VLAN) to assign to clients authenticating with this account. This is used in conjunction with the tunnel attributes to provide VLAN assignment via RADIUS.
        """
        return pulumi.get(self, "network_id")

    @_builtins.property
    @pulumi.getter
    def password(self) -> pulumi.Output[_builtins.str]:
        """
        The password for this RADIUS account. For MAC-based authentication, this must match the username (the MAC address). For regular users, this should be a secure password following your organization's password policies.
        """
        return pulumi.get(self, "password")

    @_builtins.property
    @pulumi.getter
    def site(self) -> pulumi.Output[_builtins.str]:
        """
        The name of the UniFi site where this RADIUS account should be created. If not specified, the default site will be used.
        """
        return pulumi.get(self, "site")

    @_builtins.property
    @pulumi.getter(name="tunnelMediumType")
    def tunnel_medium_type(self) -> pulumi.Output[Optional[_builtins.int]]:
        """
        The RADIUS tunnel medium type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.2). Common values:
          * `6` - 802 (includes Ethernet, Token Ring, FDDI) (default)
          * `1` - IPv4
          * `2` - IPv6

        Only change this if you need specific tunneling behavior.
        """
        return pulumi.get(self, "tunnel_medium_type")

    @_builtins.property
    @pulumi.getter(name="tunnelType")
    def tunnel_type(self) -> pulumi.Output[Optional[_builtins.int]]:
        """
        The RADIUS tunnel type attribute ([RFC 2868](https://tools.ietf.org/html/rfc2868), section 3.1). Common values:
          * `13` - VLAN (default)
          * `1` - Point-to-Point Protocol (PPTP)
          * `9` - Point-to-Point Protocol (L2TP)

        Only change this if you need specific tunneling behavior.
        """
        return pulumi.get(self, "tunnel_type")

