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

Actions and events related to the inspected page belong to the page domain.
https://chromedevtools.github.io/devtools-protocol/tot/Page/

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

from typing import Literal

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


class AddScriptToEvaluateOnLoadInput(InputModel):

    scriptSource: str


class AddScriptToEvaluateOnLoadOutput(OutputModel):

    identifier: Page.ScriptIdentifier  # deprecated


class AddScriptToEvaluateOnLoad(CDPMethod[AddScriptToEvaluateOnLoadOutput]):  # experimental deprecated
    """ Deprecated, please use addScriptToEvaluateOnNewDocument instead. """

    INPUT_VALIDATOR = AddScriptToEvaluateOnLoadInput
    OUTPUT_VALIDATOR = AddScriptToEvaluateOnLoadOutput

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


class AddScriptToEvaluateOnNewDocumentInput(InputModel):

    source: str
    worldName: str | None = None  # experimental deprecated
    includeCommandLineAPI: bool | None = None  # experimental deprecated
    runImmediately: bool | None = None  # experimental deprecated


class AddScriptToEvaluateOnNewDocumentOutput(OutputModel):

    identifier: Page.ScriptIdentifier  # deprecated


class AddScriptToEvaluateOnNewDocument(CDPMethod[AddScriptToEvaluateOnNewDocumentOutput]):  # deprecated
    """ Evaluates given script in every frame upon creation (before loading frame's scripts). """

    INPUT_VALIDATOR = AddScriptToEvaluateOnNewDocumentInput
    OUTPUT_VALIDATOR = AddScriptToEvaluateOnNewDocumentOutput

    def __init__(
        self,
        *,
        source: str,
        world_name: str | None = None,
        include_command_line_api: bool | None = None,
        run_immediately: bool | None = None
    ):
        super().__init__(
            source=source,
            worldName=world_name,
            includeCommandLineAPI=include_command_line_api,
            runImmediately=run_immediately
        )


class BringToFront(CDPMethod[None]):  # deprecated
    """ Brings page to front (activates tab). """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class CaptureScreenshotInput(InputModel):

    format: Literal['jpeg', 'png', 'webp'] | None = None  # deprecated
    quality: int | None = None  # deprecated
    clip: Page.Viewport | None = None  # deprecated
    fromSurface: bool | None = None  # experimental deprecated
    captureBeyondViewport: bool | None = None  # experimental deprecated
    optimizeForSpeed: bool | None = None  # experimental deprecated


class CaptureScreenshotOutput(OutputModel):

    data: str  # deprecated


class CaptureScreenshot(CDPMethod[CaptureScreenshotOutput]):  # deprecated
    """ Capture page screenshot. """

    INPUT_VALIDATOR = CaptureScreenshotInput
    OUTPUT_VALIDATOR = CaptureScreenshotOutput

    def __init__(
        self,
        *,
        format_: Literal['jpeg', 'png', 'webp'] | None = None,
        quality: int | None = None,
        clip: Page.Viewport | None = None,
        from_surface: bool | None = None,
        capture_beyond_viewport: bool | None = None,
        optimize_for_speed: bool | None = None
    ):
        super().__init__(
            format=format_,
            quality=quality,
            clip=clip,
            fromSurface=from_surface,
            captureBeyondViewport=capture_beyond_viewport,
            optimizeForSpeed=optimize_for_speed
        )


class CaptureSnapshotInput(InputModel):

    format: Literal['mhtml'] | None = None  # deprecated


class CaptureSnapshotOutput(OutputModel):

    data: str  # deprecated


class CaptureSnapshot(CDPMethod[CaptureSnapshotOutput]):  # experimental deprecated
    """ Returns a snapshot of the page as a string. For MHTML format, the serialization includes
    iframes, shadow DOM, external resources, and element-inline styles. """

    INPUT_VALIDATOR = CaptureSnapshotInput
    OUTPUT_VALIDATOR = CaptureSnapshotOutput

    def __init__(
        self,
        *,
        format_: Literal['mhtml'] | None = None
    ):
        super().__init__(
            format=format_
        )


class ClearDeviceMetricsOverride(CDPMethod[None]):  # experimental deprecated
    """ Clears the overridden device metrics. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class ClearDeviceOrientationOverride(CDPMethod[None]):  # experimental deprecated
    """ Clears the overridden Device Orientation. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class ClearGeolocationOverride(CDPMethod[None]):  # deprecated
    """ Clears the overridden Geolocation Position and Error. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class CreateIsolatedWorldInput(InputModel):

    frameId: Page.FrameId  # deprecated
    worldName: str | None = None  # deprecated
    grantUniveralAccess: bool | None = None  # deprecated


class CreateIsolatedWorldOutput(OutputModel):

    executionContextId: Runtime.ExecutionContextId  # deprecated


class CreateIsolatedWorld(CDPMethod[CreateIsolatedWorldOutput]):  # deprecated
    """ Creates an isolated world for the given frame. """

    INPUT_VALIDATOR = CreateIsolatedWorldInput
    OUTPUT_VALIDATOR = CreateIsolatedWorldOutput

    def __init__(
        self,
        *,
        frame_id: Page.FrameId,
        world_name: str | None = None,
        grant_univeral_access: bool | None = None
    ):
        super().__init__(
            frameId=frame_id,
            worldName=world_name,
            grantUniveralAccess=grant_univeral_access
        )


class DeleteCookieInput(InputModel):

    cookieName: str  # deprecated
    url: str  # deprecated


class DeleteCookie(CDPMethod[None]):  # experimental deprecated
    """ Deletes browser cookie with given name, domain and path. """

    INPUT_VALIDATOR = DeleteCookieInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        cookie_name: str,
        url: str
    ):
        super().__init__(
            cookieName=cookie_name,
            url=url
        )


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

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class EnableInput(InputModel):

    enableFileChooserOpenedEvent: bool | None = None  # experimental deprecated


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

    INPUT_VALIDATOR = EnableInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        enable_file_chooser_opened_event: bool | None = None
    ):
        super().__init__(
            enableFileChooserOpenedEvent=enable_file_chooser_opened_event
        )


class GetAppManifestInput(InputModel):

    manifestId: str | None = None


class GetAppManifestOutput(OutputModel):

    url: str  # deprecated
    errors: list[Page.AppManifestError]
    data: str | None = None  # deprecated
    parsed: Page.AppManifestParsedProperties | None = None  # experimental deprecated
    manifest: Page.WebAppManifest | None = None  # experimental


class GetAppManifest(CDPMethod[GetAppManifestOutput]):  # deprecated
    """ Gets the processed manifest for this current document.
      This API always waits for the manifest to be loaded.
      If manifestId is provided, and it does not match the manifest of the
        current document, this API errors out.
      If there is not a loaded page, this API errors out immediately. """

    INPUT_VALIDATOR = GetAppManifestInput
    OUTPUT_VALIDATOR = GetAppManifestOutput

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


class GetInstallabilityErrorsOutput(OutputModel):

    installabilityErrors: list[Page.InstallabilityError]


class GetInstallabilityErrors(CDPMethod[GetInstallabilityErrorsOutput]):  # experimental

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetInstallabilityErrorsOutput


class GetManifestIconsOutput(OutputModel):

    primaryIcon: str | None = None


class GetManifestIcons(CDPMethod[GetManifestIconsOutput]):  # experimental deprecated
    """ Deprecated because it's not guaranteed that the returned icon is in fact the one used for PWA installation. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetManifestIconsOutput


class GetAppIdOutput(OutputModel):

    appId: str | None = None  # deprecated
    recommendedId: str | None = None  # deprecated


class GetAppId(CDPMethod[GetAppIdOutput]):  # experimental deprecated
    """ Returns the unique (PWA) app id.
    Only returns values if the feature flag 'WebAppEnableManifestId' is enabled """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetAppIdOutput


class GetAdScriptAncestryInput(InputModel):

    frameId: Page.FrameId


class GetAdScriptAncestryOutput(OutputModel):

    adScriptAncestry: Page.AdScriptAncestry | None = None  # deprecated


class GetAdScriptAncestry(CDPMethod[GetAdScriptAncestryOutput]):  # experimental

    INPUT_VALIDATOR = GetAdScriptAncestryInput
    OUTPUT_VALIDATOR = GetAdScriptAncestryOutput

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


class GetFrameTreeOutput(OutputModel):

    frameTree: Page.FrameTree  # deprecated


class GetFrameTree(CDPMethod[GetFrameTreeOutput]):  # deprecated
    """ Returns present frame tree structure. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetFrameTreeOutput


class GetLayoutMetricsOutput(OutputModel):

    layoutViewport: Page.LayoutViewport  # deprecated
    visualViewport: Page.VisualViewport  # deprecated
    contentSize: DOM.Rect  # deprecated
    cssLayoutViewport: Page.LayoutViewport  # deprecated
    cssVisualViewport: Page.VisualViewport  # deprecated
    cssContentSize: DOM.Rect  # deprecated


class GetLayoutMetrics(CDPMethod[GetLayoutMetricsOutput]):  # deprecated
    """ Returns metrics relating to the layouting of the page, such as viewport bounds/scale. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetLayoutMetricsOutput


class GetNavigationHistoryOutput(OutputModel):

    currentIndex: int  # deprecated
    entries: list[Page.NavigationEntry]  # deprecated


class GetNavigationHistory(CDPMethod[GetNavigationHistoryOutput]):  # deprecated
    """ Returns navigation history for the current page. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetNavigationHistoryOutput


class ResetNavigationHistory(CDPMethod[None]):  # deprecated
    """ Resets navigation history for the current page. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class GetResourceContentInput(InputModel):

    frameId: Page.FrameId  # deprecated
    url: str  # deprecated


class GetResourceContentOutput(OutputModel):

    content: str  # deprecated
    base64Encoded: bool  # deprecated


class GetResourceContent(CDPMethod[GetResourceContentOutput]):  # experimental deprecated
    """ Returns content of the given resource. """

    INPUT_VALIDATOR = GetResourceContentInput
    OUTPUT_VALIDATOR = GetResourceContentOutput

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


class GetResourceTreeOutput(OutputModel):

    frameTree: Page.FrameResourceTree  # deprecated


class GetResourceTree(CDPMethod[GetResourceTreeOutput]):  # experimental deprecated
    """ Returns present frame / resource tree structure. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = GetResourceTreeOutput


class HandleJavaScriptDialogInput(InputModel):

    accept: bool  # deprecated
    promptText: str | None = None  # deprecated


class HandleJavaScriptDialog(CDPMethod[None]):  # deprecated
    """ Accepts or dismisses a JavaScript initiated dialog (alert, confirm, prompt, or onbeforeunload). """

    INPUT_VALIDATOR = HandleJavaScriptDialogInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        accept: bool,
        prompt_text: str | None = None
    ):
        super().__init__(
            accept=accept,
            promptText=prompt_text
        )


class NavigateInput(InputModel):

    url: str  # deprecated
    referrer: str | None = None  # deprecated
    transitionType: Page.TransitionType | None = None  # deprecated
    frameId: Page.FrameId | None = None  # deprecated
    referrerPolicy: Page.ReferrerPolicy | None = None  # experimental deprecated


class NavigateOutput(OutputModel):

    frameId: Page.FrameId  # deprecated
    loaderId: Network.LoaderId | None = None  # deprecated
    errorText: str | None = None  # deprecated


class Navigate(CDPMethod[NavigateOutput]):  # deprecated
    """ Navigates current page to the given URL. """

    INPUT_VALIDATOR = NavigateInput
    OUTPUT_VALIDATOR = NavigateOutput

    def __init__(
        self,
        *,
        url: str,
        referrer: str | None = None,
        transition_type: Page.TransitionType | None = None,
        frame_id: Page.FrameId | None = None,
        referrer_policy: Page.ReferrerPolicy | None = None
    ):
        super().__init__(
            url=url,
            referrer=referrer,
            transitionType=transition_type,
            frameId=frame_id,
            referrerPolicy=referrer_policy
        )


class NavigateToHistoryEntryInput(InputModel):

    entryId: int  # deprecated


class NavigateToHistoryEntry(CDPMethod[None]):  # deprecated
    """ Navigates current page to the given history entry. """

    INPUT_VALIDATOR = NavigateToHistoryEntryInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        entry_id: int
    ):
        super().__init__(
            entryId=entry_id
        )


class PrintToPDFInput(InputModel):

    landscape: bool | None = None  # deprecated
    displayHeaderFooter: bool | None = None  # deprecated
    printBackground: bool | None = None  # deprecated
    scale: float | None = None  # deprecated
    paperWidth: float | None = None  # deprecated
    paperHeight: float | None = None  # deprecated
    marginTop: float | None = None  # deprecated
    marginBottom: float | None = None  # deprecated
    marginLeft: float | None = None  # deprecated
    marginRight: float | None = None  # deprecated
    pageRanges: str | None = None  # deprecated
    headerTemplate: str | None = None  # deprecated
    footerTemplate: str | None = None  # deprecated
    preferCSSPageSize: bool | None = None  # deprecated
    transferMode: Literal['ReturnAsBase64', 'ReturnAsStream'] | None = None  # experimental deprecated
    generateTaggedPDF: bool | None = None  # experimental deprecated
    generateDocumentOutline: bool | None = None  # experimental deprecated


class PrintToPDFOutput(OutputModel):

    data: str  # deprecated
    stream: IO.StreamHandle | None = None  # experimental deprecated


class PrintToPDF(CDPMethod[PrintToPDFOutput]):  # deprecated
    """ Print page as PDF. """

    INPUT_VALIDATOR = PrintToPDFInput
    OUTPUT_VALIDATOR = PrintToPDFOutput

    def __init__(
        self,
        *,
        landscape: bool | None = None,
        display_header_footer: bool | None = None,
        print_background: bool | None = None,
        scale: float | None = None,
        paper_width: float | None = None,
        paper_height: float | None = None,
        margin_top: float | None = None,
        margin_bottom: float | None = None,
        margin_left: float | None = None,
        margin_right: float | None = None,
        page_ranges: str | None = None,
        header_template: str | None = None,
        footer_template: str | None = None,
        prefer_css_page_size: bool | None = None,
        transfer_mode: Literal['ReturnAsBase64', 'ReturnAsStream'] | None = None,
        generate_tagged_pdf: bool | None = None,
        generate_document_outline: bool | None = None
    ):
        super().__init__(
            landscape=landscape,
            displayHeaderFooter=display_header_footer,
            printBackground=print_background,
            scale=scale,
            paperWidth=paper_width,
            paperHeight=paper_height,
            marginTop=margin_top,
            marginBottom=margin_bottom,
            marginLeft=margin_left,
            marginRight=margin_right,
            pageRanges=page_ranges,
            headerTemplate=header_template,
            footerTemplate=footer_template,
            preferCSSPageSize=prefer_css_page_size,
            transferMode=transfer_mode,
            generateTaggedPDF=generate_tagged_pdf,
            generateDocumentOutline=generate_document_outline
        )


class ReloadInput(InputModel):

    ignoreCache: bool | None = None  # deprecated
    scriptToEvaluateOnLoad: str | None = None  # deprecated
    loaderId: Network.LoaderId | None = None  # experimental deprecated


class Reload(CDPMethod[None]):  # deprecated
    """ Reloads given page optionally ignoring the cache. """

    INPUT_VALIDATOR = ReloadInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        ignore_cache: bool | None = None,
        script_to_evaluate_on_load: str | None = None,
        loader_id: Network.LoaderId | None = None
    ):
        super().__init__(
            ignoreCache=ignore_cache,
            scriptToEvaluateOnLoad=script_to_evaluate_on_load,
            loaderId=loader_id
        )


class RemoveScriptToEvaluateOnLoadInput(InputModel):

    identifier: Page.ScriptIdentifier


class RemoveScriptToEvaluateOnLoad(CDPMethod[None]):  # experimental deprecated
    """ Deprecated, please use removeScriptToEvaluateOnNewDocument instead. """

    INPUT_VALIDATOR = RemoveScriptToEvaluateOnLoadInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        identifier: Page.ScriptIdentifier
    ):
        super().__init__(
            identifier=identifier
        )


class RemoveScriptToEvaluateOnNewDocumentInput(InputModel):

    identifier: Page.ScriptIdentifier


class RemoveScriptToEvaluateOnNewDocument(CDPMethod[None]):  # deprecated
    """ Removes given script from the list. """

    INPUT_VALIDATOR = RemoveScriptToEvaluateOnNewDocumentInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        identifier: Page.ScriptIdentifier
    ):
        super().__init__(
            identifier=identifier
        )


class ScreencastFrameAckInput(InputModel):

    sessionId: int  # deprecated


class ScreencastFrameAck(CDPMethod[None]):  # experimental deprecated
    """ Acknowledges that a screencast frame has been received by the frontend. """

    INPUT_VALIDATOR = ScreencastFrameAckInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        session_id: int
    ):
        super().__init__(
            sessionId=session_id
        )


class SearchInResourceInput(InputModel):

    frameId: Page.FrameId  # deprecated
    url: str  # deprecated
    query: str  # deprecated
    caseSensitive: bool | None = None  # deprecated
    isRegex: bool | None = None  # deprecated


class SearchInResourceOutput(OutputModel):

    result: list[Debugger.SearchMatch]  # deprecated


class SearchInResource(CDPMethod[SearchInResourceOutput]):  # experimental deprecated
    """ Searches for given string in resource content. """

    INPUT_VALIDATOR = SearchInResourceInput
    OUTPUT_VALIDATOR = SearchInResourceOutput

    def __init__(
        self,
        *,
        frame_id: Page.FrameId,
        url: str,
        query: str,
        case_sensitive: bool | None = None,
        is_regex: bool | None = None
    ):
        super().__init__(
            frameId=frame_id,
            url=url,
            query=query,
            caseSensitive=case_sensitive,
            isRegex=is_regex
        )


class SetAdBlockingEnabledInput(InputModel):

    enabled: bool  # deprecated


class SetAdBlockingEnabled(CDPMethod[None]):  # experimental deprecated
    """ Enable Chrome's experimental ad filter on all sites. """

    INPUT_VALIDATOR = SetAdBlockingEnabledInput
    OUTPUT_VALIDATOR = None

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


class SetBypassCSPInput(InputModel):

    enabled: bool  # deprecated


class SetBypassCSP(CDPMethod[None]):  # deprecated
    """ Enable page Content Security Policy by-passing. """

    INPUT_VALIDATOR = SetBypassCSPInput
    OUTPUT_VALIDATOR = None

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


class GetPermissionsPolicyStateInput(InputModel):

    frameId: Page.FrameId


class GetPermissionsPolicyStateOutput(OutputModel):

    states: list[Page.PermissionsPolicyFeatureState]


class GetPermissionsPolicyState(CDPMethod[GetPermissionsPolicyStateOutput]):  # experimental deprecated
    """ Get Permissions Policy state on given frame. """

    INPUT_VALIDATOR = GetPermissionsPolicyStateInput
    OUTPUT_VALIDATOR = GetPermissionsPolicyStateOutput

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


class GetOriginTrialsInput(InputModel):

    frameId: Page.FrameId


class GetOriginTrialsOutput(OutputModel):

    originTrials: list[Page.OriginTrial]


class GetOriginTrials(CDPMethod[GetOriginTrialsOutput]):  # experimental deprecated
    """ Get Origin Trials on given frame. """

    INPUT_VALIDATOR = GetOriginTrialsInput
    OUTPUT_VALIDATOR = GetOriginTrialsOutput

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


class SetDeviceMetricsOverrideInput(InputModel):

    width: int  # deprecated
    height: int  # deprecated
    deviceScaleFactor: float  # deprecated
    mobile: bool  # deprecated
    scale: float | None = None  # deprecated
    screenWidth: int | None = None  # deprecated
    screenHeight: int | None = None  # deprecated
    positionX: int | None = None  # deprecated
    positionY: int | None = None  # deprecated
    dontSetVisibleSize: bool | None = None  # deprecated
    screenOrientation: Emulation.ScreenOrientation | None = None  # deprecated
    viewport: Page.Viewport | None = None  # deprecated


class SetDeviceMetricsOverride(CDPMethod[None]):  # experimental deprecated
    """ Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
    window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
    query results). """

    INPUT_VALIDATOR = SetDeviceMetricsOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        width: int,
        height: int,
        device_scale_factor: float,
        mobile: bool,
        scale: float | None = None,
        screen_width: int | None = None,
        screen_height: int | None = None,
        position_x: int | None = None,
        position_y: int | None = None,
        dont_set_visible_size: bool | None = None,
        screen_orientation: Emulation.ScreenOrientation | None = None,
        viewport: Page.Viewport | None = None
    ):
        super().__init__(
            width=width,
            height=height,
            deviceScaleFactor=device_scale_factor,
            mobile=mobile,
            scale=scale,
            screenWidth=screen_width,
            screenHeight=screen_height,
            positionX=position_x,
            positionY=position_y,
            dontSetVisibleSize=dont_set_visible_size,
            screenOrientation=screen_orientation,
            viewport=viewport
        )


class SetDeviceOrientationOverrideInput(InputModel):

    alpha: float  # deprecated
    beta: float  # deprecated
    gamma: float  # deprecated


class SetDeviceOrientationOverride(CDPMethod[None]):  # experimental deprecated
    """ Overrides the Device Orientation. """

    INPUT_VALIDATOR = SetDeviceOrientationOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        alpha: float,
        beta: float,
        gamma: float
    ):
        super().__init__(
            alpha=alpha,
            beta=beta,
            gamma=gamma
        )


class SetFontFamiliesInput(InputModel):

    fontFamilies: Page.FontFamilies  # deprecated
    forScripts: list[Page.ScriptFontFamilies] | None = None  # deprecated


class SetFontFamilies(CDPMethod[None]):  # experimental deprecated
    """ Set generic font families. """

    INPUT_VALIDATOR = SetFontFamiliesInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        font_families: Page.FontFamilies,
        for_scripts: list[Page.ScriptFontFamilies] | None = None
    ):
        super().__init__(
            fontFamilies=font_families,
            forScripts=for_scripts
        )


class SetFontSizesInput(InputModel):

    fontSizes: Page.FontSizes  # deprecated


class SetFontSizes(CDPMethod[None]):  # experimental deprecated
    """ Set default font sizes. """

    INPUT_VALIDATOR = SetFontSizesInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        font_sizes: Page.FontSizes
    ):
        super().__init__(
            fontSizes=font_sizes
        )


class SetDocumentContentInput(InputModel):

    frameId: Page.FrameId  # deprecated
    html: str  # deprecated


class SetDocumentContent(CDPMethod[None]):  # deprecated
    """ Sets given markup as the document's HTML. """

    INPUT_VALIDATOR = SetDocumentContentInput
    OUTPUT_VALIDATOR = None

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


class SetDownloadBehaviorInput(InputModel):

    behavior: Literal['deny', 'allow', 'default']  # deprecated
    downloadPath: str | None = None  # deprecated


class SetDownloadBehavior(CDPMethod[None]):  # experimental deprecated
    """ Set the behavior when downloading a file. """

    INPUT_VALIDATOR = SetDownloadBehaviorInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        behavior: Literal['deny', 'allow', 'default'],
        download_path: str | None = None
    ):
        super().__init__(
            behavior=behavior,
            downloadPath=download_path
        )


class SetGeolocationOverrideInput(InputModel):

    latitude: float | None = None  # deprecated
    longitude: float | None = None  # deprecated
    accuracy: float | None = None  # deprecated


class SetGeolocationOverride(CDPMethod[None]):  # deprecated
    """ Overrides the Geolocation Position or Error. Omitting any of the parameters emulates position
    unavailable. """

    INPUT_VALIDATOR = SetGeolocationOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        latitude: float | None = None,
        longitude: float | None = None,
        accuracy: float | None = None
    ):
        super().__init__(
            latitude=latitude,
            longitude=longitude,
            accuracy=accuracy
        )


class SetLifecycleEventsEnabledInput(InputModel):

    enabled: bool  # deprecated


class SetLifecycleEventsEnabled(CDPMethod[None]):  # deprecated
    """ Controls whether page will emit lifecycle events. """

    INPUT_VALIDATOR = SetLifecycleEventsEnabledInput
    OUTPUT_VALIDATOR = None

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


class SetTouchEmulationEnabledInput(InputModel):

    enabled: bool  # deprecated
    configuration: Literal['mobile', 'desktop'] | None = None  # deprecated


class SetTouchEmulationEnabled(CDPMethod[None]):  # experimental deprecated
    """ Toggles mouse event-based touch event emulation. """

    INPUT_VALIDATOR = SetTouchEmulationEnabledInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        enabled: bool,
        configuration: Literal['mobile', 'desktop'] | None = None
    ):
        super().__init__(
            enabled=enabled,
            configuration=configuration
        )


class StartScreencastInput(InputModel):

    format: Literal['jpeg', 'png'] | None = None  # deprecated
    quality: int | None = None  # deprecated
    maxWidth: int | None = None  # deprecated
    maxHeight: int | None = None  # deprecated
    everyNthFrame: int | None = None  # deprecated


class StartScreencast(CDPMethod[None]):  # experimental deprecated
    """ Starts sending each frame using the `screencastFrame` event. """

    INPUT_VALIDATOR = StartScreencastInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        format_: Literal['jpeg', 'png'] | None = None,
        quality: int | None = None,
        max_width: int | None = None,
        max_height: int | None = None,
        every_nth_frame: int | None = None
    ):
        super().__init__(
            format=format_,
            quality=quality,
            maxWidth=max_width,
            maxHeight=max_height,
            everyNthFrame=every_nth_frame
        )


class StopLoading(CDPMethod[None]):  # deprecated
    """ Force the page stop all navigations and pending resource fetches. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Crash(CDPMethod[None]):  # experimental deprecated
    """ Crashes renderer on the IO thread, generates minidumps. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class Close(CDPMethod[None]):  # deprecated
    """ Tries to close page, running its beforeunload hooks, if any. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetWebLifecycleStateInput(InputModel):

    state: Literal['frozen', 'active']  # deprecated


class SetWebLifecycleState(CDPMethod[None]):  # experimental deprecated
    """ Tries to update the web lifecycle state of the page.
    It will transition the page to the given state according to:
    https://github.com/WICG/web-lifecycle/ """

    INPUT_VALIDATOR = SetWebLifecycleStateInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        state: Literal['frozen', 'active']
    ):
        super().__init__(
            state=state
        )


class StopScreencast(CDPMethod[None]):  # experimental deprecated
    """ Stops sending each frame in the `screencastFrame`. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class ProduceCompilationCacheInput(InputModel):

    scripts: list[Page.CompilationCacheParams]


class ProduceCompilationCache(CDPMethod[None]):  # experimental deprecated
    """ Requests backend to produce compilation cache for the specified scripts.
    `scripts` are appended to the list of scripts for which the cache
    would be produced. The list may be reset during page navigation.
    When script with a matching URL is encountered, the cache is optionally
    produced upon backend discretion, based on internal heuristics.
    See also: `Page.compilationCacheProduced`. """

    INPUT_VALIDATOR = ProduceCompilationCacheInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        scripts: list[Page.CompilationCacheParams]
    ):
        super().__init__(
            scripts=scripts
        )


class AddCompilationCacheInput(InputModel):

    url: str
    data: str  # deprecated


class AddCompilationCache(CDPMethod[None]):  # experimental deprecated
    """ Seeds compilation cache for given url. Compilation cache does not survive
    cross-process navigation. """

    INPUT_VALIDATOR = AddCompilationCacheInput
    OUTPUT_VALIDATOR = None

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


class ClearCompilationCache(CDPMethod[None]):  # experimental deprecated
    """ Clears seeded compilation cache. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetSPCTransactionModeInput(InputModel):

    mode: Literal['none', 'autoAccept', 'autoChooseToAuthAnotherWay', 'autoReject', 'autoOptOut']


class SetSPCTransactionMode(CDPMethod[None]):  # experimental deprecated
    """ Sets the Secure Payment Confirmation transaction mode.
    https://w3c.github.io/secure-payment-confirmation/#sctn-automation-set-spc-transaction-mode """

    INPUT_VALIDATOR = SetSPCTransactionModeInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        mode: Literal['none', 'autoAccept', 'autoChooseToAuthAnotherWay', 'autoReject', 'autoOptOut']
    ):
        super().__init__(
            mode=mode
        )


class SetRPHRegistrationModeInput(InputModel):

    mode: Literal['none', 'autoAccept', 'autoReject']


class SetRPHRegistrationMode(CDPMethod[None]):  # experimental deprecated
    """ Extensions for Custom Handlers API:
    https://html.spec.whatwg.org/multipage/system-state.html#rph-automation """

    INPUT_VALIDATOR = SetRPHRegistrationModeInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        mode: Literal['none', 'autoAccept', 'autoReject']
    ):
        super().__init__(
            mode=mode
        )


class GenerateTestReportInput(InputModel):

    message: str  # deprecated
    group: str | None = None  # deprecated


class GenerateTestReport(CDPMethod[None]):  # experimental deprecated
    """ Generates a report for testing. """

    INPUT_VALIDATOR = GenerateTestReportInput
    OUTPUT_VALIDATOR = None

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


class WaitForDebugger(CDPMethod[None]):  # experimental deprecated
    """ Pauses page execution. Can be resumed using generic Runtime.runIfWaitingForDebugger. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetInterceptFileChooserDialogInput(InputModel):

    enabled: bool
    cancel: bool | None = None  # experimental deprecated


class SetInterceptFileChooserDialog(CDPMethod[None]):  # deprecated
    """ Intercept file chooser requests and transfer control to protocol clients.
    When file chooser interception is enabled, native file chooser dialog is not shown.
    Instead, a protocol event `Page.fileChooserOpened` is emitted. """

    INPUT_VALIDATOR = SetInterceptFileChooserDialogInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        enabled: bool,
        cancel: bool | None = None
    ):
        super().__init__(
            enabled=enabled,
            cancel=cancel
        )


class SetPrerenderingAllowedInput(InputModel):

    isAllowed: bool


class SetPrerenderingAllowed(CDPMethod[None]):  # experimental deprecated
    """ Enable/disable prerendering manually.

    This command is a short-term solution for https://crbug.com/1440085.
    See https://docs.google.com/document/d/12HVmFxYj5Jc-eJr5OmWsa2bqTJsbgGLKI6ZIyx0_wpA
    for more details.

    TODO(https://crbug.com/1440085): Remove this once Puppeteer supports tab targets. """

    INPUT_VALIDATOR = SetPrerenderingAllowedInput
    OUTPUT_VALIDATOR = None

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