"""
This file is generated by generator/run.py based on the Chrome DevTools Protocol.

This domain provides various functionality related to drawing atop the inspected page.
https://chromedevtools.github.io/devtools-protocol/tot/Overlay/

***************************************************
                    Methods
***************************************************
"""
from __future__ import annotations

from cdpkit.protocol._types import (
    DOM,
    Overlay,
    Page,
    Runtime,
)
from cdpkit.protocol.base import JSON_DICT, CDPMethod, InputModel, OutputModel


class Disable(CDPMethod[None]):
    """ Disables domain notifications. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Enable(CDPMethod[None]):
    """ Enables domain notifications. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class GetHighlightObjectForTestInput(InputModel):

    nodeId: DOM.NodeId
    includeDistance: bool | None = None
    includeStyle: bool | None = None
    colorFormat: Overlay.ColorFormat | None = None
    showAccessibilityInfo: bool | None = None


class GetHighlightObjectForTestOutput(OutputModel):

    highlight: JSON_DICT


class GetHighlightObjectForTest(CDPMethod[GetHighlightObjectForTestOutput]):
    """ For testing. """

    INPUT_VALIDATOR = GetHighlightObjectForTestInput
    OUTPUT_VALIDATOR = GetHighlightObjectForTestOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        include_distance: bool | None = None,
        include_style: bool | None = None,
        color_format: Overlay.ColorFormat | None = None,
        show_accessibility_info: bool | None = None
    ):
        super().__init__(
            nodeId=node_id,
            includeDistance=include_distance,
            includeStyle=include_style,
            colorFormat=color_format,
            showAccessibilityInfo=show_accessibility_info
        )


class GetGridHighlightObjectsForTestInput(InputModel):

    nodeIds: list[DOM.NodeId]


class GetGridHighlightObjectsForTestOutput(OutputModel):

    highlights: JSON_DICT


class GetGridHighlightObjectsForTest(CDPMethod[GetGridHighlightObjectsForTestOutput]):
    """ For Persistent Grid testing. """

    INPUT_VALIDATOR = GetGridHighlightObjectsForTestInput
    OUTPUT_VALIDATOR = GetGridHighlightObjectsForTestOutput

    def __init__(
        self,
        *,
        node_ids: list[DOM.NodeId]
    ):
        super().__init__(
            nodeIds=node_ids
        )


class GetSourceOrderHighlightObjectForTestInput(InputModel):

    nodeId: DOM.NodeId


class GetSourceOrderHighlightObjectForTestOutput(OutputModel):

    highlight: JSON_DICT


class GetSourceOrderHighlightObjectForTest(CDPMethod[GetSourceOrderHighlightObjectForTestOutput]):
    """ For Source Order Viewer testing. """

    INPUT_VALIDATOR = GetSourceOrderHighlightObjectForTestInput
    OUTPUT_VALIDATOR = GetSourceOrderHighlightObjectForTestOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId
    ):
        super().__init__(
            nodeId=node_id
        )


class HideHighlight(CDPMethod[None]):
    """ Hides any highlight. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class HighlightFrameInput(InputModel):

    frameId: Page.FrameId
    contentColor: DOM.RGBA | None = None
    contentOutlineColor: DOM.RGBA | None = None


class HighlightFrame(CDPMethod[None]):  # deprecated
    """ Highlights owner element of the frame with given id.
    Deprecated: Doesn't work reliably and cannot be fixed due to process
    separation (the owner node might be in a different process). Determine
    the owner node in the client and use highlightNode. """

    INPUT_VALIDATOR = HighlightFrameInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        frame_id: Page.FrameId,
        content_color: DOM.RGBA | None = None,
        content_outline_color: DOM.RGBA | None = None
    ):
        super().__init__(
            frameId=frame_id,
            contentColor=content_color,
            contentOutlineColor=content_outline_color
        )


class HighlightNodeInput(InputModel):

    highlightConfig: Overlay.HighlightConfig
    nodeId: DOM.NodeId | None = None
    backendNodeId: DOM.BackendNodeId | None = None
    objectId: Runtime.RemoteObjectId | None = None
    selector: str | None = None


class HighlightNode(CDPMethod[None]):
    """ Highlights DOM node with given id or with the given JavaScript object wrapper. Either nodeId or
    objectId must be specified. """

    INPUT_VALIDATOR = HighlightNodeInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        highlight_config: Overlay.HighlightConfig,
        node_id: DOM.NodeId | None = None,
        backend_node_id: DOM.BackendNodeId | None = None,
        object_id: Runtime.RemoteObjectId | None = None,
        selector: str | None = None
    ):
        super().__init__(
            highlightConfig=highlight_config,
            nodeId=node_id,
            backendNodeId=backend_node_id,
            objectId=object_id,
            selector=selector
        )


class HighlightQuadInput(InputModel):

    quad: DOM.Quad
    color: DOM.RGBA | None = None
    outlineColor: DOM.RGBA | None = None


class HighlightQuad(CDPMethod[None]):
    """ Highlights given quad. Coordinates are absolute with respect to the main frame viewport. """

    INPUT_VALIDATOR = HighlightQuadInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        quad: DOM.Quad,
        color: DOM.RGBA | None = None,
        outline_color: DOM.RGBA | None = None
    ):
        super().__init__(
            quad=quad,
            color=color,
            outlineColor=outline_color
        )


class HighlightRectInput(InputModel):

    x: int
    y: int
    width: int
    height: int
    color: DOM.RGBA | None = None
    outlineColor: DOM.RGBA | None = None


class HighlightRect(CDPMethod[None]):
    """ Highlights given rectangle. Coordinates are absolute with respect to the main frame viewport.
    Issue: the method does not handle device pixel ratio (DPR) correctly.
    The coordinates currently have to be adjusted by the client
    if DPR is not 1 (see crbug.com/437807128). """

    INPUT_VALIDATOR = HighlightRectInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        x: int,
        y: int,
        width: int,
        height: int,
        color: DOM.RGBA | None = None,
        outline_color: DOM.RGBA | None = None
    ):
        super().__init__(
            x=x,
            y=y,
            width=width,
            height=height,
            color=color,
            outlineColor=outline_color
        )


class HighlightSourceOrderInput(InputModel):

    sourceOrderConfig: Overlay.SourceOrderConfig
    nodeId: DOM.NodeId | None = None
    backendNodeId: DOM.BackendNodeId | None = None
    objectId: Runtime.RemoteObjectId | None = None


class HighlightSourceOrder(CDPMethod[None]):
    """ Highlights the source order of the children of the DOM node with given id or with the given
    JavaScript object wrapper. Either nodeId or objectId must be specified. """

    INPUT_VALIDATOR = HighlightSourceOrderInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        source_order_config: Overlay.SourceOrderConfig,
        node_id: DOM.NodeId | None = None,
        backend_node_id: DOM.BackendNodeId | None = None,
        object_id: Runtime.RemoteObjectId | None = None
    ):
        super().__init__(
            sourceOrderConfig=source_order_config,
            nodeId=node_id,
            backendNodeId=backend_node_id,
            objectId=object_id
        )


class SetInspectModeInput(InputModel):

    mode: Overlay.InspectMode
    highlightConfig: Overlay.HighlightConfig | None = None


class SetInspectMode(CDPMethod[None]):
    """ Enters the 'inspect' mode. In this mode, elements that user is hovering over are highlighted.
    Backend then generates 'inspectNodeRequested' event upon element selection. """

    INPUT_VALIDATOR = SetInspectModeInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        mode: Overlay.InspectMode,
        highlight_config: Overlay.HighlightConfig | None = None
    ):
        super().__init__(
            mode=mode,
            highlightConfig=highlight_config
        )


class SetShowAdHighlightsInput(InputModel):

    show: bool


class SetShowAdHighlights(CDPMethod[None]):
    """ Highlights owner element of all frames detected to be ads. """

    INPUT_VALIDATOR = SetShowAdHighlightsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        show: bool
    ):
        super().__init__(
            show=show
        )


class SetPausedInDebuggerMessageInput(InputModel):

    message: str | None = None


class SetPausedInDebuggerMessage(CDPMethod[None]):

    INPUT_VALIDATOR = SetPausedInDebuggerMessageInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        message: str | None = None
    ):
        super().__init__(
            message=message
        )


class SetShowDebugBordersInput(InputModel):

    show: bool


class SetShowDebugBorders(CDPMethod[None]):
    """ Requests that backend shows debug borders on layers """

    INPUT_VALIDATOR = SetShowDebugBordersInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        show: bool
    ):
        super().__init__(
            show=show
        )


class SetShowFPSCounterInput(InputModel):

    show: bool


class SetShowFPSCounter(CDPMethod[None]):
    """ Requests that backend shows the FPS counter """

    INPUT_VALIDATOR = SetShowFPSCounterInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        show: bool
    ):
        super().__init__(
            show=show
        )


class SetShowGridOverlaysInput(InputModel):

    gridNodeHighlightConfigs: list[Overlay.GridNodeHighlightConfig]


class SetShowGridOverlays(CDPMethod[None]):
    """ Highlight multiple elements with the CSS Grid overlay. """

    INPUT_VALIDATOR = SetShowGridOverlaysInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        grid_node_highlight_configs: list[Overlay.GridNodeHighlightConfig]
    ):
        super().__init__(
            gridNodeHighlightConfigs=grid_node_highlight_configs
        )


class SetShowFlexOverlaysInput(InputModel):

    flexNodeHighlightConfigs: list[Overlay.FlexNodeHighlightConfig]


class SetShowFlexOverlays(CDPMethod[None]):

    INPUT_VALIDATOR = SetShowFlexOverlaysInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        flex_node_highlight_configs: list[Overlay.FlexNodeHighlightConfig]
    ):
        super().__init__(
            flexNodeHighlightConfigs=flex_node_highlight_configs
        )


class SetShowScrollSnapOverlaysInput(InputModel):

    scrollSnapHighlightConfigs: list[Overlay.ScrollSnapHighlightConfig]


class SetShowScrollSnapOverlays(CDPMethod[None]):

    INPUT_VALIDATOR = SetShowScrollSnapOverlaysInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        scroll_snap_highlight_configs: list[Overlay.ScrollSnapHighlightConfig]
    ):
        super().__init__(
            scrollSnapHighlightConfigs=scroll_snap_highlight_configs
        )


class SetShowContainerQueryOverlaysInput(InputModel):

    containerQueryHighlightConfigs: list[Overlay.ContainerQueryHighlightConfig]


class SetShowContainerQueryOverlays(CDPMethod[None]):

    INPUT_VALIDATOR = SetShowContainerQueryOverlaysInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        container_query_highlight_configs: list[Overlay.ContainerQueryHighlightConfig]
    ):
        super().__init__(
            containerQueryHighlightConfigs=container_query_highlight_configs
        )


class SetShowPaintRectsInput(InputModel):

    result: bool


class SetShowPaintRects(CDPMethod[None]):
    """ Requests that backend shows paint rectangles """

    INPUT_VALIDATOR = SetShowPaintRectsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        result: bool
    ):
        super().__init__(
            result=result
        )


class SetShowLayoutShiftRegionsInput(InputModel):

    result: bool


class SetShowLayoutShiftRegions(CDPMethod[None]):
    """ Requests that backend shows layout shift regions """

    INPUT_VALIDATOR = SetShowLayoutShiftRegionsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        result: bool
    ):
        super().__init__(
            result=result
        )


class SetShowScrollBottleneckRectsInput(InputModel):

    show: bool


class SetShowScrollBottleneckRects(CDPMethod[None]):
    """ Requests that backend shows scroll bottleneck rects """

    INPUT_VALIDATOR = SetShowScrollBottleneckRectsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        show: bool
    ):
        super().__init__(
            show=show
        )


class SetShowHitTestBordersInput(InputModel):

    show: bool


class SetShowHitTestBorders(CDPMethod[None]):  # deprecated
    """ Deprecated, no longer has any effect. """

    INPUT_VALIDATOR = SetShowHitTestBordersInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        show: bool
    ):
        super().__init__(
            show=show
        )


class SetShowWebVitalsInput(InputModel):

    show: bool


class SetShowWebVitals(CDPMethod[None]):  # deprecated
    """ Deprecated, no longer has any effect. """

    INPUT_VALIDATOR = SetShowWebVitalsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        show: bool
    ):
        super().__init__(
            show=show
        )


class SetShowViewportSizeOnResizeInput(InputModel):

    show: bool


class SetShowViewportSizeOnResize(CDPMethod[None]):
    """ Paints viewport size upon main frame resize. """

    INPUT_VALIDATOR = SetShowViewportSizeOnResizeInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        show: bool
    ):
        super().__init__(
            show=show
        )


class SetShowHingeInput(InputModel):

    hingeConfig: Overlay.HingeConfig | None = None


class SetShowHinge(CDPMethod[None]):
    """ Add a dual screen device hinge """

    INPUT_VALIDATOR = SetShowHingeInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        hinge_config: Overlay.HingeConfig | None = None
    ):
        super().__init__(
            hingeConfig=hinge_config
        )


class SetShowIsolatedElementsInput(InputModel):

    isolatedElementHighlightConfigs: list[Overlay.IsolatedElementHighlightConfig]


class SetShowIsolatedElements(CDPMethod[None]):
    """ Show elements in isolation mode with overlays. """

    INPUT_VALIDATOR = SetShowIsolatedElementsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        isolated_element_highlight_configs: list[Overlay.IsolatedElementHighlightConfig]
    ):
        super().__init__(
            isolatedElementHighlightConfigs=isolated_element_highlight_configs
        )


class SetShowWindowControlsOverlayInput(InputModel):

    windowControlsOverlayConfig: Overlay.WindowControlsOverlayConfig | None = None


class SetShowWindowControlsOverlay(CDPMethod[None]):
    """ Show Window Controls Overlay for PWA """

    INPUT_VALIDATOR = SetShowWindowControlsOverlayInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        window_controls_overlay_config: Overlay.WindowControlsOverlayConfig | None = None
    ):
        super().__init__(
            windowControlsOverlayConfig=window_controls_overlay_config
        )
