from typing import TypedDict, Literal, NotRequired, Any, Coroutine, Union, overload, Generator, final
from hfortix_fortios.models import FortiObject
from hfortix_core.types import MutationResponse, RawAPIResponse

# Payload TypedDict for IDE autocomplete (for POST/PUT - fields are optional via total=False)
# NOTE: We intentionally DON'T use NotRequired wrapper because:
# 1. total=False already makes all fields optional
# 2. NotRequired[Literal[...]] prevents Pylance from validating Literal values in dict literals
class LocalPayload(TypedDict, total=False):
    """
    Type hints for certificate/local payload fields.
    
    Local keys and certificates.
    
    **Related Resources:**

    Dependencies (resources this endpoint references):
        - :class:`~.certificate.ca.CaEndpoint` (via: cmp-server-cert, est-server-cert)
        - :class:`~.certificate.local.LocalEndpoint` (via: est-client-cert)
        - :class:`~.certificate.remote.RemoteEndpoint` (via: cmp-server-cert, est-server-cert)

    **Usage:**
        payload: LocalPayload = {
            "field": "value",  # <- autocomplete shows all fields
        }
    """
    name: str  # Name. | MaxLen: 35
    password: str  # Password as a PEM file. | MaxLen: 128
    comments: str  # Comment. | MaxLen: 511
    private_key: str  # PEM format key encrypted with a password.
    certificate: str  # PEM format certificate.
    csr: str  # Certificate Signing Request.
    state: str  # Certificate Signing Request State.
    scep_url: str  # SCEP server URL. | MaxLen: 255
    range: Literal["global", "vdom"]  # Either a global or VDOM IP address range for the c | Default: global
    source: Literal["factory", "user", "bundle"]  # Certificate source type. | Default: user
    auto_regenerate_days: int  # Number of days to wait before expiry of an updated | Default: 0 | Min: 0 | Max: 4294967295
    auto_regenerate_days_warning: int  # Number of days to wait before an expiry warning me | Default: 0 | Min: 0 | Max: 4294967295
    scep_password: str  # SCEP server challenge password for auto-regenerati | MaxLen: 128
    ca_identifier: str  # CA identifier of the CA server for signing via SCE | MaxLen: 255
    name_encoding: Literal["printable", "utf8"]  # Name encoding method for auto-regeneration. | Default: printable
    source_ip: str  # Source IP address for communications to the SCEP s | Default: 0.0.0.0
    ike_localid: str  # Local ID the FortiGate uses for authentication as | MaxLen: 63
    ike_localid_type: Literal["asn1dn", "fqdn"]  # IKE local ID type. | Default: asn1dn
    enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"]  # Certificate enrollment protocol. | Default: none
    private_key_retain: Literal["enable", "disable"]  # Enable/disable retention of private key during SCE | Default: disable
    cmp_server: str  # Address and port for CMP server | MaxLen: 63
    cmp_path: str  # Path location inside CMP server. | MaxLen: 255
    cmp_server_cert: str  # CMP server certificate. | MaxLen: 79
    cmp_regeneration_method: Literal["keyupate", "renewal"]  # CMP auto-regeneration method. | Default: keyupate
    acme_ca_url: str  # The URL for the ACME CA server | Default: https://acme-v02.api.letsencrypt.org/directory | MaxLen: 255
    acme_domain: str  # A valid domain that resolves to this FortiGate uni | MaxLen: 255
    acme_email: str  # Contact email address that is required by some CAs | MaxLen: 255
    acme_eab_key_id: str  # External Account Binding Key ID (optional setting) | MaxLen: 255
    acme_eab_key_hmac: str  # External Account Binding HMAC Key | MaxLen: 128
    acme_rsa_key_size: int  # Length of the RSA private key of the generated cer | Default: 2048 | Min: 2048 | Max: 4096
    acme_renew_window: int  # Beginning of the renewal window | Default: 30 | Min: 1 | Max: 60
    est_server: str  # Address and port for EST server | MaxLen: 255
    est_ca_id: str  # CA identifier of the CA server for signing via EST | MaxLen: 255
    est_http_username: str  # HTTP Authentication username for signing via EST. | MaxLen: 63
    est_http_password: str  # HTTP Authentication password for signing via EST. | MaxLen: 128
    est_client_cert: str  # Certificate used to authenticate this FortiGate to | MaxLen: 79
    est_server_cert: str  # EST server's certificate must be verifiable by thi | MaxLen: 79
    est_srp_username: str  # EST SRP authentication username. | MaxLen: 63
    est_srp_password: str  # EST SRP authentication password. | MaxLen: 128
    est_regeneration_method: Literal["create-new-key", "use-existing-key"]  # EST behavioral options during re-enrollment. | Default: create-new-key
    details: str  # Print local certificate detailed information.

# Nested TypedDicts for table field children (dict mode)

# Nested classes for table field children (object mode)


# Response TypedDict for GET returns (all fields present in API response)
class LocalResponse(TypedDict):
    """
    Type hints for certificate/local API response fields.
    
    All fields are present in the response from the FortiGate API.
    """
    name: str  # Name. | MaxLen: 35
    password: str  # Password as a PEM file. | MaxLen: 128
    comments: str  # Comment. | MaxLen: 511
    private_key: str  # PEM format key encrypted with a password.
    certificate: str  # PEM format certificate.
    csr: str  # Certificate Signing Request.
    state: str  # Certificate Signing Request State.
    scep_url: str  # SCEP server URL. | MaxLen: 255
    range: Literal["global", "vdom"]  # Either a global or VDOM IP address range for the c | Default: global
    source: Literal["factory", "user", "bundle"]  # Certificate source type. | Default: user
    auto_regenerate_days: int  # Number of days to wait before expiry of an updated | Default: 0 | Min: 0 | Max: 4294967295
    auto_regenerate_days_warning: int  # Number of days to wait before an expiry warning me | Default: 0 | Min: 0 | Max: 4294967295
    scep_password: str  # SCEP server challenge password for auto-regenerati | MaxLen: 128
    ca_identifier: str  # CA identifier of the CA server for signing via SCE | MaxLen: 255
    name_encoding: Literal["printable", "utf8"]  # Name encoding method for auto-regeneration. | Default: printable
    source_ip: str  # Source IP address for communications to the SCEP s | Default: 0.0.0.0
    ike_localid: str  # Local ID the FortiGate uses for authentication as | MaxLen: 63
    ike_localid_type: Literal["asn1dn", "fqdn"]  # IKE local ID type. | Default: asn1dn
    enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"]  # Certificate enrollment protocol. | Default: none
    private_key_retain: Literal["enable", "disable"]  # Enable/disable retention of private key during SCE | Default: disable
    cmp_server: str  # Address and port for CMP server | MaxLen: 63
    cmp_path: str  # Path location inside CMP server. | MaxLen: 255
    cmp_server_cert: str  # CMP server certificate. | MaxLen: 79
    cmp_regeneration_method: Literal["keyupate", "renewal"]  # CMP auto-regeneration method. | Default: keyupate
    acme_ca_url: str  # The URL for the ACME CA server | Default: https://acme-v02.api.letsencrypt.org/directory | MaxLen: 255
    acme_domain: str  # A valid domain that resolves to this FortiGate uni | MaxLen: 255
    acme_email: str  # Contact email address that is required by some CAs | MaxLen: 255
    acme_eab_key_id: str  # External Account Binding Key ID (optional setting) | MaxLen: 255
    acme_eab_key_hmac: str  # External Account Binding HMAC Key | MaxLen: 128
    acme_rsa_key_size: int  # Length of the RSA private key of the generated cer | Default: 2048 | Min: 2048 | Max: 4096
    acme_renew_window: int  # Beginning of the renewal window | Default: 30 | Min: 1 | Max: 60
    est_server: str  # Address and port for EST server | MaxLen: 255
    est_ca_id: str  # CA identifier of the CA server for signing via EST | MaxLen: 255
    est_http_username: str  # HTTP Authentication username for signing via EST. | MaxLen: 63
    est_http_password: str  # HTTP Authentication password for signing via EST. | MaxLen: 128
    est_client_cert: str  # Certificate used to authenticate this FortiGate to | MaxLen: 79
    est_server_cert: str  # EST server's certificate must be verifiable by thi | MaxLen: 79
    est_srp_username: str  # EST SRP authentication username. | MaxLen: 63
    est_srp_password: str  # EST SRP authentication password. | MaxLen: 128
    est_regeneration_method: Literal["create-new-key", "use-existing-key"]  # EST behavioral options during re-enrollment. | Default: create-new-key
    details: str  # Print local certificate detailed information.


@final
class LocalObject:
    """Typed FortiObject for certificate/local with IDE autocomplete support.
    
    This is a typed wrapper that provides IDE autocomplete for API response fields.
    At runtime, this is actually a FortiObject instance.
    """
    
    # Name. | MaxLen: 35
    name: str
    # Password as a PEM file. | MaxLen: 128
    password: str
    # Comment. | MaxLen: 511
    comments: str
    # PEM format key encrypted with a password.
    private_key: str
    # PEM format certificate.
    certificate: str
    # Certificate Signing Request.
    csr: str
    # Certificate Signing Request State.
    state: str
    # SCEP server URL. | MaxLen: 255
    scep_url: str
    # Either a global or VDOM IP address range for the certificate | Default: global
    range: Literal["global", "vdom"]
    # Certificate source type. | Default: user
    source: Literal["factory", "user", "bundle"]
    # Number of days to wait before expiry of an updated local cer | Default: 0 | Min: 0 | Max: 4294967295
    auto_regenerate_days: int
    # Number of days to wait before an expiry warning message is g | Default: 0 | Min: 0 | Max: 4294967295
    auto_regenerate_days_warning: int
    # SCEP server challenge password for auto-regeneration. | MaxLen: 128
    scep_password: str
    # CA identifier of the CA server for signing via SCEP. | MaxLen: 255
    ca_identifier: str
    # Name encoding method for auto-regeneration. | Default: printable
    name_encoding: Literal["printable", "utf8"]
    # Source IP address for communications to the SCEP server. | Default: 0.0.0.0
    source_ip: str
    # Local ID the FortiGate uses for authentication as a VPN clie | MaxLen: 63
    ike_localid: str
    # IKE local ID type. | Default: asn1dn
    ike_localid_type: Literal["asn1dn", "fqdn"]
    # Certificate enrollment protocol. | Default: none
    enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"]
    # Enable/disable retention of private key during SCEP renewal | Default: disable
    private_key_retain: Literal["enable", "disable"]
    # Address and port for CMP server (format = address:port). | MaxLen: 63
    cmp_server: str
    # Path location inside CMP server. | MaxLen: 255
    cmp_path: str
    # CMP server certificate. | MaxLen: 79
    cmp_server_cert: str
    # CMP auto-regeneration method. | Default: keyupate
    cmp_regeneration_method: Literal["keyupate", "renewal"]
    # The URL for the ACME CA server | Default: https://acme-v02.api.letsencrypt.org/directory | MaxLen: 255
    acme_ca_url: str
    # A valid domain that resolves to this FortiGate unit. | MaxLen: 255
    acme_domain: str
    # Contact email address that is required by some CAs like Lets | MaxLen: 255
    acme_email: str
    # External Account Binding Key ID (optional setting). | MaxLen: 255
    acme_eab_key_id: str
    # External Account Binding HMAC Key (URL-encoded base64). | MaxLen: 128
    acme_eab_key_hmac: str
    # Length of the RSA private key of the generated cert | Default: 2048 | Min: 2048 | Max: 4096
    acme_rsa_key_size: int
    # Beginning of the renewal window | Default: 30 | Min: 1 | Max: 60
    acme_renew_window: int
    # Address and port for EST server | MaxLen: 255
    est_server: str
    # CA identifier of the CA server for signing via EST. | MaxLen: 255
    est_ca_id: str
    # HTTP Authentication username for signing via EST. | MaxLen: 63
    est_http_username: str
    # HTTP Authentication password for signing via EST. | MaxLen: 128
    est_http_password: str
    # Certificate used to authenticate this FortiGate to EST serve | MaxLen: 79
    est_client_cert: str
    # EST server's certificate must be verifiable by this certific | MaxLen: 79
    est_server_cert: str
    # EST SRP authentication username. | MaxLen: 63
    est_srp_username: str
    # EST SRP authentication password. | MaxLen: 128
    est_srp_password: str
    # EST behavioral options during re-enrollment. | Default: create-new-key
    est_regeneration_method: Literal["create-new-key", "use-existing-key"]
    # Print local certificate detailed information.
    details: str
    
    # Common API response fields
    status: str
    http_status: int | None
    vdom: str | None
    
    # Methods from FortiObject
    def get_full(self, name: str) -> Any: ...
    def to_dict(self) -> LocalPayload: ...
    def keys(self) -> Any: ...
    def values(self) -> Generator[Any, None, None]: ...
    def items(self) -> Generator[tuple[str, Any], None, None]: ...
    def get(self, key: str, default: Any = None) -> Any: ...
    def __getitem__(self, key: str) -> Any: ...


class Local:
    """
    Local keys and certificates.
    
    Path: certificate/local
    Category: cmdb
    Primary Key: name
    """
    
    # ================================================================
    # DEFAULT MODE OVERLOADS (no response_mode) - MUST BE FIRST
    # These match when response_mode is NOT passed (client default is "dict")
    # Pylance matches overloads top-to-bottom, so these must come first!
    # ================================================================
    
    # Default mode: mkey as positional arg -> returns typed dict
    @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 = ...,
    ) -> LocalResponse: ...
    
    # Default mode: mkey as keyword arg -> returns typed dict
    @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 = ...,
    ) -> LocalResponse: ...
    
    # Default mode: no mkey -> returns list of typed dicts
    @overload
    def get(
        self,
        name: None = None,
        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 = ...,
    ) -> list[LocalResponse]: ...
    
    # ================================================================
    # EXPLICIT response_mode="object" OVERLOADS
    # ================================================================
    
    # Object mode: mkey as positional arg -> returns single object
    @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 = ...,
        raw_json: Literal[False] = ...,
        *,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> LocalObject: ...
    
    # Object mode: mkey as keyword arg -> returns single object
    @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 = ...,
        raw_json: Literal[False] = ...,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> LocalObject: ...
    
    # Object mode: no mkey -> returns list of objects
    @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 = ...,
        raw_json: Literal[False] = ...,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> list[LocalObject]: ...
    
    # raw_json=True returns the full API envelope
    @overload
    def get(
        self,
        name: str | None = ...,
        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 = ...,
        raw_json: Literal[True] = ...,
        response_mode: Literal["object"] = ...,
        **kwargs: Any,
    ) -> RawAPIResponse: ...
    
    # Dict mode with mkey provided as positional arg (single dict)
    @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 = ...,
        raw_json: Literal[False] = ...,
        response_mode: Literal["dict"] = ...,
        **kwargs: Any,
    ) -> LocalResponse: ...
    
    # Dict mode with mkey provided as keyword arg (single dict)
    @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 = ...,
        raw_json: Literal[False] = ...,
        response_mode: Literal["dict"] = ...,
        **kwargs: Any,
    ) -> LocalResponse: ...
    
    # Dict mode - list of dicts (no mkey/name provided) - keyword-only signature
    @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 = ...,
        raw_json: Literal[False] = ...,
        response_mode: Literal["dict"] = ...,
        **kwargs: Any,
    ) -> list[LocalResponse]: ...
    
    # Fallback overload for all other cases
    @overload
    def get(
        self,
        name: str | None = ...,
        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 = ...,
        raw_json: bool = ...,
        response_mode: Literal["dict", "object"] | None = ...,
        **kwargs: Any,
    ) -> Union[dict[str, Any], list[dict[str, Any]], FortiObject, list[FortiObject]]: ...
    
    def get(
        self,
        name: str | None = ...,
        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 = ...,
        raw_json: bool = ...,
        response_mode: str | None = ...,
        **kwargs: Any,
    ) -> LocalObject | list[LocalObject] | dict[str, Any] | list[dict[str, Any]]: ...
    
    def get_schema(
        self,
        vdom: str | None = ...,
        format: str = ...,
    ) -> dict[str, Any]: ...
    
    # PUT overloads
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        raw_json: Literal[False] = ...,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> LocalObject: ...
    
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        raw_json: Literal[False] = ...,
        response_mode: Literal["dict"] | None = ...,
        **kwargs: Any,
    ) -> MutationResponse: ...
    
    # raw_json=True returns the full API envelope
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        raw_json: Literal[True] = ...,
        **kwargs: Any,
    ) -> RawAPIResponse: ...
    
    # Default overload (no response_mode or raw_json specified)
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        **kwargs: Any,
    ) -> MutationResponse: ...
    
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        raw_json: bool = ...,
        response_mode: Literal["dict", "object"] | None = ...,
        **kwargs: Any,
    ) -> MutationResponse: ...
    
    def exists(
        self,
        name: str,
        vdom: str | bool | None = ...,
    ) -> bool: ...
    
    def set(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        raw_json: bool = ...,
        response_mode: Literal["dict", "object"] | None = ...,
        **kwargs: Any,
    ) -> MutationResponse: ...
    
    # Helper methods
    @staticmethod
    def help(field_name: str | None = ...) -> str: ...
    
    @staticmethod
    def fields(detailed: bool = ...) -> Union[list[str], list[dict[str, Any]]]: ...
    
    @staticmethod
    def field_info(field_name: str) -> dict[str, Any]: ...
    
    @staticmethod
    def validate_field(name: str, value: Any) -> bool: ...
    
    @staticmethod
    def required_fields() -> list[str]: ...
    
    @staticmethod
    def defaults() -> dict[str, Any]: ...
    
    @staticmethod
    def schema() -> dict[str, Any]: ...


# ================================================================
# MODE-SPECIFIC CLASSES FOR CLIENT-LEVEL response_mode SUPPORT
# ================================================================

class LocalDictMode:
    """Local endpoint for dict response mode (default for this client).
    
    By default returns LocalResponse (TypedDict).
    Can be overridden per-call with response_mode="object" to return LocalObject.
    """
    
    # raw_json=True returns RawAPIResponse regardless of response_mode
    @overload
    def get(
        self,
        name: str | None = ...,
        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 = ...,
        *,
        raw_json: Literal[True],
        **kwargs: Any,
    ) -> RawAPIResponse: ...
    
    # Object mode override with mkey (single item)
    @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 = ...,
        raw_json: bool = ...,
        *,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> LocalObject: ...
    
    # Object mode override without mkey (list)
    @overload
    def get(
        self,
        name: None = ...,
        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 = ...,
        raw_json: bool = ...,
        *,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> list[LocalObject]: ...
    
    # Dict mode with mkey (single item) - default
    @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 = ...,
        raw_json: bool = ...,
        response_mode: Literal["dict"] | None = ...,
        **kwargs: Any,
    ) -> LocalResponse: ...
    
    # Dict mode without mkey (list) - default
    @overload
    def get(
        self,
        name: None = ...,
        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 = ...,
        raw_json: bool = ...,
        response_mode: Literal["dict"] | None = ...,
        **kwargs: Any,
    ) -> list[LocalResponse]: ...


    # raw_json=True returns RawAPIResponse for PUT
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        *,
        raw_json: Literal[True],
        **kwargs: Any,
    ) -> RawAPIResponse: ...
    
    # PUT - Object mode override
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        *,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> LocalObject: ...
    
    # PUT - Default overload (returns MutationResponse)
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        **kwargs: Any,
    ) -> MutationResponse: ...
    
    # PUT - Dict mode (default for DictMode class)
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        **kwargs: Any,
    ) -> MutationResponse: ...



class LocalObjectMode:
    """Local endpoint for object response mode (default for this client).
    
    By default returns LocalObject (FortiObject).
    Can be overridden per-call with response_mode="dict" to return LocalResponse (TypedDict).
    """
    
    # raw_json=True returns RawAPIResponse for GET
    @overload
    def get(
        self,
        name: str | None = ...,
        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 = ...,
        *,
        raw_json: Literal[True],
        **kwargs: Any,
    ) -> RawAPIResponse: ...
    
    # Dict mode override with mkey (single item)
    @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 = ...,
        raw_json: bool = ...,
        *,
        response_mode: Literal["dict"],
        **kwargs: Any,
    ) -> LocalResponse: ...
    
    # Dict mode override without mkey (list)
    @overload
    def get(
        self,
        name: None = ...,
        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 = ...,
        raw_json: bool = ...,
        *,
        response_mode: Literal["dict"],
        **kwargs: Any,
    ) -> list[LocalResponse]: ...
    
    # Object mode with mkey (single item) - default
    @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 = ...,
        raw_json: bool = ...,
        response_mode: Literal["object"] | None = ...,
        **kwargs: Any,
    ) -> LocalObject: ...
    
    # Object mode without mkey (list) - default
    @overload
    def get(
        self,
        name: None = ...,
        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 = ...,
        raw_json: bool = ...,
        response_mode: Literal["object"] | None = ...,
        **kwargs: Any,
    ) -> list[LocalObject]: ...


    # PUT - Dict mode override
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        *,
        response_mode: Literal["dict"],
        **kwargs: Any,
    ) -> MutationResponse: ...
    
    # raw_json=True returns RawAPIResponse for PUT
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        *,
        raw_json: Literal[True],
        **kwargs: Any,
    ) -> RawAPIResponse: ...
    
    # PUT - Object mode override (requires explicit response_mode="object")
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        *,
        response_mode: Literal["object"],
        **kwargs: Any,
    ) -> LocalObject: ...
    
    # PUT - Default overload (no response_mode specified, returns Object for ObjectMode)
    @overload
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        **kwargs: Any,
    ) -> LocalObject: ...
    
    # PUT - Default for ObjectMode (returns MutationResponse like DictMode)
    def put(
        self,
        payload_dict: LocalPayload | None = ...,
        name: str | None = ...,
        password: str | None = ...,
        comments: str | None = ...,
        private_key: str | None = ...,
        certificate: str | None = ...,
        csr: str | None = ...,
        state: str | None = ...,
        scep_url: str | None = ...,
        range: Literal["global", "vdom"] | None = ...,
        source: Literal["factory", "user", "bundle"] | None = ...,
        auto_regenerate_days: int | None = ...,
        auto_regenerate_days_warning: int | None = ...,
        scep_password: str | None = ...,
        ca_identifier: str | None = ...,
        name_encoding: Literal["printable", "utf8"] | None = ...,
        source_ip: str | None = ...,
        ike_localid: str | None = ...,
        ike_localid_type: Literal["asn1dn", "fqdn"] | None = ...,
        enroll_protocol: Literal["none", "scep", "cmpv2", "acme2", "est"] | None = ...,
        private_key_retain: Literal["enable", "disable"] | None = ...,
        cmp_server: str | None = ...,
        cmp_path: str | None = ...,
        cmp_server_cert: str | None = ...,
        cmp_regeneration_method: Literal["keyupate", "renewal"] | None = ...,
        acme_ca_url: str | None = ...,
        acme_domain: str | None = ...,
        acme_email: str | None = ...,
        acme_eab_key_id: str | None = ...,
        acme_eab_key_hmac: str | None = ...,
        acme_rsa_key_size: int | None = ...,
        acme_renew_window: int | None = ...,
        est_server: str | None = ...,
        est_ca_id: str | None = ...,
        est_http_username: str | None = ...,
        est_http_password: str | None = ...,
        est_client_cert: str | None = ...,
        est_server_cert: str | None = ...,
        est_srp_username: str | None = ...,
        est_srp_password: str | None = ...,
        est_regeneration_method: Literal["create-new-key", "use-existing-key"] | None = ...,
        details: str | None = ...,
        vdom: str | bool | None = ...,
        **kwargs: Any,
    ) -> MutationResponse: ...



__all__ = [
    "Local",
    "LocalDictMode",
    "LocalObjectMode",
    "LocalPayload",
    "LocalObject",
]