Skip to main content

rustenium_cdp_definitions/browser_protocol/emulation/
commands.rs

1use serde::{Deserialize, Serialize};
2#[doc = "Clears the overridden device metrics.\n[clearDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDeviceMetricsOverride)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct ClearDeviceMetricsOverrideParams {}
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6pub enum ClearDeviceMetricsOverrideMethod {
7    #[serde(rename = "Emulation.clearDeviceMetricsOverride")]
8    ClearDeviceMetricsOverride,
9}
10#[doc = "Clears the overridden device metrics.\n[clearDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDeviceMetricsOverride)"]
11#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12pub struct ClearDeviceMetricsOverride {
13    pub method: ClearDeviceMetricsOverrideMethod,
14    pub params: ClearDeviceMetricsOverrideParams,
15}
16impl ClearDeviceMetricsOverride {
17    pub const IDENTIFIER: &'static str = "Emulation.clearDeviceMetricsOverride";
18    pub fn identifier(&self) -> &'static str {
19        Self::IDENTIFIER
20    }
21}
22impl crate::CommandResult for ClearDeviceMetricsOverride {
23    type Result = super::results::ClearDeviceMetricsOverrideResult;
24}
25#[doc = "Clears the overridden Geolocation Position and Error.\n[clearGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearGeolocationOverride)"]
26#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
27pub struct ClearGeolocationOverrideParams {}
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub enum ClearGeolocationOverrideMethod {
30    #[serde(rename = "Emulation.clearGeolocationOverride")]
31    ClearGeolocationOverride,
32}
33#[doc = "Clears the overridden Geolocation Position and Error.\n[clearGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearGeolocationOverride)"]
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct ClearGeolocationOverride {
36    pub method: ClearGeolocationOverrideMethod,
37    pub params: ClearGeolocationOverrideParams,
38}
39impl ClearGeolocationOverride {
40    pub const IDENTIFIER: &'static str = "Emulation.clearGeolocationOverride";
41    pub fn identifier(&self) -> &'static str {
42        Self::IDENTIFIER
43    }
44}
45impl crate::CommandResult for ClearGeolocationOverride {
46    type Result = super::results::ClearGeolocationOverrideResult;
47}
48#[doc = "Requests that page scale factor is reset to initial values.\n[resetPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-resetPageScaleFactor)"]
49#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
50pub struct ResetPageScaleFactorParams {}
51#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
52pub enum ResetPageScaleFactorMethod {
53    #[serde(rename = "Emulation.resetPageScaleFactor")]
54    ResetPageScaleFactor,
55}
56#[doc = "Requests that page scale factor is reset to initial values.\n[resetPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-resetPageScaleFactor)"]
57#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
58pub struct ResetPageScaleFactor {
59    pub method: ResetPageScaleFactorMethod,
60    pub params: ResetPageScaleFactorParams,
61}
62impl ResetPageScaleFactor {
63    pub const IDENTIFIER: &'static str = "Emulation.resetPageScaleFactor";
64    pub fn identifier(&self) -> &'static str {
65        Self::IDENTIFIER
66    }
67}
68impl crate::CommandResult for ResetPageScaleFactor {
69    type Result = super::results::ResetPageScaleFactorResult;
70}
71#[doc = "Enables or disables simulating a focused and active page.\n[setFocusEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setFocusEmulationEnabled)"]
72#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
73pub struct SetFocusEmulationEnabledParams {
74    #[doc = "Whether to enable to disable focus emulation."]
75    #[serde(rename = "enabled")]
76    pub enabled: bool,
77}
78impl SetFocusEmulationEnabledParams {
79    pub fn new(enabled: impl Into<bool>) -> Self {
80        Self {
81            enabled: enabled.into(),
82        }
83    }
84}
85#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
86pub enum SetFocusEmulationEnabledMethod {
87    #[serde(rename = "Emulation.setFocusEmulationEnabled")]
88    SetFocusEmulationEnabled,
89}
90#[doc = "Enables or disables simulating a focused and active page.\n[setFocusEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setFocusEmulationEnabled)"]
91#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
92pub struct SetFocusEmulationEnabled {
93    pub method: SetFocusEmulationEnabledMethod,
94    pub params: SetFocusEmulationEnabledParams,
95}
96impl SetFocusEmulationEnabled {
97    pub const IDENTIFIER: &'static str = "Emulation.setFocusEmulationEnabled";
98    pub fn identifier(&self) -> &'static str {
99        Self::IDENTIFIER
100    }
101}
102impl crate::CommandResult for SetFocusEmulationEnabled {
103    type Result = super::results::SetFocusEmulationEnabledResult;
104}
105#[doc = "Automatically render all web contents using a dark theme.\n[setAutoDarkModeOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutoDarkModeOverride)"]
106#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
107pub struct SetAutoDarkModeOverrideParams {
108    #[doc = "Whether to enable or disable automatic dark mode.\nIf not specified, any existing override will be cleared."]
109    #[serde(rename = "enabled")]
110    #[serde(skip_serializing_if = "Option::is_none")]
111    #[serde(default)]
112    pub enabled: Option<bool>,
113}
114#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
115pub enum SetAutoDarkModeOverrideMethod {
116    #[serde(rename = "Emulation.setAutoDarkModeOverride")]
117    SetAutoDarkModeOverride,
118}
119#[doc = "Automatically render all web contents using a dark theme.\n[setAutoDarkModeOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutoDarkModeOverride)"]
120#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
121pub struct SetAutoDarkModeOverride {
122    pub method: SetAutoDarkModeOverrideMethod,
123    pub params: SetAutoDarkModeOverrideParams,
124}
125impl SetAutoDarkModeOverride {
126    pub const IDENTIFIER: &'static str = "Emulation.setAutoDarkModeOverride";
127    pub fn identifier(&self) -> &'static str {
128        Self::IDENTIFIER
129    }
130}
131impl crate::CommandResult for SetAutoDarkModeOverride {
132    type Result = super::results::SetAutoDarkModeOverrideResult;
133}
134#[doc = "Enables CPU throttling to emulate slow CPUs.\n[setCPUThrottlingRate](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate)"]
135#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
136pub struct SetCpuThrottlingRateParams {
137    #[doc = "Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc)."]
138    #[serde(rename = "rate")]
139    pub rate: f64,
140}
141impl SetCpuThrottlingRateParams {
142    pub fn new(rate: impl Into<f64>) -> Self {
143        Self { rate: rate.into() }
144    }
145}
146#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
147pub enum SetCpuThrottlingRateMethod {
148    #[serde(rename = "Emulation.setCPUThrottlingRate")]
149    SetCpuThrottlingRate,
150}
151#[doc = "Enables CPU throttling to emulate slow CPUs.\n[setCPUThrottlingRate](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate)"]
152#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
153pub struct SetCpuThrottlingRate {
154    pub method: SetCpuThrottlingRateMethod,
155    pub params: SetCpuThrottlingRateParams,
156}
157impl SetCpuThrottlingRate {
158    pub const IDENTIFIER: &'static str = "Emulation.setCPUThrottlingRate";
159    pub fn identifier(&self) -> &'static str {
160        Self::IDENTIFIER
161    }
162}
163impl crate::CommandResult for SetCpuThrottlingRate {
164    type Result = super::results::SetCpuThrottlingRateResult;
165}
166#[doc = "Sets or clears an override of the default background color of the frame. This override is used\nif the content does not specify one.\n[setDefaultBackgroundColorOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDefaultBackgroundColorOverride)"]
167#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
168pub struct SetDefaultBackgroundColorOverrideParams {
169    #[doc = "RGBA of the default background color. If not specified, any existing override will be\ncleared."]
170    #[serde(rename = "color")]
171    #[serde(skip_serializing_if = "Option::is_none")]
172    #[serde(default)]
173    pub color: Option<crate::browser_protocol::dom::types::Rgba>,
174}
175#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
176pub enum SetDefaultBackgroundColorOverrideMethod {
177    #[serde(rename = "Emulation.setDefaultBackgroundColorOverride")]
178    SetDefaultBackgroundColorOverride,
179}
180#[doc = "Sets or clears an override of the default background color of the frame. This override is used\nif the content does not specify one.\n[setDefaultBackgroundColorOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDefaultBackgroundColorOverride)"]
181#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
182pub struct SetDefaultBackgroundColorOverride {
183    pub method: SetDefaultBackgroundColorOverrideMethod,
184    pub params: SetDefaultBackgroundColorOverrideParams,
185}
186impl SetDefaultBackgroundColorOverride {
187    pub const IDENTIFIER: &'static str = "Emulation.setDefaultBackgroundColorOverride";
188    pub fn identifier(&self) -> &'static str {
189        Self::IDENTIFIER
190    }
191}
192impl crate::CommandResult for SetDefaultBackgroundColorOverride {
193    type Result = super::results::SetDefaultBackgroundColorOverrideResult;
194}
195#[doc = "Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the\nrespective variables to be undefined, even if previously overridden.\n[setSafeAreaInsetsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSafeAreaInsetsOverride)"]
196#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
197pub struct SetSafeAreaInsetsOverrideParams {
198    #[serde(rename = "insets")]
199    pub insets: super::types::SafeAreaInsets,
200}
201impl SetSafeAreaInsetsOverrideParams {
202    pub fn new(insets: impl Into<super::types::SafeAreaInsets>) -> Self {
203        Self {
204            insets: insets.into(),
205        }
206    }
207}
208#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
209pub enum SetSafeAreaInsetsOverrideMethod {
210    #[serde(rename = "Emulation.setSafeAreaInsetsOverride")]
211    SetSafeAreaInsetsOverride,
212}
213#[doc = "Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the\nrespective variables to be undefined, even if previously overridden.\n[setSafeAreaInsetsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSafeAreaInsetsOverride)"]
214#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
215pub struct SetSafeAreaInsetsOverride {
216    pub method: SetSafeAreaInsetsOverrideMethod,
217    pub params: SetSafeAreaInsetsOverrideParams,
218}
219impl SetSafeAreaInsetsOverride {
220    pub const IDENTIFIER: &'static str = "Emulation.setSafeAreaInsetsOverride";
221    pub fn identifier(&self) -> &'static str {
222        Self::IDENTIFIER
223    }
224}
225impl crate::CommandResult for SetSafeAreaInsetsOverride {
226    type Result = super::results::SetSafeAreaInsetsOverrideResult;
227}
228#[doc = "Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\nwindow.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media\nquery results).\n[setDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDeviceMetricsOverride)"]
229#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
230pub struct SetDeviceMetricsOverrideParams {
231    #[doc = "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override."]
232    #[serde(rename = "width")]
233    pub width: i64,
234    #[doc = "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override."]
235    #[serde(rename = "height")]
236    pub height: i64,
237    #[doc = "Overriding device scale factor value. 0 disables the override."]
238    #[serde(rename = "deviceScaleFactor")]
239    pub device_scale_factor: f64,
240    #[doc = "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text\nautosizing and more."]
241    #[serde(rename = "mobile")]
242    pub mobile: bool,
243    #[doc = "Scale to apply to resulting view image."]
244    #[serde(rename = "scale")]
245    #[serde(skip_serializing_if = "Option::is_none")]
246    #[serde(default)]
247    pub scale: Option<f64>,
248    #[doc = "Overriding screen width value in pixels (minimum 0, maximum 10000000)."]
249    #[serde(rename = "screenWidth")]
250    #[serde(skip_serializing_if = "Option::is_none")]
251    #[serde(default)]
252    pub screen_width: Option<i64>,
253    #[doc = "Overriding screen height value in pixels (minimum 0, maximum 10000000)."]
254    #[serde(rename = "screenHeight")]
255    #[serde(skip_serializing_if = "Option::is_none")]
256    #[serde(default)]
257    pub screen_height: Option<i64>,
258    #[doc = "Overriding view X position on screen in pixels (minimum 0, maximum 10000000)."]
259    #[serde(rename = "positionX")]
260    #[serde(skip_serializing_if = "Option::is_none")]
261    #[serde(default)]
262    pub position_x: Option<i64>,
263    #[doc = "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000)."]
264    #[serde(rename = "positionY")]
265    #[serde(skip_serializing_if = "Option::is_none")]
266    #[serde(default)]
267    pub position_y: Option<i64>,
268    #[doc = "Do not set visible view size, rely upon explicit setVisibleSize call."]
269    #[serde(rename = "dontSetVisibleSize")]
270    #[serde(skip_serializing_if = "Option::is_none")]
271    #[serde(default)]
272    pub dont_set_visible_size: Option<bool>,
273    #[doc = "Screen orientation override."]
274    #[serde(rename = "screenOrientation")]
275    #[serde(skip_serializing_if = "Option::is_none")]
276    #[serde(default)]
277    pub screen_orientation: Option<super::types::ScreenOrientation>,
278    #[doc = "If set, the visible area of the page will be overridden to this viewport. This viewport\nchange is not observed by the page, e.g. viewport-relative elements do not change positions."]
279    #[serde(rename = "viewport")]
280    #[serde(skip_serializing_if = "Option::is_none")]
281    #[serde(default)]
282    pub viewport: Option<crate::browser_protocol::page::types::Viewport>,
283    #[doc = "Scrollbar type. Default: `default`."]
284    #[serde(rename = "scrollbarType")]
285    #[serde(skip_serializing_if = "Option::is_none")]
286    #[serde(default)]
287    pub scrollbar_type: Option<SetDeviceMetricsOverrideScrollbarType>,
288}
289#[doc = "Scrollbar type. Default: `default`."]
290#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
291pub enum SetDeviceMetricsOverrideScrollbarType {
292    #[doc = "Emulates scrollbars that float over the content, typically appearing\nonly when scrolling."]
293    #[serde(rename = "overlay")]
294    Overlay,
295    #[doc = "Restores the platform's default scrollbar behavior, which might be\nclassic (occupying space within the layout) or overlay, depending\non the platform. Note: if `mobile` is `true`, the default scrollbar type is `overlay`."]
296    #[serde(rename = "default")]
297    Default,
298}
299impl SetDeviceMetricsOverrideParams {
300    pub fn new(
301        width: impl Into<i64>,
302        height: impl Into<i64>,
303        device_scale_factor: impl Into<f64>,
304        mobile: impl Into<bool>,
305    ) -> Self {
306        Self {
307            width: width.into(),
308            height: height.into(),
309            device_scale_factor: device_scale_factor.into(),
310            mobile: mobile.into(),
311            scale: None,
312            screen_width: None,
313            screen_height: None,
314            position_x: None,
315            position_y: None,
316            dont_set_visible_size: None,
317            screen_orientation: None,
318            viewport: None,
319            scrollbar_type: None,
320        }
321    }
322}
323#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
324pub enum SetDeviceMetricsOverrideMethod {
325    #[serde(rename = "Emulation.setDeviceMetricsOverride")]
326    SetDeviceMetricsOverride,
327}
328#[doc = "Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\nwindow.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media\nquery results).\n[setDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDeviceMetricsOverride)"]
329#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
330pub struct SetDeviceMetricsOverride {
331    pub method: SetDeviceMetricsOverrideMethod,
332    pub params: SetDeviceMetricsOverrideParams,
333}
334impl SetDeviceMetricsOverride {
335    pub const IDENTIFIER: &'static str = "Emulation.setDeviceMetricsOverride";
336    pub fn identifier(&self) -> &'static str {
337        Self::IDENTIFIER
338    }
339}
340impl crate::CommandResult for SetDeviceMetricsOverride {
341    type Result = super::results::SetDeviceMetricsOverrideResult;
342}
343#[doc = "Start reporting the given posture value to the Device Posture API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDevicePostureOverride)"]
344#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
345pub struct SetDevicePostureOverrideParams {
346    #[serde(rename = "posture")]
347    pub posture: super::types::DevicePosture,
348}
349impl SetDevicePostureOverrideParams {
350    pub fn new(posture: impl Into<super::types::DevicePosture>) -> Self {
351        Self {
352            posture: posture.into(),
353        }
354    }
355}
356#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
357pub enum SetDevicePostureOverrideMethod {
358    #[serde(rename = "Emulation.setDevicePostureOverride")]
359    SetDevicePostureOverride,
360}
361#[doc = "Start reporting the given posture value to the Device Posture API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDevicePostureOverride)"]
362#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
363pub struct SetDevicePostureOverride {
364    pub method: SetDevicePostureOverrideMethod,
365    pub params: SetDevicePostureOverrideParams,
366}
367impl SetDevicePostureOverride {
368    pub const IDENTIFIER: &'static str = "Emulation.setDevicePostureOverride";
369    pub fn identifier(&self) -> &'static str {
370        Self::IDENTIFIER
371    }
372}
373impl crate::CommandResult for SetDevicePostureOverride {
374    type Result = super::results::SetDevicePostureOverrideResult;
375}
376#[doc = "Clears a device posture override set with either setDeviceMetricsOverride()\nor setDevicePostureOverride() and starts using posture information from the\nplatform again.\nDoes nothing if no override is set.\n[clearDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDevicePostureOverride)"]
377#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
378pub struct ClearDevicePostureOverrideParams {}
379#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
380pub enum ClearDevicePostureOverrideMethod {
381    #[serde(rename = "Emulation.clearDevicePostureOverride")]
382    ClearDevicePostureOverride,
383}
384#[doc = "Clears a device posture override set with either setDeviceMetricsOverride()\nor setDevicePostureOverride() and starts using posture information from the\nplatform again.\nDoes nothing if no override is set.\n[clearDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDevicePostureOverride)"]
385#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
386pub struct ClearDevicePostureOverride {
387    pub method: ClearDevicePostureOverrideMethod,
388    pub params: ClearDevicePostureOverrideParams,
389}
390impl ClearDevicePostureOverride {
391    pub const IDENTIFIER: &'static str = "Emulation.clearDevicePostureOverride";
392    pub fn identifier(&self) -> &'static str {
393        Self::IDENTIFIER
394    }
395}
396impl crate::CommandResult for ClearDevicePostureOverride {
397    type Result = super::results::ClearDevicePostureOverrideResult;
398}
399#[doc = "Start using the given display features to pupulate the Viewport Segments API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDisplayFeaturesOverride)"]
400#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
401pub struct SetDisplayFeaturesOverrideParams {
402    #[serde(rename = "features")]
403    #[serde(skip_serializing_if = "Vec::is_empty")]
404    pub features: Vec<super::types::DisplayFeature>,
405}
406impl SetDisplayFeaturesOverrideParams {
407    pub fn new(features: Vec<super::types::DisplayFeature>) -> Self {
408        Self { features }
409    }
410}
411#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
412pub enum SetDisplayFeaturesOverrideMethod {
413    #[serde(rename = "Emulation.setDisplayFeaturesOverride")]
414    SetDisplayFeaturesOverride,
415}
416#[doc = "Start using the given display features to pupulate the Viewport Segments API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDisplayFeaturesOverride)"]
417#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
418pub struct SetDisplayFeaturesOverride {
419    pub method: SetDisplayFeaturesOverrideMethod,
420    pub params: SetDisplayFeaturesOverrideParams,
421}
422impl SetDisplayFeaturesOverride {
423    pub const IDENTIFIER: &'static str = "Emulation.setDisplayFeaturesOverride";
424    pub fn identifier(&self) -> &'static str {
425        Self::IDENTIFIER
426    }
427}
428impl crate::CommandResult for SetDisplayFeaturesOverride {
429    type Result = super::results::SetDisplayFeaturesOverrideResult;
430}
431#[doc = "Clears the display features override set with either setDeviceMetricsOverride()\nor setDisplayFeaturesOverride() and starts using display features from the\nplatform again.\nDoes nothing if no override is set.\n[clearDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDisplayFeaturesOverride)"]
432#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
433pub struct ClearDisplayFeaturesOverrideParams {}
434#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
435pub enum ClearDisplayFeaturesOverrideMethod {
436    #[serde(rename = "Emulation.clearDisplayFeaturesOverride")]
437    ClearDisplayFeaturesOverride,
438}
439#[doc = "Clears the display features override set with either setDeviceMetricsOverride()\nor setDisplayFeaturesOverride() and starts using display features from the\nplatform again.\nDoes nothing if no override is set.\n[clearDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDisplayFeaturesOverride)"]
440#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
441pub struct ClearDisplayFeaturesOverride {
442    pub method: ClearDisplayFeaturesOverrideMethod,
443    pub params: ClearDisplayFeaturesOverrideParams,
444}
445impl ClearDisplayFeaturesOverride {
446    pub const IDENTIFIER: &'static str = "Emulation.clearDisplayFeaturesOverride";
447    pub fn identifier(&self) -> &'static str {
448        Self::IDENTIFIER
449    }
450}
451impl crate::CommandResult for ClearDisplayFeaturesOverride {
452    type Result = super::results::ClearDisplayFeaturesOverrideResult;
453}
454#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
455pub struct SetScrollbarsHiddenParams {
456    #[doc = "Whether scrollbars should be always hidden."]
457    #[serde(rename = "hidden")]
458    pub hidden: bool,
459}
460impl SetScrollbarsHiddenParams {
461    pub fn new(hidden: impl Into<bool>) -> Self {
462        Self {
463            hidden: hidden.into(),
464        }
465    }
466}
467#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
468pub enum SetScrollbarsHiddenMethod {
469    #[serde(rename = "Emulation.setScrollbarsHidden")]
470    SetScrollbarsHidden,
471}
472#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
473pub struct SetScrollbarsHidden {
474    pub method: SetScrollbarsHiddenMethod,
475    pub params: SetScrollbarsHiddenParams,
476}
477impl SetScrollbarsHidden {
478    pub const IDENTIFIER: &'static str = "Emulation.setScrollbarsHidden";
479    pub fn identifier(&self) -> &'static str {
480        Self::IDENTIFIER
481    }
482}
483impl crate::CommandResult for SetScrollbarsHidden {
484    type Result = super::results::SetScrollbarsHiddenResult;
485}
486#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
487pub struct SetDocumentCookieDisabledParams {
488    #[doc = "Whether document.coookie API should be disabled."]
489    #[serde(rename = "disabled")]
490    pub disabled: bool,
491}
492impl SetDocumentCookieDisabledParams {
493    pub fn new(disabled: impl Into<bool>) -> Self {
494        Self {
495            disabled: disabled.into(),
496        }
497    }
498}
499#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
500pub enum SetDocumentCookieDisabledMethod {
501    #[serde(rename = "Emulation.setDocumentCookieDisabled")]
502    SetDocumentCookieDisabled,
503}
504#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
505pub struct SetDocumentCookieDisabled {
506    pub method: SetDocumentCookieDisabledMethod,
507    pub params: SetDocumentCookieDisabledParams,
508}
509impl SetDocumentCookieDisabled {
510    pub const IDENTIFIER: &'static str = "Emulation.setDocumentCookieDisabled";
511    pub fn identifier(&self) -> &'static str {
512        Self::IDENTIFIER
513    }
514}
515impl crate::CommandResult for SetDocumentCookieDisabled {
516    type Result = super::results::SetDocumentCookieDisabledResult;
517}
518#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
519pub struct SetEmitTouchEventsForMouseParams {
520    #[doc = "Whether touch emulation based on mouse input should be enabled."]
521    #[serde(rename = "enabled")]
522    pub enabled: bool,
523    #[doc = "Touch/gesture events configuration. Default: current platform."]
524    #[serde(rename = "configuration")]
525    #[serde(skip_serializing_if = "Option::is_none")]
526    #[serde(default)]
527    pub configuration: Option<SetEmitTouchEventsForMouseConfiguration>,
528}
529#[doc = "Touch/gesture events configuration. Default: current platform."]
530#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
531pub enum SetEmitTouchEventsForMouseConfiguration {
532    #[serde(rename = "mobile")]
533    Mobile,
534    #[serde(rename = "desktop")]
535    Desktop,
536}
537impl SetEmitTouchEventsForMouseParams {
538    pub fn new(enabled: impl Into<bool>) -> Self {
539        Self {
540            enabled: enabled.into(),
541            configuration: None,
542        }
543    }
544}
545#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
546pub enum SetEmitTouchEventsForMouseMethod {
547    #[serde(rename = "Emulation.setEmitTouchEventsForMouse")]
548    SetEmitTouchEventsForMouse,
549}
550#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
551pub struct SetEmitTouchEventsForMouse {
552    pub method: SetEmitTouchEventsForMouseMethod,
553    pub params: SetEmitTouchEventsForMouseParams,
554}
555impl SetEmitTouchEventsForMouse {
556    pub const IDENTIFIER: &'static str = "Emulation.setEmitTouchEventsForMouse";
557    pub fn identifier(&self) -> &'static str {
558        Self::IDENTIFIER
559    }
560}
561impl crate::CommandResult for SetEmitTouchEventsForMouse {
562    type Result = super::results::SetEmitTouchEventsForMouseResult;
563}
564#[doc = "Emulates the given media type or media feature for CSS media queries.\n[setEmulatedMedia](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia)"]
565#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
566pub struct SetEmulatedMediaParams {
567    #[doc = "Media type to emulate. Empty string disables the override."]
568    #[serde(rename = "media")]
569    #[serde(skip_serializing_if = "Option::is_none")]
570    #[serde(default)]
571    pub media: Option<String>,
572    #[doc = "Media features to emulate."]
573    #[serde(rename = "features")]
574    #[serde(skip_serializing_if = "Option::is_none")]
575    #[serde(default)]
576    pub features: Option<Vec<super::types::MediaFeature>>,
577}
578#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
579pub enum SetEmulatedMediaMethod {
580    #[serde(rename = "Emulation.setEmulatedMedia")]
581    SetEmulatedMedia,
582}
583#[doc = "Emulates the given media type or media feature for CSS media queries.\n[setEmulatedMedia](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia)"]
584#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
585pub struct SetEmulatedMedia {
586    pub method: SetEmulatedMediaMethod,
587    pub params: SetEmulatedMediaParams,
588}
589impl SetEmulatedMedia {
590    pub const IDENTIFIER: &'static str = "Emulation.setEmulatedMedia";
591    pub fn identifier(&self) -> &'static str {
592        Self::IDENTIFIER
593    }
594}
595impl crate::CommandResult for SetEmulatedMedia {
596    type Result = super::results::SetEmulatedMediaResult;
597}
598#[doc = "Emulates the given vision deficiency.\n[setEmulatedVisionDeficiency](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedVisionDeficiency)"]
599#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
600pub struct SetEmulatedVisionDeficiencyParams {
601    #[doc = "Vision deficiency to emulate. Order: best-effort emulations come first, followed by any\nphysiologically accurate emulations for medically recognized color vision deficiencies."]
602    #[serde(rename = "type")]
603    pub r#type: SetEmulatedVisionDeficiencyType,
604}
605#[doc = "Vision deficiency to emulate. Order: best-effort emulations come first, followed by any\nphysiologically accurate emulations for medically recognized color vision deficiencies."]
606#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
607pub enum SetEmulatedVisionDeficiencyType {
608    #[serde(rename = "none")]
609    None,
610    #[serde(rename = "blurredVision")]
611    BlurredVision,
612    #[serde(rename = "reducedContrast")]
613    ReducedContrast,
614    #[serde(rename = "achromatopsia")]
615    Achromatopsia,
616    #[serde(rename = "deuteranopia")]
617    Deuteranopia,
618    #[serde(rename = "protanopia")]
619    Protanopia,
620    #[serde(rename = "tritanopia")]
621    Tritanopia,
622}
623impl SetEmulatedVisionDeficiencyParams {
624    pub fn new(r#type: impl Into<SetEmulatedVisionDeficiencyType>) -> Self {
625        Self {
626            r#type: r#type.into(),
627        }
628    }
629}
630#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
631pub enum SetEmulatedVisionDeficiencyMethod {
632    #[serde(rename = "Emulation.setEmulatedVisionDeficiency")]
633    SetEmulatedVisionDeficiency,
634}
635#[doc = "Emulates the given vision deficiency.\n[setEmulatedVisionDeficiency](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedVisionDeficiency)"]
636#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
637pub struct SetEmulatedVisionDeficiency {
638    pub method: SetEmulatedVisionDeficiencyMethod,
639    pub params: SetEmulatedVisionDeficiencyParams,
640}
641impl SetEmulatedVisionDeficiency {
642    pub const IDENTIFIER: &'static str = "Emulation.setEmulatedVisionDeficiency";
643    pub fn identifier(&self) -> &'static str {
644        Self::IDENTIFIER
645    }
646}
647impl crate::CommandResult for SetEmulatedVisionDeficiency {
648    type Result = super::results::SetEmulatedVisionDeficiencyResult;
649}
650#[doc = "Emulates the given OS text scale.\n[setEmulatedOSTextScale](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedOSTextScale)"]
651#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
652pub struct SetEmulatedOsTextScaleParams {
653    #[serde(rename = "scale")]
654    #[serde(skip_serializing_if = "Option::is_none")]
655    #[serde(default)]
656    pub scale: Option<f64>,
657}
658#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
659pub enum SetEmulatedOsTextScaleMethod {
660    #[serde(rename = "Emulation.setEmulatedOSTextScale")]
661    SetEmulatedOsTextScale,
662}
663#[doc = "Emulates the given OS text scale.\n[setEmulatedOSTextScale](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedOSTextScale)"]
664#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
665pub struct SetEmulatedOsTextScale {
666    pub method: SetEmulatedOsTextScaleMethod,
667    pub params: SetEmulatedOsTextScaleParams,
668}
669impl SetEmulatedOsTextScale {
670    pub const IDENTIFIER: &'static str = "Emulation.setEmulatedOSTextScale";
671    pub fn identifier(&self) -> &'static str {
672        Self::IDENTIFIER
673    }
674}
675impl crate::CommandResult for SetEmulatedOsTextScale {
676    type Result = super::results::SetEmulatedOsTextScaleResult;
677}
678#[doc = "Overrides the Geolocation Position or Error. Omitting latitude, longitude or\naccuracy emulates position unavailable.\n[setGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setGeolocationOverride)"]
679#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
680pub struct SetGeolocationOverrideParams {
681    #[doc = "Mock latitude"]
682    #[serde(rename = "latitude")]
683    #[serde(skip_serializing_if = "Option::is_none")]
684    #[serde(default)]
685    pub latitude: Option<f64>,
686    #[doc = "Mock longitude"]
687    #[serde(rename = "longitude")]
688    #[serde(skip_serializing_if = "Option::is_none")]
689    #[serde(default)]
690    pub longitude: Option<f64>,
691    #[doc = "Mock accuracy"]
692    #[serde(rename = "accuracy")]
693    #[serde(skip_serializing_if = "Option::is_none")]
694    #[serde(default)]
695    pub accuracy: Option<f64>,
696    #[doc = "Mock altitude"]
697    #[serde(rename = "altitude")]
698    #[serde(skip_serializing_if = "Option::is_none")]
699    #[serde(default)]
700    pub altitude: Option<f64>,
701    #[doc = "Mock altitudeAccuracy"]
702    #[serde(rename = "altitudeAccuracy")]
703    #[serde(skip_serializing_if = "Option::is_none")]
704    #[serde(default)]
705    pub altitude_accuracy: Option<f64>,
706    #[doc = "Mock heading"]
707    #[serde(rename = "heading")]
708    #[serde(skip_serializing_if = "Option::is_none")]
709    #[serde(default)]
710    pub heading: Option<f64>,
711    #[doc = "Mock speed"]
712    #[serde(rename = "speed")]
713    #[serde(skip_serializing_if = "Option::is_none")]
714    #[serde(default)]
715    pub speed: Option<f64>,
716}
717#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
718pub enum SetGeolocationOverrideMethod {
719    #[serde(rename = "Emulation.setGeolocationOverride")]
720    SetGeolocationOverride,
721}
722#[doc = "Overrides the Geolocation Position or Error. Omitting latitude, longitude or\naccuracy emulates position unavailable.\n[setGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setGeolocationOverride)"]
723#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
724pub struct SetGeolocationOverride {
725    pub method: SetGeolocationOverrideMethod,
726    pub params: SetGeolocationOverrideParams,
727}
728impl SetGeolocationOverride {
729    pub const IDENTIFIER: &'static str = "Emulation.setGeolocationOverride";
730    pub fn identifier(&self) -> &'static str {
731        Self::IDENTIFIER
732    }
733}
734impl crate::CommandResult for SetGeolocationOverride {
735    type Result = super::results::SetGeolocationOverrideResult;
736}
737#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
738pub struct GetOverriddenSensorInformationParams {
739    #[serde(rename = "type")]
740    pub r#type: super::types::SensorType,
741}
742impl GetOverriddenSensorInformationParams {
743    pub fn new(r#type: impl Into<super::types::SensorType>) -> Self {
744        Self {
745            r#type: r#type.into(),
746        }
747    }
748}
749#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
750pub enum GetOverriddenSensorInformationMethod {
751    #[serde(rename = "Emulation.getOverriddenSensorInformation")]
752    GetOverriddenSensorInformation,
753}
754#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
755pub struct GetOverriddenSensorInformation {
756    pub method: GetOverriddenSensorInformationMethod,
757    pub params: GetOverriddenSensorInformationParams,
758}
759impl GetOverriddenSensorInformation {
760    pub const IDENTIFIER: &'static str = "Emulation.getOverriddenSensorInformation";
761    pub fn identifier(&self) -> &'static str {
762        Self::IDENTIFIER
763    }
764}
765impl crate::CommandResult for GetOverriddenSensorInformation {
766    type Result = super::results::GetOverriddenSensorInformationResult;
767}
768#[doc = "Overrides a platform sensor of a given type. If |enabled| is true, calls to\nSensor.start() will use a virtual sensor as backend rather than fetching\ndata from a real hardware sensor. Otherwise, existing virtual\nsensor-backend Sensor objects will fire an error event and new calls to\nSensor.start() will attempt to use a real sensor instead.\n[setSensorOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideEnabled)"]
769#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
770pub struct SetSensorOverrideEnabledParams {
771    #[serde(rename = "enabled")]
772    pub enabled: bool,
773    #[serde(rename = "type")]
774    pub r#type: super::types::SensorType,
775    #[serde(rename = "metadata")]
776    #[serde(skip_serializing_if = "Option::is_none")]
777    #[serde(default)]
778    pub metadata: Option<super::types::SensorMetadata>,
779}
780impl SetSensorOverrideEnabledParams {
781    pub fn new(enabled: impl Into<bool>, r#type: impl Into<super::types::SensorType>) -> Self {
782        Self {
783            enabled: enabled.into(),
784            r#type: r#type.into(),
785            metadata: None,
786        }
787    }
788}
789#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
790pub enum SetSensorOverrideEnabledMethod {
791    #[serde(rename = "Emulation.setSensorOverrideEnabled")]
792    SetSensorOverrideEnabled,
793}
794#[doc = "Overrides a platform sensor of a given type. If |enabled| is true, calls to\nSensor.start() will use a virtual sensor as backend rather than fetching\ndata from a real hardware sensor. Otherwise, existing virtual\nsensor-backend Sensor objects will fire an error event and new calls to\nSensor.start() will attempt to use a real sensor instead.\n[setSensorOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideEnabled)"]
795#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
796pub struct SetSensorOverrideEnabled {
797    pub method: SetSensorOverrideEnabledMethod,
798    pub params: SetSensorOverrideEnabledParams,
799}
800impl SetSensorOverrideEnabled {
801    pub const IDENTIFIER: &'static str = "Emulation.setSensorOverrideEnabled";
802    pub fn identifier(&self) -> &'static str {
803        Self::IDENTIFIER
804    }
805}
806impl crate::CommandResult for SetSensorOverrideEnabled {
807    type Result = super::results::SetSensorOverrideEnabledResult;
808}
809#[doc = "Updates the sensor readings reported by a sensor type previously overridden\nby setSensorOverrideEnabled.\n[setSensorOverrideReadings](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideReadings)"]
810#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
811pub struct SetSensorOverrideReadingsParams {
812    #[serde(rename = "type")]
813    pub r#type: super::types::SensorType,
814    #[serde(rename = "reading")]
815    pub reading: super::types::SensorReading,
816}
817impl SetSensorOverrideReadingsParams {
818    pub fn new(
819        r#type: impl Into<super::types::SensorType>,
820        reading: impl Into<super::types::SensorReading>,
821    ) -> Self {
822        Self {
823            r#type: r#type.into(),
824            reading: reading.into(),
825        }
826    }
827}
828#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
829pub enum SetSensorOverrideReadingsMethod {
830    #[serde(rename = "Emulation.setSensorOverrideReadings")]
831    SetSensorOverrideReadings,
832}
833#[doc = "Updates the sensor readings reported by a sensor type previously overridden\nby setSensorOverrideEnabled.\n[setSensorOverrideReadings](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideReadings)"]
834#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
835pub struct SetSensorOverrideReadings {
836    pub method: SetSensorOverrideReadingsMethod,
837    pub params: SetSensorOverrideReadingsParams,
838}
839impl SetSensorOverrideReadings {
840    pub const IDENTIFIER: &'static str = "Emulation.setSensorOverrideReadings";
841    pub fn identifier(&self) -> &'static str {
842        Self::IDENTIFIER
843    }
844}
845impl crate::CommandResult for SetSensorOverrideReadings {
846    type Result = super::results::SetSensorOverrideReadingsResult;
847}
848#[doc = "Overrides a pressure source of a given type, as used by the Compute\nPressure API, so that updates to PressureObserver.observe() are provided\nvia setPressureStateOverride instead of being retrieved from\nplatform-provided telemetry data.\n[setPressureSourceOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureSourceOverrideEnabled)"]
849#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
850pub struct SetPressureSourceOverrideEnabledParams {
851    #[serde(rename = "enabled")]
852    pub enabled: bool,
853    #[serde(rename = "source")]
854    pub source: super::types::PressureSource,
855    #[serde(rename = "metadata")]
856    #[serde(skip_serializing_if = "Option::is_none")]
857    #[serde(default)]
858    pub metadata: Option<super::types::PressureMetadata>,
859}
860impl SetPressureSourceOverrideEnabledParams {
861    pub fn new(enabled: impl Into<bool>, source: impl Into<super::types::PressureSource>) -> Self {
862        Self {
863            enabled: enabled.into(),
864            source: source.into(),
865            metadata: None,
866        }
867    }
868}
869#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
870pub enum SetPressureSourceOverrideEnabledMethod {
871    #[serde(rename = "Emulation.setPressureSourceOverrideEnabled")]
872    SetPressureSourceOverrideEnabled,
873}
874#[doc = "Overrides a pressure source of a given type, as used by the Compute\nPressure API, so that updates to PressureObserver.observe() are provided\nvia setPressureStateOverride instead of being retrieved from\nplatform-provided telemetry data.\n[setPressureSourceOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureSourceOverrideEnabled)"]
875#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
876pub struct SetPressureSourceOverrideEnabled {
877    pub method: SetPressureSourceOverrideEnabledMethod,
878    pub params: SetPressureSourceOverrideEnabledParams,
879}
880impl SetPressureSourceOverrideEnabled {
881    pub const IDENTIFIER: &'static str = "Emulation.setPressureSourceOverrideEnabled";
882    pub fn identifier(&self) -> &'static str {
883        Self::IDENTIFIER
884    }
885}
886impl crate::CommandResult for SetPressureSourceOverrideEnabled {
887    type Result = super::results::SetPressureSourceOverrideEnabledResult;
888}
889#[doc = "TODO: OBSOLETE: To remove when setPressureDataOverride is merged.\nProvides a given pressure state that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureStateOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureStateOverride)"]
890#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
891pub struct SetPressureStateOverrideParams {
892    #[serde(rename = "source")]
893    pub source: super::types::PressureSource,
894    #[serde(rename = "state")]
895    pub state: super::types::PressureState,
896}
897impl SetPressureStateOverrideParams {
898    pub fn new(
899        source: impl Into<super::types::PressureSource>,
900        state: impl Into<super::types::PressureState>,
901    ) -> Self {
902        Self {
903            source: source.into(),
904            state: state.into(),
905        }
906    }
907}
908#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
909pub enum SetPressureStateOverrideMethod {
910    #[serde(rename = "Emulation.setPressureStateOverride")]
911    SetPressureStateOverride,
912}
913#[doc = "TODO: OBSOLETE: To remove when setPressureDataOverride is merged.\nProvides a given pressure state that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureStateOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureStateOverride)"]
914#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
915pub struct SetPressureStateOverride {
916    pub method: SetPressureStateOverrideMethod,
917    pub params: SetPressureStateOverrideParams,
918}
919impl SetPressureStateOverride {
920    pub const IDENTIFIER: &'static str = "Emulation.setPressureStateOverride";
921    pub fn identifier(&self) -> &'static str {
922        Self::IDENTIFIER
923    }
924}
925impl crate::CommandResult for SetPressureStateOverride {
926    type Result = super::results::SetPressureStateOverrideResult;
927}
928#[doc = "Provides a given pressure data set that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureDataOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureDataOverride)"]
929#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
930pub struct SetPressureDataOverrideParams {
931    #[serde(rename = "source")]
932    pub source: super::types::PressureSource,
933    #[serde(rename = "state")]
934    pub state: super::types::PressureState,
935    #[serde(rename = "ownContributionEstimate")]
936    #[serde(skip_serializing_if = "Option::is_none")]
937    #[serde(default)]
938    pub own_contribution_estimate: Option<f64>,
939}
940impl SetPressureDataOverrideParams {
941    pub fn new(
942        source: impl Into<super::types::PressureSource>,
943        state: impl Into<super::types::PressureState>,
944    ) -> Self {
945        Self {
946            source: source.into(),
947            state: state.into(),
948            own_contribution_estimate: None,
949        }
950    }
951}
952#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
953pub enum SetPressureDataOverrideMethod {
954    #[serde(rename = "Emulation.setPressureDataOverride")]
955    SetPressureDataOverride,
956}
957#[doc = "Provides a given pressure data set that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureDataOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureDataOverride)"]
958#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
959pub struct SetPressureDataOverride {
960    pub method: SetPressureDataOverrideMethod,
961    pub params: SetPressureDataOverrideParams,
962}
963impl SetPressureDataOverride {
964    pub const IDENTIFIER: &'static str = "Emulation.setPressureDataOverride";
965    pub fn identifier(&self) -> &'static str {
966        Self::IDENTIFIER
967    }
968}
969impl crate::CommandResult for SetPressureDataOverride {
970    type Result = super::results::SetPressureDataOverrideResult;
971}
972#[doc = "Overrides the Idle state.\n[setIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setIdleOverride)"]
973#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
974pub struct SetIdleOverrideParams {
975    #[doc = "Mock isUserActive"]
976    #[serde(rename = "isUserActive")]
977    pub is_user_active: bool,
978    #[doc = "Mock isScreenUnlocked"]
979    #[serde(rename = "isScreenUnlocked")]
980    pub is_screen_unlocked: bool,
981}
982impl SetIdleOverrideParams {
983    pub fn new(is_user_active: impl Into<bool>, is_screen_unlocked: impl Into<bool>) -> Self {
984        Self {
985            is_user_active: is_user_active.into(),
986            is_screen_unlocked: is_screen_unlocked.into(),
987        }
988    }
989}
990#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
991pub enum SetIdleOverrideMethod {
992    #[serde(rename = "Emulation.setIdleOverride")]
993    SetIdleOverride,
994}
995#[doc = "Overrides the Idle state.\n[setIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setIdleOverride)"]
996#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
997pub struct SetIdleOverride {
998    pub method: SetIdleOverrideMethod,
999    pub params: SetIdleOverrideParams,
1000}
1001impl SetIdleOverride {
1002    pub const IDENTIFIER: &'static str = "Emulation.setIdleOverride";
1003    pub fn identifier(&self) -> &'static str {
1004        Self::IDENTIFIER
1005    }
1006}
1007impl crate::CommandResult for SetIdleOverride {
1008    type Result = super::results::SetIdleOverrideResult;
1009}
1010#[doc = "Clears Idle state overrides.\n[clearIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearIdleOverride)"]
1011#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1012pub struct ClearIdleOverrideParams {}
1013#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1014pub enum ClearIdleOverrideMethod {
1015    #[serde(rename = "Emulation.clearIdleOverride")]
1016    ClearIdleOverride,
1017}
1018#[doc = "Clears Idle state overrides.\n[clearIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearIdleOverride)"]
1019#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1020pub struct ClearIdleOverride {
1021    pub method: ClearIdleOverrideMethod,
1022    pub params: ClearIdleOverrideParams,
1023}
1024impl ClearIdleOverride {
1025    pub const IDENTIFIER: &'static str = "Emulation.clearIdleOverride";
1026    pub fn identifier(&self) -> &'static str {
1027        Self::IDENTIFIER
1028    }
1029}
1030impl crate::CommandResult for ClearIdleOverride {
1031    type Result = super::results::ClearIdleOverrideResult;
1032}
1033#[doc = "Sets a specified page scale factor.\n[setPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPageScaleFactor)"]
1034#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1035pub struct SetPageScaleFactorParams {
1036    #[doc = "Page scale factor."]
1037    #[serde(rename = "pageScaleFactor")]
1038    pub page_scale_factor: f64,
1039}
1040impl SetPageScaleFactorParams {
1041    pub fn new(page_scale_factor: impl Into<f64>) -> Self {
1042        Self {
1043            page_scale_factor: page_scale_factor.into(),
1044        }
1045    }
1046}
1047#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1048pub enum SetPageScaleFactorMethod {
1049    #[serde(rename = "Emulation.setPageScaleFactor")]
1050    SetPageScaleFactor,
1051}
1052#[doc = "Sets a specified page scale factor.\n[setPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPageScaleFactor)"]
1053#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1054pub struct SetPageScaleFactor {
1055    pub method: SetPageScaleFactorMethod,
1056    pub params: SetPageScaleFactorParams,
1057}
1058impl SetPageScaleFactor {
1059    pub const IDENTIFIER: &'static str = "Emulation.setPageScaleFactor";
1060    pub fn identifier(&self) -> &'static str {
1061        Self::IDENTIFIER
1062    }
1063}
1064impl crate::CommandResult for SetPageScaleFactor {
1065    type Result = super::results::SetPageScaleFactorResult;
1066}
1067#[doc = "Switches script execution in the page.\n[setScriptExecutionDisabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScriptExecutionDisabled)"]
1068#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1069pub struct SetScriptExecutionDisabledParams {
1070    #[doc = "Whether script execution should be disabled in the page."]
1071    #[serde(rename = "value")]
1072    pub value: bool,
1073}
1074impl SetScriptExecutionDisabledParams {
1075    pub fn new(value: impl Into<bool>) -> Self {
1076        Self {
1077            value: value.into(),
1078        }
1079    }
1080}
1081#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1082pub enum SetScriptExecutionDisabledMethod {
1083    #[serde(rename = "Emulation.setScriptExecutionDisabled")]
1084    SetScriptExecutionDisabled,
1085}
1086#[doc = "Switches script execution in the page.\n[setScriptExecutionDisabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScriptExecutionDisabled)"]
1087#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1088pub struct SetScriptExecutionDisabled {
1089    pub method: SetScriptExecutionDisabledMethod,
1090    pub params: SetScriptExecutionDisabledParams,
1091}
1092impl SetScriptExecutionDisabled {
1093    pub const IDENTIFIER: &'static str = "Emulation.setScriptExecutionDisabled";
1094    pub fn identifier(&self) -> &'static str {
1095        Self::IDENTIFIER
1096    }
1097}
1098impl crate::CommandResult for SetScriptExecutionDisabled {
1099    type Result = super::results::SetScriptExecutionDisabledResult;
1100}
1101#[doc = "Enables touch on platforms which do not support them.\n[setTouchEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTouchEmulationEnabled)"]
1102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1103pub struct SetTouchEmulationEnabledParams {
1104    #[doc = "Whether the touch event emulation should be enabled."]
1105    #[serde(rename = "enabled")]
1106    pub enabled: bool,
1107    #[doc = "Maximum touch points supported. Defaults to one."]
1108    #[serde(rename = "maxTouchPoints")]
1109    #[serde(skip_serializing_if = "Option::is_none")]
1110    #[serde(default)]
1111    pub max_touch_points: Option<i64>,
1112}
1113impl SetTouchEmulationEnabledParams {
1114    pub fn new(enabled: impl Into<bool>) -> Self {
1115        Self {
1116            enabled: enabled.into(),
1117            max_touch_points: None,
1118        }
1119    }
1120}
1121#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1122pub enum SetTouchEmulationEnabledMethod {
1123    #[serde(rename = "Emulation.setTouchEmulationEnabled")]
1124    SetTouchEmulationEnabled,
1125}
1126#[doc = "Enables touch on platforms which do not support them.\n[setTouchEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTouchEmulationEnabled)"]
1127#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1128pub struct SetTouchEmulationEnabled {
1129    pub method: SetTouchEmulationEnabledMethod,
1130    pub params: SetTouchEmulationEnabledParams,
1131}
1132impl SetTouchEmulationEnabled {
1133    pub const IDENTIFIER: &'static str = "Emulation.setTouchEmulationEnabled";
1134    pub fn identifier(&self) -> &'static str {
1135        Self::IDENTIFIER
1136    }
1137}
1138impl crate::CommandResult for SetTouchEmulationEnabled {
1139    type Result = super::results::SetTouchEmulationEnabledResult;
1140}
1141#[doc = "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\nthe current virtual time policy.  Note this supersedes any previous time budget.\n[setVirtualTimePolicy](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVirtualTimePolicy)"]
1142#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1143pub struct SetVirtualTimePolicyParams {
1144    #[serde(rename = "policy")]
1145    pub policy: super::types::VirtualTimePolicy,
1146    #[doc = "If set, after this many virtual milliseconds have elapsed virtual time will be paused and a\nvirtualTimeBudgetExpired event is sent."]
1147    #[serde(rename = "budget")]
1148    #[serde(skip_serializing_if = "Option::is_none")]
1149    #[serde(default)]
1150    pub budget: Option<f64>,
1151    #[doc = "If set this specifies the maximum number of tasks that can be run before virtual is forced\nforwards to prevent deadlock."]
1152    #[serde(rename = "maxVirtualTimeTaskStarvationCount")]
1153    #[serde(skip_serializing_if = "Option::is_none")]
1154    #[serde(default)]
1155    pub max_virtual_time_task_starvation_count: Option<i64>,
1156    #[doc = "If set, base::Time::Now will be overridden to initially return this value."]
1157    #[serde(rename = "initialVirtualTime")]
1158    #[serde(skip_serializing_if = "Option::is_none")]
1159    #[serde(default)]
1160    pub initial_virtual_time: Option<crate::browser_protocol::network::types::TimeSinceEpoch>,
1161}
1162impl SetVirtualTimePolicyParams {
1163    pub fn new(policy: impl Into<super::types::VirtualTimePolicy>) -> Self {
1164        Self {
1165            policy: policy.into(),
1166            budget: None,
1167            max_virtual_time_task_starvation_count: None,
1168            initial_virtual_time: None,
1169        }
1170    }
1171}
1172#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1173pub enum SetVirtualTimePolicyMethod {
1174    #[serde(rename = "Emulation.setVirtualTimePolicy")]
1175    SetVirtualTimePolicy,
1176}
1177#[doc = "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\nthe current virtual time policy.  Note this supersedes any previous time budget.\n[setVirtualTimePolicy](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVirtualTimePolicy)"]
1178#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1179pub struct SetVirtualTimePolicy {
1180    pub method: SetVirtualTimePolicyMethod,
1181    pub params: SetVirtualTimePolicyParams,
1182}
1183impl SetVirtualTimePolicy {
1184    pub const IDENTIFIER: &'static str = "Emulation.setVirtualTimePolicy";
1185    pub fn identifier(&self) -> &'static str {
1186        Self::IDENTIFIER
1187    }
1188}
1189impl crate::CommandResult for SetVirtualTimePolicy {
1190    type Result = super::results::SetVirtualTimePolicyResult;
1191}
1192#[doc = "Overrides default host system locale with the specified one.\n[setLocaleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setLocaleOverride)"]
1193#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1194pub struct SetLocaleOverrideParams {
1195    #[doc = "ICU style C locale (e.g. \"en_US\"). If not specified or empty, disables the override and\nrestores default host system locale."]
1196    #[serde(rename = "locale")]
1197    #[serde(skip_serializing_if = "Option::is_none")]
1198    #[serde(default)]
1199    pub locale: Option<String>,
1200}
1201#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1202pub enum SetLocaleOverrideMethod {
1203    #[serde(rename = "Emulation.setLocaleOverride")]
1204    SetLocaleOverride,
1205}
1206#[doc = "Overrides default host system locale with the specified one.\n[setLocaleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setLocaleOverride)"]
1207#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1208pub struct SetLocaleOverride {
1209    pub method: SetLocaleOverrideMethod,
1210    pub params: SetLocaleOverrideParams,
1211}
1212impl SetLocaleOverride {
1213    pub const IDENTIFIER: &'static str = "Emulation.setLocaleOverride";
1214    pub fn identifier(&self) -> &'static str {
1215        Self::IDENTIFIER
1216    }
1217}
1218impl crate::CommandResult for SetLocaleOverride {
1219    type Result = super::results::SetLocaleOverrideResult;
1220}
1221#[doc = "Overrides default host system timezone with the specified one.\n[setTimezoneOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTimezoneOverride)"]
1222#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1223pub struct SetTimezoneOverrideParams {
1224    #[doc = "The timezone identifier. List of supported timezones:\nhttps://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt\nIf empty, disables the override and restores default host system timezone."]
1225    #[serde(rename = "timezoneId")]
1226    pub timezone_id: String,
1227}
1228impl SetTimezoneOverrideParams {
1229    pub fn new(timezone_id: impl Into<String>) -> Self {
1230        Self {
1231            timezone_id: timezone_id.into(),
1232        }
1233    }
1234}
1235impl<T: Into<String>> From<T> for SetTimezoneOverrideParams {
1236    fn from(url: T) -> Self {
1237        SetTimezoneOverrideParams::new(url)
1238    }
1239}
1240#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1241pub enum SetTimezoneOverrideMethod {
1242    #[serde(rename = "Emulation.setTimezoneOverride")]
1243    SetTimezoneOverride,
1244}
1245#[doc = "Overrides default host system timezone with the specified one.\n[setTimezoneOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTimezoneOverride)"]
1246#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1247pub struct SetTimezoneOverride {
1248    pub method: SetTimezoneOverrideMethod,
1249    pub params: SetTimezoneOverrideParams,
1250}
1251impl SetTimezoneOverride {
1252    pub const IDENTIFIER: &'static str = "Emulation.setTimezoneOverride";
1253    pub fn identifier(&self) -> &'static str {
1254        Self::IDENTIFIER
1255    }
1256}
1257impl crate::CommandResult for SetTimezoneOverride {
1258    type Result = super::results::SetTimezoneOverrideResult;
1259}
1260#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1261pub struct SetDisabledImageTypesParams {
1262    #[doc = "Image types to disable."]
1263    #[serde(rename = "imageTypes")]
1264    #[serde(skip_serializing_if = "Vec::is_empty")]
1265    pub image_types: Vec<super::types::DisabledImageType>,
1266}
1267impl SetDisabledImageTypesParams {
1268    pub fn new(image_types: Vec<super::types::DisabledImageType>) -> Self {
1269        Self { image_types }
1270    }
1271}
1272#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1273pub enum SetDisabledImageTypesMethod {
1274    #[serde(rename = "Emulation.setDisabledImageTypes")]
1275    SetDisabledImageTypes,
1276}
1277#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1278pub struct SetDisabledImageTypes {
1279    pub method: SetDisabledImageTypesMethod,
1280    pub params: SetDisabledImageTypesParams,
1281}
1282impl SetDisabledImageTypes {
1283    pub const IDENTIFIER: &'static str = "Emulation.setDisabledImageTypes";
1284    pub fn identifier(&self) -> &'static str {
1285        Self::IDENTIFIER
1286    }
1287}
1288impl crate::CommandResult for SetDisabledImageTypes {
1289    type Result = super::results::SetDisabledImageTypesResult;
1290}
1291#[doc = "Override the value of navigator.connection.saveData\n[setDataSaverOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDataSaverOverride)"]
1292#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
1293pub struct SetDataSaverOverrideParams {
1294    #[doc = "Override value. Omitting the parameter disables the override."]
1295    #[serde(rename = "dataSaverEnabled")]
1296    #[serde(skip_serializing_if = "Option::is_none")]
1297    #[serde(default)]
1298    pub data_saver_enabled: Option<bool>,
1299}
1300#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1301pub enum SetDataSaverOverrideMethod {
1302    #[serde(rename = "Emulation.setDataSaverOverride")]
1303    SetDataSaverOverride,
1304}
1305#[doc = "Override the value of navigator.connection.saveData\n[setDataSaverOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDataSaverOverride)"]
1306#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1307pub struct SetDataSaverOverride {
1308    pub method: SetDataSaverOverrideMethod,
1309    pub params: SetDataSaverOverrideParams,
1310}
1311impl SetDataSaverOverride {
1312    pub const IDENTIFIER: &'static str = "Emulation.setDataSaverOverride";
1313    pub fn identifier(&self) -> &'static str {
1314        Self::IDENTIFIER
1315    }
1316}
1317impl crate::CommandResult for SetDataSaverOverride {
1318    type Result = super::results::SetDataSaverOverrideResult;
1319}
1320#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1321pub struct SetHardwareConcurrencyOverrideParams {
1322    #[doc = "Hardware concurrency to report"]
1323    #[serde(rename = "hardwareConcurrency")]
1324    pub hardware_concurrency: i64,
1325}
1326impl SetHardwareConcurrencyOverrideParams {
1327    pub fn new(hardware_concurrency: impl Into<i64>) -> Self {
1328        Self {
1329            hardware_concurrency: hardware_concurrency.into(),
1330        }
1331    }
1332}
1333#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1334pub enum SetHardwareConcurrencyOverrideMethod {
1335    #[serde(rename = "Emulation.setHardwareConcurrencyOverride")]
1336    SetHardwareConcurrencyOverride,
1337}
1338#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1339pub struct SetHardwareConcurrencyOverride {
1340    pub method: SetHardwareConcurrencyOverrideMethod,
1341    pub params: SetHardwareConcurrencyOverrideParams,
1342}
1343impl SetHardwareConcurrencyOverride {
1344    pub const IDENTIFIER: &'static str = "Emulation.setHardwareConcurrencyOverride";
1345    pub fn identifier(&self) -> &'static str {
1346        Self::IDENTIFIER
1347    }
1348}
1349impl crate::CommandResult for SetHardwareConcurrencyOverride {
1350    type Result = super::results::SetHardwareConcurrencyOverrideResult;
1351}
1352#[doc = "Allows overriding user agent with the given string.\n`userAgentMetadata` must be set for Client Hint headers to be sent.\n[setUserAgentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setUserAgentOverride)"]
1353#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1354pub struct SetUserAgentOverrideParams {
1355    #[doc = "User agent to use."]
1356    #[serde(rename = "userAgent")]
1357    pub user_agent: String,
1358    #[doc = "Browser language to emulate."]
1359    #[serde(rename = "acceptLanguage")]
1360    #[serde(skip_serializing_if = "Option::is_none")]
1361    #[serde(default)]
1362    pub accept_language: Option<String>,
1363    #[doc = "The platform navigator.platform should return."]
1364    #[serde(rename = "platform")]
1365    #[serde(skip_serializing_if = "Option::is_none")]
1366    #[serde(default)]
1367    pub platform: Option<String>,
1368    #[doc = "To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData"]
1369    #[serde(rename = "userAgentMetadata")]
1370    #[serde(skip_serializing_if = "Option::is_none")]
1371    #[serde(default)]
1372    pub user_agent_metadata: Option<super::types::UserAgentMetadata>,
1373}
1374impl SetUserAgentOverrideParams {
1375    pub fn new(user_agent: impl Into<String>) -> Self {
1376        Self {
1377            user_agent: user_agent.into(),
1378            accept_language: None,
1379            platform: None,
1380            user_agent_metadata: None,
1381        }
1382    }
1383}
1384impl<T: Into<String>> From<T> for SetUserAgentOverrideParams {
1385    fn from(url: T) -> Self {
1386        SetUserAgentOverrideParams::new(url)
1387    }
1388}
1389#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1390pub enum SetUserAgentOverrideMethod {
1391    #[serde(rename = "Emulation.setUserAgentOverride")]
1392    SetUserAgentOverride,
1393}
1394#[doc = "Allows overriding user agent with the given string.\n`userAgentMetadata` must be set for Client Hint headers to be sent.\n[setUserAgentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setUserAgentOverride)"]
1395#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1396pub struct SetUserAgentOverride {
1397    pub method: SetUserAgentOverrideMethod,
1398    pub params: SetUserAgentOverrideParams,
1399}
1400impl SetUserAgentOverride {
1401    pub const IDENTIFIER: &'static str = "Emulation.setUserAgentOverride";
1402    pub fn identifier(&self) -> &'static str {
1403        Self::IDENTIFIER
1404    }
1405}
1406impl crate::CommandResult for SetUserAgentOverride {
1407    type Result = super::results::SetUserAgentOverrideResult;
1408}
1409#[doc = "Allows overriding the automation flag.\n[setAutomationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutomationOverride)"]
1410#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1411pub struct SetAutomationOverrideParams {
1412    #[doc = "Whether the override should be enabled."]
1413    #[serde(rename = "enabled")]
1414    pub enabled: bool,
1415}
1416impl SetAutomationOverrideParams {
1417    pub fn new(enabled: impl Into<bool>) -> Self {
1418        Self {
1419            enabled: enabled.into(),
1420        }
1421    }
1422}
1423#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1424pub enum SetAutomationOverrideMethod {
1425    #[serde(rename = "Emulation.setAutomationOverride")]
1426    SetAutomationOverride,
1427}
1428#[doc = "Allows overriding the automation flag.\n[setAutomationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutomationOverride)"]
1429#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1430pub struct SetAutomationOverride {
1431    pub method: SetAutomationOverrideMethod,
1432    pub params: SetAutomationOverrideParams,
1433}
1434impl SetAutomationOverride {
1435    pub const IDENTIFIER: &'static str = "Emulation.setAutomationOverride";
1436    pub fn identifier(&self) -> &'static str {
1437        Self::IDENTIFIER
1438    }
1439}
1440impl crate::CommandResult for SetAutomationOverride {
1441    type Result = super::results::SetAutomationOverrideResult;
1442}
1443#[doc = "Allows overriding the difference between the small and large viewport sizes, which determine the\nvalue of the `svh` and `lvh` unit, respectively. Only supported for top-level frames.\n[setSmallViewportHeightDifferenceOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSmallViewportHeightDifferenceOverride)"]
1444#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1445pub struct SetSmallViewportHeightDifferenceOverrideParams {
1446    #[doc = "This will cause an element of size 100svh to be `difference` pixels smaller than an element\nof size 100lvh."]
1447    #[serde(rename = "difference")]
1448    pub difference: i64,
1449}
1450impl SetSmallViewportHeightDifferenceOverrideParams {
1451    pub fn new(difference: impl Into<i64>) -> Self {
1452        Self {
1453            difference: difference.into(),
1454        }
1455    }
1456}
1457#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1458pub enum SetSmallViewportHeightDifferenceOverrideMethod {
1459    #[serde(rename = "Emulation.setSmallViewportHeightDifferenceOverride")]
1460    SetSmallViewportHeightDifferenceOverride,
1461}
1462#[doc = "Allows overriding the difference between the small and large viewport sizes, which determine the\nvalue of the `svh` and `lvh` unit, respectively. Only supported for top-level frames.\n[setSmallViewportHeightDifferenceOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSmallViewportHeightDifferenceOverride)"]
1463#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1464pub struct SetSmallViewportHeightDifferenceOverride {
1465    pub method: SetSmallViewportHeightDifferenceOverrideMethod,
1466    pub params: SetSmallViewportHeightDifferenceOverrideParams,
1467}
1468impl SetSmallViewportHeightDifferenceOverride {
1469    pub const IDENTIFIER: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride";
1470    pub fn identifier(&self) -> &'static str {
1471        Self::IDENTIFIER
1472    }
1473}
1474impl crate::CommandResult for SetSmallViewportHeightDifferenceOverride {
1475    type Result = super::results::SetSmallViewportHeightDifferenceOverrideResult;
1476}
1477#[doc = "Returns device's screen configuration. In headful mode, the physical screens configuration is returned,\nwhereas in headless mode, a virtual headless screen configuration is provided instead.\n[getScreenInfos](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-getScreenInfos)"]
1478#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1479pub struct GetScreenInfosParams {}
1480#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1481pub enum GetScreenInfosMethod {
1482    #[serde(rename = "Emulation.getScreenInfos")]
1483    GetScreenInfos,
1484}
1485#[doc = "Returns device's screen configuration. In headful mode, the physical screens configuration is returned,\nwhereas in headless mode, a virtual headless screen configuration is provided instead.\n[getScreenInfos](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-getScreenInfos)"]
1486#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1487pub struct GetScreenInfos {
1488    pub method: GetScreenInfosMethod,
1489    pub params: GetScreenInfosParams,
1490}
1491impl GetScreenInfos {
1492    pub const IDENTIFIER: &'static str = "Emulation.getScreenInfos";
1493    pub fn identifier(&self) -> &'static str {
1494        Self::IDENTIFIER
1495    }
1496}
1497impl crate::CommandResult for GetScreenInfos {
1498    type Result = super::results::GetScreenInfosResult;
1499}
1500#[doc = "Add a new screen to the device. Only supported in headless mode.\n[addScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-addScreen)"]
1501#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1502pub struct AddScreenParams {
1503    #[doc = "Offset of the left edge of the screen in pixels."]
1504    #[serde(rename = "left")]
1505    pub left: i64,
1506    #[doc = "Offset of the top edge of the screen in pixels."]
1507    #[serde(rename = "top")]
1508    pub top: i64,
1509    #[doc = "The width of the screen in pixels."]
1510    #[serde(rename = "width")]
1511    pub width: i64,
1512    #[doc = "The height of the screen in pixels."]
1513    #[serde(rename = "height")]
1514    pub height: i64,
1515    #[doc = "Specifies the screen's work area. Default is entire screen."]
1516    #[serde(rename = "workAreaInsets")]
1517    #[serde(skip_serializing_if = "Option::is_none")]
1518    #[serde(default)]
1519    pub work_area_insets: Option<super::types::WorkAreaInsets>,
1520    #[doc = "Specifies the screen's device pixel ratio. Default is 1."]
1521    #[serde(rename = "devicePixelRatio")]
1522    #[serde(skip_serializing_if = "Option::is_none")]
1523    #[serde(default)]
1524    pub device_pixel_ratio: Option<f64>,
1525    #[doc = "Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0."]
1526    #[serde(rename = "rotation")]
1527    #[serde(skip_serializing_if = "Option::is_none")]
1528    #[serde(default)]
1529    pub rotation: Option<i64>,
1530    #[doc = "Specifies the screen's color depth in bits. Default is 24."]
1531    #[serde(rename = "colorDepth")]
1532    #[serde(skip_serializing_if = "Option::is_none")]
1533    #[serde(default)]
1534    pub color_depth: Option<i64>,
1535    #[doc = "Specifies the descriptive label for the screen. Default is none."]
1536    #[serde(rename = "label")]
1537    #[serde(skip_serializing_if = "Option::is_none")]
1538    #[serde(default)]
1539    pub label: Option<String>,
1540    #[doc = "Indicates whether the screen is internal to the device or external, attached to the device. Default is false."]
1541    #[serde(rename = "isInternal")]
1542    #[serde(skip_serializing_if = "Option::is_none")]
1543    #[serde(default)]
1544    pub is_internal: Option<bool>,
1545}
1546impl AddScreenParams {
1547    pub fn new(
1548        left: impl Into<i64>,
1549        top: impl Into<i64>,
1550        width: impl Into<i64>,
1551        height: impl Into<i64>,
1552    ) -> Self {
1553        Self {
1554            left: left.into(),
1555            top: top.into(),
1556            width: width.into(),
1557            height: height.into(),
1558            work_area_insets: None,
1559            device_pixel_ratio: None,
1560            rotation: None,
1561            color_depth: None,
1562            label: None,
1563            is_internal: None,
1564        }
1565    }
1566}
1567#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1568pub enum AddScreenMethod {
1569    #[serde(rename = "Emulation.addScreen")]
1570    AddScreen,
1571}
1572#[doc = "Add a new screen to the device. Only supported in headless mode.\n[addScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-addScreen)"]
1573#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1574pub struct AddScreen {
1575    pub method: AddScreenMethod,
1576    pub params: AddScreenParams,
1577}
1578impl AddScreen {
1579    pub const IDENTIFIER: &'static str = "Emulation.addScreen";
1580    pub fn identifier(&self) -> &'static str {
1581        Self::IDENTIFIER
1582    }
1583}
1584impl crate::CommandResult for AddScreen {
1585    type Result = super::results::AddScreenResult;
1586}
1587#[doc = "Remove screen from the device. Only supported in headless mode.\n[removeScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-removeScreen)"]
1588#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1589pub struct RemoveScreenParams {
1590    #[serde(rename = "screenId")]
1591    pub screen_id: super::types::ScreenId,
1592}
1593impl RemoveScreenParams {
1594    pub fn new(screen_id: impl Into<super::types::ScreenId>) -> Self {
1595        Self {
1596            screen_id: screen_id.into(),
1597        }
1598    }
1599}
1600#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1601pub enum RemoveScreenMethod {
1602    #[serde(rename = "Emulation.removeScreen")]
1603    RemoveScreen,
1604}
1605#[doc = "Remove screen from the device. Only supported in headless mode.\n[removeScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-removeScreen)"]
1606#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1607pub struct RemoveScreen {
1608    pub method: RemoveScreenMethod,
1609    pub params: RemoveScreenParams,
1610}
1611impl RemoveScreen {
1612    pub const IDENTIFIER: &'static str = "Emulation.removeScreen";
1613    pub fn identifier(&self) -> &'static str {
1614        Self::IDENTIFIER
1615    }
1616}
1617impl crate::CommandResult for RemoveScreen {
1618    type Result = super::results::RemoveScreenResult;
1619}
1620group_enum ! (EmulationCommands { ClearDeviceMetricsOverride (ClearDeviceMetricsOverride) , ClearGeolocationOverride (ClearGeolocationOverride) , ResetPageScaleFactor (ResetPageScaleFactor) , SetFocusEmulationEnabled (SetFocusEmulationEnabled) , SetAutoDarkModeOverride (SetAutoDarkModeOverride) , SetCpuThrottlingRate (SetCpuThrottlingRate) , SetDefaultBackgroundColorOverride (SetDefaultBackgroundColorOverride) , SetSafeAreaInsetsOverride (SetSafeAreaInsetsOverride) , SetDeviceMetricsOverride (SetDeviceMetricsOverride) , SetDevicePostureOverride (SetDevicePostureOverride) , ClearDevicePostureOverride (ClearDevicePostureOverride) , SetDisplayFeaturesOverride (SetDisplayFeaturesOverride) , ClearDisplayFeaturesOverride (ClearDisplayFeaturesOverride) , SetScrollbarsHidden (SetScrollbarsHidden) , SetDocumentCookieDisabled (SetDocumentCookieDisabled) , SetEmitTouchEventsForMouse (SetEmitTouchEventsForMouse) , SetEmulatedMedia (SetEmulatedMedia) , SetEmulatedVisionDeficiency (SetEmulatedVisionDeficiency) , SetEmulatedOsTextScale (SetEmulatedOsTextScale) , SetGeolocationOverride (SetGeolocationOverride) , GetOverriddenSensorInformation (GetOverriddenSensorInformation) , SetSensorOverrideEnabled (SetSensorOverrideEnabled) , SetSensorOverrideReadings (SetSensorOverrideReadings) , SetPressureSourceOverrideEnabled (SetPressureSourceOverrideEnabled) , SetPressureStateOverride (SetPressureStateOverride) , SetPressureDataOverride (SetPressureDataOverride) , SetIdleOverride (SetIdleOverride) , ClearIdleOverride (ClearIdleOverride) , SetPageScaleFactor (SetPageScaleFactor) , SetScriptExecutionDisabled (SetScriptExecutionDisabled) , SetTouchEmulationEnabled (SetTouchEmulationEnabled) , SetVirtualTimePolicy (SetVirtualTimePolicy) , SetLocaleOverride (SetLocaleOverride) , SetTimezoneOverride (SetTimezoneOverride) , SetDisabledImageTypes (SetDisabledImageTypes) , SetDataSaverOverride (SetDataSaverOverride) , SetHardwareConcurrencyOverride (SetHardwareConcurrencyOverride) , SetUserAgentOverride (SetUserAgentOverride) , SetAutomationOverride (SetAutomationOverride) , SetSmallViewportHeightDifferenceOverride (SetSmallViewportHeightDifferenceOverride) , GetScreenInfos (GetScreenInfos) , AddScreen (AddScreen) , RemoveScreen (RemoveScreen) } + identifiable);