""" - Type Stubs

Auto-generated stub file for type checking and IDE support.

Endpoint: user/nac_policy
Category: cmdb
"""

from __future__ import annotations

from typing import (
    Any,
    ClassVar,
    Literal,
    TypedDict,
    overload,
)

from hfortix_fortios.models import (
    FortiObject,
    FortiObjectList,
)


# ================================================================
# TypedDict Payloads
# ================================================================

class NacPolicySeverityItem(TypedDict, total=False):
    """Nested item for severity field."""
    severity_num: int


class NacPolicySwitchgroupItem(TypedDict, total=False):
    """Nested item for switch-group field."""
    name: str


class NacPolicyPayload(TypedDict, total=False):
    """Payload type for NacPolicy operations."""
    name: str
    description: str
    category: Literal["device", "firewall-user", "ems-tag", "fortivoice-tag", "vulnerability"]
    status: Literal["enable", "disable"]
    match_type: Literal["dynamic", "override"]
    match_period: int
    match_remove: Literal["default", "link-down"]
    mac: str
    hw_vendor: str
    type: str
    family: str
    os: str
    hw_version: str
    sw_version: str
    host: str
    user: str
    src: str
    user_group: str
    ems_tag: str
    fortivoice_tag: str
    severity: str | list[str] | list[NacPolicySeverityItem]
    switch_fortilink: str
    switch_group: str | list[str] | list[NacPolicySwitchgroupItem]
    switch_mac_policy: str
    firewall_address: str
    ssid_policy: str


# ================================================================
# Response Types (TypedDict for dict-style access)
# ================================================================

class NacPolicyResponse(TypedDict, total=False):
    """Response type for NacPolicy - use with .dict property for typed dict access."""
    name: str
    description: str
    category: Literal["device", "firewall-user", "ems-tag", "fortivoice-tag", "vulnerability"]
    status: Literal["enable", "disable"]
    match_type: Literal["dynamic", "override"]
    match_period: int
    match_remove: Literal["default", "link-down"]
    mac: str
    hw_vendor: str
    type: str
    family: str
    os: str
    hw_version: str
    sw_version: str
    host: str
    user: str
    src: str
    user_group: str
    ems_tag: str
    fortivoice_tag: str
    severity: list[NacPolicySeverityItem]
    switch_fortilink: str
    switch_group: list[NacPolicySwitchgroupItem]
    switch_mac_policy: str
    firewall_address: str
    ssid_policy: str


# ================================================================
# Response Types (Class for attribute access)
# ================================================================


class NacPolicySeverityItemObject(FortiObject[NacPolicySeverityItem]):
    """Typed object for severity table items with attribute access."""
    severity_num: int


class NacPolicySwitchgroupItemObject(FortiObject[NacPolicySwitchgroupItem]):
    """Typed object for switch-group table items with attribute access."""
    name: str


class NacPolicyObject(FortiObject):
    """Typed FortiObject for NacPolicy with field access."""
    name: str
    description: str
    category: Literal["device", "firewall-user", "ems-tag", "fortivoice-tag", "vulnerability"]
    status: Literal["enable", "disable"]
    match_type: Literal["dynamic", "override"]
    match_period: int
    match_remove: Literal["default", "link-down"]
    mac: str
    hw_vendor: str
    type: str
    family: str
    os: str
    hw_version: str
    sw_version: str
    host: str
    user: str
    src: str
    user_group: str
    ems_tag: str
    fortivoice_tag: str
    severity: FortiObjectList[NacPolicySeverityItemObject]
    switch_fortilink: str
    switch_group: FortiObjectList[NacPolicySwitchgroupItemObject]
    switch_mac_policy: str
    firewall_address: str
    ssid_policy: str


# ================================================================
# Main Endpoint Class
# ================================================================

class NacPolicy:
    """
    
    Endpoint: user/nac_policy
    Category: cmdb
    MKey: name
    """
    
    # Class attributes for introspection
    endpoint: ClassVar[str] = ...
    path: ClassVar[str] = ...
    category: ClassVar[str] = ...
    mkey: ClassVar[str] = ...
    capabilities: ClassVar[dict[str, Any]] = ...
    
    def __init__(self, client: Any) -> None:
        """Initialize endpoint with HTTP client."""
        ...
    
    # ================================================================
    # GET Methods
    # ================================================================
    
    # CMDB with mkey - overloads for single vs list returns
    @overload
    def get(
        self,
        name: str,
        *,
        filter: str | list[str] | None = ...,
        count: int | None = ...,
        start: int | None = ...,
        payload_dict: dict[str, Any] | None = ...,
        range: list[int] | None = ...,
        sort: str | None = ...,
        format: str | None = ...,
        action: str | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> NacPolicyObject: ...
    
    @overload
    def get(
        self,
        *,
        filter: str | list[str] | None = ...,
        count: int | None = ...,
        start: int | None = ...,
        payload_dict: dict[str, Any] | None = ...,
        range: list[int] | None = ...,
        sort: str | None = ...,
        format: str | None = ...,
        action: str | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> FortiObjectList[NacPolicyObject]: ...
    
    def get_schema(
        self,
        vdom: str | None = ...,
        format: str = ...,
    ) -> FortiObject: ...

    # ================================================================
    # POST Method
    # ================================================================
    
    def post(
        self,
        payload_dict: NacPolicyPayload | None = ...,
        name: str | None = ...,
        description: str | None = ...,
        category: Literal["device", "firewall-user", "ems-tag", "fortivoice-tag", "vulnerability"] | None = ...,
        status: Literal["enable", "disable"] | None = ...,
        match_type: Literal["dynamic", "override"] | None = ...,
        match_period: int | None = ...,
        match_remove: Literal["default", "link-down"] | None = ...,
        mac: str | None = ...,
        hw_vendor: str | None = ...,
        type: str | None = ...,
        family: str | None = ...,
        os: str | None = ...,
        hw_version: str | None = ...,
        sw_version: str | None = ...,
        host: str | None = ...,
        user: str | None = ...,
        src: str | None = ...,
        user_group: str | None = ...,
        ems_tag: str | None = ...,
        fortivoice_tag: str | None = ...,
        severity: str | list[str] | list[NacPolicySeverityItem] | None = ...,
        switch_fortilink: str | None = ...,
        switch_group: str | list[str] | list[NacPolicySwitchgroupItem] | None = ...,
        switch_mac_policy: str | None = ...,
        firewall_address: str | None = ...,
        ssid_policy: str | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> NacPolicyObject: ...

    # ================================================================
    # PUT Method
    # ================================================================
    
    def put(
        self,
        payload_dict: NacPolicyPayload | None = ...,
        name: str | None = ...,
        description: str | None = ...,
        category: Literal["device", "firewall-user", "ems-tag", "fortivoice-tag", "vulnerability"] | None = ...,
        status: Literal["enable", "disable"] | None = ...,
        match_type: Literal["dynamic", "override"] | None = ...,
        match_period: int | None = ...,
        match_remove: Literal["default", "link-down"] | None = ...,
        mac: str | None = ...,
        hw_vendor: str | None = ...,
        type: str | None = ...,
        family: str | None = ...,
        os: str | None = ...,
        hw_version: str | None = ...,
        sw_version: str | None = ...,
        host: str | None = ...,
        user: str | None = ...,
        src: str | None = ...,
        user_group: str | None = ...,
        ems_tag: str | None = ...,
        fortivoice_tag: str | None = ...,
        severity: str | list[str] | list[NacPolicySeverityItem] | None = ...,
        switch_fortilink: str | None = ...,
        switch_group: str | list[str] | list[NacPolicySwitchgroupItem] | None = ...,
        switch_mac_policy: str | None = ...,
        firewall_address: str | None = ...,
        ssid_policy: str | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> NacPolicyObject: ...

    # ================================================================
    # DELETE Method
    # ================================================================
    
    def delete(
        self,
        name: str | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> FortiObject[Any]: ...

    # ================================================================
    # Utility Methods
    # ================================================================
    
    def exists(
        self,
        name: str,
        vdom: str | bool | None = ...,
    ) -> bool: ...
    
    def set(
        self,
        payload_dict: NacPolicyPayload | None = ...,
        name: str | None = ...,
        description: str | None = ...,
        category: Literal["device", "firewall-user", "ems-tag", "fortivoice-tag", "vulnerability"] | None = ...,
        status: Literal["enable", "disable"] | None = ...,
        match_type: Literal["dynamic", "override"] | None = ...,
        match_period: int | None = ...,
        match_remove: Literal["default", "link-down"] | None = ...,
        mac: str | None = ...,
        hw_vendor: str | None = ...,
        type: str | None = ...,
        family: str | None = ...,
        os: str | None = ...,
        hw_version: str | None = ...,
        sw_version: str | None = ...,
        host: str | None = ...,
        user: str | None = ...,
        src: str | None = ...,
        user_group: str | None = ...,
        ems_tag: str | None = ...,
        fortivoice_tag: str | None = ...,
        severity: str | list[str] | list[NacPolicySeverityItem] | None = ...,
        switch_fortilink: str | None = ...,
        switch_group: str | list[str] | list[NacPolicySwitchgroupItem] | None = ...,
        switch_mac_policy: str | None = ...,
        firewall_address: str | None = ...,
        ssid_policy: str | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> FortiObject[Any]: ...
    
    # Helper methods
    @staticmethod
    def help(field_name: str | None = ...) -> str: ...
    
    @staticmethod
    def fields(detailed: bool = ...) -> list[str] | list[dict[str, Any]]: ...
    
    @staticmethod
    def field_info(field_name: str) -> FortiObject[Any]: ...
    
    @staticmethod
    def validate_field(name: str, value: Any) -> bool: ...
    
    @staticmethod
    def required_fields() -> list[str]: ...
    
    @staticmethod
    def defaults() -> FortiObject[Any]: ...
    
    @staticmethod
    def schema() -> FortiObject[Any]: ...


__all__ = [
    "NacPolicy",
    "NacPolicyPayload",
    "NacPolicyResponse",
    "NacPolicyObject",
]