# This file is auto-generated by the CDP protocol generator.
# Do not edit this file manually as your changes will be overwritten.
# Generated from Chrome DevTools Protocol specifications.

"""CDP Console Domain Library"""

from typing import Any, Dict, Optional, cast

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from ...client import CDPClient


class ConsoleClient:
    """Client for Console domain commands."""

    def __init__(self, client: "CDPClient"):
        self._client = client

    async def clearMessages(
        self,
        params: None = None,
        session_id: Optional[str] = None,
    ) -> "Dict[str, Any]":
        """Does nothing."""
        return cast(
            "Dict[str, Any]",
            await self._client.send_raw(
                method="Console.clearMessages",
                params=params,
                session_id=session_id,
            ),
        )

    async def disable(
        self,
        params: None = None,
        session_id: Optional[str] = None,
    ) -> "Dict[str, Any]":
        """Disables console domain, prevents further console messages from being reported to the client."""
        return cast(
            "Dict[str, Any]",
            await self._client.send_raw(
                method="Console.disable",
                params=params,
                session_id=session_id,
            ),
        )

    async def enable(
        self,
        params: None = None,
        session_id: Optional[str] = None,
    ) -> "Dict[str, Any]":
        """Enables console domain, sends the messages collected so far to the client by means of the
        `messageAdded` notification."""
        return cast(
            "Dict[str, Any]",
            await self._client.send_raw(
                method="Console.enable",
                params=params,
                session_id=session_id,
            ),
        )
