# 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__ = ['UserArgs', 'User']

@pulumi.input_type
class UserArgs:
    def __init__(__self__, *,
                 mac: pulumi.Input[_builtins.str],
                 allow_existing: Optional[pulumi.Input[_builtins.bool]] = None,
                 blocked: Optional[pulumi.Input[_builtins.bool]] = None,
                 dev_id_override: Optional[pulumi.Input[_builtins.int]] = None,
                 fixed_ip: Optional[pulumi.Input[_builtins.str]] = None,
                 local_dns_record: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 note: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 skip_forget_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 user_group_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a User resource.
        :param pulumi.Input[_builtins.str] mac: The MAC address of the device/client. This is used as the unique identifier and cannot be changed after creation. Must be a valid MAC address format (e.g., '00:11:22:33:44:55'). MAC addresses are case-insensitive.
        :param pulumi.Input[_builtins.bool] allow_existing: Allow this resource to take over management of an existing user in the UniFi controller. When true:
                 * The resource can manage users that were automatically created when devices connected
                 * Existing settings will be overwritten with the values specified in this resource
                 * If false, attempting to manage an existing user will result in an error
               
               Use with caution as it can modify settings for devices already connected to your network.
        :param pulumi.Input[_builtins.bool] blocked: When true, this client will be blocked from accessing the network. Useful for temporarily or permanently restricting network access for specific devices.
        :param pulumi.Input[_builtins.int] dev_id_override: Override the device fingerprint.
        :param pulumi.Input[_builtins.str] fixed_ip: A static IPv4 address to assign to this client. Ensure this IP is within the client's network range and not already assigned to another device.
        :param pulumi.Input[_builtins.str] local_dns_record: A local DNS hostname for this client. When set, other devices on the network can resolve this name to the client's IP address (e.g., 'printer.local', 'nas.home.arpa'). Such DNS record is automatically added to controller's DNS records.
        :param pulumi.Input[_builtins.str] name: A friendly name for the device/client. This helps identify the device in the UniFi interface (eg. 'Living Room TV', 'John's Laptop').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network this client should be associated with. This is particularly important when using VLANs or multiple networks.
        :param pulumi.Input[_builtins.str] note: Additional information about the client that you want to record (e.g., 'Company asset tag #12345', 'Guest device - expires 2024-03-01').
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this user should be managed. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.bool] skip_forget_on_destroy: When false (default), the client will be 'forgotten' by the controller when this resource is destroyed. Set to true to keep the client's history in the controller after the resource is removed from Terraform.
        :param pulumi.Input[_builtins.str] user_group_id: The ID of the user group this client belongs to. User groups can be used to apply common settings and restrictions to multiple clients.
        """
        pulumi.set(__self__, "mac", mac)
        if allow_existing is not None:
            pulumi.set(__self__, "allow_existing", allow_existing)
        if blocked is not None:
            pulumi.set(__self__, "blocked", blocked)
        if dev_id_override is not None:
            pulumi.set(__self__, "dev_id_override", dev_id_override)
        if fixed_ip is not None:
            pulumi.set(__self__, "fixed_ip", fixed_ip)
        if local_dns_record is not None:
            pulumi.set(__self__, "local_dns_record", local_dns_record)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if network_id is not None:
            pulumi.set(__self__, "network_id", network_id)
        if note is not None:
            pulumi.set(__self__, "note", note)
        if site is not None:
            pulumi.set(__self__, "site", site)
        if skip_forget_on_destroy is not None:
            pulumi.set(__self__, "skip_forget_on_destroy", skip_forget_on_destroy)
        if user_group_id is not None:
            pulumi.set(__self__, "user_group_id", user_group_id)

    @_builtins.property
    @pulumi.getter
    def mac(self) -> pulumi.Input[_builtins.str]:
        """
        The MAC address of the device/client. This is used as the unique identifier and cannot be changed after creation. Must be a valid MAC address format (e.g., '00:11:22:33:44:55'). MAC addresses are case-insensitive.
        """
        return pulumi.get(self, "mac")

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

    @_builtins.property
    @pulumi.getter(name="allowExisting")
    def allow_existing(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow this resource to take over management of an existing user in the UniFi controller. When true:
          * The resource can manage users that were automatically created when devices connected
          * Existing settings will be overwritten with the values specified in this resource
          * If false, attempting to manage an existing user will result in an error

        Use with caution as it can modify settings for devices already connected to your network.
        """
        return pulumi.get(self, "allow_existing")

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

    @_builtins.property
    @pulumi.getter
    def blocked(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When true, this client will be blocked from accessing the network. Useful for temporarily or permanently restricting network access for specific devices.
        """
        return pulumi.get(self, "blocked")

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

    @_builtins.property
    @pulumi.getter(name="devIdOverride")
    def dev_id_override(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        Override the device fingerprint.
        """
        return pulumi.get(self, "dev_id_override")

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

    @_builtins.property
    @pulumi.getter(name="fixedIp")
    def fixed_ip(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A static IPv4 address to assign to this client. Ensure this IP is within the client's network range and not already assigned to another device.
        """
        return pulumi.get(self, "fixed_ip")

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

    @_builtins.property
    @pulumi.getter(name="localDnsRecord")
    def local_dns_record(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A local DNS hostname for this client. When set, other devices on the network can resolve this name to the client's IP address (e.g., 'printer.local', 'nas.home.arpa'). Such DNS record is automatically added to controller's DNS records.
        """
        return pulumi.get(self, "local_dns_record")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A friendly name for the device/client. This helps identify the device in the UniFi interface (eg. 'Living Room TV', 'John's Laptop').
        """
        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 this client should be associated with. This is particularly important when using VLANs or multiple networks.
        """
        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 note(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Additional information about the client that you want to record (e.g., 'Company asset tag #12345', 'Guest device - expires 2024-03-01').
        """
        return pulumi.get(self, "note")

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

    @_builtins.property
    @pulumi.getter
    def site(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the UniFi site where this user should be managed. 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="skipForgetOnDestroy")
    def skip_forget_on_destroy(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When false (default), the client will be 'forgotten' by the controller when this resource is destroyed. Set to true to keep the client's history in the controller after the resource is removed from Terraform.
        """
        return pulumi.get(self, "skip_forget_on_destroy")

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

    @_builtins.property
    @pulumi.getter(name="userGroupId")
    def user_group_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the user group this client belongs to. User groups can be used to apply common settings and restrictions to multiple clients.
        """
        return pulumi.get(self, "user_group_id")

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


@pulumi.input_type
class _UserState:
    def __init__(__self__, *,
                 allow_existing: Optional[pulumi.Input[_builtins.bool]] = None,
                 blocked: Optional[pulumi.Input[_builtins.bool]] = None,
                 dev_id_override: Optional[pulumi.Input[_builtins.int]] = None,
                 fixed_ip: Optional[pulumi.Input[_builtins.str]] = None,
                 hostname: Optional[pulumi.Input[_builtins.str]] = None,
                 ip: Optional[pulumi.Input[_builtins.str]] = None,
                 local_dns_record: Optional[pulumi.Input[_builtins.str]] = None,
                 mac: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 note: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 skip_forget_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 user_group_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering User resources.
        :param pulumi.Input[_builtins.bool] allow_existing: Allow this resource to take over management of an existing user in the UniFi controller. When true:
                 * The resource can manage users that were automatically created when devices connected
                 * Existing settings will be overwritten with the values specified in this resource
                 * If false, attempting to manage an existing user will result in an error
               
               Use with caution as it can modify settings for devices already connected to your network.
        :param pulumi.Input[_builtins.bool] blocked: When true, this client will be blocked from accessing the network. Useful for temporarily or permanently restricting network access for specific devices.
        :param pulumi.Input[_builtins.int] dev_id_override: Override the device fingerprint.
        :param pulumi.Input[_builtins.str] fixed_ip: A static IPv4 address to assign to this client. Ensure this IP is within the client's network range and not already assigned to another device.
        :param pulumi.Input[_builtins.str] hostname: The hostname of the user.
        :param pulumi.Input[_builtins.str] ip: The IP address of the user.
        :param pulumi.Input[_builtins.str] local_dns_record: A local DNS hostname for this client. When set, other devices on the network can resolve this name to the client's IP address (e.g., 'printer.local', 'nas.home.arpa'). Such DNS record is automatically added to controller's DNS records.
        :param pulumi.Input[_builtins.str] mac: The MAC address of the device/client. This is used as the unique identifier and cannot be changed after creation. Must be a valid MAC address format (e.g., '00:11:22:33:44:55'). MAC addresses are case-insensitive.
        :param pulumi.Input[_builtins.str] name: A friendly name for the device/client. This helps identify the device in the UniFi interface (eg. 'Living Room TV', 'John's Laptop').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network this client should be associated with. This is particularly important when using VLANs or multiple networks.
        :param pulumi.Input[_builtins.str] note: Additional information about the client that you want to record (e.g., 'Company asset tag #12345', 'Guest device - expires 2024-03-01').
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this user should be managed. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.bool] skip_forget_on_destroy: When false (default), the client will be 'forgotten' by the controller when this resource is destroyed. Set to true to keep the client's history in the controller after the resource is removed from Terraform.
        :param pulumi.Input[_builtins.str] user_group_id: The ID of the user group this client belongs to. User groups can be used to apply common settings and restrictions to multiple clients.
        """
        if allow_existing is not None:
            pulumi.set(__self__, "allow_existing", allow_existing)
        if blocked is not None:
            pulumi.set(__self__, "blocked", blocked)
        if dev_id_override is not None:
            pulumi.set(__self__, "dev_id_override", dev_id_override)
        if fixed_ip is not None:
            pulumi.set(__self__, "fixed_ip", fixed_ip)
        if hostname is not None:
            pulumi.set(__self__, "hostname", hostname)
        if ip is not None:
            pulumi.set(__self__, "ip", ip)
        if local_dns_record is not None:
            pulumi.set(__self__, "local_dns_record", local_dns_record)
        if mac is not None:
            pulumi.set(__self__, "mac", mac)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if network_id is not None:
            pulumi.set(__self__, "network_id", network_id)
        if note is not None:
            pulumi.set(__self__, "note", note)
        if site is not None:
            pulumi.set(__self__, "site", site)
        if skip_forget_on_destroy is not None:
            pulumi.set(__self__, "skip_forget_on_destroy", skip_forget_on_destroy)
        if user_group_id is not None:
            pulumi.set(__self__, "user_group_id", user_group_id)

    @_builtins.property
    @pulumi.getter(name="allowExisting")
    def allow_existing(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow this resource to take over management of an existing user in the UniFi controller. When true:
          * The resource can manage users that were automatically created when devices connected
          * Existing settings will be overwritten with the values specified in this resource
          * If false, attempting to manage an existing user will result in an error

        Use with caution as it can modify settings for devices already connected to your network.
        """
        return pulumi.get(self, "allow_existing")

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

    @_builtins.property
    @pulumi.getter
    def blocked(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When true, this client will be blocked from accessing the network. Useful for temporarily or permanently restricting network access for specific devices.
        """
        return pulumi.get(self, "blocked")

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

    @_builtins.property
    @pulumi.getter(name="devIdOverride")
    def dev_id_override(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        Override the device fingerprint.
        """
        return pulumi.get(self, "dev_id_override")

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

    @_builtins.property
    @pulumi.getter(name="fixedIp")
    def fixed_ip(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A static IPv4 address to assign to this client. Ensure this IP is within the client's network range and not already assigned to another device.
        """
        return pulumi.get(self, "fixed_ip")

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

    @_builtins.property
    @pulumi.getter
    def hostname(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The hostname of the user.
        """
        return pulumi.get(self, "hostname")

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

    @_builtins.property
    @pulumi.getter
    def ip(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The IP address of the user.
        """
        return pulumi.get(self, "ip")

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

    @_builtins.property
    @pulumi.getter(name="localDnsRecord")
    def local_dns_record(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A local DNS hostname for this client. When set, other devices on the network can resolve this name to the client's IP address (e.g., 'printer.local', 'nas.home.arpa'). Such DNS record is automatically added to controller's DNS records.
        """
        return pulumi.get(self, "local_dns_record")

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

    @_builtins.property
    @pulumi.getter
    def mac(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The MAC address of the device/client. This is used as the unique identifier and cannot be changed after creation. Must be a valid MAC address format (e.g., '00:11:22:33:44:55'). MAC addresses are case-insensitive.
        """
        return pulumi.get(self, "mac")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        A friendly name for the device/client. This helps identify the device in the UniFi interface (eg. 'Living Room TV', 'John's Laptop').
        """
        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 this client should be associated with. This is particularly important when using VLANs or multiple networks.
        """
        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 note(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Additional information about the client that you want to record (e.g., 'Company asset tag #12345', 'Guest device - expires 2024-03-01').
        """
        return pulumi.get(self, "note")

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

    @_builtins.property
    @pulumi.getter
    def site(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the UniFi site where this user should be managed. 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="skipForgetOnDestroy")
    def skip_forget_on_destroy(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        When false (default), the client will be 'forgotten' by the controller when this resource is destroyed. Set to true to keep the client's history in the controller after the resource is removed from Terraform.
        """
        return pulumi.get(self, "skip_forget_on_destroy")

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

    @_builtins.property
    @pulumi.getter(name="userGroupId")
    def user_group_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the user group this client belongs to. User groups can be used to apply common settings and restrictions to multiple clients.
        """
        return pulumi.get(self, "user_group_id")

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


@pulumi.type_token("unifi:iam/user:User")
class User(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 allow_existing: Optional[pulumi.Input[_builtins.bool]] = None,
                 blocked: Optional[pulumi.Input[_builtins.bool]] = None,
                 dev_id_override: Optional[pulumi.Input[_builtins.int]] = None,
                 fixed_ip: Optional[pulumi.Input[_builtins.str]] = None,
                 local_dns_record: Optional[pulumi.Input[_builtins.str]] = None,
                 mac: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 note: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 skip_forget_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 user_group_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        The `iam.User` resource manages network clients in the UniFi controller, which are identified by their unique MAC addresses.

        This resource allows you to manage:
          * Fixed IP assignments
          * User groups and network access
          * Network blocking and restrictions
          * Local DNS records

        Important Notes:
          * Users are automatically created in the controller when devices connect to the network
          * By default, this resource can take over management of existing users (controlled by `allow_existing`)
          * Users can be 'forgotten' on destroy (controlled by `skip_forget_on_destroy`)

        This resource is particularly useful for:
          * Managing static IP assignments
          * Implementing access control
          * Setting up local DNS records
          * Organizing devices into user groups

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_unifi as unifi

        test = unifi.iam.User("test",
            mac="01:23:45:67:89:AB",
            name="some client",
            note="my note",
            fixed_ip="10.0.0.50",
            network_id=my_vlan["id"])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] allow_existing: Allow this resource to take over management of an existing user in the UniFi controller. When true:
                 * The resource can manage users that were automatically created when devices connected
                 * Existing settings will be overwritten with the values specified in this resource
                 * If false, attempting to manage an existing user will result in an error
               
               Use with caution as it can modify settings for devices already connected to your network.
        :param pulumi.Input[_builtins.bool] blocked: When true, this client will be blocked from accessing the network. Useful for temporarily or permanently restricting network access for specific devices.
        :param pulumi.Input[_builtins.int] dev_id_override: Override the device fingerprint.
        :param pulumi.Input[_builtins.str] fixed_ip: A static IPv4 address to assign to this client. Ensure this IP is within the client's network range and not already assigned to another device.
        :param pulumi.Input[_builtins.str] local_dns_record: A local DNS hostname for this client. When set, other devices on the network can resolve this name to the client's IP address (e.g., 'printer.local', 'nas.home.arpa'). Such DNS record is automatically added to controller's DNS records.
        :param pulumi.Input[_builtins.str] mac: The MAC address of the device/client. This is used as the unique identifier and cannot be changed after creation. Must be a valid MAC address format (e.g., '00:11:22:33:44:55'). MAC addresses are case-insensitive.
        :param pulumi.Input[_builtins.str] name: A friendly name for the device/client. This helps identify the device in the UniFi interface (eg. 'Living Room TV', 'John's Laptop').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network this client should be associated with. This is particularly important when using VLANs or multiple networks.
        :param pulumi.Input[_builtins.str] note: Additional information about the client that you want to record (e.g., 'Company asset tag #12345', 'Guest device - expires 2024-03-01').
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this user should be managed. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.bool] skip_forget_on_destroy: When false (default), the client will be 'forgotten' by the controller when this resource is destroyed. Set to true to keep the client's history in the controller after the resource is removed from Terraform.
        :param pulumi.Input[_builtins.str] user_group_id: The ID of the user group this client belongs to. User groups can be used to apply common settings and restrictions to multiple clients.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: UserArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `iam.User` resource manages network clients in the UniFi controller, which are identified by their unique MAC addresses.

        This resource allows you to manage:
          * Fixed IP assignments
          * User groups and network access
          * Network blocking and restrictions
          * Local DNS records

        Important Notes:
          * Users are automatically created in the controller when devices connect to the network
          * By default, this resource can take over management of existing users (controlled by `allow_existing`)
          * Users can be 'forgotten' on destroy (controlled by `skip_forget_on_destroy`)

        This resource is particularly useful for:
          * Managing static IP assignments
          * Implementing access control
          * Setting up local DNS records
          * Organizing devices into user groups

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_unifi as unifi

        test = unifi.iam.User("test",
            mac="01:23:45:67:89:AB",
            name="some client",
            note="my note",
            fixed_ip="10.0.0.50",
            network_id=my_vlan["id"])
        ```

        :param str resource_name: The name of the resource.
        :param UserArgs 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(UserArgs, 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,
                 allow_existing: Optional[pulumi.Input[_builtins.bool]] = None,
                 blocked: Optional[pulumi.Input[_builtins.bool]] = None,
                 dev_id_override: Optional[pulumi.Input[_builtins.int]] = None,
                 fixed_ip: Optional[pulumi.Input[_builtins.str]] = None,
                 local_dns_record: Optional[pulumi.Input[_builtins.str]] = None,
                 mac: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 network_id: Optional[pulumi.Input[_builtins.str]] = None,
                 note: Optional[pulumi.Input[_builtins.str]] = None,
                 site: Optional[pulumi.Input[_builtins.str]] = None,
                 skip_forget_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 user_group_id: Optional[pulumi.Input[_builtins.str]] = 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__ = UserArgs.__new__(UserArgs)

            __props__.__dict__["allow_existing"] = allow_existing
            __props__.__dict__["blocked"] = blocked
            __props__.__dict__["dev_id_override"] = dev_id_override
            __props__.__dict__["fixed_ip"] = fixed_ip
            __props__.__dict__["local_dns_record"] = local_dns_record
            if mac is None and not opts.urn:
                raise TypeError("Missing required property 'mac'")
            __props__.__dict__["mac"] = mac
            __props__.__dict__["name"] = name
            __props__.__dict__["network_id"] = network_id
            __props__.__dict__["note"] = note
            __props__.__dict__["site"] = site
            __props__.__dict__["skip_forget_on_destroy"] = skip_forget_on_destroy
            __props__.__dict__["user_group_id"] = user_group_id
            __props__.__dict__["hostname"] = None
            __props__.__dict__["ip"] = None
        super(User, __self__).__init__(
            'unifi:iam/user:User',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            allow_existing: Optional[pulumi.Input[_builtins.bool]] = None,
            blocked: Optional[pulumi.Input[_builtins.bool]] = None,
            dev_id_override: Optional[pulumi.Input[_builtins.int]] = None,
            fixed_ip: Optional[pulumi.Input[_builtins.str]] = None,
            hostname: Optional[pulumi.Input[_builtins.str]] = None,
            ip: Optional[pulumi.Input[_builtins.str]] = None,
            local_dns_record: Optional[pulumi.Input[_builtins.str]] = None,
            mac: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            network_id: Optional[pulumi.Input[_builtins.str]] = None,
            note: Optional[pulumi.Input[_builtins.str]] = None,
            site: Optional[pulumi.Input[_builtins.str]] = None,
            skip_forget_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
            user_group_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'User':
        """
        Get an existing User 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.bool] allow_existing: Allow this resource to take over management of an existing user in the UniFi controller. When true:
                 * The resource can manage users that were automatically created when devices connected
                 * Existing settings will be overwritten with the values specified in this resource
                 * If false, attempting to manage an existing user will result in an error
               
               Use with caution as it can modify settings for devices already connected to your network.
        :param pulumi.Input[_builtins.bool] blocked: When true, this client will be blocked from accessing the network. Useful for temporarily or permanently restricting network access for specific devices.
        :param pulumi.Input[_builtins.int] dev_id_override: Override the device fingerprint.
        :param pulumi.Input[_builtins.str] fixed_ip: A static IPv4 address to assign to this client. Ensure this IP is within the client's network range and not already assigned to another device.
        :param pulumi.Input[_builtins.str] hostname: The hostname of the user.
        :param pulumi.Input[_builtins.str] ip: The IP address of the user.
        :param pulumi.Input[_builtins.str] local_dns_record: A local DNS hostname for this client. When set, other devices on the network can resolve this name to the client's IP address (e.g., 'printer.local', 'nas.home.arpa'). Such DNS record is automatically added to controller's DNS records.
        :param pulumi.Input[_builtins.str] mac: The MAC address of the device/client. This is used as the unique identifier and cannot be changed after creation. Must be a valid MAC address format (e.g., '00:11:22:33:44:55'). MAC addresses are case-insensitive.
        :param pulumi.Input[_builtins.str] name: A friendly name for the device/client. This helps identify the device in the UniFi interface (eg. 'Living Room TV', 'John's Laptop').
        :param pulumi.Input[_builtins.str] network_id: The ID of the network this client should be associated with. This is particularly important when using VLANs or multiple networks.
        :param pulumi.Input[_builtins.str] note: Additional information about the client that you want to record (e.g., 'Company asset tag #12345', 'Guest device - expires 2024-03-01').
        :param pulumi.Input[_builtins.str] site: The name of the UniFi site where this user should be managed. If not specified, the default site will be used.
        :param pulumi.Input[_builtins.bool] skip_forget_on_destroy: When false (default), the client will be 'forgotten' by the controller when this resource is destroyed. Set to true to keep the client's history in the controller after the resource is removed from Terraform.
        :param pulumi.Input[_builtins.str] user_group_id: The ID of the user group this client belongs to. User groups can be used to apply common settings and restrictions to multiple clients.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _UserState.__new__(_UserState)

        __props__.__dict__["allow_existing"] = allow_existing
        __props__.__dict__["blocked"] = blocked
        __props__.__dict__["dev_id_override"] = dev_id_override
        __props__.__dict__["fixed_ip"] = fixed_ip
        __props__.__dict__["hostname"] = hostname
        __props__.__dict__["ip"] = ip
        __props__.__dict__["local_dns_record"] = local_dns_record
        __props__.__dict__["mac"] = mac
        __props__.__dict__["name"] = name
        __props__.__dict__["network_id"] = network_id
        __props__.__dict__["note"] = note
        __props__.__dict__["site"] = site
        __props__.__dict__["skip_forget_on_destroy"] = skip_forget_on_destroy
        __props__.__dict__["user_group_id"] = user_group_id
        return User(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="allowExisting")
    def allow_existing(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        Allow this resource to take over management of an existing user in the UniFi controller. When true:
          * The resource can manage users that were automatically created when devices connected
          * Existing settings will be overwritten with the values specified in this resource
          * If false, attempting to manage an existing user will result in an error

        Use with caution as it can modify settings for devices already connected to your network.
        """
        return pulumi.get(self, "allow_existing")

    @_builtins.property
    @pulumi.getter
    def blocked(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When true, this client will be blocked from accessing the network. Useful for temporarily or permanently restricting network access for specific devices.
        """
        return pulumi.get(self, "blocked")

    @_builtins.property
    @pulumi.getter(name="devIdOverride")
    def dev_id_override(self) -> pulumi.Output[Optional[_builtins.int]]:
        """
        Override the device fingerprint.
        """
        return pulumi.get(self, "dev_id_override")

    @_builtins.property
    @pulumi.getter(name="fixedIp")
    def fixed_ip(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        A static IPv4 address to assign to this client. Ensure this IP is within the client's network range and not already assigned to another device.
        """
        return pulumi.get(self, "fixed_ip")

    @_builtins.property
    @pulumi.getter
    def hostname(self) -> pulumi.Output[_builtins.str]:
        """
        The hostname of the user.
        """
        return pulumi.get(self, "hostname")

    @_builtins.property
    @pulumi.getter
    def ip(self) -> pulumi.Output[_builtins.str]:
        """
        The IP address of the user.
        """
        return pulumi.get(self, "ip")

    @_builtins.property
    @pulumi.getter(name="localDnsRecord")
    def local_dns_record(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        A local DNS hostname for this client. When set, other devices on the network can resolve this name to the client's IP address (e.g., 'printer.local', 'nas.home.arpa'). Such DNS record is automatically added to controller's DNS records.
        """
        return pulumi.get(self, "local_dns_record")

    @_builtins.property
    @pulumi.getter
    def mac(self) -> pulumi.Output[_builtins.str]:
        """
        The MAC address of the device/client. This is used as the unique identifier and cannot be changed after creation. Must be a valid MAC address format (e.g., '00:11:22:33:44:55'). MAC addresses are case-insensitive.
        """
        return pulumi.get(self, "mac")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        A friendly name for the device/client. This helps identify the device in the UniFi interface (eg. 'Living Room TV', 'John's Laptop').
        """
        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 this client should be associated with. This is particularly important when using VLANs or multiple networks.
        """
        return pulumi.get(self, "network_id")

    @_builtins.property
    @pulumi.getter
    def note(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Additional information about the client that you want to record (e.g., 'Company asset tag #12345', 'Guest device - expires 2024-03-01').
        """
        return pulumi.get(self, "note")

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

    @_builtins.property
    @pulumi.getter(name="skipForgetOnDestroy")
    def skip_forget_on_destroy(self) -> pulumi.Output[Optional[_builtins.bool]]:
        """
        When false (default), the client will be 'forgotten' by the controller when this resource is destroyed. Set to true to keep the client's history in the controller after the resource is removed from Terraform.
        """
        return pulumi.get(self, "skip_forget_on_destroy")

    @_builtins.property
    @pulumi.getter(name="userGroupId")
    def user_group_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The ID of the user group this client belongs to. User groups can be used to apply common settings and restrictions to multiple clients.
        """
        return pulumi.get(self, "user_group_id")

