""" - Type Stubs

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

Endpoint: system/alarm
Category: cmdb
"""

from __future__ import annotations

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

from hfortix_fortios.models import (
    FortiObject,
    FortiObjectList,
)


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

class AlarmGroupsFwpolicyviolationsItem(TypedDict, total=False):
    """Nested item for groups.fw-policy-violations field."""
    id: int
    threshold: int
    src_ip: str
    dst_ip: str
    src_port: int
    dst_port: int


class AlarmGroupsItem(TypedDict, total=False):
    """Nested item for groups field."""
    id: int
    period: int
    admin_auth_failure_threshold: int
    admin_auth_lockout_threshold: int
    user_auth_failure_threshold: int
    user_auth_lockout_threshold: int
    replay_attempt_threshold: int
    self_test_failure_threshold: int
    log_full_warning_threshold: int
    encryption_failure_threshold: int
    decryption_failure_threshold: int
    fw_policy_violations: str | list[str] | list[AlarmGroupsFwpolicyviolationsItem]
    fw_policy_id: int
    fw_policy_id_threshold: int


class AlarmPayload(TypedDict, total=False):
    """Payload type for Alarm operations."""
    status: Literal["enable", "disable"]
    audible: Literal["enable", "disable"]
    groups: str | list[str] | list[AlarmGroupsItem]


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

class AlarmResponse(TypedDict, total=False):
    """Response type for Alarm - use with .dict property for typed dict access."""
    status: Literal["enable", "disable"]
    audible: Literal["enable", "disable"]
    groups: list[AlarmGroupsItem]


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


class AlarmGroupsFwpolicyviolationsItemObject(FortiObject[AlarmGroupsFwpolicyviolationsItem]):
    """Typed object for groups.fw-policy-violations table items with attribute access."""
    id: int
    threshold: int
    src_ip: str
    dst_ip: str
    src_port: int
    dst_port: int


class AlarmGroupsItemObject(FortiObject[AlarmGroupsItem]):
    """Typed object for groups table items with attribute access."""
    id: int
    period: int
    admin_auth_failure_threshold: int
    admin_auth_lockout_threshold: int
    user_auth_failure_threshold: int
    user_auth_lockout_threshold: int
    replay_attempt_threshold: int
    self_test_failure_threshold: int
    log_full_warning_threshold: int
    encryption_failure_threshold: int
    decryption_failure_threshold: int
    fw_policy_violations: FortiObjectList[AlarmGroupsFwpolicyviolationsItemObject]
    fw_policy_id: int
    fw_policy_id_threshold: int


class AlarmObject(FortiObject):
    """Typed FortiObject for Alarm with field access."""
    status: Literal["enable", "disable"]
    audible: Literal["enable", "disable"]
    groups: FortiObjectList[AlarmGroupsItemObject]


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

class Alarm:
    """
    
    Endpoint: system/alarm
    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 = ...,
    ) -> AlarmObject: ...
    
    def get_schema(
        self,
        vdom: str | None = ...,
        format: str = ...,
    ) -> FortiObject: ...


    # ================================================================
    # PUT Method
    # ================================================================
    
    def put(
        self,
        payload_dict: AlarmPayload | None = ...,
        status: Literal["enable", "disable"] | None = ...,
        audible: Literal["enable", "disable"] | None = ...,
        groups: str | list[str] | list[AlarmGroupsItem] | None = ...,
        vdom: str | bool | None = ...,
        error_mode: Literal["raise", "return", "print"] | None = ...,
        error_format: Literal["detailed", "simple", "code_only"] | None = ...,
    ) -> AlarmObject: ...


    # ================================================================
    # Utility Methods
    # ================================================================
    
    def exists(
        self,
        name: str,
        vdom: str | bool | None = ...,
    ) -> bool: ...
    
    def set(
        self,
        payload_dict: AlarmPayload | None = ...,
        status: Literal["enable", "disable"] | None = ...,
        audible: Literal["enable", "disable"] | None = ...,
        groups: str | list[str] | list[AlarmGroupsItem] | 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__ = [
    "Alarm",
    "AlarmPayload",
    "AlarmResponse",
    "AlarmObject",
]