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

This domain emulates different environments for the page.
https://chromedevtools.github.io/devtools-protocol/tot/Emulation/

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

from typing import Literal

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


class CanEmulateOutput(OutputModel):

    result: bool  # deprecated


class CanEmulate(CDPMethod[CanEmulateOutput]):  # deprecated
    """ Tells whether emulation is supported. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = CanEmulateOutput


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

    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 ResetPageScaleFactor(CDPMethod[None]):  # experimental deprecated
    """ Requests that page scale factor is reset to initial values. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetFocusEmulationEnabledInput(InputModel):

    enabled: bool  # deprecated


class SetFocusEmulationEnabled(CDPMethod[None]):  # experimental deprecated
    """ Enables or disables simulating a focused and active page. """

    INPUT_VALIDATOR = SetFocusEmulationEnabledInput
    OUTPUT_VALIDATOR = None

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


class SetAutoDarkModeOverrideInput(InputModel):

    enabled: bool | None = None  # deprecated


class SetAutoDarkModeOverride(CDPMethod[None]):  # experimental deprecated
    """ Automatically render all web contents using a dark theme. """

    INPUT_VALIDATOR = SetAutoDarkModeOverrideInput
    OUTPUT_VALIDATOR = None

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


class SetCPUThrottlingRateInput(InputModel):

    rate: float  # deprecated


class SetCPUThrottlingRate(CDPMethod[None]):  # deprecated
    """ Enables CPU throttling to emulate slow CPUs. """

    INPUT_VALIDATOR = SetCPUThrottlingRateInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        rate: float
    ):
        super().__init__(
            rate=rate
        )


class SetDefaultBackgroundColorOverrideInput(InputModel):

    color: DOM.RGBA | None = None  # deprecated


class SetDefaultBackgroundColorOverride(CDPMethod[None]):  # deprecated
    """ Sets or clears an override of the default background color of the frame. This override is used
    if the content does not specify one. """

    INPUT_VALIDATOR = SetDefaultBackgroundColorOverrideInput
    OUTPUT_VALIDATOR = None

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


class SetSafeAreaInsetsOverrideInput(InputModel):

    insets: Emulation.SafeAreaInsets


class SetSafeAreaInsetsOverride(CDPMethod[None]):  # experimental deprecated
    """ Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the
    respective variables to be undefined, even if previously overridden. """

    INPUT_VALIDATOR = SetSafeAreaInsetsOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        insets: Emulation.SafeAreaInsets
    ):
        super().__init__(
            insets=insets
        )


class SetDeviceMetricsOverrideInput(InputModel):

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


class SetDeviceMetricsOverride(CDPMethod[None]):  # 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,
        display_feature: Emulation.DisplayFeature | None = None,
        device_posture: Emulation.DevicePosture | 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,
            displayFeature=display_feature,
            devicePosture=device_posture
        )


class SetDevicePostureOverrideInput(InputModel):

    posture: Emulation.DevicePosture


class SetDevicePostureOverride(CDPMethod[None]):  # experimental deprecated
    """ Start reporting the given posture value to the Device Posture API.
    This override can also be set in setDeviceMetricsOverride(). """

    INPUT_VALIDATOR = SetDevicePostureOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        posture: Emulation.DevicePosture
    ):
        super().__init__(
            posture=posture
        )


class ClearDevicePostureOverride(CDPMethod[None]):  # experimental deprecated
    """ Clears a device posture override set with either setDeviceMetricsOverride()
    or setDevicePostureOverride() and starts using posture information from the
    platform again.
    Does nothing if no override is set. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetDisplayFeaturesOverrideInput(InputModel):

    features: list[Emulation.DisplayFeature]


class SetDisplayFeaturesOverride(CDPMethod[None]):  # experimental deprecated
    """ Start using the given display features to pupulate the Viewport Segments API.
    This override can also be set in setDeviceMetricsOverride(). """

    INPUT_VALIDATOR = SetDisplayFeaturesOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        features: list[Emulation.DisplayFeature]
    ):
        super().__init__(
            features=features
        )


class ClearDisplayFeaturesOverride(CDPMethod[None]):  # experimental deprecated
    """ Clears the display features override set with either setDeviceMetricsOverride()
    or setDisplayFeaturesOverride() and starts using display features from the
    platform again.
    Does nothing if no override is set. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetScrollbarsHiddenInput(InputModel):

    hidden: bool  # deprecated


class SetScrollbarsHidden(CDPMethod[None]):  # experimental

    INPUT_VALIDATOR = SetScrollbarsHiddenInput
    OUTPUT_VALIDATOR = None

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


class SetDocumentCookieDisabledInput(InputModel):

    disabled: bool  # deprecated


class SetDocumentCookieDisabled(CDPMethod[None]):  # experimental

    INPUT_VALIDATOR = SetDocumentCookieDisabledInput
    OUTPUT_VALIDATOR = None

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


class SetEmitTouchEventsForMouseInput(InputModel):

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


class SetEmitTouchEventsForMouse(CDPMethod[None]):  # experimental

    INPUT_VALIDATOR = SetEmitTouchEventsForMouseInput
    OUTPUT_VALIDATOR = None

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


class SetEmulatedMediaInput(InputModel):

    media: str | None = None  # deprecated
    features: list[Emulation.MediaFeature] | None = None  # deprecated


class SetEmulatedMedia(CDPMethod[None]):  # deprecated
    """ Emulates the given media type or media feature for CSS media queries. """

    INPUT_VALIDATOR = SetEmulatedMediaInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        media: str | None = None,
        features: list[Emulation.MediaFeature] | None = None
    ):
        super().__init__(
            media=media,
            features=features
        )


class SetEmulatedVisionDeficiencyInput(InputModel):

    type: Literal['none', 'blurredVision', 'reducedContrast', 'achromatopsia', 'deuteranopia', 'protanopia', 'tritanopia']  # deprecated


class SetEmulatedVisionDeficiency(CDPMethod[None]):  # deprecated
    """ Emulates the given vision deficiency. """

    INPUT_VALIDATOR = SetEmulatedVisionDeficiencyInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        type_: Literal['none', 'blurredVision', 'reducedContrast', 'achromatopsia', 'deuteranopia', 'protanopia', 'tritanopia']
    ):
        super().__init__(
            type=type_
        )


class SetEmulatedOSTextScaleInput(InputModel):

    scale: float | None = None


class SetEmulatedOSTextScale(CDPMethod[None]):  # deprecated
    """ Emulates the given OS text scale. """

    INPUT_VALIDATOR = SetEmulatedOSTextScaleInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        scale: float | None = None
    ):
        super().__init__(
            scale=scale
        )


class SetGeolocationOverrideInput(InputModel):

    latitude: float | None = None  # deprecated
    longitude: float | None = None  # deprecated
    accuracy: float | None = None  # deprecated
    altitude: float | None = None  # deprecated
    altitudeAccuracy: float | None = None  # deprecated
    heading: float | None = None  # deprecated
    speed: float | None = None  # deprecated


class SetGeolocationOverride(CDPMethod[None]):  # deprecated
    """ Overrides the Geolocation Position or Error. Omitting latitude, longitude or
    accuracy emulates position unavailable. """

    INPUT_VALIDATOR = SetGeolocationOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        latitude: float | None = None,
        longitude: float | None = None,
        accuracy: float | None = None,
        altitude: float | None = None,
        altitude_accuracy: float | None = None,
        heading: float | None = None,
        speed: float | None = None
    ):
        super().__init__(
            latitude=latitude,
            longitude=longitude,
            accuracy=accuracy,
            altitude=altitude,
            altitudeAccuracy=altitude_accuracy,
            heading=heading,
            speed=speed
        )


class GetOverriddenSensorInformationInput(InputModel):

    type: Emulation.SensorType


class GetOverriddenSensorInformationOutput(OutputModel):

    requestedSamplingFrequency: float


class GetOverriddenSensorInformation(CDPMethod[GetOverriddenSensorInformationOutput]):  # experimental

    INPUT_VALIDATOR = GetOverriddenSensorInformationInput
    OUTPUT_VALIDATOR = GetOverriddenSensorInformationOutput

    def __init__(
        self,
        *,
        type_: Emulation.SensorType
    ):
        super().__init__(
            type=type_
        )


class SetSensorOverrideEnabledInput(InputModel):

    enabled: bool
    type: Emulation.SensorType
    metadata: Emulation.SensorMetadata | None = None


class SetSensorOverrideEnabled(CDPMethod[None]):  # experimental deprecated
    """ Overrides a platform sensor of a given type. If |enabled| is true, calls to
    Sensor.start() will use a virtual sensor as backend rather than fetching
    data from a real hardware sensor. Otherwise, existing virtual
    sensor-backend Sensor objects will fire an error event and new calls to
    Sensor.start() will attempt to use a real sensor instead. """

    INPUT_VALIDATOR = SetSensorOverrideEnabledInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        enabled: bool,
        type_: Emulation.SensorType,
        metadata: Emulation.SensorMetadata | None = None
    ):
        super().__init__(
            enabled=enabled,
            type=type_,
            metadata=metadata
        )


class SetSensorOverrideReadingsInput(InputModel):

    type: Emulation.SensorType
    reading: Emulation.SensorReading


class SetSensorOverrideReadings(CDPMethod[None]):  # experimental deprecated
    """ Updates the sensor readings reported by a sensor type previously overridden
    by setSensorOverrideEnabled. """

    INPUT_VALIDATOR = SetSensorOverrideReadingsInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        type_: Emulation.SensorType,
        reading: Emulation.SensorReading
    ):
        super().__init__(
            type=type_,
            reading=reading
        )


class SetPressureSourceOverrideEnabledInput(InputModel):

    enabled: bool
    source: Emulation.PressureSource
    metadata: Emulation.PressureMetadata | None = None


class SetPressureSourceOverrideEnabled(CDPMethod[None]):  # experimental deprecated
    """ Overrides a pressure source of a given type, as used by the Compute
    Pressure API, so that updates to PressureObserver.observe() are provided
    via setPressureStateOverride instead of being retrieved from
    platform-provided telemetry data. """

    INPUT_VALIDATOR = SetPressureSourceOverrideEnabledInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        enabled: bool,
        source: Emulation.PressureSource,
        metadata: Emulation.PressureMetadata | None = None
    ):
        super().__init__(
            enabled=enabled,
            source=source,
            metadata=metadata
        )


class SetPressureStateOverrideInput(InputModel):

    source: Emulation.PressureSource
    state: Emulation.PressureState


class SetPressureStateOverride(CDPMethod[None]):  # experimental deprecated
    """ TODO: OBSOLETE: To remove when setPressureDataOverride is merged.
    Provides a given pressure state that will be processed and eventually be
    delivered to PressureObserver users. |source| must have been previously
    overridden by setPressureSourceOverrideEnabled. """

    INPUT_VALIDATOR = SetPressureStateOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        source: Emulation.PressureSource,
        state: Emulation.PressureState
    ):
        super().__init__(
            source=source,
            state=state
        )


class SetPressureDataOverrideInput(InputModel):

    source: Emulation.PressureSource
    state: Emulation.PressureState
    ownContributionEstimate: float | None = None


class SetPressureDataOverride(CDPMethod[None]):  # experimental deprecated
    """ Provides a given pressure data set that will be processed and eventually be
    delivered to PressureObserver users. |source| must have been previously
    overridden by setPressureSourceOverrideEnabled. """

    INPUT_VALIDATOR = SetPressureDataOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        source: Emulation.PressureSource,
        state: Emulation.PressureState,
        own_contribution_estimate: float | None = None
    ):
        super().__init__(
            source=source,
            state=state,
            ownContributionEstimate=own_contribution_estimate
        )


class SetIdleOverrideInput(InputModel):

    isUserActive: bool  # deprecated
    isScreenUnlocked: bool  # deprecated


class SetIdleOverride(CDPMethod[None]):  # deprecated
    """ Overrides the Idle state. """

    INPUT_VALIDATOR = SetIdleOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        is_user_active: bool,
        is_screen_unlocked: bool
    ):
        super().__init__(
            isUserActive=is_user_active,
            isScreenUnlocked=is_screen_unlocked
        )


class ClearIdleOverride(CDPMethod[None]):  # deprecated
    """ Clears Idle state overrides. """

    INPUT_VALIDATOR = None
    OUTPUT_VALIDATOR = None


class SetNavigatorOverridesInput(InputModel):

    platform: str  # deprecated


class SetNavigatorOverrides(CDPMethod[None]):  # experimental deprecated
    """ Overrides value returned by the javascript navigator object. """

    INPUT_VALIDATOR = SetNavigatorOverridesInput
    OUTPUT_VALIDATOR = None

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


class SetPageScaleFactorInput(InputModel):

    pageScaleFactor: float  # deprecated


class SetPageScaleFactor(CDPMethod[None]):  # experimental deprecated
    """ Sets a specified page scale factor. """

    INPUT_VALIDATOR = SetPageScaleFactorInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        page_scale_factor: float
    ):
        super().__init__(
            pageScaleFactor=page_scale_factor
        )


class SetScriptExecutionDisabledInput(InputModel):

    value: bool  # deprecated


class SetScriptExecutionDisabled(CDPMethod[None]):  # deprecated
    """ Switches script execution in the page. """

    INPUT_VALIDATOR = SetScriptExecutionDisabledInput
    OUTPUT_VALIDATOR = None

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


class SetTouchEmulationEnabledInput(InputModel):

    enabled: bool  # deprecated
    maxTouchPoints: int | None = None  # deprecated


class SetTouchEmulationEnabled(CDPMethod[None]):  # deprecated
    """ Enables touch on platforms which do not support them. """

    INPUT_VALIDATOR = SetTouchEmulationEnabledInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        enabled: bool,
        max_touch_points: int | None = None
    ):
        super().__init__(
            enabled=enabled,
            maxTouchPoints=max_touch_points
        )


class SetVirtualTimePolicyInput(InputModel):

    policy: Emulation.VirtualTimePolicy
    budget: float | None = None  # deprecated
    maxVirtualTimeTaskStarvationCount: int | None = None  # deprecated
    initialVirtualTime: Network.TimeSinceEpoch | None = None  # deprecated


class SetVirtualTimePolicyOutput(OutputModel):

    virtualTimeTicksBase: float  # deprecated


class SetVirtualTimePolicy(CDPMethod[SetVirtualTimePolicyOutput]):  # experimental deprecated
    """ Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets
    the current virtual time policy.  Note this supersedes any previous time budget. """

    INPUT_VALIDATOR = SetVirtualTimePolicyInput
    OUTPUT_VALIDATOR = SetVirtualTimePolicyOutput

    def __init__(
        self,
        *,
        policy: Emulation.VirtualTimePolicy,
        budget: float | None = None,
        max_virtual_time_task_starvation_count: int | None = None,
        initial_virtual_time: Network.TimeSinceEpoch | None = None
    ):
        super().__init__(
            policy=policy,
            budget=budget,
            maxVirtualTimeTaskStarvationCount=max_virtual_time_task_starvation_count,
            initialVirtualTime=initial_virtual_time
        )


class SetLocaleOverrideInput(InputModel):

    locale: str | None = None  # deprecated


class SetLocaleOverride(CDPMethod[None]):  # experimental deprecated
    """ Overrides default host system locale with the specified one. """

    INPUT_VALIDATOR = SetLocaleOverrideInput
    OUTPUT_VALIDATOR = None

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


class SetTimezoneOverrideInput(InputModel):

    timezoneId: str  # deprecated


class SetTimezoneOverride(CDPMethod[None]):  # deprecated
    """ Overrides default host system timezone with the specified one. """

    INPUT_VALIDATOR = SetTimezoneOverrideInput
    OUTPUT_VALIDATOR = None

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


class SetVisibleSizeInput(InputModel):

    width: int  # deprecated
    height: int  # deprecated


class SetVisibleSize(CDPMethod[None]):  # experimental deprecated
    """ Resizes the frame/viewport of the page. Note that this does not affect the frame's container
    (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported
    on Android. """

    INPUT_VALIDATOR = SetVisibleSizeInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        width: int,
        height: int
    ):
        super().__init__(
            width=width,
            height=height
        )


class SetDisabledImageTypesInput(InputModel):

    imageTypes: list[Emulation.DisabledImageType]  # deprecated


class SetDisabledImageTypes(CDPMethod[None]):  # experimental

    INPUT_VALIDATOR = SetDisabledImageTypesInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        image_types: list[Emulation.DisabledImageType]
    ):
        super().__init__(
            imageTypes=image_types
        )


class SetHardwareConcurrencyOverrideInput(InputModel):

    hardwareConcurrency: int  # deprecated


class SetHardwareConcurrencyOverride(CDPMethod[None]):  # experimental

    INPUT_VALIDATOR = SetHardwareConcurrencyOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        hardware_concurrency: int
    ):
        super().__init__(
            hardwareConcurrency=hardware_concurrency
        )


class SetUserAgentOverrideInput(InputModel):

    userAgent: str  # deprecated
    acceptLanguage: str | None = None  # deprecated
    platform: str | None = None  # deprecated
    userAgentMetadata: Emulation.UserAgentMetadata | None = None  # experimental deprecated


class SetUserAgentOverride(CDPMethod[None]):  # deprecated
    """ Allows overriding user agent with the given string.
    `userAgentMetadata` must be set for Client Hint headers to be sent. """

    INPUT_VALIDATOR = SetUserAgentOverrideInput
    OUTPUT_VALIDATOR = None

    def __init__(
        self,
        *,
        user_agent: str,
        accept_language: str | None = None,
        platform: str | None = None,
        user_agent_metadata: Emulation.UserAgentMetadata | None = None
    ):
        super().__init__(
            userAgent=user_agent,
            acceptLanguage=accept_language,
            platform=platform,
            userAgentMetadata=user_agent_metadata
        )


class SetAutomationOverrideInput(InputModel):

    enabled: bool  # deprecated


class SetAutomationOverride(CDPMethod[None]):  # experimental deprecated
    """ Allows overriding the automation flag. """

    INPUT_VALIDATOR = SetAutomationOverrideInput
    OUTPUT_VALIDATOR = None

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


class SetSmallViewportHeightDifferenceOverrideInput(InputModel):

    difference: int  # deprecated


class SetSmallViewportHeightDifferenceOverride(CDPMethod[None]):  # experimental deprecated
    """ Allows overriding the difference between the small and large viewport sizes, which determine the
    value of the `svh` and `lvh` unit, respectively. Only supported for top-level frames. """

    INPUT_VALIDATOR = SetSmallViewportHeightDifferenceOverrideInput
    OUTPUT_VALIDATOR = None

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