""" - Type Stubs

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

Endpoint: log/threat_weight
Category: cmdb
"""

from __future__ import annotations

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

from hfortix_fortios.models import (
    FortiObject,
    FortiObjectList,
)


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

class ThreatWeightWebItem:
    """Nested item for web field - supports attribute access."""
    id: int
    category: int
    level: Literal["disable", "low", "medium", "high", "critical"]


class ThreatWeightGeolocationItem:
    """Nested item for geolocation field - supports attribute access."""
    id: int
    country: str
    level: Literal["disable", "low", "medium", "high", "critical"]


class ThreatWeightApplicationItem:
    """Nested item for application field - supports attribute access."""
    id: int
    category: int
    level: Literal["disable", "low", "medium", "high", "critical"]


class ThreatWeightPayload(TypedDict, total=False):
    """Payload type for ThreatWeight operations."""
    status: Literal["enable", "disable"]
    level: str
    blocked_connection: Literal["disable", "low", "medium", "high", "critical"]
    failed_connection: Literal["disable", "low", "medium", "high", "critical"]
    url_block_detected: Literal["disable", "low", "medium", "high", "critical"]
    botnet_connection_detected: Literal["disable", "low", "medium", "high", "critical"]
    malware: str
    ips: str
    web: str | list[str] | list[dict[str, Any]] | list[ThreatWeightWebItem]
    geolocation: str | list[str] | list[dict[str, Any]] | list[ThreatWeightGeolocationItem]
    application: str | list[str] | list[dict[str, Any]] | list[ThreatWeightApplicationItem]


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

class ThreatWeightResponse(TypedDict, total=False):
    """Response type for ThreatWeight - use with .dict property for typed dict access."""
    status: Literal["enable", "disable"]
    level: str
    blocked_connection: Literal["disable", "low", "medium", "high", "critical"]
    failed_connection: Literal["disable", "low", "medium", "high", "critical"]
    url_block_detected: Literal["disable", "low", "medium", "high", "critical"]
    botnet_connection_detected: Literal["disable", "low", "medium", "high", "critical"]
    malware: str
    ips: str
    web: list[ThreatWeightWebItem]
    geolocation: list[ThreatWeightGeolocationItem]
    application: list[ThreatWeightApplicationItem]


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


class ThreatWeightObject(FortiObject):
    """Typed FortiObject for ThreatWeight with field access."""
    status: Literal["enable", "disable"]
    level: str
    blocked_connection: Literal["disable", "low", "medium", "high", "critical"]
    failed_connection: Literal["disable", "low", "medium", "high", "critical"]
    url_block_detected: Literal["disable", "low", "medium", "high", "critical"]
    botnet_connection_detected: Literal["disable", "low", "medium", "high", "critical"]
    malware: str
    ips: str
    web: list[ThreatWeightWebItem]
    geolocation: list[ThreatWeightGeolocationItem]
    application: list[ThreatWeightApplicationItem]


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

class ThreatWeight:
    """
    
    Endpoint: log/threat_weight
    Category: cmdb
    """
    
    # Class attributes for introspection
    endpoint: ClassVar[str] = ...
    path: ClassVar[str] = ...
    category: ClassVar[str] = ...
    capabilities: ClassVar[dict[str, Any]] = ...
    
    def __init__(self, client: Any) -> None:
        """Initialize endpoint with HTTP client."""
        ...
    
    # ================================================================
    # GET Methods
    # ================================================================
    
    # Singleton endpoint (no mkey)
    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 = ...,
    ) -> ThreatWeightObject: ...
    
    def get_schema(
        self,
        vdom: str | None = ...,
        format: str = ...,
    ) -> FortiObject: ...


    # ================================================================
    # PUT Method
    # ================================================================
    
    def put(
        self,
        payload_dict: ThreatWeightPayload | None = ...,
        status: Literal["enable", "disable"] | None = ...,
        level: str | None = ...,
        blocked_connection: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        failed_connection: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        url_block_detected: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        botnet_connection_detected: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        malware: str | None = ...,
        ips: str | None = ...,
        web: str | list[str] | list[dict[str, Any]] | list[ThreatWeightWebItem] | None = ...,
        geolocation: str | list[str] | list[dict[str, Any]] | list[ThreatWeightGeolocationItem] | None = ...,
        application: str | list[str] | list[dict[str, Any]] | list[ThreatWeightApplicationItem] | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> ThreatWeightObject: ...


    # ================================================================
    # Utility Methods
    # ================================================================
    
    def exists(
        self,
        name: str,
        vdom: str | bool | None = ...,
    ) -> bool: ...
    
    def set(
        self,
        payload_dict: ThreatWeightPayload | None = ...,
        status: Literal["enable", "disable"] | None = ...,
        level: str | None = ...,
        blocked_connection: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        failed_connection: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        url_block_detected: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        botnet_connection_detected: Literal["disable", "low", "medium", "high", "critical"] | None = ...,
        malware: str | None = ...,
        ips: str | None = ...,
        web: str | list[str] | list[dict[str, Any]] | list[ThreatWeightWebItem] | None = ...,
        geolocation: str | list[str] | list[dict[str, Any]] | list[ThreatWeightGeolocationItem] | None = ...,
        application: str | list[str] | list[dict[str, Any]] | list[ThreatWeightApplicationItem] | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> FortiObject: ...
    
    # 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: ...
    
    @staticmethod
    def validate_field(name: str, value: Any) -> bool: ...
    
    @staticmethod
    def required_fields() -> list[str]: ...
    
    @staticmethod
    def defaults() -> FortiObject: ...
    
    @staticmethod
    def schema() -> FortiObject: ...


__all__ = [
    "ThreatWeight",
    "ThreatWeightPayload",
    "ThreatWeightResponse",
    "ThreatWeightObject",
]