# AUTO-GENERATED By cidipi/tools/generator.py. DO NOT EDIT.

from typing import Any, Literal, Optional, Union

from pydantic import PrivateAttr

import cidipi.protocols.types as types
from cidipi.interface import IEvent


class Console:
    """
    This domain is deprecated - use Runtime or Log instead.
    """

    class messageAdded(IEvent):
        """
        Issued when new console message is added.
        """

        _domain: str = PrivateAttr("Console")
        message: "types.Console.TypeConsoleMessage"
        """
        Console message that has been added.
        """


class Debugger:
    """
        Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
    breakpoints, stepping through execution, exploring stack traces, etc.
    """

    class breakpointResolved(IEvent):
        """
        Fired when breakpoint is resolved to an actual script and location.
        """

        _domain: str = PrivateAttr("Debugger")
        breakpointId: "types.Debugger.TypeBreakpointId"
        """
        Breakpoint unique identifier.
        """
        location: "types.Debugger.TypeLocation"
        """
        Actual breakpoint location.
        """

    class paused(IEvent):
        """
        Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
        """

        _domain: str = PrivateAttr("Debugger")
        callFrames: list[Any]
        """
        Call stack the virtual machine stopped on.
        """
        reason: Literal[
            "ambiguous",
            "assert",
            "CSPViolation",
            "debugCommand",
            "DOM",
            "EventListener",
            "exception",
            "instrumentation",
            "OOM",
            "other",
            "promiseRejection",
            "XHR",
            "step",
        ]
        """
        Pause reason.
        """
        data: Optional[dict[str, Any]] = None
        """
        Object containing break-specific auxiliary properties.
        """
        hitBreakpoints: Optional[list[Any]] = None
        """
        Hit breakpoints IDs
        """
        asyncStackTrace: Optional["types.Runtime.TypeStackTrace"] = None
        """
        Async stack trace, if any.
        """
        asyncStackTraceId: Optional["types.Runtime.TypeStackTraceId"] = None
        """
        Async stack trace, if any.
        """
        asyncCallStackTraceId: Optional["types.Runtime.TypeStackTraceId"] = None
        """
        Never present, will be removed.
        """

    class resumed(IEvent):
        """
        Fired when the virtual machine resumed execution.
        """

        _domain: str = PrivateAttr("Debugger")

    class scriptFailedToParse(IEvent):
        """
        Fired when virtual machine fails to parse the script.
        """

        _domain: str = PrivateAttr("Debugger")
        scriptId: "types.Runtime.TypeScriptId"
        """
        Identifier of the script parsed.
        """
        url: str
        """
        URL or name of the script parsed (if any).
        """
        startLine: Union[float, int]
        """
        Line offset of the script within the resource with given URL (for script tags).
        """
        startColumn: Union[float, int]
        """
        Column offset of the script within the resource with given URL.
        """
        endLine: Union[float, int]
        """
        Last line of the script.
        """
        endColumn: Union[float, int]
        """
        Length of the last line of the script.
        """
        executionContextId: "types.Runtime.TypeExecutionContextId"
        """
        Specifies script creation context.
        """
        hash: str
        """
        Content hash of the script, SHA-256.
        """
        executionContextAuxData: Optional[dict[str, Any]] = None
        """
        Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
        """
        sourceMapURL: Optional[str] = None
        """
        URL of source map associated with script (if any).
        """
        hasSourceURL: Optional[bool] = None
        """
        True, if this script has sourceURL.
        """
        isModule: Optional[bool] = None
        """
        True, if this script is ES6 module.
        """
        length: Optional[Union[float, int]] = None
        """
        This script length.
        """
        stackTrace: Optional["types.Runtime.TypeStackTrace"] = None
        """
        JavaScript top stack frame of where the script parsed event was triggered if available.
        """
        codeOffset: Optional[Union[float, int]] = None
        """
        If the scriptLanguage is WebAssembly, the code section offset in the module.
        """
        scriptLanguage: Optional["types.Debugger.TypeScriptLanguage"] = None
        """
        The language of the script.
        """
        embedderName: Optional[str] = None
        """
        The name the embedder supplied for this script.
        """

    class scriptParsed(IEvent):
        """
                Fired when virtual machine parses script. This event is also fired for all known and uncollected
        scripts upon enabling debugger.
        """

        _domain: str = PrivateAttr("Debugger")
        scriptId: "types.Runtime.TypeScriptId"
        """
        Identifier of the script parsed.
        """
        url: str
        """
        URL or name of the script parsed (if any).
        """
        startLine: Union[float, int]
        """
        Line offset of the script within the resource with given URL (for script tags).
        """
        startColumn: Union[float, int]
        """
        Column offset of the script within the resource with given URL.
        """
        endLine: Union[float, int]
        """
        Last line of the script.
        """
        endColumn: Union[float, int]
        """
        Length of the last line of the script.
        """
        executionContextId: "types.Runtime.TypeExecutionContextId"
        """
        Specifies script creation context.
        """
        hash: str
        """
        Content hash of the script, SHA-256.
        """
        executionContextAuxData: Optional[dict[str, Any]] = None
        """
        Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}
        """
        isLiveEdit: Optional[bool] = None
        """
        True, if this script is generated as a result of the live edit operation.
        """
        sourceMapURL: Optional[str] = None
        """
        URL of source map associated with script (if any).
        """
        hasSourceURL: Optional[bool] = None
        """
        True, if this script has sourceURL.
        """
        isModule: Optional[bool] = None
        """
        True, if this script is ES6 module.
        """
        length: Optional[Union[float, int]] = None
        """
        This script length.
        """
        stackTrace: Optional["types.Runtime.TypeStackTrace"] = None
        """
        JavaScript top stack frame of where the script parsed event was triggered if available.
        """
        codeOffset: Optional[Union[float, int]] = None
        """
        If the scriptLanguage is WebAssembly, the code section offset in the module.
        """
        scriptLanguage: Optional["types.Debugger.TypeScriptLanguage"] = None
        """
        The language of the script.
        """
        debugSymbols: Optional["types.Debugger.TypeDebugSymbols"] = None
        """
        If the scriptLanguage is WebASsembly, the source of debug symbols for the module.
        """
        embedderName: Optional[str] = None
        """
        The name the embedder supplied for this script.
        """


class HeapProfiler:
    class addHeapSnapshotChunk(IEvent):
        _domain: str = PrivateAttr("HeapProfiler")
        chunk: str

    class heapStatsUpdate(IEvent):
        """
        If heap objects tracking has been started then backend may send update for one or more fragments
        """

        _domain: str = PrivateAttr("HeapProfiler")
        statsUpdate: list[Any]
        """
        An array of triplets. Each triplet describes a fragment. The first integer is the fragment
index, the second integer is a total count of objects for the fragment, the third integer is
a total size of the objects for the fragment.
        """

    class lastSeenObjectId(IEvent):
        """
                If heap objects tracking has been started then backend regularly sends a current value for last
        seen object id and corresponding timestamp. If the were changes in the heap since last event
        then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
        """

        _domain: str = PrivateAttr("HeapProfiler")
        lastSeenObjectId: Union[float, int]
        timestamp: Union[float, int]

    class reportHeapSnapshotProgress(IEvent):
        _domain: str = PrivateAttr("HeapProfiler")
        done: Union[float, int]
        total: Union[float, int]
        finished: Optional[bool] = None

    class resetProfiles(IEvent):
        _domain: str = PrivateAttr("HeapProfiler")


class Profiler:
    class consoleProfileFinished(IEvent):
        _domain: str = PrivateAttr("Profiler")
        id: str
        location: "types.Debugger.TypeLocation"
        """
        Location of console.profileEnd().
        """
        profile: "types.Profiler.TypeProfile"
        title: Optional[str] = None
        """
        Profile title passed as an argument to console.profile().
        """

    class consoleProfileStarted(IEvent):
        """
        Sent when new profile recording is started using console.profile() call.
        """

        _domain: str = PrivateAttr("Profiler")
        id: str
        location: "types.Debugger.TypeLocation"
        """
        Location of console.profile().
        """
        title: Optional[str] = None
        """
        Profile title passed as an argument to console.profile().
        """

    class preciseCoverageDeltaUpdate(IEvent):
        """
                Reports coverage delta since the last poll (either from an event like this, or from
        `takePreciseCoverage` for the current isolate. May only be sent if precise code
        coverage has been started. This event can be trigged by the embedder to, for example,
        trigger collection of coverage data immediately at a certain point in time.
        """

        _domain: str = PrivateAttr("Profiler")
        timestamp: Union[float, int]
        """
        Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
        """
        occasion: str
        """
        Identifier for distinguishing coverage events.
        """
        result: list[Any]
        """
        Coverage data for the current isolate.
        """


class Runtime:
    """
        Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects.
    Evaluation results are returned as mirror object that expose object type, string representation
    and unique identifier that can be used for further object reference. Original objects are
    maintained in memory unless they are either explicitly released or are released along with the
    other objects in their object group.
    """

    class bindingCalled(IEvent):
        """
        Notification is issued every time when binding is called.
        """

        _domain: str = PrivateAttr("Runtime")
        name: str
        payload: str
        executionContextId: "types.Runtime.TypeExecutionContextId"
        """
        Identifier of the context where the call was made.
        """

    class consoleAPICalled(IEvent):
        """
        Issued when console API was called.
        """

        _domain: str = PrivateAttr("Runtime")
        type: Literal[
            "log",
            "debug",
            "info",
            "error",
            "warning",
            "dir",
            "dirxml",
            "table",
            "trace",
            "clear",
            "startGroup",
            "startGroupCollapsed",
            "endGroup",
            "assert",
            "profile",
            "profileEnd",
            "count",
            "timeEnd",
        ]
        """
        Type of the call.
        """
        args: list[Any]
        """
        Call arguments.
        """
        executionContextId: "types.Runtime.TypeExecutionContextId"
        """
        Identifier of the context where the call was made.
        """
        timestamp: "types.Runtime.TypeTimestamp"
        """
        Call timestamp.
        """
        stackTrace: Optional["types.Runtime.TypeStackTrace"] = None
        """
        Stack trace captured when the call was made. The async stack chain is automatically reported for
the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call
chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field.
        """
        context: Optional[str] = None
        """
        Console context descriptor for calls on non-default console context (not console.*):
'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call
on named context.
        """

    class exceptionRevoked(IEvent):
        """
        Issued when unhandled exception was revoked.
        """

        _domain: str = PrivateAttr("Runtime")
        reason: str
        """
        Reason describing why exception was revoked.
        """
        exceptionId: Union[float, int]
        """
        The id of revoked exception, as reported in `exceptionThrown`.
        """

    class exceptionThrown(IEvent):
        """
        Issued when exception was thrown and unhandled.
        """

        _domain: str = PrivateAttr("Runtime")
        timestamp: "types.Runtime.TypeTimestamp"
        """
        Timestamp of the exception.
        """
        exceptionDetails: "types.Runtime.TypeExceptionDetails"

    class executionContextCreated(IEvent):
        """
        Issued when new execution context is created.
        """

        _domain: str = PrivateAttr("Runtime")
        context: "types.Runtime.TypeExecutionContextDescription"
        """
        A newly created execution context.
        """

    class executionContextDestroyed(IEvent):
        """
        Issued when execution context is destroyed.
        """

        _domain: str = PrivateAttr("Runtime")
        executionContextId: "types.Runtime.TypeExecutionContextId"
        """
        Id of the destroyed context
        """
        executionContextUniqueId: str
        """
        Unique Id of the destroyed context
        """

    class executionContextsCleared(IEvent):
        """
        Issued when all executionContexts were cleared in browser
        """

        _domain: str = PrivateAttr("Runtime")

    class inspectRequested(IEvent):
        """
                Issued when object should be inspected (for example, as a result of inspect() command line API
        call).
        """

        _domain: str = PrivateAttr("Runtime")
        object: "types.Runtime.TypeRemoteObject"
        hints: dict[str, Any]
        executionContextId: Optional["types.Runtime.TypeExecutionContextId"] = None
        """
        Identifier of the context where the call was made.
        """


class Accessibility:
    class loadComplete(IEvent):
        """
                The loadComplete event mirrors the load complete event sent by the browser to assistive
        technology when the web page has finished loading.
        """

        _domain: str = PrivateAttr("Accessibility")
        root: "types.Accessibility.TypeAXNode"
        """
        New document root node.
        """

    class nodesUpdated(IEvent):
        """
        The nodesUpdated event is sent every time a previously requested node has changed the in tree.
        """

        _domain: str = PrivateAttr("Accessibility")
        nodes: list[Any]
        """
        Updated node data.
        """


class Animation:
    class animationCanceled(IEvent):
        """
        Event for when an animation has been cancelled.
        """

        _domain: str = PrivateAttr("Animation")
        id: str
        """
        Id of the animation that was cancelled.
        """

    class animationCreated(IEvent):
        """
        Event for each animation that has been created.
        """

        _domain: str = PrivateAttr("Animation")
        id: str
        """
        Id of the animation that was created.
        """

    class animationStarted(IEvent):
        """
        Event for animation that has been started.
        """

        _domain: str = PrivateAttr("Animation")
        animation: "types.Animation.TypeAnimation"
        """
        Animation that was started.
        """

    class animationUpdated(IEvent):
        """
        Event for animation that has been updated.
        """

        _domain: str = PrivateAttr("Animation")
        animation: "types.Animation.TypeAnimation"
        """
        Animation that was updated.
        """


class Audits:
    """
    Audits domain allows investigation of page violations and possible improvements.
    """

    class issueAdded(IEvent):
        _domain: str = PrivateAttr("Audits")
        issue: "types.Audits.TypeInspectorIssue"


class Autofill:
    """
    Defines commands and events for Autofill.
    """

    class addressFormFilled(IEvent):
        """
        Emitted when an address form is filled.
        """

        _domain: str = PrivateAttr("Autofill")
        filledFields: list[Any]
        """
        Information about the fields that were filled
        """
        addressUi: "types.Autofill.TypeAddressUI"
        """
        An UI representation of the address used to fill the form.
Consists of a 2D array where each child represents an address/profile line.
        """


class BackgroundService:
    """
    Defines events for background web platform features.
    """

    class recordingStateChanged(IEvent):
        """
        Called when the recording state for the service has been updated.
        """

        _domain: str = PrivateAttr("BackgroundService")
        isRecording: bool
        service: "types.BackgroundService.TypeServiceName"

    class backgroundServiceEventReceived(IEvent):
        """
                Called with all existing backgroundServiceEvents when enabled, and all new
        events afterwards if enabled and recording.
        """

        _domain: str = PrivateAttr("BackgroundService")
        backgroundServiceEvent: "types.BackgroundService.TypeBackgroundServiceEvent"


class Browser:
    """
    The Browser domain defines methods and events for browser managing.
    """

    class downloadWillBegin(IEvent):
        """
        Fired when page is about to start a download.
        """

        _domain: str = PrivateAttr("Browser")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that caused the download to begin.
        """
        guid: str
        """
        Global unique identifier of the download.
        """
        url: str
        """
        URL of the resource being downloaded.
        """
        suggestedFilename: str
        """
        Suggested file name of the resource (the actual name of the file saved on disk may differ).
        """

    class downloadProgress(IEvent):
        """
        Fired when download makes progress. Last call has |done| == true.
        """

        _domain: str = PrivateAttr("Browser")
        guid: str
        """
        Global unique identifier of the download.
        """
        totalBytes: Union[float, int]
        """
        Total expected bytes to download.
        """
        receivedBytes: Union[float, int]
        """
        Total bytes received.
        """
        state: Literal["inProgress", "completed", "canceled"]
        """
        Download status.
        """


class CSS:
    """
        This domain exposes CSS read/write operations. All CSS objects (stylesheets, rules, and styles)
    have an associated `id` used in subsequent operations on the related object. Each object type has
    a specific `id` structure, and those are not interchangeable between objects of different kinds.
    CSS objects can be loaded using the `get*ForNode()` calls (which accept a DOM node id). A client
    can also keep track of stylesheets via the `styleSheetAdded`/`styleSheetRemoved` events and
    subsequently load the required stylesheet contents using the `getStyleSheet[Text]()` methods.
    """

    class fontsUpdated(IEvent):
        """
                Fires whenever a web font is updated.  A non-empty font parameter indicates a successfully loaded
        web font.
        """

        _domain: str = PrivateAttr("CSS")
        font: Optional["types.CSS.TypeFontFace"] = None
        """
        The web font that has loaded.
        """

    class mediaQueryResultChanged(IEvent):
        """
                Fires whenever a MediaQuery result changes (for example, after a browser window has been
        resized.) The current implementation considers only viewport-dependent media features.
        """

        _domain: str = PrivateAttr("CSS")

    class styleSheetAdded(IEvent):
        """
        Fired whenever an active document stylesheet is added.
        """

        _domain: str = PrivateAttr("CSS")
        header: "types.CSS.TypeCSSStyleSheetHeader"
        """
        Added stylesheet metainfo.
        """

    class styleSheetChanged(IEvent):
        """
        Fired whenever a stylesheet is changed as a result of the client operation.
        """

        _domain: str = PrivateAttr("CSS")
        styleSheetId: "types.CSS.TypeStyleSheetId"

    class styleSheetRemoved(IEvent):
        """
        Fired whenever an active document stylesheet is removed.
        """

        _domain: str = PrivateAttr("CSS")
        styleSheetId: "types.CSS.TypeStyleSheetId"
        """
        Identifier of the removed stylesheet.
        """


class Cast:
    """
        A domain for interacting with Cast, Presentation API, and Remote Playback API
    functionalities.
    """

    class sinksUpdated(IEvent):
        """
                This is fired whenever the list of available sinks changes. A sink is a
        device or a software surface that you can cast to.
        """

        _domain: str = PrivateAttr("Cast")
        sinks: list[Any]

    class issueUpdated(IEvent):
        """
                This is fired whenever the outstanding issue/error message changes.
        |issueMessage| is empty if there is no issue.
        """

        _domain: str = PrivateAttr("Cast")
        issueMessage: str


class DOM:
    """
        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.
    """

    class attributeModified(IEvent):
        """
        Fired when `Element`'s attribute is modified.
        """

        _domain: str = PrivateAttr("DOM")
        nodeId: "types.DOM.TypeNodeId"
        """
        Id of the node that has changed.
        """
        name: str
        """
        Attribute name.
        """
        value: str
        """
        Attribute value.
        """

    class attributeRemoved(IEvent):
        """
        Fired when `Element`'s attribute is removed.
        """

        _domain: str = PrivateAttr("DOM")
        nodeId: "types.DOM.TypeNodeId"
        """
        Id of the node that has changed.
        """
        name: str
        """
        A ttribute name.
        """

    class characterDataModified(IEvent):
        """
        Mirrors `DOMCharacterDataModified` event.
        """

        _domain: str = PrivateAttr("DOM")
        nodeId: "types.DOM.TypeNodeId"
        """
        Id of the node that has changed.
        """
        characterData: str
        """
        New text value.
        """

    class childNodeCountUpdated(IEvent):
        """
        Fired when `Container`'s child node count has changed.
        """

        _domain: str = PrivateAttr("DOM")
        nodeId: "types.DOM.TypeNodeId"
        """
        Id of the node that has changed.
        """
        childNodeCount: Union[float, int]
        """
        New node count.
        """

    class childNodeInserted(IEvent):
        """
        Mirrors `DOMNodeInserted` event.
        """

        _domain: str = PrivateAttr("DOM")
        parentNodeId: "types.DOM.TypeNodeId"
        """
        Id of the node that has changed.
        """
        previousNodeId: "types.DOM.TypeNodeId"
        """
        Id of the previous sibling.
        """
        node: "types.DOM.TypeNode"
        """
        Inserted node data.
        """

    class childNodeRemoved(IEvent):
        """
        Mirrors `DOMNodeRemoved` event.
        """

        _domain: str = PrivateAttr("DOM")
        parentNodeId: "types.DOM.TypeNodeId"
        """
        Parent id.
        """
        nodeId: "types.DOM.TypeNodeId"
        """
        Id of the node that has been removed.
        """

    class distributedNodesUpdated(IEvent):
        """
        Called when distribution is changed.
        """

        _domain: str = PrivateAttr("DOM")
        insertionPointId: "types.DOM.TypeNodeId"
        """
        Insertion point where distributed nodes were updated.
        """
        distributedNodes: list[Any]
        """
        Distributed nodes for given insertion point.
        """

    class documentUpdated(IEvent):
        """
        Fired when `Document` has been totally updated. Node ids are no longer valid.
        """

        _domain: str = PrivateAttr("DOM")

    class inlineStyleInvalidated(IEvent):
        """
        Fired when `Element`'s inline style is modified via a CSS property modification.
        """

        _domain: str = PrivateAttr("DOM")
        nodeIds: list[Any]
        """
        Ids of the nodes for which the inline styles have been invalidated.
        """

    class pseudoElementAdded(IEvent):
        """
        Called when a pseudo element is added to an element.
        """

        _domain: str = PrivateAttr("DOM")
        parentId: "types.DOM.TypeNodeId"
        """
        Pseudo element's parent element id.
        """
        pseudoElement: "types.DOM.TypeNode"
        """
        The added pseudo element.
        """

    class topLayerElementsUpdated(IEvent):
        """
        Called when top layer elements are changed.
        """

        _domain: str = PrivateAttr("DOM")

    class pseudoElementRemoved(IEvent):
        """
        Called when a pseudo element is removed from an element.
        """

        _domain: str = PrivateAttr("DOM")
        parentId: "types.DOM.TypeNodeId"
        """
        Pseudo element's parent element id.
        """
        pseudoElementId: "types.DOM.TypeNodeId"
        """
        The removed pseudo element id.
        """

    class setChildNodes(IEvent):
        """
                Fired when backend wants to provide client with the missing DOM structure. This happens upon
        most of the calls requesting node ids.
        """

        _domain: str = PrivateAttr("DOM")
        parentId: "types.DOM.TypeNodeId"
        """
        Parent node id to populate with children.
        """
        nodes: list[Any]
        """
        Child nodes array.
        """

    class shadowRootPopped(IEvent):
        """
        Called when shadow root is popped from the element.
        """

        _domain: str = PrivateAttr("DOM")
        hostId: "types.DOM.TypeNodeId"
        """
        Host element id.
        """
        rootId: "types.DOM.TypeNodeId"
        """
        Shadow root id.
        """

    class shadowRootPushed(IEvent):
        """
        Called when shadow root is pushed into the element.
        """

        _domain: str = PrivateAttr("DOM")
        hostId: "types.DOM.TypeNodeId"
        """
        Host element id.
        """
        root: "types.DOM.TypeNode"
        """
        Shadow root.
        """


class DOMStorage:
    """
    Query and modify DOM storage.
    """

    class domStorageItemAdded(IEvent):
        _domain: str = PrivateAttr("DOMStorage")
        storageId: "types.DOMStorage.TypeStorageId"
        key: str
        newValue: str

    class domStorageItemRemoved(IEvent):
        _domain: str = PrivateAttr("DOMStorage")
        storageId: "types.DOMStorage.TypeStorageId"
        key: str

    class domStorageItemUpdated(IEvent):
        _domain: str = PrivateAttr("DOMStorage")
        storageId: "types.DOMStorage.TypeStorageId"
        key: str
        oldValue: str
        newValue: str

    class domStorageItemsCleared(IEvent):
        _domain: str = PrivateAttr("DOMStorage")
        storageId: "types.DOMStorage.TypeStorageId"


class Database:
    class addDatabase(IEvent):
        _domain: str = PrivateAttr("Database")
        database: "types.Database.TypeDatabase"


class Emulation:
    """
    This domain emulates different environments for the page.
    """

    class virtualTimeBudgetExpired(IEvent):
        """
        Notification sent after the virtual time budget for the current VirtualTimePolicy has run out.
        """

        _domain: str = PrivateAttr("Emulation")


class Input:
    class dragIntercepted(IEvent):
        """
                Emitted only when `Input.setInterceptDrags` is enabled. Use this data with `Input.dispatchDragEvent` to
        restore normal drag and drop behavior.
        """

        _domain: str = PrivateAttr("Input")
        data: "types.Input.TypeDragData"


class Inspector:
    class detached(IEvent):
        """
        Fired when remote debugging connection is about to be terminated. Contains detach reason.
        """

        _domain: str = PrivateAttr("Inspector")
        reason: str
        """
        The reason why connection has been terminated.
        """

    class targetCrashed(IEvent):
        """
        Fired when debugging target has crashed
        """

        _domain: str = PrivateAttr("Inspector")

    class targetReloadedAfterCrash(IEvent):
        """
        Fired when debugging target has reloaded after crash
        """

        _domain: str = PrivateAttr("Inspector")


class LayerTree:
    class layerPainted(IEvent):
        _domain: str = PrivateAttr("LayerTree")
        layerId: "types.LayerTree.TypeLayerId"
        """
        The id of the painted layer.
        """
        clip: "types.DOM.TypeRect"
        """
        Clip rectangle.
        """

    class layerTreeDidChange(IEvent):
        _domain: str = PrivateAttr("LayerTree")
        layers: Optional[list[Any]] = None
        """
        Layer tree, absent if not in the compositing mode.
        """


class Log:
    """
    Provides access to log entries.
    """

    class entryAdded(IEvent):
        """
        Issued when new message was logged.
        """

        _domain: str = PrivateAttr("Log")
        entry: "types.Log.TypeLogEntry"
        """
        The entry.
        """


class Network:
    """
        Network domain allows tracking network activities of the page. It exposes information about http,
    file, data and other requests and responses, their headers, bodies, timing, etc.
    """

    class dataReceived(IEvent):
        """
        Fired when data chunk was received over the network.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        dataLength: Union[float, int]
        """
        Data chunk length.
        """
        encodedDataLength: Union[float, int]
        """
        Actual bytes received (might be less than dataLength for compressed encodings).
        """
        data: Optional[str] = None
        """
        Data that was received. (Encoded as a base64 string when passed over JSON)
        """

    class eventSourceMessageReceived(IEvent):
        """
        Fired when EventSource message is received.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        eventName: str
        """
        Message type.
        """
        eventId: str
        """
        Message identifier.
        """
        data: str
        """
        Message content.
        """

    class loadingFailed(IEvent):
        """
        Fired when HTTP request has failed to load.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        type: "types.Network.TypeResourceType"
        """
        Resource type.
        """
        errorText: str
        """
        Error message. List of network errors: https://cs.chromium.org/chromium/src/net/base/net_error_list.h
        """
        canceled: Optional[bool] = None
        """
        True if loading was canceled.
        """
        blockedReason: Optional["types.Network.TypeBlockedReason"] = None
        """
        The reason why loading was blocked, if any.
        """
        corsErrorStatus: Optional["types.Network.TypeCorsErrorStatus"] = None
        """
        The reason why loading was blocked by CORS, if any.
        """

    class loadingFinished(IEvent):
        """
        Fired when HTTP request has finished loading.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        encodedDataLength: Union[float, int]
        """
        Total number of bytes received for this request.
        """

    class requestIntercepted(IEvent):
        """
                Details of an intercepted HTTP request, which must be either allowed, blocked, modified or
        mocked.
        Deprecated, use Fetch.requestPaused instead.
        """

        _domain: str = PrivateAttr("Network")
        interceptionId: "types.Network.TypeInterceptionId"
        """
        Each request the page makes will have a unique id, however if any redirects are encountered
while processing that fetch, they will be reported with the same id as the original fetch.
Likewise if HTTP authentication is needed then the same fetch id will be used.
        """
        request: "types.Network.TypeRequest"
        frameId: "types.Page.TypeFrameId"
        """
        The id of the frame that initiated the request.
        """
        resourceType: "types.Network.TypeResourceType"
        """
        How the requested resource will be used.
        """
        isNavigationRequest: bool
        """
        Whether this is a navigation request, which can abort the navigation completely.
        """
        isDownload: Optional[bool] = None
        """
        Set if the request is a navigation that will result in a download.
Only present after response is received from the server (i.e. HeadersReceived stage).
        """
        redirectUrl: Optional[str] = None
        """
        Redirect location, only sent if a redirect was intercepted.
        """
        authChallenge: Optional["types.Network.TypeAuthChallenge"] = None
        """
        Details of the Authorization Challenge encountered. If this is set then
continueInterceptedRequest must contain an authChallengeResponse.
        """
        responseErrorReason: Optional["types.Network.TypeErrorReason"] = None
        """
        Response error if intercepted at response stage or if redirect occurred while intercepting
request.
        """
        responseStatusCode: Optional[Union[float, int]] = None
        """
        Response code if intercepted at response stage or if redirect occurred while intercepting
request or auth retry occurred.
        """
        responseHeaders: Optional["types.Network.TypeHeaders"] = None
        """
        Response headers if intercepted at the response stage or if redirect occurred while
intercepting request or auth retry occurred.
        """
        requestId: Optional["types.Network.TypeRequestId"] = None
        """
        If the intercepted request had a corresponding requestWillBeSent event fired for it, then
this requestId will be the same as the requestId present in the requestWillBeSent event.
        """

    class requestServedFromCache(IEvent):
        """
        Fired if request ended up loading from cache.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """

    class requestWillBeSent(IEvent):
        """
        Fired when page is about to send HTTP request.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        loaderId: "types.Network.TypeLoaderId"
        """
        Loader identifier. Empty string if the request is fetched from worker.
        """
        documentURL: str
        """
        URL of the document this request is loaded for.
        """
        request: "types.Network.TypeRequest"
        """
        Request data.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        wallTime: "types.Network.TypeTimeSinceEpoch"
        """
        Timestamp.
        """
        initiator: "types.Network.TypeInitiator"
        """
        Request initiator.
        """
        redirectHasExtraInfo: bool
        """
        In the case that redirectResponse is populated, this flag indicates whether
requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be or were emitted
for the request which was just redirected.
        """
        redirectResponse: Optional["types.Network.TypeResponse"] = None
        """
        Redirect response data.
        """
        type: Optional["types.Network.TypeResourceType"] = None
        """
        Type of this resource.
        """
        frameId: Optional["types.Page.TypeFrameId"] = None
        """
        Frame identifier.
        """
        hasUserGesture: Optional[bool] = None
        """
        Whether the request is initiated by a user gesture. Defaults to false.
        """

    class resourceChangedPriority(IEvent):
        """
        Fired when resource loading priority is changed
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        newPriority: "types.Network.TypeResourcePriority"
        """
        New priority
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """

    class signedExchangeReceived(IEvent):
        """
        Fired when a signed exchange was received over the network
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        info: "types.Network.TypeSignedExchangeInfo"
        """
        Information about the signed exchange response.
        """

    class responseReceived(IEvent):
        """
        Fired when HTTP response is available.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        loaderId: "types.Network.TypeLoaderId"
        """
        Loader identifier. Empty string if the request is fetched from worker.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        type: "types.Network.TypeResourceType"
        """
        Resource type.
        """
        response: "types.Network.TypeResponse"
        """
        Response data.
        """
        hasExtraInfo: bool
        """
        Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events will be
or were emitted for this request.
        """
        frameId: Optional["types.Page.TypeFrameId"] = None
        """
        Frame identifier.
        """

    class webSocketClosed(IEvent):
        """
        Fired when WebSocket is closed.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """

    class webSocketCreated(IEvent):
        """
        Fired upon WebSocket creation.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        url: str
        """
        WebSocket request URL.
        """
        initiator: Optional["types.Network.TypeInitiator"] = None
        """
        Request initiator.
        """

    class webSocketFrameError(IEvent):
        """
        Fired when WebSocket message error occurs.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        errorMessage: str
        """
        WebSocket error message.
        """

    class webSocketFrameReceived(IEvent):
        """
        Fired when WebSocket message is received.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        response: "types.Network.TypeWebSocketFrame"
        """
        WebSocket response data.
        """

    class webSocketFrameSent(IEvent):
        """
        Fired when WebSocket message is sent.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        response: "types.Network.TypeWebSocketFrame"
        """
        WebSocket response data.
        """

    class webSocketHandshakeResponseReceived(IEvent):
        """
        Fired when WebSocket handshake response becomes available.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        response: "types.Network.TypeWebSocketResponse"
        """
        WebSocket response data.
        """

    class webSocketWillSendHandshakeRequest(IEvent):
        """
        Fired when WebSocket is about to initiate handshake.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        wallTime: "types.Network.TypeTimeSinceEpoch"
        """
        UTC Timestamp.
        """
        request: "types.Network.TypeWebSocketRequest"
        """
        WebSocket request data.
        """

    class webTransportCreated(IEvent):
        """
        Fired upon WebTransport creation.
        """

        _domain: str = PrivateAttr("Network")
        transportId: "types.Network.TypeRequestId"
        """
        WebTransport identifier.
        """
        url: str
        """
        WebTransport request URL.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """
        initiator: Optional["types.Network.TypeInitiator"] = None
        """
        Request initiator.
        """

    class webTransportConnectionEstablished(IEvent):
        """
        Fired when WebTransport handshake is finished.
        """

        _domain: str = PrivateAttr("Network")
        transportId: "types.Network.TypeRequestId"
        """
        WebTransport identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """

    class webTransportClosed(IEvent):
        """
        Fired when WebTransport is disposed.
        """

        _domain: str = PrivateAttr("Network")
        transportId: "types.Network.TypeRequestId"
        """
        WebTransport identifier.
        """
        timestamp: "types.Network.TypeMonotonicTime"
        """
        Timestamp.
        """

    class requestWillBeSentExtraInfo(IEvent):
        """
                Fired when additional information about a requestWillBeSent event is available from the
        network stack. Not every requestWillBeSent event will have an additional
        requestWillBeSentExtraInfo fired for it, and there is no guarantee whether requestWillBeSent
        or requestWillBeSentExtraInfo will be fired first for the same request.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier. Used to match this information to an existing requestWillBeSent event.
        """
        associatedCookies: list[Any]
        """
        A list of cookies potentially associated to the requested URL. This includes both cookies sent with
the request and the ones not sent; the latter are distinguished by having blockedReasons field set.
        """
        headers: "types.Network.TypeHeaders"
        """
        Raw request headers as they will be sent over the wire.
        """
        connectTiming: "types.Network.TypeConnectTiming"
        """
        Connection timing information for the request.
        """
        clientSecurityState: Optional["types.Network.TypeClientSecurityState"] = None
        """
        The client security state set for the request.
        """
        siteHasCookieInOtherPartition: Optional[bool] = None
        """
        Whether the site has partitioned cookies stored in a partition different than the current one.
        """

    class responseReceivedExtraInfo(IEvent):
        """
                Fired when additional information about a responseReceived event is available from the network
        stack. Not every responseReceived event will have an additional responseReceivedExtraInfo for
        it, and responseReceivedExtraInfo may be fired before or after responseReceived.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier. Used to match this information to another responseReceived event.
        """
        blockedCookies: list[Any]
        """
        A list of cookies which were not stored from the response along with the corresponding
reasons for blocking. The cookies here may not be valid due to syntax errors, which
are represented by the invalid cookie line string instead of a proper cookie.
        """
        headers: "types.Network.TypeHeaders"
        """
        Raw response headers as they were received over the wire.
        """
        resourceIPAddressSpace: "types.Network.TypeIPAddressSpace"
        """
        The IP address space of the resource. The address space can only be determined once the transport
established the connection, so we can't send it in `requestWillBeSentExtraInfo`.
        """
        statusCode: Union[float, int]
        """
        The status code of the response. This is useful in cases the request failed and no responseReceived
event is triggered, which is the case for, e.g., CORS errors. This is also the correct status code
for cached requests, where the status in responseReceived is a 200 and this will be 304.
        """
        headersText: Optional[str] = None
        """
        Raw response header text as it was received over the wire. The raw text may not always be
available, such as in the case of HTTP/2 or QUIC.
        """
        cookiePartitionKey: Optional["types.Network.TypeCookiePartitionKey"] = None
        """
        The cookie partition key that will be used to store partitioned cookies set in this response.
Only sent when partitioned cookies are enabled.
        """
        cookiePartitionKeyOpaque: Optional[bool] = None
        """
        True if partitioned cookies are enabled, but the partition key is not serializable to string.
        """
        exemptedCookies: Optional[list[Any]] = None
        """
        A list of cookies which should have been blocked by 3PCD but are exempted and stored from
the response with the corresponding reason.
        """

    class responseReceivedEarlyHints(IEvent):
        """
                Fired when 103 Early Hints headers is received in addition to the common response.
        Not every responseReceived event will have an responseReceivedEarlyHints fired.
        Only one responseReceivedEarlyHints may be fired for eached responseReceived event.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier. Used to match this information to another responseReceived event.
        """
        headers: "types.Network.TypeHeaders"
        """
        Raw response headers as they were received over the wire.
        """

    class trustTokenOperationDone(IEvent):
        """
                Fired exactly once for each Trust Token operation. Depending on
        the type of the operation and whether the operation succeeded or
        failed, the event is fired before the corresponding request was sent
        or after the response was received.
        """

        _domain: str = PrivateAttr("Network")
        status: Literal[
            "Ok",
            "InvalidArgument",
            "MissingIssuerKeys",
            "FailedPrecondition",
            "ResourceExhausted",
            "AlreadyExists",
            "ResourceLimited",
            "Unauthorized",
            "BadResponse",
            "InternalError",
            "UnknownError",
            "FulfilledLocally",
        ]
        """
        Detailed success or error status of the operation.
'AlreadyExists' also signifies a successful operation, as the result
of the operation already exists und thus, the operation was abort
preemptively (e.g. a cache hit).
        """
        type: "types.Network.TypeTrustTokenOperationType"
        requestId: "types.Network.TypeRequestId"
        topLevelOrigin: Optional[str] = None
        """
        Top level origin. The context in which the operation was attempted.
        """
        issuerOrigin: Optional[str] = None
        """
        Origin of the issuer in case of a "Issuance" or "Redemption" operation.
        """
        issuedTokenCount: Optional[Union[float, int]] = None
        """
        The number of obtained Trust Tokens on a successful "Issuance" operation.
        """

    class subresourceWebBundleMetadataReceived(IEvent):
        """
                Fired once when parsing the .wbn file has succeeded.
        The event contains the information about the web bundle contents.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier. Used to match this information to another event.
        """
        urls: list[Any]
        """
        A list of URLs of resources in the subresource Web Bundle.
        """

    class subresourceWebBundleMetadataError(IEvent):
        """
        Fired once when parsing the .wbn file has failed.
        """

        _domain: str = PrivateAttr("Network")
        requestId: "types.Network.TypeRequestId"
        """
        Request identifier. Used to match this information to another event.
        """
        errorMessage: str
        """
        Error message
        """

    class subresourceWebBundleInnerResponseParsed(IEvent):
        """
                Fired when handling requests for resources within a .wbn file.
        Note: this will only be fired for resources that are requested by the webpage.
        """

        _domain: str = PrivateAttr("Network")
        innerRequestId: "types.Network.TypeRequestId"
        """
        Request identifier of the subresource request
        """
        innerRequestURL: str
        """
        URL of the subresource resource.
        """
        bundleRequestId: Optional["types.Network.TypeRequestId"] = None
        """
        Bundle request identifier. Used to match this information to another event.
This made be absent in case when the instrumentation was enabled only
after webbundle was parsed.
        """

    class subresourceWebBundleInnerResponseError(IEvent):
        """
        Fired when request for resources within a .wbn file failed.
        """

        _domain: str = PrivateAttr("Network")
        innerRequestId: "types.Network.TypeRequestId"
        """
        Request identifier of the subresource request
        """
        innerRequestURL: str
        """
        URL of the subresource resource.
        """
        errorMessage: str
        """
        Error message
        """
        bundleRequestId: Optional["types.Network.TypeRequestId"] = None
        """
        Bundle request identifier. Used to match this information to another event.
This made be absent in case when the instrumentation was enabled only
after webbundle was parsed.
        """

    class reportingApiReportAdded(IEvent):
        """
                Is sent whenever a new report is added.
        And after 'enableReportingApi' for all existing reports.
        """

        _domain: str = PrivateAttr("Network")
        report: "types.Network.TypeReportingApiReport"

    class reportingApiReportUpdated(IEvent):
        _domain: str = PrivateAttr("Network")
        report: "types.Network.TypeReportingApiReport"

    class reportingApiEndpointsChangedForOrigin(IEvent):
        _domain: str = PrivateAttr("Network")
        origin: str
        """
        Origin of the document(s) which configured the endpoints.
        """
        endpoints: list[Any]


class Overlay:
    """
    This domain provides various functionality related to drawing atop the inspected page.
    """

    class inspectNodeRequested(IEvent):
        """
                Fired when the node should be inspected. This happens after call to `setInspectMode` or when
        user manually inspects an element.
        """

        _domain: str = PrivateAttr("Overlay")
        backendNodeId: "types.DOM.TypeBackendNodeId"
        """
        Id of the node to inspect.
        """

    class nodeHighlightRequested(IEvent):
        """
        Fired when the node should be highlighted. This happens after call to `setInspectMode`.
        """

        _domain: str = PrivateAttr("Overlay")
        nodeId: "types.DOM.TypeNodeId"

    class screenshotRequested(IEvent):
        """
        Fired when user asks to capture screenshot of some area on the page.
        """

        _domain: str = PrivateAttr("Overlay")
        viewport: "types.Page.TypeViewport"
        """
        Viewport to capture, in device independent pixels (dip).
        """

    class inspectModeCanceled(IEvent):
        """
        Fired when user cancels the inspect mode.
        """

        _domain: str = PrivateAttr("Overlay")


class Page:
    """
    Actions and events related to the inspected page belong to the page domain.
    """

    class domContentEventFired(IEvent):
        _domain: str = PrivateAttr("Page")
        timestamp: "types.Network.TypeMonotonicTime"

    class fileChooserOpened(IEvent):
        """
        Emitted only when `page.interceptFileChooser` is enabled.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame containing input node.
        """
        mode: Literal["selectSingle", "selectMultiple"]
        """
        Input mode.
        """
        backendNodeId: Optional["types.DOM.TypeBackendNodeId"] = None
        """
        Input node id. Only present for file choosers opened via an `<input type="file">` element.
        """

    class frameAttached(IEvent):
        """
        Fired when frame has been attached to its parent.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that has been attached.
        """
        parentFrameId: "types.Page.TypeFrameId"
        """
        Parent frame identifier.
        """
        stack: Optional["types.Runtime.TypeStackTrace"] = None
        """
        JavaScript stack trace of when frame was attached, only set if frame initiated from script.
        """

    class frameClearedScheduledNavigation(IEvent):
        """
        Fired when frame no longer has a scheduled navigation.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that has cleared its scheduled navigation.
        """

    class frameDetached(IEvent):
        """
        Fired when frame has been detached from its parent.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that has been detached.
        """
        reason: Literal["remove", "swap"]

    class frameNavigated(IEvent):
        """
        Fired once navigation of the frame has completed. Frame is now associated with the new loader.
        """

        _domain: str = PrivateAttr("Page")
        frame: "types.Page.TypeFrame"
        """
        Frame object.
        """
        type: "types.Page.TypeNavigationType"

    class documentOpened(IEvent):
        """
        Fired when opening document to write to.
        """

        _domain: str = PrivateAttr("Page")
        frame: "types.Page.TypeFrame"
        """
        Frame object.
        """

    class frameResized(IEvent):
        _domain: str = PrivateAttr("Page")

    class frameRequestedNavigation(IEvent):
        """
                Fired when a renderer-initiated navigation is requested.
        Navigation may still be cancelled after the event is issued.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that is being navigated.
        """
        reason: "types.Page.TypeClientNavigationReason"
        """
        The reason for the navigation.
        """
        url: str
        """
        The destination URL for the requested navigation.
        """
        disposition: "types.Page.TypeClientNavigationDisposition"
        """
        The disposition for the navigation.
        """

    class frameScheduledNavigation(IEvent):
        """
        Fired when frame schedules a potential navigation.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that has scheduled a navigation.
        """
        delay: Union[float, int]
        """
        Delay (in seconds) until the navigation is scheduled to begin. The navigation is not
guaranteed to start.
        """
        reason: "types.Page.TypeClientNavigationReason"
        """
        The reason for the navigation.
        """
        url: str
        """
        The destination URL for the scheduled navigation.
        """

    class frameStartedLoading(IEvent):
        """
        Fired when frame has started loading.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that has started loading.
        """

    class frameStoppedLoading(IEvent):
        """
        Fired when frame has stopped loading.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that has stopped loading.
        """

    class downloadWillBegin(IEvent):
        """
                Fired when page is about to start a download.
        Deprecated. Use Browser.downloadWillBegin instead.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame that caused download to begin.
        """
        guid: str
        """
        Global unique identifier of the download.
        """
        url: str
        """
        URL of the resource being downloaded.
        """
        suggestedFilename: str
        """
        Suggested file name of the resource (the actual name of the file saved on disk may differ).
        """

    class downloadProgress(IEvent):
        """
                Fired when download makes progress. Last call has |done| == true.
        Deprecated. Use Browser.downloadProgress instead.
        """

        _domain: str = PrivateAttr("Page")
        guid: str
        """
        Global unique identifier of the download.
        """
        totalBytes: Union[float, int]
        """
        Total expected bytes to download.
        """
        receivedBytes: Union[float, int]
        """
        Total bytes received.
        """
        state: Literal["inProgress", "completed", "canceled"]
        """
        Download status.
        """

    class interstitialHidden(IEvent):
        """
        Fired when interstitial page was hidden
        """

        _domain: str = PrivateAttr("Page")

    class interstitialShown(IEvent):
        """
        Fired when interstitial page was shown
        """

        _domain: str = PrivateAttr("Page")

    class javascriptDialogClosed(IEvent):
        """
                Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) has been
        closed.
        """

        _domain: str = PrivateAttr("Page")
        result: bool
        """
        Whether dialog was confirmed.
        """
        userInput: str
        """
        User input in case of prompt.
        """

    class javascriptDialogOpening(IEvent):
        """
                Fired when a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload) is about to
        open.
        """

        _domain: str = PrivateAttr("Page")
        url: str
        """
        Frame url.
        """
        message: str
        """
        Message that will be displayed by the dialog.
        """
        type: "types.Page.TypeDialogType"
        """
        Dialog type.
        """
        hasBrowserHandler: bool
        """
        True iff browser is capable showing or acting on the given dialog. When browser has no
dialog handler for given target, calling alert while Page domain is engaged will stall
the page execution. Execution can be resumed via calling Page.handleJavaScriptDialog.
        """
        defaultPrompt: Optional[str] = None
        """
        Default dialog prompt.
        """

    class lifecycleEvent(IEvent):
        """
        Fired for top level page lifecycle events such as navigation, load, paint, etc.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame.
        """
        loaderId: "types.Network.TypeLoaderId"
        """
        Loader identifier. Empty string if the request is fetched from worker.
        """
        name: str
        timestamp: "types.Network.TypeMonotonicTime"

    class backForwardCacheNotUsed(IEvent):
        """
                Fired for failed bfcache history navigations if BackForwardCache feature is enabled. Do
        not assume any ordering with the Page.frameNavigated event. This event is fired only for
        main-frame history navigation where the document changes (non-same-document navigations),
        when bfcache navigation fails.
        """

        _domain: str = PrivateAttr("Page")
        loaderId: "types.Network.TypeLoaderId"
        """
        The loader id for the associated navigation.
        """
        frameId: "types.Page.TypeFrameId"
        """
        The frame id of the associated frame.
        """
        notRestoredExplanations: list[Any]
        """
        Array of reasons why the page could not be cached. This must not be empty.
        """
        notRestoredExplanationsTree: Optional[
            "types.Page.TypeBackForwardCacheNotRestoredExplanationTree"
        ] = None
        """
        Tree structure of reasons why the page could not be cached for each frame.
        """

    class loadEventFired(IEvent):
        _domain: str = PrivateAttr("Page")
        timestamp: "types.Network.TypeMonotonicTime"

    class navigatedWithinDocument(IEvent):
        """
        Fired when same-document navigation happens, e.g. due to history API usage or anchor navigation.
        """

        _domain: str = PrivateAttr("Page")
        frameId: "types.Page.TypeFrameId"
        """
        Id of the frame.
        """
        url: str
        """
        Frame's new url.
        """

    class screencastFrame(IEvent):
        """
        Compressed image data requested by the `startScreencast`.
        """

        _domain: str = PrivateAttr("Page")
        data: str
        """
        Base64-encoded compressed image. (Encoded as a base64 string when passed over JSON)
        """
        metadata: "types.Page.TypeScreencastFrameMetadata"
        """
        Screencast frame metadata.
        """
        sessionId: Union[float, int]
        """
        Frame number.
        """

    class screencastVisibilityChanged(IEvent):
        """
        Fired when the page with currently enabled screencast was shown or hidden `.
        """

        _domain: str = PrivateAttr("Page")
        visible: bool
        """
        True if the page is visible.
        """

    class windowOpen(IEvent):
        """
                Fired when a new window is going to be opened, via window.open(), link click, form submission,
        etc.
        """

        _domain: str = PrivateAttr("Page")
        url: str
        """
        The URL for the new window.
        """
        windowName: str
        """
        Window name.
        """
        windowFeatures: list[Any]
        """
        An array of enabled window features.
        """
        userGesture: bool
        """
        Whether or not it was triggered by user gesture.
        """

    class compilationCacheProduced(IEvent):
        """
                Issued for every compilation cache generated. Is only available
        if Page.setGenerateCompilationCache is enabled.
        """

        _domain: str = PrivateAttr("Page")
        url: str
        data: str
        """
        Base64-encoded data (Encoded as a base64 string when passed over JSON)
        """


class Performance:
    class metrics(IEvent):
        """
        Current values of the metrics.
        """

        _domain: str = PrivateAttr("Performance")
        metrics: list[Any]
        """
        Current values of the metrics.
        """
        title: str
        """
        Timestamp title.
        """


class PerformanceTimeline:
    """
        Reporting of performance timeline events, as specified in
    https://w3c.github.io/performance-timeline/#dom-performanceobserver.
    """

    class timelineEventAdded(IEvent):
        """
        Sent when a performance timeline event is added. See reportPerformanceTimeline method.
        """

        _domain: str = PrivateAttr("PerformanceTimeline")
        event: "types.PerformanceTimeline.TypeTimelineEvent"


class Security:
    """
    Security
    """

    class certificateError(IEvent):
        """
                There is a certificate error. If overriding certificate errors is enabled, then it should be
        handled with the `handleCertificateError` command. Note: this event does not fire if the
        certificate error has been allowed internally. Only one client per target should override
        certificate errors at the same time.
        """

        _domain: str = PrivateAttr("Security")
        eventId: Union[float, int]
        """
        The ID of the event.
        """
        errorType: str
        """
        The type of the error.
        """
        requestURL: str
        """
        The url that was requested.
        """

    class visibleSecurityStateChanged(IEvent):
        """
        The security state of the page changed.
        """

        _domain: str = PrivateAttr("Security")
        visibleSecurityState: "types.Security.TypeVisibleSecurityState"
        """
        Security state information about the page.
        """

    class securityStateChanged(IEvent):
        """
        The security state of the page changed. No longer being sent.
        """

        _domain: str = PrivateAttr("Security")
        securityState: "types.Security.TypeSecurityState"
        """
        Security state.
        """
        schemeIsCryptographic: bool
        """
        True if the page was loaded over cryptographic transport such as HTTPS.
        """
        explanations: list[Any]
        """
        Previously a list of explanations for the security state. Now always
empty.
        """
        insecureContentStatus: "types.Security.TypeInsecureContentStatus"
        """
        Information about insecure content on the page.
        """
        summary: Optional[str] = None
        """
        Overrides user-visible description of the state. Always omitted.
        """


class ServiceWorker:
    class workerErrorReported(IEvent):
        _domain: str = PrivateAttr("ServiceWorker")
        errorMessage: "types.ServiceWorker.TypeServiceWorkerErrorMessage"

    class workerRegistrationUpdated(IEvent):
        _domain: str = PrivateAttr("ServiceWorker")
        registrations: list[Any]

    class workerVersionUpdated(IEvent):
        _domain: str = PrivateAttr("ServiceWorker")
        versions: list[Any]


class Storage:
    class cacheStorageContentUpdated(IEvent):
        """
        A cache's contents have been modified.
        """

        _domain: str = PrivateAttr("Storage")
        origin: str
        """
        Origin to update.
        """
        storageKey: str
        """
        Storage key to update.
        """
        bucketId: str
        """
        Storage bucket to update.
        """
        cacheName: str
        """
        Name of cache in origin.
        """

    class cacheStorageListUpdated(IEvent):
        """
        A cache has been added/deleted.
        """

        _domain: str = PrivateAttr("Storage")
        origin: str
        """
        Origin to update.
        """
        storageKey: str
        """
        Storage key to update.
        """
        bucketId: str
        """
        Storage bucket to update.
        """

    class indexedDBContentUpdated(IEvent):
        """
        The origin's IndexedDB object store has been modified.
        """

        _domain: str = PrivateAttr("Storage")
        origin: str
        """
        Origin to update.
        """
        storageKey: str
        """
        Storage key to update.
        """
        bucketId: str
        """
        Storage bucket to update.
        """
        databaseName: str
        """
        Database to update.
        """
        objectStoreName: str
        """
        ObjectStore to update.
        """

    class indexedDBListUpdated(IEvent):
        """
        The origin's IndexedDB database list has been modified.
        """

        _domain: str = PrivateAttr("Storage")
        origin: str
        """
        Origin to update.
        """
        storageKey: str
        """
        Storage key to update.
        """
        bucketId: str
        """
        Storage bucket to update.
        """

    class interestGroupAccessed(IEvent):
        """
                One of the interest groups was accessed. Note that these events are global
        to all targets sharing an interest group store.
        """

        _domain: str = PrivateAttr("Storage")
        accessTime: "types.Network.TypeTimeSinceEpoch"
        type: "types.Storage.TypeInterestGroupAccessType"
        ownerOrigin: str
        name: str
        componentSellerOrigin: Optional[str] = None
        """
        For topLevelBid/topLevelAdditionalBid, and when appropriate,
win and additionalBidWin
        """
        bid: Optional[Union[float, int]] = None
        """
        For bid or somethingBid event, if done locally and not on a server.
        """
        bidCurrency: Optional[str] = None
        uniqueAuctionId: Optional["types.Storage.TypeInterestGroupAuctionId"] = None
        """
        For non-global events --- links to interestGroupAuctionEvent
        """

    class interestGroupAuctionEventOccurred(IEvent):
        """
                An auction involving interest groups is taking place. These events are
        target-specific.
        """

        _domain: str = PrivateAttr("Storage")
        eventTime: "types.Network.TypeTimeSinceEpoch"
        type: "types.Storage.TypeInterestGroupAuctionEventType"
        uniqueAuctionId: "types.Storage.TypeInterestGroupAuctionId"
        parentAuctionId: Optional["types.Storage.TypeInterestGroupAuctionId"] = None
        """
        Set for child auctions.
        """
        auctionConfig: Optional[dict[str, Any]] = None
        """
        Set for started and configResolved
        """

    class interestGroupAuctionNetworkRequestCreated(IEvent):
        """
                Specifies which auctions a particular network fetch may be related to, and
        in what role. Note that it is not ordered with respect to
        Network.requestWillBeSent (but will happen before loadingFinished
        loadingFailed).
        """

        _domain: str = PrivateAttr("Storage")
        type: "types.Storage.TypeInterestGroupAuctionFetchType"
        requestId: "types.Network.TypeRequestId"
        auctions: list[Any]
        """
        This is the set of the auctions using the worklet that issued this
request.  In the case of trusted signals, it's possible that only some of
them actually care about the keys being queried.
        """

    class sharedStorageAccessed(IEvent):
        """
                Shared storage was accessed by the associated page.
        The following parameters are included in all events.
        """

        _domain: str = PrivateAttr("Storage")
        accessTime: "types.Network.TypeTimeSinceEpoch"
        """
        Time of the access.
        """
        type: "types.Storage.TypeSharedStorageAccessType"
        """
        Enum value indicating the Shared Storage API method invoked.
        """
        mainFrameId: "types.Page.TypeFrameId"
        """
        DevTools Frame Token for the primary frame tree's root.
        """
        ownerOrigin: str
        """
        Serialized origin for the context that invoked the Shared Storage API.
        """
        params: "types.Storage.TypeSharedStorageAccessParams"
        """
        The sub-parameters wrapped by `params` are all optional and their
presence/absence depends on `type`.
        """

    class storageBucketCreatedOrUpdated(IEvent):
        _domain: str = PrivateAttr("Storage")
        bucketInfo: "types.Storage.TypeStorageBucketInfo"

    class storageBucketDeleted(IEvent):
        _domain: str = PrivateAttr("Storage")
        bucketId: str

    class attributionReportingSourceRegistered(IEvent):
        _domain: str = PrivateAttr("Storage")
        registration: "types.Storage.TypeAttributionReportingSourceRegistration"
        result: "types.Storage.TypeAttributionReportingSourceRegistrationResult"

    class attributionReportingTriggerRegistered(IEvent):
        _domain: str = PrivateAttr("Storage")
        registration: "types.Storage.TypeAttributionReportingTriggerRegistration"
        eventLevel: "types.Storage.TypeAttributionReportingEventLevelResult"
        aggregatable: "types.Storage.TypeAttributionReportingAggregatableResult"


class Target:
    """
    Supports additional targets discovery and allows to attach to them.
    """

    class attachedToTarget(IEvent):
        """
        Issued when attached to target because of auto-attach or `attachToTarget` command.
        """

        _domain: str = PrivateAttr("Target")
        sessionId: "types.Target.TypeSessionID"
        """
        Identifier assigned to the session used to send/receive messages.
        """
        targetInfo: "types.Target.TypeTargetInfo"
        waitingForDebugger: bool

    class detachedFromTarget(IEvent):
        """
                Issued when detached from target for any reason (including `detachFromTarget` command). Can be
        issued multiple times per target if multiple sessions have been attached to it.
        """

        _domain: str = PrivateAttr("Target")
        sessionId: "types.Target.TypeSessionID"
        """
        Detached session identifier.
        """
        targetId: Optional["types.Target.TypeTargetID"] = None
        """
        Deprecated.
        """

    class receivedMessageFromTarget(IEvent):
        """
                Notifies about a new protocol message received from the session (as reported in
        `attachedToTarget` event).
        """

        _domain: str = PrivateAttr("Target")
        sessionId: "types.Target.TypeSessionID"
        """
        Identifier of a session which sends a message.
        """
        message: str
        targetId: Optional["types.Target.TypeTargetID"] = None
        """
        Deprecated.
        """

    class targetCreated(IEvent):
        """
        Issued when a possible inspection target is created.
        """

        _domain: str = PrivateAttr("Target")
        targetInfo: "types.Target.TypeTargetInfo"

    class targetDestroyed(IEvent):
        """
        Issued when a target is destroyed.
        """

        _domain: str = PrivateAttr("Target")
        targetId: "types.Target.TypeTargetID"

    class targetCrashed(IEvent):
        """
        Issued when a target has crashed.
        """

        _domain: str = PrivateAttr("Target")
        targetId: "types.Target.TypeTargetID"
        status: str
        """
        Termination status type.
        """
        errorCode: Union[float, int]
        """
        Termination error code.
        """

    class targetInfoChanged(IEvent):
        """
                Issued when some information about a target has changed. This only happens between
        `targetCreated` and `targetDestroyed`.
        """

        _domain: str = PrivateAttr("Target")
        targetInfo: "types.Target.TypeTargetInfo"


class Tethering:
    """
    The Tethering domain defines methods and events for browser port binding.
    """

    class accepted(IEvent):
        """
        Informs that port was successfully bound and got a specified connection id.
        """

        _domain: str = PrivateAttr("Tethering")
        port: Union[float, int]
        """
        Port number that was successfully bound.
        """
        connectionId: str
        """
        Connection id to be used.
        """


class Tracing:
    class bufferUsage(IEvent):
        _domain: str = PrivateAttr("Tracing")
        percentFull: Optional[Union[float, int]] = None
        """
        A number in range [0..1] that indicates the used size of event buffer as a fraction of its
total size.
        """
        eventCount: Optional[Union[float, int]] = None
        """
        An approximate number of events in the trace log.
        """
        value: Optional[Union[float, int]] = None
        """
        A number in range [0..1] that indicates the used size of event buffer as a fraction of its
total size.
        """

    class dataCollected(IEvent):
        """
                Contains a bucket of collected trace events. When tracing is stopped collected events will be
        sent as a sequence of dataCollected events followed by tracingComplete event.
        """

        _domain: str = PrivateAttr("Tracing")
        value: list[Any]

    class tracingComplete(IEvent):
        """
                Signals that tracing is stopped and there is no trace buffers pending flush, all data were
        delivered via dataCollected events.
        """

        _domain: str = PrivateAttr("Tracing")
        dataLossOccurred: bool
        """
        Indicates whether some trace data is known to have been lost, e.g. because the trace ring
buffer wrapped around.
        """
        stream: Optional["types.IO.TypeStreamHandle"] = None
        """
        A handle of the stream that holds resulting trace data.
        """
        traceFormat: Optional["types.Tracing.TypeStreamFormat"] = None
        """
        Trace data format of returned stream.
        """
        streamCompression: Optional["types.Tracing.TypeStreamCompression"] = None
        """
        Compression format of returned stream.
        """


class Fetch:
    """
    A domain for letting clients substitute browser's network layer with client code.
    """

    class requestPaused(IEvent):
        """
                Issued when the domain is enabled and the request URL matches the
        specified filter. The request is paused until the client responds
        with one of continueRequest, failRequest or fulfillRequest.
        The stage of the request can be determined by presence of responseErrorReason
        and responseStatusCode -- the request is at the response stage if either
        of these fields is present and in the request stage otherwise.
        Redirect responses and subsequent requests are reported similarly to regular
        responses and requests. Redirect responses may be distinguished by the value
        of `responseStatusCode` (which is one of 301, 302, 303, 307, 308) along with
        presence of the `location` header. Requests resulting from a redirect will
        have `redirectedRequestId` field set.
        """

        _domain: str = PrivateAttr("Fetch")
        requestId: "types.Fetch.TypeRequestId"
        """
        Each request the page makes will have a unique id.
        """
        request: "types.Network.TypeRequest"
        """
        The details of the request.
        """
        frameId: "types.Page.TypeFrameId"
        """
        The id of the frame that initiated the request.
        """
        resourceType: "types.Network.TypeResourceType"
        """
        How the requested resource will be used.
        """
        responseErrorReason: Optional["types.Network.TypeErrorReason"] = None
        """
        Response error if intercepted at response stage.
        """
        responseStatusCode: Optional[Union[float, int]] = None
        """
        Response code if intercepted at response stage.
        """
        responseStatusText: Optional[str] = None
        """
        Response status text if intercepted at response stage.
        """
        responseHeaders: Optional[list[Any]] = None
        """
        Response headers if intercepted at the response stage.
        """
        networkId: Optional["types.Network.TypeRequestId"] = None
        """
        If the intercepted request had a corresponding Network.requestWillBeSent event fired for it,
then this networkId will be the same as the requestId present in the requestWillBeSent event.
        """
        redirectedRequestId: Optional["types.Fetch.TypeRequestId"] = None
        """
        If the request is due to a redirect response from the server, the id of the request that
has caused the redirect.
        """

    class authRequired(IEvent):
        """
                Issued when the domain is enabled with handleAuthRequests set to true.
        The request is paused until client responds with continueWithAuth.
        """

        _domain: str = PrivateAttr("Fetch")
        requestId: "types.Fetch.TypeRequestId"
        """
        Each request the page makes will have a unique id.
        """
        request: "types.Network.TypeRequest"
        """
        The details of the request.
        """
        frameId: "types.Page.TypeFrameId"
        """
        The id of the frame that initiated the request.
        """
        resourceType: "types.Network.TypeResourceType"
        """
        How the requested resource will be used.
        """
        authChallenge: "types.Fetch.TypeAuthChallenge"
        """
        Details of the Authorization Challenge encountered.
If this is set, client should respond with continueRequest that
contains AuthChallengeResponse.
        """


class WebAudio:
    """
        This domain allows inspection of Web Audio API.
    https://webaudio.github.io/web-audio-api/
    """

    class contextCreated(IEvent):
        """
        Notifies that a new BaseAudioContext has been created.
        """

        _domain: str = PrivateAttr("WebAudio")
        context: "types.WebAudio.TypeBaseAudioContext"

    class contextWillBeDestroyed(IEvent):
        """
        Notifies that an existing BaseAudioContext will be destroyed.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"

    class contextChanged(IEvent):
        """
        Notifies that existing BaseAudioContext has changed some properties (id stays the same)..
        """

        _domain: str = PrivateAttr("WebAudio")
        context: "types.WebAudio.TypeBaseAudioContext"

    class audioListenerCreated(IEvent):
        """
        Notifies that the construction of an AudioListener has finished.
        """

        _domain: str = PrivateAttr("WebAudio")
        listener: "types.WebAudio.TypeAudioListener"

    class audioListenerWillBeDestroyed(IEvent):
        """
        Notifies that a new AudioListener has been created.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"
        listenerId: "types.WebAudio.TypeGraphObjectId"

    class audioNodeCreated(IEvent):
        """
        Notifies that a new AudioNode has been created.
        """

        _domain: str = PrivateAttr("WebAudio")
        node: "types.WebAudio.TypeAudioNode"

    class audioNodeWillBeDestroyed(IEvent):
        """
        Notifies that an existing AudioNode has been destroyed.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"
        nodeId: "types.WebAudio.TypeGraphObjectId"

    class audioParamCreated(IEvent):
        """
        Notifies that a new AudioParam has been created.
        """

        _domain: str = PrivateAttr("WebAudio")
        param: "types.WebAudio.TypeAudioParam"

    class audioParamWillBeDestroyed(IEvent):
        """
        Notifies that an existing AudioParam has been destroyed.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"
        nodeId: "types.WebAudio.TypeGraphObjectId"
        paramId: "types.WebAudio.TypeGraphObjectId"

    class nodesConnected(IEvent):
        """
        Notifies that two AudioNodes are connected.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"
        sourceId: "types.WebAudio.TypeGraphObjectId"
        destinationId: "types.WebAudio.TypeGraphObjectId"
        sourceOutputIndex: Optional[Union[float, int]] = None
        destinationInputIndex: Optional[Union[float, int]] = None

    class nodesDisconnected(IEvent):
        """
        Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"
        sourceId: "types.WebAudio.TypeGraphObjectId"
        destinationId: "types.WebAudio.TypeGraphObjectId"
        sourceOutputIndex: Optional[Union[float, int]] = None
        destinationInputIndex: Optional[Union[float, int]] = None

    class nodeParamConnected(IEvent):
        """
        Notifies that an AudioNode is connected to an AudioParam.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"
        sourceId: "types.WebAudio.TypeGraphObjectId"
        destinationId: "types.WebAudio.TypeGraphObjectId"
        sourceOutputIndex: Optional[Union[float, int]] = None

    class nodeParamDisconnected(IEvent):
        """
        Notifies that an AudioNode is disconnected to an AudioParam.
        """

        _domain: str = PrivateAttr("WebAudio")
        contextId: "types.WebAudio.TypeGraphObjectId"
        sourceId: "types.WebAudio.TypeGraphObjectId"
        destinationId: "types.WebAudio.TypeGraphObjectId"
        sourceOutputIndex: Optional[Union[float, int]] = None


class WebAuthn:
    """
        This domain allows configuring virtual authenticators to test the WebAuthn
    API.
    """

    class credentialAdded(IEvent):
        """
        Triggered when a credential is added to an authenticator.
        """

        _domain: str = PrivateAttr("WebAuthn")
        authenticatorId: "types.WebAuthn.TypeAuthenticatorId"
        credential: "types.WebAuthn.TypeCredential"

    class credentialAsserted(IEvent):
        """
        Triggered when a credential is used in a webauthn assertion.
        """

        _domain: str = PrivateAttr("WebAuthn")
        authenticatorId: "types.WebAuthn.TypeAuthenticatorId"
        credential: "types.WebAuthn.TypeCredential"


class Media:
    """
    This domain allows detailed inspection of media elements
    """

    class playerPropertiesChanged(IEvent):
        """
                This can be called multiple times, and can be used to set / override /
        remove player properties. A null propValue indicates removal.
        """

        _domain: str = PrivateAttr("Media")
        playerId: "types.Media.TypePlayerId"
        properties: list[Any]

    class playerEventsAdded(IEvent):
        """
                Send events as a list, allowing them to be batched on the browser for less
        congestion. If batched, events must ALWAYS be in chronological order.
        """

        _domain: str = PrivateAttr("Media")
        playerId: "types.Media.TypePlayerId"
        events: list[Any]

    class playerMessagesLogged(IEvent):
        """
        Send a list of any messages that need to be delivered.
        """

        _domain: str = PrivateAttr("Media")
        playerId: "types.Media.TypePlayerId"
        messages: list[Any]

    class playerErrorsRaised(IEvent):
        """
        Send a list of any errors that need to be delivered.
        """

        _domain: str = PrivateAttr("Media")
        playerId: "types.Media.TypePlayerId"
        errors: list[Any]

    class playersCreated(IEvent):
        """
                Called whenever a player is created, or when a new agent joins and receives
        a list of active players. If an agent is restored, it will receive the full
        list of player ids and all events again.
        """

        _domain: str = PrivateAttr("Media")
        players: list[Any]


class DeviceAccess:
    class deviceRequestPrompted(IEvent):
        """
                A device request opened a user prompt to select a device. Respond with the
        selectPrompt or cancelPrompt command.
        """

        _domain: str = PrivateAttr("DeviceAccess")
        id: "types.DeviceAccess.TypeRequestId"
        devices: list[Any]


class Preload:
    class ruleSetUpdated(IEvent):
        """
        Upsert. Currently, it is only emitted when a rule set added.
        """

        _domain: str = PrivateAttr("Preload")
        ruleSet: "types.Preload.TypeRuleSet"

    class ruleSetRemoved(IEvent):
        _domain: str = PrivateAttr("Preload")
        id: "types.Preload.TypeRuleSetId"

    class preloadEnabledStateUpdated(IEvent):
        """
        Fired when a preload enabled state is updated.
        """

        _domain: str = PrivateAttr("Preload")
        disabledByPreference: bool
        disabledByDataSaver: bool
        disabledByBatterySaver: bool
        disabledByHoldbackPrefetchSpeculationRules: bool
        disabledByHoldbackPrerenderSpeculationRules: bool

    class prefetchStatusUpdated(IEvent):
        """
        Fired when a prefetch attempt is updated.
        """

        _domain: str = PrivateAttr("Preload")
        key: "types.Preload.TypePreloadingAttemptKey"
        initiatingFrameId: "types.Page.TypeFrameId"
        """
        The frame id of the frame initiating prefetch.
        """
        prefetchUrl: str
        status: "types.Preload.TypePreloadingStatus"
        prefetchStatus: "types.Preload.TypePrefetchStatus"
        requestId: "types.Network.TypeRequestId"

    class prerenderStatusUpdated(IEvent):
        """
        Fired when a prerender attempt is updated.
        """

        _domain: str = PrivateAttr("Preload")
        key: "types.Preload.TypePreloadingAttemptKey"
        status: "types.Preload.TypePreloadingStatus"
        prerenderStatus: Optional["types.Preload.TypePrerenderFinalStatus"] = None
        disallowedMojoInterface: Optional[str] = None
        """
        This is used to give users more information about the name of Mojo interface
that is incompatible with prerender and has caused the cancellation of the attempt.
        """
        mismatchedHeaders: Optional[list[Any]] = None

    class preloadingAttemptSourcesUpdated(IEvent):
        """
        Send a list of sources for all preloading attempts in a document.
        """

        _domain: str = PrivateAttr("Preload")
        loaderId: "types.Network.TypeLoaderId"
        preloadingAttemptSources: list[Any]


class FedCm:
    """
    This domain allows interacting with the FedCM dialog.
    """

    class dialogShown(IEvent):
        _domain: str = PrivateAttr("FedCm")
        dialogId: str
        dialogType: "types.FedCm.TypeDialogType"
        accounts: list[Any]
        title: str
        """
        These exist primarily so that the caller can verify the
RP context was used appropriately.
        """
        subtitle: Optional[str] = None

    class dialogClosed(IEvent):
        """
                Triggered when a dialog is closed, either by user action, JS abort,
        or a command below.
        """

        _domain: str = PrivateAttr("FedCm")
        dialogId: str
