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

This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object
that has an `id`. This `id` can be used to get additional information on the Node, resolve it into
the JavaScript object wrapper, etc. It is important that client receives DOM events only for the
nodes that are known to the client. Backend keeps track of the nodes that were sent to the client
and never sends the same node twice. It is client's responsibility to collect information about
the nodes that were sent to the client. Note that `iframe` owner elements will return
corresponding document elements as their child nodes.
https://chromedevtools.github.io/devtools-protocol/tot/DOM/

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

from typing import Literal

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


class CollectClassNamesFromSubtreeInput(InputModel):

    nodeId: DOM.NodeId  # deprecated


class CollectClassNamesFromSubtreeOutput(OutputModel):

    classNames: list[str]  # deprecated


class CollectClassNamesFromSubtree(CDPMethod[CollectClassNamesFromSubtreeOutput]):  # experimental deprecated
    """ Collects class names for the node with given id and all of it's child nodes. """

    INPUT_VALIDATOR = CollectClassNamesFromSubtreeInput
    OUTPUT_VALIDATOR = CollectClassNamesFromSubtreeOutput

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


class CopyToInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    targetNodeId: DOM.NodeId  # deprecated
    insertBeforeNodeId: DOM.NodeId | None = None  # deprecated


class CopyToOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class CopyTo(CDPMethod[CopyToOutput]):  # experimental deprecated
    """ Creates a deep copy of the specified node and places it into the target container before the
    given anchor. """

    INPUT_VALIDATOR = CopyToInput
    OUTPUT_VALIDATOR = CopyToOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        target_node_id: DOM.NodeId,
        insert_before_node_id: DOM.NodeId | None = None
    ):
        super().__init__(
            nodeId=node_id,
            targetNodeId=target_node_id,
            insertBeforeNodeId=insert_before_node_id
        )


class DescribeNodeInput(InputModel):

    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectId: Runtime.RemoteObjectId | None = None  # deprecated
    depth: int | None = None  # deprecated
    pierce: bool | None = None  # deprecated


class DescribeNodeOutput(OutputModel):

    node: DOM.Node  # deprecated


class DescribeNode(CDPMethod[DescribeNodeOutput]):  # deprecated
    """ Describes node given its id, does not require domain to be enabled. Does not start tracking any
    objects, can be used for automation. """

    INPUT_VALIDATOR = DescribeNodeInput
    OUTPUT_VALIDATOR = DescribeNodeOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId | None = None,
        backend_node_id: DOM.BackendNodeId | None = None,
        object_id: Runtime.RemoteObjectId | None = None,
        depth: int | None = None,
        pierce: bool | None = None
    ):
        super().__init__(
            nodeId=node_id,
            backendNodeId=backend_node_id,
            objectId=object_id,
            depth=depth,
            pierce=pierce
        )


class ScrollIntoViewIfNeededInput(InputModel):

    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectId: Runtime.RemoteObjectId | None = None  # deprecated
    rect: DOM.Rect | None = None  # deprecated


class ScrollIntoViewIfNeeded(CDPMethod[None]):  # deprecated
    """ Scrolls the specified rect of the given node into view if not already visible.
    Note: exactly one between nodeId, backendNodeId and objectId should be passed
    to identify the node. """

    INPUT_VALIDATOR = ScrollIntoViewIfNeededInput
    OUTPUT_VALIDATOR = None

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


class Disable(CDPMethod[None]):  # deprecated
    """ Disables DOM agent for the given page. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class DiscardSearchResultsInput(InputModel):

    searchId: str  # deprecated


class DiscardSearchResults(CDPMethod[None]):  # experimental deprecated
    """ Discards search results from the session with the given id. `getSearchResults` should no longer
    be called for that search. """

    INPUT_VALIDATOR = DiscardSearchResultsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        search_id: str
    ):
        super().__init__(
            searchId=search_id
        )


class EnableInput(InputModel):

    includeWhitespace: Literal['none', 'all'] | None = None  # experimental deprecated


class Enable(CDPMethod[None]):  # deprecated
    """ Enables DOM agent for the given page. """

    INPUT_VALIDATOR = EnableInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        include_whitespace: Literal['none', 'all'] | None = None
    ):
        super().__init__(
            includeWhitespace=include_whitespace
        )


class FocusInput(InputModel):

    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectId: Runtime.RemoteObjectId | None = None  # deprecated


class Focus(CDPMethod[None]):  # deprecated
    """ Focuses the given element. """

    INPUT_VALIDATOR = FocusInput
    OUTPUT_VALIDATOR = None

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


class GetAttributesInput(InputModel):

    nodeId: DOM.NodeId  # deprecated


class GetAttributesOutput(OutputModel):

    attributes: list[str]  # deprecated


class GetAttributes(CDPMethod[GetAttributesOutput]):  # deprecated
    """ Returns attributes for the specified node. """

    INPUT_VALIDATOR = GetAttributesInput
    OUTPUT_VALIDATOR = GetAttributesOutput

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


class GetBoxModelInput(InputModel):

    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectId: Runtime.RemoteObjectId | None = None  # deprecated


class GetBoxModelOutput(OutputModel):

    model: DOM.BoxModel  # deprecated


class GetBoxModel(CDPMethod[GetBoxModelOutput]):  # deprecated
    """ Returns boxes for the given node. """

    INPUT_VALIDATOR = GetBoxModelInput
    OUTPUT_VALIDATOR = GetBoxModelOutput

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


class GetContentQuadsInput(InputModel):

    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectId: Runtime.RemoteObjectId | None = None  # deprecated


class GetContentQuadsOutput(OutputModel):

    quads: list[DOM.Quad]  # deprecated


class GetContentQuads(CDPMethod[GetContentQuadsOutput]):  # experimental deprecated
    """ Returns quads that describe node position on the page. This method
    might return multiple quads for inline nodes. """

    INPUT_VALIDATOR = GetContentQuadsInput
    OUTPUT_VALIDATOR = GetContentQuadsOutput

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


class GetDocumentInput(InputModel):

    depth: int | None = None  # deprecated
    pierce: bool | None = None  # deprecated


class GetDocumentOutput(OutputModel):

    root: DOM.Node  # deprecated


class GetDocument(CDPMethod[GetDocumentOutput]):  # deprecated
    """ Returns the root DOM node (and optionally the subtree) to the caller.
    Implicitly enables the DOM domain events for the current target. """

    INPUT_VALIDATOR = GetDocumentInput
    OUTPUT_VALIDATOR = GetDocumentOutput

    def __init__(
        self,
        *,
        depth: int | None = None,
        pierce: bool | None = None
    ):
        super().__init__(
            depth=depth,
            pierce=pierce
        )


class GetFlattenedDocumentInput(InputModel):

    depth: int | None = None  # deprecated
    pierce: bool | None = None  # deprecated


class GetFlattenedDocumentOutput(OutputModel):

    nodes: list[DOM.Node]  # deprecated


class GetFlattenedDocument(CDPMethod[GetFlattenedDocumentOutput]):  # deprecated
    """ Returns the root DOM node (and optionally the subtree) to the caller.
    Deprecated, as it is not designed to work well with the rest of the DOM agent.
    Use DOMSnapshot.captureSnapshot instead. """

    INPUT_VALIDATOR = GetFlattenedDocumentInput
    OUTPUT_VALIDATOR = GetFlattenedDocumentOutput

    def __init__(
        self,
        *,
        depth: int | None = None,
        pierce: bool | None = None
    ):
        super().__init__(
            depth=depth,
            pierce=pierce
        )


class GetNodesForSubtreeByStyleInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    computedStyles: list[DOM.CSSComputedStyleProperty]  # deprecated
    pierce: bool | None = None  # deprecated


class GetNodesForSubtreeByStyleOutput(OutputModel):

    nodeIds: list[DOM.NodeId]  # deprecated


class GetNodesForSubtreeByStyle(CDPMethod[GetNodesForSubtreeByStyleOutput]):  # experimental deprecated
    """ Finds nodes with a given computed style in a subtree. """

    INPUT_VALIDATOR = GetNodesForSubtreeByStyleInput
    OUTPUT_VALIDATOR = GetNodesForSubtreeByStyleOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        computed_styles: list[DOM.CSSComputedStyleProperty],
        pierce: bool | None = None
    ):
        super().__init__(
            nodeId=node_id,
            computedStyles=computed_styles,
            pierce=pierce
        )


class GetNodeForLocationInput(InputModel):

    x: int  # deprecated
    y: int  # deprecated
    includeUserAgentShadowDOM: bool | None = None  # deprecated
    ignorePointerEventsNone: bool | None = None  # deprecated


class GetNodeForLocationOutput(OutputModel):

    backendNodeId: DOM.BackendNodeId  # deprecated
    frameId: Page.FrameId  # deprecated
    nodeId: DOM.NodeId | None = None  # deprecated


class GetNodeForLocation(CDPMethod[GetNodeForLocationOutput]):  # deprecated
    """ Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is
    either returned or not. """

    INPUT_VALIDATOR = GetNodeForLocationInput
    OUTPUT_VALIDATOR = GetNodeForLocationOutput

    def __init__(
        self,
        *,
        x: int,
        y: int,
        include_user_agent_shadow_dom: bool | None = None,
        ignore_pointer_events_none: bool | None = None
    ):
        super().__init__(
            x=x,
            y=y,
            includeUserAgentShadowDOM=include_user_agent_shadow_dom,
            ignorePointerEventsNone=ignore_pointer_events_none
        )


class GetOuterHTMLInput(InputModel):

    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectId: Runtime.RemoteObjectId | None = None  # deprecated


class GetOuterHTMLOutput(OutputModel):

    outerHTML: str  # deprecated


class GetOuterHTML(CDPMethod[GetOuterHTMLOutput]):  # deprecated
    """ Returns node's HTML markup. """

    INPUT_VALIDATOR = GetOuterHTMLInput
    OUTPUT_VALIDATOR = GetOuterHTMLOutput

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


class GetRelayoutBoundaryInput(InputModel):

    nodeId: DOM.NodeId  # deprecated


class GetRelayoutBoundaryOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class GetRelayoutBoundary(CDPMethod[GetRelayoutBoundaryOutput]):  # experimental deprecated
    """ Returns the id of the nearest ancestor that is a relayout boundary. """

    INPUT_VALIDATOR = GetRelayoutBoundaryInput
    OUTPUT_VALIDATOR = GetRelayoutBoundaryOutput

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


class GetSearchResultsInput(InputModel):

    searchId: str  # deprecated
    fromIndex: int  # deprecated
    toIndex: int  # deprecated


class GetSearchResultsOutput(OutputModel):

    nodeIds: list[DOM.NodeId]  # deprecated


class GetSearchResults(CDPMethod[GetSearchResultsOutput]):  # experimental deprecated
    """ Returns search results from given `fromIndex` to given `toIndex` from the search with the given
    identifier. """

    INPUT_VALIDATOR = GetSearchResultsInput
    OUTPUT_VALIDATOR = GetSearchResultsOutput

    def __init__(
        self,
        *,
        search_id: str,
        from_index: int,
        to_index: int
    ):
        super().__init__(
            searchId=search_id,
            fromIndex=from_index,
            toIndex=to_index
        )


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

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class HighlightNode(CDPMethod[None]):  # deprecated
    """ Highlights DOM node. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class HighlightRect(CDPMethod[None]):  # deprecated
    """ Highlights given rectangle. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class MarkUndoableState(CDPMethod[None]):  # experimental deprecated
    """ Marks last undoable state. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class MoveToInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    targetNodeId: DOM.NodeId  # deprecated
    insertBeforeNodeId: DOM.NodeId | None = None  # deprecated


class MoveToOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class MoveTo(CDPMethod[MoveToOutput]):  # deprecated
    """ Moves node into the new container, places it before the given anchor. """

    INPUT_VALIDATOR = MoveToInput
    OUTPUT_VALIDATOR = MoveToOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        target_node_id: DOM.NodeId,
        insert_before_node_id: DOM.NodeId | None = None
    ):
        super().__init__(
            nodeId=node_id,
            targetNodeId=target_node_id,
            insertBeforeNodeId=insert_before_node_id
        )


class PerformSearchInput(InputModel):

    query: str  # deprecated
    includeUserAgentShadowDOM: bool | None = None  # deprecated


class PerformSearchOutput(OutputModel):

    searchId: str  # deprecated
    resultCount: int  # deprecated


class PerformSearch(CDPMethod[PerformSearchOutput]):  # experimental deprecated
    """ Searches for a given string in the DOM tree. Use `getSearchResults` to access search results or
    `cancelSearch` to end this search session. """

    INPUT_VALIDATOR = PerformSearchInput
    OUTPUT_VALIDATOR = PerformSearchOutput

    def __init__(
        self,
        *,
        query: str,
        include_user_agent_shadow_dom: bool | None = None
    ):
        super().__init__(
            query=query,
            includeUserAgentShadowDOM=include_user_agent_shadow_dom
        )


class PushNodeByPathToFrontendInput(InputModel):

    path: str  # deprecated


class PushNodeByPathToFrontendOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class PushNodeByPathToFrontend(CDPMethod[PushNodeByPathToFrontendOutput]):  # experimental deprecated
    """ Requests that the node is sent to the caller given its path. // FIXME, use XPath """

    INPUT_VALIDATOR = PushNodeByPathToFrontendInput
    OUTPUT_VALIDATOR = PushNodeByPathToFrontendOutput

    def __init__(
        self,
        *,
        path: str
    ):
        super().__init__(
            path=path
        )


class PushNodesByBackendIdsToFrontendInput(InputModel):

    backendNodeIds: list[DOM.BackendNodeId]  # deprecated


class PushNodesByBackendIdsToFrontendOutput(OutputModel):

    nodeIds: list[DOM.NodeId]  # deprecated


class PushNodesByBackendIdsToFrontend(CDPMethod[PushNodesByBackendIdsToFrontendOutput]):  # experimental deprecated
    """ Requests that a batch of nodes is sent to the caller given their backend node ids. """

    INPUT_VALIDATOR = PushNodesByBackendIdsToFrontendInput
    OUTPUT_VALIDATOR = PushNodesByBackendIdsToFrontendOutput

    def __init__(
        self,
        *,
        backend_node_ids: list[DOM.BackendNodeId]
    ):
        super().__init__(
            backendNodeIds=backend_node_ids
        )


class QuerySelectorInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    selector: str  # deprecated


class QuerySelectorOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class QuerySelector(CDPMethod[QuerySelectorOutput]):  # deprecated
    """ Executes `querySelector` on a given node. """

    INPUT_VALIDATOR = QuerySelectorInput
    OUTPUT_VALIDATOR = QuerySelectorOutput

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


class QuerySelectorAllInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    selector: str  # deprecated


class QuerySelectorAllOutput(OutputModel):

    nodeIds: list[DOM.NodeId]  # deprecated


class QuerySelectorAll(CDPMethod[QuerySelectorAllOutput]):  # deprecated
    """ Executes `querySelectorAll` on a given node. """

    INPUT_VALIDATOR = QuerySelectorAllInput
    OUTPUT_VALIDATOR = QuerySelectorAllOutput

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


class GetTopLayerElementsOutput(OutputModel):

    nodeIds: list[DOM.NodeId]  # deprecated


class GetTopLayerElements(CDPMethod[GetTopLayerElementsOutput]):  # experimental deprecated
    """ Returns NodeIds of current top layer elements.
    Top layer is rendered closest to the user within a viewport, therefore its elements always
    appear on top of all other content. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetTopLayerElementsOutput


class GetElementByRelationInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    relation: Literal['PopoverTarget', 'InterestTarget', 'CommandFor']  # deprecated


class GetElementByRelationOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class GetElementByRelation(CDPMethod[GetElementByRelationOutput]):  # experimental deprecated
    """ Returns the NodeId of the matched element according to certain relations. """

    INPUT_VALIDATOR = GetElementByRelationInput
    OUTPUT_VALIDATOR = GetElementByRelationOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        relation: Literal['PopoverTarget', 'InterestTarget', 'CommandFor']
    ):
        super().__init__(
            nodeId=node_id,
            relation=relation
        )


class Redo(CDPMethod[None]):  # experimental deprecated
    """ Re-does the last undone action. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class RemoveAttributeInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    name: str  # deprecated


class RemoveAttribute(CDPMethod[None]):  # deprecated
    """ Removes attribute with given name from an element with given id. """

    INPUT_VALIDATOR = RemoveAttributeInput
    OUTPUT_VALIDATOR = None

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


class RemoveNodeInput(InputModel):

    nodeId: DOM.NodeId  # deprecated


class RemoveNode(CDPMethod[None]):  # deprecated
    """ Removes node with given id. """

    INPUT_VALIDATOR = RemoveNodeInput
    OUTPUT_VALIDATOR = None

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


class RequestChildNodesInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    depth: int | None = None  # deprecated
    pierce: bool | None = None  # deprecated


class RequestChildNodes(CDPMethod[None]):  # deprecated
    """ Requests that children of the node with given id are returned to the caller in form of
    `setChildNodes` events where not only immediate children are retrieved, but all children down to
    the specified depth. """

    INPUT_VALIDATOR = RequestChildNodesInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        depth: int | None = None,
        pierce: bool | None = None
    ):
        super().__init__(
            nodeId=node_id,
            depth=depth,
            pierce=pierce
        )


class RequestNodeInput(InputModel):

    objectId: Runtime.RemoteObjectId  # deprecated


class RequestNodeOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class RequestNode(CDPMethod[RequestNodeOutput]):  # deprecated
    """ Requests that the node is sent to the caller given the JavaScript node object reference. All
    nodes that form the path from the node to the root are also sent to the client as a series of
    `setChildNodes` notifications. """

    INPUT_VALIDATOR = RequestNodeInput
    OUTPUT_VALIDATOR = RequestNodeOutput

    def __init__(
        self,
        *,
        object_id: Runtime.RemoteObjectId
    ):
        super().__init__(
            objectId=object_id
        )


class ResolveNodeInput(InputModel):

    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectGroup: str | None = None  # deprecated
    executionContextId: Runtime.ExecutionContextId | None = None  # deprecated


class ResolveNodeOutput(OutputModel):

    object: Runtime.RemoteObject  # deprecated


class ResolveNode(CDPMethod[ResolveNodeOutput]):  # deprecated
    """ Resolves the JavaScript node object for a given NodeId or BackendNodeId. """

    INPUT_VALIDATOR = ResolveNodeInput
    OUTPUT_VALIDATOR = ResolveNodeOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId | None = None,
        backend_node_id: DOM.BackendNodeId | None = None,
        object_group: str | None = None,
        execution_context_id: Runtime.ExecutionContextId | None = None
    ):
        super().__init__(
            nodeId=node_id,
            backendNodeId=backend_node_id,
            objectGroup=object_group,
            executionContextId=execution_context_id
        )


class SetAttributeValueInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    name: str  # deprecated
    value: str  # deprecated


class SetAttributeValue(CDPMethod[None]):  # deprecated
    """ Sets attribute for an element with given id. """

    INPUT_VALIDATOR = SetAttributeValueInput
    OUTPUT_VALIDATOR = None

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


class SetAttributesAsTextInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    text: str  # deprecated
    name: str | None = None  # deprecated


class SetAttributesAsText(CDPMethod[None]):  # deprecated
    """ Sets attributes on element with given id. This method is useful when user edits some existing
    attribute value and types in several attribute name/value pairs. """

    INPUT_VALIDATOR = SetAttributesAsTextInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        text: str,
        name: str | None = None
    ):
        super().__init__(
            nodeId=node_id,
            text=text,
            name=name
        )


class SetFileInputFilesInput(InputModel):

    files: list[str]  # deprecated
    nodeId: DOM.NodeId | None = None  # deprecated
    backendNodeId: DOM.BackendNodeId | None = None  # deprecated
    objectId: Runtime.RemoteObjectId | None = None  # deprecated


class SetFileInputFiles(CDPMethod[None]):  # deprecated
    """ Sets files for the given file input element. """

    INPUT_VALIDATOR = SetFileInputFilesInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        files: list[str],
        node_id: DOM.NodeId | None = None,
        backend_node_id: DOM.BackendNodeId | None = None,
        object_id: Runtime.RemoteObjectId | None = None
    ):
        super().__init__(
            files=files,
            nodeId=node_id,
            backendNodeId=backend_node_id,
            objectId=object_id
        )


class SetNodeStackTracesEnabledInput(InputModel):

    enable: bool  # deprecated


class SetNodeStackTracesEnabled(CDPMethod[None]):  # experimental deprecated
    """ Sets if stack traces should be captured for Nodes. See `Node.getNodeStackTraces`. Default is disabled. """

    INPUT_VALIDATOR = SetNodeStackTracesEnabledInput
    OUTPUT_VALIDATOR = None

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


class GetNodeStackTracesInput(InputModel):

    nodeId: DOM.NodeId  # deprecated


class GetNodeStackTracesOutput(OutputModel):

    creation: Runtime.StackTrace | None = None  # deprecated


class GetNodeStackTraces(CDPMethod[GetNodeStackTracesOutput]):  # experimental deprecated
    """ Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation. """

    INPUT_VALIDATOR = GetNodeStackTracesInput
    OUTPUT_VALIDATOR = GetNodeStackTracesOutput

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


class GetFileInfoInput(InputModel):

    objectId: Runtime.RemoteObjectId  # deprecated


class GetFileInfoOutput(OutputModel):

    path: str


class GetFileInfo(CDPMethod[GetFileInfoOutput]):  # experimental deprecated
    """ Returns file information for the given
    File wrapper. """

    INPUT_VALIDATOR = GetFileInfoInput
    OUTPUT_VALIDATOR = GetFileInfoOutput

    def __init__(
        self,
        *,
        object_id: Runtime.RemoteObjectId
    ):
        super().__init__(
            objectId=object_id
        )


class GetDetachedDomNodesOutput(OutputModel):

    detachedNodes: list[DOM.DetachedElementInfo]  # deprecated


class GetDetachedDomNodes(CDPMethod[GetDetachedDomNodesOutput]):  # experimental deprecated
    """ Returns list of detached nodes """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetDetachedDomNodesOutput


class SetInspectedNodeInput(InputModel):

    nodeId: DOM.NodeId  # deprecated


class SetInspectedNode(CDPMethod[None]):  # experimental deprecated
    """ Enables console to refer to the node with given id via $x (see Command Line API for more details
    $x functions). """

    INPUT_VALIDATOR = SetInspectedNodeInput
    OUTPUT_VALIDATOR = None

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


class SetNodeNameInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    name: str  # deprecated


class SetNodeNameOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class SetNodeName(CDPMethod[SetNodeNameOutput]):  # deprecated
    """ Sets node name for a node with given id. """

    INPUT_VALIDATOR = SetNodeNameInput
    OUTPUT_VALIDATOR = SetNodeNameOutput

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


class SetNodeValueInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    value: str  # deprecated


class SetNodeValue(CDPMethod[None]):  # deprecated
    """ Sets node value for a node with given id. """

    INPUT_VALIDATOR = SetNodeValueInput
    OUTPUT_VALIDATOR = None

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


class SetOuterHTMLInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    outerHTML: str  # deprecated


class SetOuterHTML(CDPMethod[None]):  # deprecated
    """ Sets node HTML markup, returns new node id. """

    INPUT_VALIDATOR = SetOuterHTMLInput
    OUTPUT_VALIDATOR = None

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


class Undo(CDPMethod[None]):  # experimental deprecated
    """ Undoes the last performed action. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class GetFrameOwnerInput(InputModel):

    frameId: Page.FrameId


class GetFrameOwnerOutput(OutputModel):

    backendNodeId: DOM.BackendNodeId  # deprecated
    nodeId: DOM.NodeId | None = None  # deprecated


class GetFrameOwner(CDPMethod[GetFrameOwnerOutput]):  # experimental deprecated
    """ Returns iframe node that owns iframe with the given domain. """

    INPUT_VALIDATOR = GetFrameOwnerInput
    OUTPUT_VALIDATOR = GetFrameOwnerOutput

    def __init__(
        self,
        *,
        frame_id: Page.FrameId
    ):
        super().__init__(
            frameId=frame_id
        )


class GetContainerForNodeInput(InputModel):

    nodeId: DOM.NodeId
    containerName: str | None = None
    physicalAxes: DOM.PhysicalAxes | None = None
    logicalAxes: DOM.LogicalAxes | None = None
    queriesScrollState: bool | None = None


class GetContainerForNodeOutput(OutputModel):

    nodeId: DOM.NodeId | None = None  # deprecated


class GetContainerForNode(CDPMethod[GetContainerForNodeOutput]):  # experimental deprecated
    """ Returns the query container of the given node based on container query
    conditions: containerName, physical and logical axes, and whether it queries
    scroll-state. If no axes are provided and queriesScrollState is false, the
    style container is returned, which is the direct parent or the closest
    element with a matching container-name. """

    INPUT_VALIDATOR = GetContainerForNodeInput
    OUTPUT_VALIDATOR = GetContainerForNodeOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        container_name: str | None = None,
        physical_axes: DOM.PhysicalAxes | None = None,
        logical_axes: DOM.LogicalAxes | None = None,
        queries_scroll_state: bool | None = None
    ):
        super().__init__(
            nodeId=node_id,
            containerName=container_name,
            physicalAxes=physical_axes,
            logicalAxes=logical_axes,
            queriesScrollState=queries_scroll_state
        )


class GetQueryingDescendantsForContainerInput(InputModel):

    nodeId: DOM.NodeId  # deprecated


class GetQueryingDescendantsForContainerOutput(OutputModel):

    nodeIds: list[DOM.NodeId]  # deprecated


class GetQueryingDescendantsForContainer(CDPMethod[GetQueryingDescendantsForContainerOutput]):  # experimental deprecated
    """ Returns the descendants of a container query container that have
    container queries against this container. """

    INPUT_VALIDATOR = GetQueryingDescendantsForContainerInput
    OUTPUT_VALIDATOR = GetQueryingDescendantsForContainerOutput

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


class GetAnchorElementInput(InputModel):

    nodeId: DOM.NodeId  # deprecated
    anchorSpecifier: str | None = None  # deprecated


class GetAnchorElementOutput(OutputModel):

    nodeId: DOM.NodeId  # deprecated


class GetAnchorElement(CDPMethod[GetAnchorElementOutput]):  # experimental deprecated
    """ Returns the target anchor element of the given anchor query according to
    https://www.w3.org/TR/css-anchor-position-1/#target. """

    INPUT_VALIDATOR = GetAnchorElementInput
    OUTPUT_VALIDATOR = GetAnchorElementOutput

    def __init__(
        self,
        *,
        node_id: DOM.NodeId,
        anchor_specifier: str | None = None
    ):
        super().__init__(
            nodeId=node_id,
            anchorSpecifier=anchor_specifier
        )
