Skip to main content

cdp_driver/protocol/
emulation.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! This domain emulates different environments for the page.
5//!
6//! Types, command parameters and event payloads for the `Emulation`
7//! domain. The method-name constants for the same domain are in
8//! [`crate::methods`].
9
10use serde::{Deserialize, Serialize};
11
12/// Experimental: may change without notice.
13#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
14pub struct SafeAreaInsets {
15    /// Overrides safe-area-inset-top.
16    #[serde(default, skip_serializing_if = "Option::is_none")]
17    pub top: Option<i64>,
18    /// Overrides safe-area-max-inset-top.
19    #[serde(rename = "topMax", default, skip_serializing_if = "Option::is_none")]
20    pub top_max: Option<i64>,
21    /// Overrides safe-area-inset-left.
22    #[serde(default, skip_serializing_if = "Option::is_none")]
23    pub left: Option<i64>,
24    /// Overrides safe-area-max-inset-left.
25    #[serde(rename = "leftMax", default, skip_serializing_if = "Option::is_none")]
26    pub left_max: Option<i64>,
27    /// Overrides safe-area-inset-bottom.
28    #[serde(default, skip_serializing_if = "Option::is_none")]
29    pub bottom: Option<i64>,
30    /// Overrides safe-area-max-inset-bottom.
31    #[serde(rename = "bottomMax", default, skip_serializing_if = "Option::is_none")]
32    pub bottom_max: Option<i64>,
33    /// Overrides safe-area-inset-right.
34    #[serde(default, skip_serializing_if = "Option::is_none")]
35    pub right: Option<i64>,
36    /// Overrides safe-area-max-inset-right.
37    #[serde(rename = "rightMax", default, skip_serializing_if = "Option::is_none")]
38    pub right_max: Option<i64>,
39}
40
41/// Screen orientation.
42#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
43pub struct ScreenOrientation {
44    /// Orientation type.
45    pub r#type: ScreenOrientationType,
46    /// Orientation angle.
47    pub angle: i64,
48}
49
50/// The values `type` accepts on `ScreenOrientation`.
51#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
52pub enum ScreenOrientationType {
53    /// `portraitPrimary`
54    #[serde(rename = "portraitPrimary")]
55    PortraitPrimary,
56    /// `portraitSecondary`
57    #[serde(rename = "portraitSecondary")]
58    PortraitSecondary,
59    /// `landscapePrimary`
60    #[serde(rename = "landscapePrimary")]
61    LandscapePrimary,
62    /// `landscapeSecondary`
63    #[serde(rename = "landscapeSecondary")]
64    LandscapeSecondary,
65    /// A value this vendored schema does not list. Chrome adds values ahead of
66    /// the published protocol, so an unrecognised one is kept as it arrived
67    /// rather than failing the payload it came in.
68    #[serde(untagged)]
69    Unrecognized(String),
70}
71
72#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
73pub struct DisplayFeature {
74    /// Orientation of a display feature in relation to screen
75    pub orientation: DisplayFeatureOrientation,
76    /// The offset from the screen origin in either the x (for vertical
77    /// orientation) or y (for horizontal orientation) direction.
78    pub offset: i64,
79    /// A display feature may mask content such that it is not physically
80    /// displayed - this length along with the offset describes this area. A
81    /// display feature that only splits content will have a 0 mask_length.
82    #[serde(rename = "maskLength")]
83    pub mask_length: i64,
84}
85
86/// The values `orientation` accepts on `DisplayFeature`.
87#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
88pub enum DisplayFeatureOrientation {
89    /// `vertical`
90    #[serde(rename = "vertical")]
91    Vertical,
92    /// `horizontal`
93    #[serde(rename = "horizontal")]
94    Horizontal,
95    /// A value this vendored schema does not list. Chrome adds values ahead of
96    /// the published protocol, so an unrecognised one is kept as it arrived
97    /// rather than failing the payload it came in.
98    #[serde(untagged)]
99    Unrecognized(String),
100}
101
102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
103pub struct DevicePosture {
104    /// Current posture of the device
105    pub r#type: DevicePostureType,
106}
107
108/// The values `type` accepts on `DevicePosture`.
109#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
110pub enum DevicePostureType {
111    /// `continuous`
112    #[serde(rename = "continuous")]
113    Continuous,
114    /// `folded`
115    #[serde(rename = "folded")]
116    Folded,
117    /// A value this vendored schema does not list. Chrome adds values ahead of
118    /// the published protocol, so an unrecognised one is kept as it arrived
119    /// rather than failing the payload it came in.
120    #[serde(untagged)]
121    Unrecognized(String),
122}
123
124#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
125pub struct MediaFeature {
126    pub name: String,
127    pub value: String,
128}
129
130/// advance: If the scheduler runs out of immediate work, the virtual time
131/// base may fast forward to allow the next delayed task (if any) to run;
132/// pause: The virtual time base may not advance;
133/// pauseIfNetworkFetchesPending: The virtual time base may not advance if
134/// there are any pending resource fetches.
135///
136/// Experimental: may change without notice.
137#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
138pub enum VirtualTimePolicy {
139    /// `advance`
140    #[serde(rename = "advance")]
141    Advance,
142    /// `pause`
143    #[serde(rename = "pause")]
144    Pause,
145    /// `pauseIfNetworkFetchesPending`
146    #[serde(rename = "pauseIfNetworkFetchesPending")]
147    PauseIfNetworkFetchesPending,
148    /// A value this vendored schema does not list. Chrome adds values ahead of
149    /// the published protocol, so an unrecognised one is kept as it arrived
150    /// rather than failing the payload it came in.
151    #[serde(untagged)]
152    Unrecognized(String),
153}
154
155/// Used to specify User Agent Client Hints to emulate. See
156/// <https://wicg.github.io/ua-client-hints>
157///
158/// Experimental: may change without notice.
159#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
160pub struct UserAgentBrandVersion {
161    pub brand: String,
162    pub version: String,
163}
164
165/// Used to specify User Agent Client Hints to emulate. See
166/// <https://wicg.github.io/ua-client-hints> Missing optional values will be
167/// filled in by the target with what it would normally use.
168///
169/// Experimental: may change without notice.
170#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
171pub struct UserAgentMetadata {
172    /// Brands appearing in Sec-CH-UA.
173    #[serde(default, skip_serializing_if = "Option::is_none")]
174    pub brands: Option<Vec<UserAgentBrandVersion>>,
175    /// Brands appearing in Sec-CH-UA-Full-Version-List.
176    #[serde(
177        rename = "fullVersionList",
178        default,
179        skip_serializing_if = "Option::is_none"
180    )]
181    pub full_version_list: Option<Vec<UserAgentBrandVersion>>,
182    /// Deprecated in the protocol.
183    #[serde(
184        rename = "fullVersion",
185        default,
186        skip_serializing_if = "Option::is_none"
187    )]
188    pub full_version: Option<String>,
189    pub platform: String,
190    #[serde(rename = "platformVersion")]
191    pub platform_version: String,
192    pub architecture: String,
193    pub model: String,
194    pub mobile: bool,
195    #[serde(default, skip_serializing_if = "Option::is_none")]
196    pub bitness: Option<String>,
197    #[serde(default, skip_serializing_if = "Option::is_none")]
198    pub wow64: Option<bool>,
199    /// Used to specify User Agent form-factor values. See
200    /// <https://wicg.github.io/ua-client-hints/#sec-ch-ua-form-factors>
201    #[serde(
202        rename = "formFactors",
203        default,
204        skip_serializing_if = "Option::is_none"
205    )]
206    pub form_factors: Option<Vec<String>>,
207}
208
209/// Used to specify sensor types to emulate. See
210/// <https://w3c.github.io/sensors/#automation> for more information.
211///
212/// Experimental: may change without notice.
213#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
214pub enum SensorType {
215    /// `absolute-orientation`
216    #[serde(rename = "absolute-orientation")]
217    AbsoluteOrientation,
218    /// `accelerometer`
219    #[serde(rename = "accelerometer")]
220    Accelerometer,
221    /// `ambient-light`
222    #[serde(rename = "ambient-light")]
223    AmbientLight,
224    /// `gravity`
225    #[serde(rename = "gravity")]
226    Gravity,
227    /// `gyroscope`
228    #[serde(rename = "gyroscope")]
229    Gyroscope,
230    /// `linear-acceleration`
231    #[serde(rename = "linear-acceleration")]
232    LinearAcceleration,
233    /// `magnetometer`
234    #[serde(rename = "magnetometer")]
235    Magnetometer,
236    /// `relative-orientation`
237    #[serde(rename = "relative-orientation")]
238    RelativeOrientation,
239    /// A value this vendored schema does not list. Chrome adds values ahead of
240    /// the published protocol, so an unrecognised one is kept as it arrived
241    /// rather than failing the payload it came in.
242    #[serde(untagged)]
243    Unrecognized(String),
244}
245
246/// Experimental: may change without notice.
247#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
248pub struct SensorMetadata {
249    #[serde(default, skip_serializing_if = "Option::is_none")]
250    pub available: Option<bool>,
251    #[serde(
252        rename = "minimumFrequency",
253        default,
254        skip_serializing_if = "Option::is_none"
255    )]
256    pub minimum_frequency: Option<f64>,
257    #[serde(
258        rename = "maximumFrequency",
259        default,
260        skip_serializing_if = "Option::is_none"
261    )]
262    pub maximum_frequency: Option<f64>,
263}
264
265/// Experimental: may change without notice.
266#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
267pub struct SensorReadingSingle {
268    pub value: f64,
269}
270
271/// Experimental: may change without notice.
272#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
273pub struct SensorReadingXyz {
274    pub x: f64,
275    pub y: f64,
276    pub z: f64,
277}
278
279/// Experimental: may change without notice.
280#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
281pub struct SensorReadingQuaternion {
282    pub x: f64,
283    pub y: f64,
284    pub z: f64,
285    pub w: f64,
286}
287
288/// Experimental: may change without notice.
289#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
290pub struct SensorReading {
291    #[serde(default, skip_serializing_if = "Option::is_none")]
292    pub single: Option<SensorReadingSingle>,
293    #[serde(default, skip_serializing_if = "Option::is_none")]
294    pub xyz: Option<SensorReadingXyz>,
295    #[serde(default, skip_serializing_if = "Option::is_none")]
296    pub quaternion: Option<SensorReadingQuaternion>,
297}
298
299/// Experimental: may change without notice.
300#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
301pub enum PressureSource {
302    /// `cpu`
303    #[serde(rename = "cpu")]
304    Cpu,
305    /// A value this vendored schema does not list. Chrome adds values ahead of
306    /// the published protocol, so an unrecognised one is kept as it arrived
307    /// rather than failing the payload it came in.
308    #[serde(untagged)]
309    Unrecognized(String),
310}
311
312/// Experimental: may change without notice.
313#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
314pub enum PressureState {
315    /// `nominal`
316    #[serde(rename = "nominal")]
317    Nominal,
318    /// `fair`
319    #[serde(rename = "fair")]
320    Fair,
321    /// `serious`
322    #[serde(rename = "serious")]
323    Serious,
324    /// `critical`
325    #[serde(rename = "critical")]
326    Critical,
327    /// A value this vendored schema does not list. Chrome adds values ahead of
328    /// the published protocol, so an unrecognised one is kept as it arrived
329    /// rather than failing the payload it came in.
330    #[serde(untagged)]
331    Unrecognized(String),
332}
333
334/// Experimental: may change without notice.
335#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
336pub struct PressureMetadata {
337    #[serde(default, skip_serializing_if = "Option::is_none")]
338    pub available: Option<bool>,
339}
340
341/// Experimental: may change without notice.
342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
343pub struct WorkAreaInsets {
344    /// Work area top inset in pixels. Default is 0;
345    #[serde(default, skip_serializing_if = "Option::is_none")]
346    pub top: Option<i64>,
347    /// Work area left inset in pixels. Default is 0;
348    #[serde(default, skip_serializing_if = "Option::is_none")]
349    pub left: Option<i64>,
350    /// Work area bottom inset in pixels. Default is 0;
351    #[serde(default, skip_serializing_if = "Option::is_none")]
352    pub bottom: Option<i64>,
353    /// Work area right inset in pixels. Default is 0;
354    #[serde(default, skip_serializing_if = "Option::is_none")]
355    pub right: Option<i64>,
356}
357
358/// Experimental: may change without notice.
359pub type ScreenId = String;
360
361/// Screen information similar to the one returned by
362/// window.getScreenDetails() method, see
363/// <https://w3c.github.io/window-management/#screendetailed>.
364///
365/// Experimental: may change without notice.
366#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
367pub struct ScreenInfo {
368    /// Offset of the left edge of the screen.
369    pub left: i64,
370    /// Offset of the top edge of the screen.
371    pub top: i64,
372    /// Width of the screen.
373    pub width: i64,
374    /// Height of the screen.
375    pub height: i64,
376    /// Offset of the left edge of the available screen area.
377    #[serde(rename = "availLeft")]
378    pub avail_left: i64,
379    /// Offset of the top edge of the available screen area.
380    #[serde(rename = "availTop")]
381    pub avail_top: i64,
382    /// Width of the available screen area.
383    #[serde(rename = "availWidth")]
384    pub avail_width: i64,
385    /// Height of the available screen area.
386    #[serde(rename = "availHeight")]
387    pub avail_height: i64,
388    /// Specifies the screen's device pixel ratio.
389    #[serde(rename = "devicePixelRatio")]
390    pub device_pixel_ratio: f64,
391    /// Specifies the screen's orientation.
392    pub orientation: ScreenOrientation,
393    /// Specifies the screen's color depth in bits.
394    #[serde(rename = "colorDepth")]
395    pub color_depth: i64,
396    /// Indicates whether the device has multiple screens.
397    #[serde(rename = "isExtended")]
398    pub is_extended: bool,
399    /// Indicates whether the screen is internal to the device or external,
400    /// attached to the device.
401    #[serde(rename = "isInternal")]
402    pub is_internal: bool,
403    /// Indicates whether the screen is set as the the operating system primary
404    /// screen.
405    #[serde(rename = "isPrimary")]
406    pub is_primary: bool,
407    /// Specifies the descriptive label for the screen.
408    pub label: String,
409    /// Specifies the unique identifier of the screen.
410    pub id: ScreenId,
411}
412
413/// Enum of image types that can be disabled.
414///
415/// Experimental: may change without notice.
416#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
417pub enum DisabledImageType {
418    /// `avif`
419    #[serde(rename = "avif")]
420    Avif,
421    /// `jxl`
422    #[serde(rename = "jxl")]
423    Jxl,
424    /// `webp`
425    #[serde(rename = "webp")]
426    Webp,
427    /// A value this vendored schema does not list. Chrome adds values ahead of
428    /// the published protocol, so an unrecognised one is kept as it arrived
429    /// rather than failing the payload it came in.
430    #[serde(untagged)]
431    Unrecognized(String),
432}
433
434/// Tells whether emulation is supported.
435///
436/// Deprecated in the protocol.
437///
438/// Parameters of `Emulation.canEmulate`.
439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
440pub struct CanEmulateParams {}
441
442/// What `Emulation.canEmulate` answers with.
443#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
444pub struct CanEmulateReturns {
445    /// True if emulation is supported.
446    pub result: bool,
447}
448
449impl crate::typed::Command for CanEmulateParams {
450    const METHOD: &'static str = "Emulation.canEmulate";
451    type Returns = CanEmulateReturns;
452}
453
454/// Clears the overridden device metrics.
455///
456/// Parameters of `Emulation.clearDeviceMetricsOverride`.
457#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
458pub struct ClearDeviceMetricsOverrideParams {}
459
460impl crate::typed::Command for ClearDeviceMetricsOverrideParams {
461    const METHOD: &'static str = "Emulation.clearDeviceMetricsOverride";
462    type Returns = crate::typed::NoReturns;
463}
464
465/// Clears the overridden Geolocation Position and Error.
466///
467/// Parameters of `Emulation.clearGeolocationOverride`.
468#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
469pub struct ClearGeolocationOverrideParams {}
470
471impl crate::typed::Command for ClearGeolocationOverrideParams {
472    const METHOD: &'static str = "Emulation.clearGeolocationOverride";
473    type Returns = crate::typed::NoReturns;
474}
475
476/// Requests that page scale factor is reset to initial values.
477///
478/// Experimental: may change without notice.
479///
480/// Parameters of `Emulation.resetPageScaleFactor`.
481#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
482pub struct ResetPageScaleFactorParams {}
483
484impl crate::typed::Command for ResetPageScaleFactorParams {
485    const METHOD: &'static str = "Emulation.resetPageScaleFactor";
486    type Returns = crate::typed::NoReturns;
487}
488
489/// Enables or disables simulating a focused and active page.
490///
491/// Experimental: may change without notice.
492///
493/// Parameters of `Emulation.setFocusEmulationEnabled`.
494#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
495pub struct SetFocusEmulationEnabledParams {
496    /// Whether to enable to disable focus emulation.
497    pub enabled: bool,
498}
499
500impl crate::typed::Command for SetFocusEmulationEnabledParams {
501    const METHOD: &'static str = "Emulation.setFocusEmulationEnabled";
502    type Returns = crate::typed::NoReturns;
503}
504
505/// Automatically render all web contents using a dark theme.
506///
507/// Experimental: may change without notice.
508///
509/// Parameters of `Emulation.setAutoDarkModeOverride`.
510#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
511pub struct SetAutoDarkModeOverrideParams {
512    /// Whether to enable or disable automatic dark mode. If not specified, any
513    /// existing override will be cleared.
514    #[serde(default, skip_serializing_if = "Option::is_none")]
515    pub enabled: Option<bool>,
516}
517
518impl crate::typed::Command for SetAutoDarkModeOverrideParams {
519    const METHOD: &'static str = "Emulation.setAutoDarkModeOverride";
520    type Returns = crate::typed::NoReturns;
521}
522
523/// Enables CPU throttling to emulate slow CPUs.
524///
525/// Parameters of `Emulation.setCPUThrottlingRate`.
526#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
527pub struct SetCpuThrottlingRateParams {
528    /// Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown,
529    /// etc).
530    pub rate: f64,
531}
532
533impl crate::typed::Command for SetCpuThrottlingRateParams {
534    const METHOD: &'static str = "Emulation.setCPUThrottlingRate";
535    type Returns = crate::typed::NoReturns;
536}
537
538/// Sets or clears an override of the default background color of the frame.
539/// This override is used if the content does not specify one.
540///
541/// Parameters of `Emulation.setDefaultBackgroundColorOverride`.
542#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
543pub struct SetDefaultBackgroundColorOverrideParams {
544    /// RGBA of the default background color. If not specified, any existing
545    /// override will be cleared.
546    #[serde(default, skip_serializing_if = "Option::is_none")]
547    pub color: Option<crate::protocol::dom::Rgba>,
548}
549
550impl crate::typed::Command for SetDefaultBackgroundColorOverrideParams {
551    const METHOD: &'static str = "Emulation.setDefaultBackgroundColorOverride";
552    type Returns = crate::typed::NoReturns;
553}
554
555/// Overrides the values for env(safe-area-inset-*) and
556/// env(safe-area-max-inset-*). Unset values will cause the respective
557/// variables to be undefined, even if previously overridden.
558///
559/// Experimental: may change without notice.
560///
561/// Parameters of `Emulation.setSafeAreaInsetsOverride`.
562#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
563pub struct SetSafeAreaInsetsOverrideParams {
564    pub insets: SafeAreaInsets,
565}
566
567impl crate::typed::Command for SetSafeAreaInsetsOverrideParams {
568    const METHOD: &'static str = "Emulation.setSafeAreaInsetsOverride";
569    type Returns = crate::typed::NoReturns;
570}
571
572/// Overrides virtual keyboard geometry in CSS pixels, relative to the
573/// top-level viewport. The provided rect is used for
574/// navigator.virtualKeyboard.boundingRect, geometrychange events, and
575/// env(keyboard-inset-*) values on the inspected frame. The override applies
576/// independently of navigator.virtualKeyboard.overlaysContent so clients can
577/// preview overlay geometry without mutating page state. Values are rounded
578/// to the nearest CSS pixel. Omitting the rect clears the override.
579///
580/// Experimental: may change without notice.
581///
582/// Parameters of `Emulation.setVirtualKeyboardGeometryOverride`.
583#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
584pub struct SetVirtualKeyboardGeometryOverrideParams {
585    #[serde(
586        rename = "keyboardRect",
587        default,
588        skip_serializing_if = "Option::is_none"
589    )]
590    pub keyboard_rect: Option<crate::protocol::dom::Rect>,
591}
592
593impl crate::typed::Command for SetVirtualKeyboardGeometryOverrideParams {
594    const METHOD: &'static str = "Emulation.setVirtualKeyboardGeometryOverride";
595    type Returns = crate::typed::NoReturns;
596}
597
598/// Overrides the values of device screen dimensions (window.screen.width,
599/// window.screen.height, window.innerWidth, window.innerHeight, and
600/// "device-width"/"device-height"-related CSS media query results).
601///
602/// Parameters of `Emulation.setDeviceMetricsOverride`.
603#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
604pub struct SetDeviceMetricsOverrideParams {
605    /// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables
606    /// the override.
607    pub width: i64,
608    /// Overriding height value in pixels (minimum 0, maximum 10000000). 0
609    /// disables the override.
610    pub height: i64,
611    /// Overriding device scale factor value. 0 disables the override.
612    #[serde(rename = "deviceScaleFactor")]
613    pub device_scale_factor: f64,
614    /// Whether to emulate mobile device. This includes viewport meta tag, overlay
615    /// scrollbars, text autosizing and more.
616    pub mobile: bool,
617    /// Scale to apply to resulting view image.
618    ///
619    /// Experimental: may change without notice.
620    #[serde(default, skip_serializing_if = "Option::is_none")]
621    pub scale: Option<f64>,
622    /// Overriding screen width value in pixels (minimum 0, maximum 10000000).
623    ///
624    /// Experimental: may change without notice.
625    #[serde(
626        rename = "screenWidth",
627        default,
628        skip_serializing_if = "Option::is_none"
629    )]
630    pub screen_width: Option<i64>,
631    /// Overriding screen height value in pixels (minimum 0, maximum 10000000).
632    ///
633    /// Experimental: may change without notice.
634    #[serde(
635        rename = "screenHeight",
636        default,
637        skip_serializing_if = "Option::is_none"
638    )]
639    pub screen_height: Option<i64>,
640    /// Overriding view X position on screen in pixels (minimum 0, maximum
641    /// 10000000).
642    ///
643    /// Experimental: may change without notice.
644    #[serde(rename = "positionX", default, skip_serializing_if = "Option::is_none")]
645    pub position_x: Option<i64>,
646    /// Overriding view Y position on screen in pixels (minimum 0, maximum
647    /// 10000000).
648    ///
649    /// Experimental: may change without notice.
650    #[serde(rename = "positionY", default, skip_serializing_if = "Option::is_none")]
651    pub position_y: Option<i64>,
652    /// Do not set visible view size, rely upon explicit setVisibleSize call.
653    ///
654    /// Experimental: may change without notice.
655    #[serde(
656        rename = "dontSetVisibleSize",
657        default,
658        skip_serializing_if = "Option::is_none"
659    )]
660    pub dont_set_visible_size: Option<bool>,
661    /// Screen orientation override.
662    #[serde(
663        rename = "screenOrientation",
664        default,
665        skip_serializing_if = "Option::is_none"
666    )]
667    pub screen_orientation: Option<ScreenOrientation>,
668    /// If set, the visible area of the page will be overridden to this viewport.
669    /// This viewport change is not observed by the page, e.g. viewport-relative
670    /// elements do not change positions.
671    ///
672    /// Experimental: may change without notice.
673    #[serde(default, skip_serializing_if = "Option::is_none")]
674    pub viewport: Option<crate::protocol::page::Viewport>,
675    /// If set, the display feature of a multi-segment screen. If not set,
676    /// multi-segment support is turned-off. Deprecated, use
677    /// Emulation.setDisplayFeaturesOverride.
678    ///
679    /// Deprecated in the protocol.
680    ///
681    /// Experimental: may change without notice.
682    #[serde(
683        rename = "displayFeature",
684        default,
685        skip_serializing_if = "Option::is_none"
686    )]
687    pub display_feature: Option<DisplayFeature>,
688    /// If set, the posture of a foldable device. If not set the posture is set to
689    /// continuous. Deprecated, use Emulation.setDevicePostureOverride.
690    ///
691    /// Deprecated in the protocol.
692    ///
693    /// Experimental: may change without notice.
694    #[serde(
695        rename = "devicePosture",
696        default,
697        skip_serializing_if = "Option::is_none"
698    )]
699    pub device_posture: Option<DevicePosture>,
700    /// Scrollbar type. Default: `default`.
701    ///
702    /// Experimental: may change without notice.
703    #[serde(
704        rename = "scrollbarType",
705        default,
706        skip_serializing_if = "Option::is_none"
707    )]
708    pub scrollbar_type: Option<SetDeviceMetricsOverrideScrollbarType>,
709    /// If set to true, enables screen orientation lock emulation, which
710    /// intercepts screen.orientation.lock() calls from the page and reports
711    /// orientation changes via screenOrientationLockChanged events. This is
712    /// useful for emulating mobile device orientation lock behavior in responsive
713    /// design mode.
714    ///
715    /// Experimental: may change without notice.
716    #[serde(
717        rename = "screenOrientationLockEmulation",
718        default,
719        skip_serializing_if = "Option::is_none"
720    )]
721    pub screen_orientation_lock_emulation: Option<bool>,
722    /// Viewport meta tag behavior. Default: `default`. Note: if `mobile` is
723    /// `true`, the viewport meta tag is always enabled.
724    ///
725    /// Experimental: may change without notice.
726    #[serde(
727        rename = "viewportMeta",
728        default,
729        skip_serializing_if = "Option::is_none"
730    )]
731    pub viewport_meta: Option<SetDeviceMetricsOverrideViewportMeta>,
732    /// Text layout mode. Default: `default`. Note: if `mobile` is `true`, mobile
733    /// text layout mode (text autosizing) is always enabled.
734    ///
735    /// Experimental: may change without notice.
736    #[serde(
737        rename = "textLayoutMode",
738        default,
739        skip_serializing_if = "Option::is_none"
740    )]
741    pub text_layout_mode: Option<SetDeviceMetricsOverrideTextLayoutMode>,
742}
743
744/// The values `scrollbarType` accepts on `setDeviceMetricsOverride`.
745#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
746pub enum SetDeviceMetricsOverrideScrollbarType {
747    /// `overlay`
748    #[serde(rename = "overlay")]
749    Overlay,
750    /// `default`
751    #[serde(rename = "default")]
752    Default,
753    /// A value this vendored schema does not list. Chrome adds values ahead of
754    /// the published protocol, so an unrecognised one is kept as it arrived
755    /// rather than failing the payload it came in.
756    #[serde(untagged)]
757    Unrecognized(String),
758}
759
760/// The values `viewportMeta` accepts on `setDeviceMetricsOverride`.
761#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
762pub enum SetDeviceMetricsOverrideViewportMeta {
763    /// `enable`
764    #[serde(rename = "enable")]
765    Enable,
766    /// `default`
767    #[serde(rename = "default")]
768    Default,
769    /// A value this vendored schema does not list. Chrome adds values ahead of
770    /// the published protocol, so an unrecognised one is kept as it arrived
771    /// rather than failing the payload it came in.
772    #[serde(untagged)]
773    Unrecognized(String),
774}
775
776/// The values `textLayoutMode` accepts on `setDeviceMetricsOverride`.
777#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
778pub enum SetDeviceMetricsOverrideTextLayoutMode {
779    /// `mobile`
780    #[serde(rename = "mobile")]
781    Mobile,
782    /// `default`
783    #[serde(rename = "default")]
784    Default,
785    /// A value this vendored schema does not list. Chrome adds values ahead of
786    /// the published protocol, so an unrecognised one is kept as it arrived
787    /// rather than failing the payload it came in.
788    #[serde(untagged)]
789    Unrecognized(String),
790}
791
792impl crate::typed::Command for SetDeviceMetricsOverrideParams {
793    const METHOD: &'static str = "Emulation.setDeviceMetricsOverride";
794    type Returns = crate::typed::NoReturns;
795}
796
797/// Start reporting the given posture value to the Device Posture API. This
798/// override can also be set in setDeviceMetricsOverride().
799///
800/// Experimental: may change without notice.
801///
802/// Parameters of `Emulation.setDevicePostureOverride`.
803#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
804pub struct SetDevicePostureOverrideParams {
805    pub posture: DevicePosture,
806}
807
808impl crate::typed::Command for SetDevicePostureOverrideParams {
809    const METHOD: &'static str = "Emulation.setDevicePostureOverride";
810    type Returns = crate::typed::NoReturns;
811}
812
813/// Clears a device posture override set with either
814/// setDeviceMetricsOverride() or setDevicePostureOverride() and starts using
815/// posture information from the platform again. Does nothing if no override
816/// is set.
817///
818/// Experimental: may change without notice.
819///
820/// Parameters of `Emulation.clearDevicePostureOverride`.
821#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
822pub struct ClearDevicePostureOverrideParams {}
823
824impl crate::typed::Command for ClearDevicePostureOverrideParams {
825    const METHOD: &'static str = "Emulation.clearDevicePostureOverride";
826    type Returns = crate::typed::NoReturns;
827}
828
829/// Start using the given display features to pupulate the Viewport Segments
830/// API. This override can also be set in setDeviceMetricsOverride().
831///
832/// Experimental: may change without notice.
833///
834/// Parameters of `Emulation.setDisplayFeaturesOverride`.
835#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
836pub struct SetDisplayFeaturesOverrideParams {
837    pub features: Vec<DisplayFeature>,
838}
839
840impl crate::typed::Command for SetDisplayFeaturesOverrideParams {
841    const METHOD: &'static str = "Emulation.setDisplayFeaturesOverride";
842    type Returns = crate::typed::NoReturns;
843}
844
845/// Clears the display features override set with either
846/// setDeviceMetricsOverride() or setDisplayFeaturesOverride() and starts
847/// using display features from the platform again. Does nothing if no
848/// override is set.
849///
850/// Experimental: may change without notice.
851///
852/// Parameters of `Emulation.clearDisplayFeaturesOverride`.
853#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
854pub struct ClearDisplayFeaturesOverrideParams {}
855
856impl crate::typed::Command for ClearDisplayFeaturesOverrideParams {
857    const METHOD: &'static str = "Emulation.clearDisplayFeaturesOverride";
858    type Returns = crate::typed::NoReturns;
859}
860
861/// Experimental: may change without notice.
862///
863/// Parameters of `Emulation.setScrollbarsHidden`.
864#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
865pub struct SetScrollbarsHiddenParams {
866    /// Whether scrollbars should be always hidden.
867    pub hidden: bool,
868}
869
870impl crate::typed::Command for SetScrollbarsHiddenParams {
871    const METHOD: &'static str = "Emulation.setScrollbarsHidden";
872    type Returns = crate::typed::NoReturns;
873}
874
875/// Experimental: may change without notice.
876///
877/// Parameters of `Emulation.setDocumentCookieDisabled`.
878#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
879pub struct SetDocumentCookieDisabledParams {
880    /// Whether document.coookie API should be disabled.
881    pub disabled: bool,
882}
883
884impl crate::typed::Command for SetDocumentCookieDisabledParams {
885    const METHOD: &'static str = "Emulation.setDocumentCookieDisabled";
886    type Returns = crate::typed::NoReturns;
887}
888
889/// Experimental: may change without notice.
890///
891/// Parameters of `Emulation.setEmitTouchEventsForMouse`.
892#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
893pub struct SetEmitTouchEventsForMouseParams {
894    /// Whether touch emulation based on mouse input should be enabled.
895    pub enabled: bool,
896    /// Touch/gesture events configuration. Default: current platform.
897    #[serde(default, skip_serializing_if = "Option::is_none")]
898    pub configuration: Option<SetEmitTouchEventsForMouseConfiguration>,
899}
900
901/// The values `configuration` accepts on `setEmitTouchEventsForMouse`.
902#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
903pub enum SetEmitTouchEventsForMouseConfiguration {
904    /// `mobile`
905    #[serde(rename = "mobile")]
906    Mobile,
907    /// `desktop`
908    #[serde(rename = "desktop")]
909    Desktop,
910    /// A value this vendored schema does not list. Chrome adds values ahead of
911    /// the published protocol, so an unrecognised one is kept as it arrived
912    /// rather than failing the payload it came in.
913    #[serde(untagged)]
914    Unrecognized(String),
915}
916
917impl crate::typed::Command for SetEmitTouchEventsForMouseParams {
918    const METHOD: &'static str = "Emulation.setEmitTouchEventsForMouse";
919    type Returns = crate::typed::NoReturns;
920}
921
922/// Emulates the given media type or media feature for CSS media queries.
923///
924/// Parameters of `Emulation.setEmulatedMedia`.
925#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
926pub struct SetEmulatedMediaParams {
927    /// Media type to emulate. Empty string disables the override.
928    #[serde(default, skip_serializing_if = "Option::is_none")]
929    pub media: Option<String>,
930    /// Media features to emulate.
931    #[serde(default, skip_serializing_if = "Option::is_none")]
932    pub features: Option<Vec<MediaFeature>>,
933}
934
935impl crate::typed::Command for SetEmulatedMediaParams {
936    const METHOD: &'static str = "Emulation.setEmulatedMedia";
937    type Returns = crate::typed::NoReturns;
938}
939
940/// Emulates the given vision deficiency.
941///
942/// Parameters of `Emulation.setEmulatedVisionDeficiency`.
943#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
944pub struct SetEmulatedVisionDeficiencyParams {
945    /// Vision deficiency to emulate. Order: best-effort emulations come first,
946    /// followed by any physiologically accurate emulations for medically
947    /// recognized color vision deficiencies.
948    pub r#type: SetEmulatedVisionDeficiencyType,
949}
950
951/// The values `type` accepts on `setEmulatedVisionDeficiency`.
952#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
953pub enum SetEmulatedVisionDeficiencyType {
954    /// `none`
955    #[serde(rename = "none")]
956    None,
957    /// `blurredVision`
958    #[serde(rename = "blurredVision")]
959    BlurredVision,
960    /// `reducedContrast`
961    #[serde(rename = "reducedContrast")]
962    ReducedContrast,
963    /// `achromatopsia`
964    #[serde(rename = "achromatopsia")]
965    Achromatopsia,
966    /// `deuteranopia`
967    #[serde(rename = "deuteranopia")]
968    Deuteranopia,
969    /// `protanopia`
970    #[serde(rename = "protanopia")]
971    Protanopia,
972    /// `tritanopia`
973    #[serde(rename = "tritanopia")]
974    Tritanopia,
975    /// A value this vendored schema does not list. Chrome adds values ahead of
976    /// the published protocol, so an unrecognised one is kept as it arrived
977    /// rather than failing the payload it came in.
978    #[serde(untagged)]
979    Unrecognized(String),
980}
981
982impl crate::typed::Command for SetEmulatedVisionDeficiencyParams {
983    const METHOD: &'static str = "Emulation.setEmulatedVisionDeficiency";
984    type Returns = crate::typed::NoReturns;
985}
986
987/// Emulates the given OS text scale.
988///
989/// Parameters of `Emulation.setEmulatedOSTextScale`.
990#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
991pub struct SetEmulatedOsTextScaleParams {
992    #[serde(default, skip_serializing_if = "Option::is_none")]
993    pub scale: Option<f64>,
994}
995
996impl crate::typed::Command for SetEmulatedOsTextScaleParams {
997    const METHOD: &'static str = "Emulation.setEmulatedOSTextScale";
998    type Returns = crate::typed::NoReturns;
999}
1000
1001/// Overrides the Geolocation Position or Error. Omitting latitude, longitude
1002/// or accuracy emulates position unavailable.
1003///
1004/// Parameters of `Emulation.setGeolocationOverride`.
1005#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1006pub struct SetGeolocationOverrideParams {
1007    /// Mock latitude
1008    #[serde(default, skip_serializing_if = "Option::is_none")]
1009    pub latitude: Option<f64>,
1010    /// Mock longitude
1011    #[serde(default, skip_serializing_if = "Option::is_none")]
1012    pub longitude: Option<f64>,
1013    /// Mock accuracy
1014    #[serde(default, skip_serializing_if = "Option::is_none")]
1015    pub accuracy: Option<f64>,
1016    /// Mock altitude
1017    #[serde(default, skip_serializing_if = "Option::is_none")]
1018    pub altitude: Option<f64>,
1019    /// Mock altitudeAccuracy
1020    #[serde(
1021        rename = "altitudeAccuracy",
1022        default,
1023        skip_serializing_if = "Option::is_none"
1024    )]
1025    pub altitude_accuracy: Option<f64>,
1026    /// Mock heading
1027    #[serde(default, skip_serializing_if = "Option::is_none")]
1028    pub heading: Option<f64>,
1029    /// Mock speed
1030    #[serde(default, skip_serializing_if = "Option::is_none")]
1031    pub speed: Option<f64>,
1032}
1033
1034impl crate::typed::Command for SetGeolocationOverrideParams {
1035    const METHOD: &'static str = "Emulation.setGeolocationOverride";
1036    type Returns = crate::typed::NoReturns;
1037}
1038
1039/// Experimental: may change without notice.
1040///
1041/// Parameters of `Emulation.getOverriddenSensorInformation`.
1042#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1043pub struct GetOverriddenSensorInformationParams {
1044    pub r#type: SensorType,
1045}
1046
1047/// What `Emulation.getOverriddenSensorInformation` answers with.
1048#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1049pub struct GetOverriddenSensorInformationReturns {
1050    #[serde(rename = "requestedSamplingFrequency")]
1051    pub requested_sampling_frequency: f64,
1052}
1053
1054impl crate::typed::Command for GetOverriddenSensorInformationParams {
1055    const METHOD: &'static str = "Emulation.getOverriddenSensorInformation";
1056    type Returns = GetOverriddenSensorInformationReturns;
1057}
1058
1059/// Overrides a platform sensor of a given type. If |enabled| is true, calls
1060/// to Sensor.start() will use a virtual sensor as backend rather than
1061/// fetching data from a real hardware sensor. Otherwise, existing virtual
1062/// sensor-backend Sensor objects will fire an error event and new calls to
1063/// Sensor.start() will attempt to use a real sensor instead.
1064///
1065/// Experimental: may change without notice.
1066///
1067/// Parameters of `Emulation.setSensorOverrideEnabled`.
1068#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1069pub struct SetSensorOverrideEnabledParams {
1070    pub enabled: bool,
1071    pub r#type: SensorType,
1072    #[serde(default, skip_serializing_if = "Option::is_none")]
1073    pub metadata: Option<SensorMetadata>,
1074}
1075
1076impl crate::typed::Command for SetSensorOverrideEnabledParams {
1077    const METHOD: &'static str = "Emulation.setSensorOverrideEnabled";
1078    type Returns = crate::typed::NoReturns;
1079}
1080
1081/// Updates the sensor readings reported by a sensor type previously
1082/// overridden by setSensorOverrideEnabled.
1083///
1084/// Experimental: may change without notice.
1085///
1086/// Parameters of `Emulation.setSensorOverrideReadings`.
1087#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1088pub struct SetSensorOverrideReadingsParams {
1089    pub r#type: SensorType,
1090    pub reading: SensorReading,
1091}
1092
1093impl crate::typed::Command for SetSensorOverrideReadingsParams {
1094    const METHOD: &'static str = "Emulation.setSensorOverrideReadings";
1095    type Returns = crate::typed::NoReturns;
1096}
1097
1098/// Overrides a pressure source of a given type, as used by the Compute
1099/// Pressure API, so that updates to PressureObserver.observe() are provided
1100/// via setPressureStateOverride instead of being retrieved from
1101/// platform-provided telemetry data.
1102///
1103/// Experimental: may change without notice.
1104///
1105/// Parameters of `Emulation.setPressureSourceOverrideEnabled`.
1106#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1107pub struct SetPressureSourceOverrideEnabledParams {
1108    pub enabled: bool,
1109    pub source: PressureSource,
1110    #[serde(default, skip_serializing_if = "Option::is_none")]
1111    pub metadata: Option<PressureMetadata>,
1112}
1113
1114impl crate::typed::Command for SetPressureSourceOverrideEnabledParams {
1115    const METHOD: &'static str = "Emulation.setPressureSourceOverrideEnabled";
1116    type Returns = crate::typed::NoReturns;
1117}
1118
1119/// Provides a given pressure state that will be processed and eventually be
1120/// delivered to PressureObserver users. |source| must have been previously
1121/// overridden by setPressureSourceOverrideEnabled.
1122///
1123/// Experimental: may change without notice.
1124///
1125/// Parameters of `Emulation.setPressureStateOverride`.
1126#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1127pub struct SetPressureStateOverrideParams {
1128    pub source: PressureSource,
1129    pub state: PressureState,
1130}
1131
1132impl crate::typed::Command for SetPressureStateOverrideParams {
1133    const METHOD: &'static str = "Emulation.setPressureStateOverride";
1134    type Returns = crate::typed::NoReturns;
1135}
1136
1137/// Overrides the Idle state.
1138///
1139/// Parameters of `Emulation.setIdleOverride`.
1140#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1141pub struct SetIdleOverrideParams {
1142    /// Mock isUserActive
1143    #[serde(rename = "isUserActive")]
1144    pub is_user_active: bool,
1145    /// Mock isScreenUnlocked
1146    #[serde(rename = "isScreenUnlocked")]
1147    pub is_screen_unlocked: bool,
1148}
1149
1150impl crate::typed::Command for SetIdleOverrideParams {
1151    const METHOD: &'static str = "Emulation.setIdleOverride";
1152    type Returns = crate::typed::NoReturns;
1153}
1154
1155/// Clears Idle state overrides.
1156///
1157/// Parameters of `Emulation.clearIdleOverride`.
1158#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1159pub struct ClearIdleOverrideParams {}
1160
1161impl crate::typed::Command for ClearIdleOverrideParams {
1162    const METHOD: &'static str = "Emulation.clearIdleOverride";
1163    type Returns = crate::typed::NoReturns;
1164}
1165
1166/// Overrides value returned by the javascript navigator object.
1167///
1168/// Deprecated in the protocol.
1169///
1170/// Experimental: may change without notice.
1171///
1172/// Parameters of `Emulation.setNavigatorOverrides`.
1173#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1174pub struct SetNavigatorOverridesParams {
1175    /// The platform navigator.platform should return.
1176    pub platform: String,
1177}
1178
1179impl crate::typed::Command for SetNavigatorOverridesParams {
1180    const METHOD: &'static str = "Emulation.setNavigatorOverrides";
1181    type Returns = crate::typed::NoReturns;
1182}
1183
1184/// Sets a specified page scale factor.
1185///
1186/// Experimental: may change without notice.
1187///
1188/// Parameters of `Emulation.setPageScaleFactor`.
1189#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1190pub struct SetPageScaleFactorParams {
1191    /// Page scale factor.
1192    #[serde(rename = "pageScaleFactor")]
1193    pub page_scale_factor: f64,
1194}
1195
1196impl crate::typed::Command for SetPageScaleFactorParams {
1197    const METHOD: &'static str = "Emulation.setPageScaleFactor";
1198    type Returns = crate::typed::NoReturns;
1199}
1200
1201/// Switches script execution in the page.
1202///
1203/// Parameters of `Emulation.setScriptExecutionDisabled`.
1204#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1205pub struct SetScriptExecutionDisabledParams {
1206    /// Whether script execution should be disabled in the page.
1207    pub value: bool,
1208}
1209
1210impl crate::typed::Command for SetScriptExecutionDisabledParams {
1211    const METHOD: &'static str = "Emulation.setScriptExecutionDisabled";
1212    type Returns = crate::typed::NoReturns;
1213}
1214
1215/// Enables touch on platforms which do not support them.
1216///
1217/// Parameters of `Emulation.setTouchEmulationEnabled`.
1218#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1219pub struct SetTouchEmulationEnabledParams {
1220    /// Whether the touch event emulation should be enabled.
1221    pub enabled: bool,
1222    /// Maximum touch points supported. Defaults to one.
1223    #[serde(
1224        rename = "maxTouchPoints",
1225        default,
1226        skip_serializing_if = "Option::is_none"
1227    )]
1228    pub max_touch_points: Option<i64>,
1229}
1230
1231impl crate::typed::Command for SetTouchEmulationEnabledParams {
1232    const METHOD: &'static str = "Emulation.setTouchEmulationEnabled";
1233    type Returns = crate::typed::NoReturns;
1234}
1235
1236/// Turns on virtual time for all frames (replacing real-time with a synthetic
1237/// time source) and sets the current virtual time policy. Note this
1238/// supersedes any previous time budget.
1239///
1240/// Experimental: may change without notice.
1241///
1242/// Parameters of `Emulation.setVirtualTimePolicy`.
1243#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1244pub struct SetVirtualTimePolicyParams {
1245    pub policy: VirtualTimePolicy,
1246    /// If set, after this many virtual milliseconds have elapsed virtual time
1247    /// will be paused and a virtualTimeBudgetExpired event is sent.
1248    #[serde(default, skip_serializing_if = "Option::is_none")]
1249    pub budget: Option<f64>,
1250    /// If set this specifies the maximum number of tasks that can be run before
1251    /// virtual is forced forwards to prevent deadlock.
1252    #[serde(
1253        rename = "maxVirtualTimeTaskStarvationCount",
1254        default,
1255        skip_serializing_if = "Option::is_none"
1256    )]
1257    pub max_virtual_time_task_starvation_count: Option<i64>,
1258    /// If set, base::Time::Now will be overridden to initially return this value.
1259    #[serde(
1260        rename = "initialVirtualTime",
1261        default,
1262        skip_serializing_if = "Option::is_none"
1263    )]
1264    pub initial_virtual_time: Option<crate::protocol::network::TimeSinceEpoch>,
1265}
1266
1267/// What `Emulation.setVirtualTimePolicy` answers with.
1268#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1269pub struct SetVirtualTimePolicyReturns {
1270    /// Absolute timestamp at which virtual time was first enabled (up time in
1271    /// milliseconds).
1272    #[serde(rename = "virtualTimeTicksBase")]
1273    pub virtual_time_ticks_base: f64,
1274}
1275
1276impl crate::typed::Command for SetVirtualTimePolicyParams {
1277    const METHOD: &'static str = "Emulation.setVirtualTimePolicy";
1278    type Returns = SetVirtualTimePolicyReturns;
1279}
1280
1281/// Overrides default host system locale with the specified one.
1282///
1283/// Experimental: may change without notice.
1284///
1285/// Parameters of `Emulation.setLocaleOverride`.
1286#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1287pub struct SetLocaleOverrideParams {
1288    /// ICU style C locale (e.g. "en_US"). If not specified or empty, disables the
1289    /// override and restores default host system locale.
1290    #[serde(default, skip_serializing_if = "Option::is_none")]
1291    pub locale: Option<String>,
1292}
1293
1294impl crate::typed::Command for SetLocaleOverrideParams {
1295    const METHOD: &'static str = "Emulation.setLocaleOverride";
1296    type Returns = crate::typed::NoReturns;
1297}
1298
1299/// Overrides default host system timezone with the specified one.
1300///
1301/// Parameters of `Emulation.setTimezoneOverride`.
1302#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1303pub struct SetTimezoneOverrideParams {
1304    /// The timezone identifier. List of supported timezones:
1305    /// <https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt>
1306    /// If empty, disables the override and restores default host system timezone.
1307    #[serde(rename = "timezoneId")]
1308    pub timezone_id: String,
1309}
1310
1311impl crate::typed::Command for SetTimezoneOverrideParams {
1312    const METHOD: &'static str = "Emulation.setTimezoneOverride";
1313    type Returns = crate::typed::NoReturns;
1314}
1315
1316/// Resizes the frame/viewport of the page. Note that this does not affect the
1317/// frame's container (e.g. browser window). Can be used to produce
1318/// screenshots of the specified size. Not supported on Android.
1319///
1320/// Deprecated in the protocol.
1321///
1322/// Experimental: may change without notice.
1323///
1324/// Parameters of `Emulation.setVisibleSize`.
1325#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1326pub struct SetVisibleSizeParams {
1327    /// Frame width (DIP).
1328    pub width: i64,
1329    /// Frame height (DIP).
1330    pub height: i64,
1331}
1332
1333impl crate::typed::Command for SetVisibleSizeParams {
1334    const METHOD: &'static str = "Emulation.setVisibleSize";
1335    type Returns = crate::typed::NoReturns;
1336}
1337
1338/// Experimental: may change without notice.
1339///
1340/// Parameters of `Emulation.setDisabledImageTypes`.
1341#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1342pub struct SetDisabledImageTypesParams {
1343    /// Image types to disable.
1344    #[serde(rename = "imageTypes")]
1345    pub image_types: Vec<DisabledImageType>,
1346}
1347
1348impl crate::typed::Command for SetDisabledImageTypesParams {
1349    const METHOD: &'static str = "Emulation.setDisabledImageTypes";
1350    type Returns = crate::typed::NoReturns;
1351}
1352
1353/// Override the value of navigator.connection.saveData
1354///
1355/// Experimental: may change without notice.
1356///
1357/// Parameters of `Emulation.setDataSaverOverride`.
1358#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1359pub struct SetDataSaverOverrideParams {
1360    /// Override value. Omitting the parameter disables the override.
1361    #[serde(
1362        rename = "dataSaverEnabled",
1363        default,
1364        skip_serializing_if = "Option::is_none"
1365    )]
1366    pub data_saver_enabled: Option<bool>,
1367}
1368
1369impl crate::typed::Command for SetDataSaverOverrideParams {
1370    const METHOD: &'static str = "Emulation.setDataSaverOverride";
1371    type Returns = crate::typed::NoReturns;
1372}
1373
1374/// Experimental: may change without notice.
1375///
1376/// Parameters of `Emulation.setHardwareConcurrencyOverride`.
1377#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1378pub struct SetHardwareConcurrencyOverrideParams {
1379    /// Hardware concurrency to report
1380    #[serde(rename = "hardwareConcurrency")]
1381    pub hardware_concurrency: i64,
1382}
1383
1384impl crate::typed::Command for SetHardwareConcurrencyOverrideParams {
1385    const METHOD: &'static str = "Emulation.setHardwareConcurrencyOverride";
1386    type Returns = crate::typed::NoReturns;
1387}
1388
1389/// Overrides the value of navigator.cpuPerformance
1390///
1391/// Experimental: may change without notice.
1392///
1393/// Parameters of `Emulation.setCPUPerformanceOverride`.
1394#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1395pub struct SetCpuPerformanceOverrideParams {
1396    /// Override value. Omitting the parameter disables the override.
1397    #[serde(
1398        rename = "performanceTier",
1399        default,
1400        skip_serializing_if = "Option::is_none"
1401    )]
1402    pub performance_tier: Option<SetCpuPerformanceOverridePerformanceTier>,
1403}
1404
1405/// The values `performanceTier` accepts on `setCPUPerformanceOverride`.
1406#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1407pub enum SetCpuPerformanceOverridePerformanceTier {
1408    /// `unknown`
1409    #[serde(rename = "unknown")]
1410    Unknown,
1411    /// `low`
1412    #[serde(rename = "low")]
1413    Low,
1414    /// `mid`
1415    #[serde(rename = "mid")]
1416    Mid,
1417    /// `high`
1418    #[serde(rename = "high")]
1419    High,
1420    /// `ultra`
1421    #[serde(rename = "ultra")]
1422    Ultra,
1423    /// A value this vendored schema does not list. Chrome adds values ahead of
1424    /// the published protocol, so an unrecognised one is kept as it arrived
1425    /// rather than failing the payload it came in.
1426    #[serde(untagged)]
1427    Unrecognized(String),
1428}
1429
1430impl crate::typed::Command for SetCpuPerformanceOverrideParams {
1431    const METHOD: &'static str = "Emulation.setCPUPerformanceOverride";
1432    type Returns = crate::typed::NoReturns;
1433}
1434
1435/// Allows overriding user agent with the given string. `userAgentMetadata`
1436/// must be set for Client Hint headers to be sent.
1437///
1438/// Parameters of `Emulation.setUserAgentOverride`.
1439#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1440pub struct SetUserAgentOverrideParams {
1441    /// User agent to use.
1442    #[serde(rename = "userAgent")]
1443    pub user_agent: String,
1444    /// Browser language to emulate.
1445    #[serde(
1446        rename = "acceptLanguage",
1447        default,
1448        skip_serializing_if = "Option::is_none"
1449    )]
1450    pub accept_language: Option<String>,
1451    /// The platform navigator.platform should return.
1452    #[serde(default, skip_serializing_if = "Option::is_none")]
1453    pub platform: Option<String>,
1454    /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
1455    ///
1456    /// Experimental: may change without notice.
1457    #[serde(
1458        rename = "userAgentMetadata",
1459        default,
1460        skip_serializing_if = "Option::is_none"
1461    )]
1462    pub user_agent_metadata: Option<UserAgentMetadata>,
1463}
1464
1465impl crate::typed::Command for SetUserAgentOverrideParams {
1466    const METHOD: &'static str = "Emulation.setUserAgentOverride";
1467    type Returns = crate::typed::NoReturns;
1468}
1469
1470/// Allows overriding the automation flag.
1471///
1472/// Experimental: may change without notice.
1473///
1474/// Parameters of `Emulation.setAutomationOverride`.
1475#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1476pub struct SetAutomationOverrideParams {
1477    /// Whether the override should be enabled.
1478    pub enabled: bool,
1479}
1480
1481impl crate::typed::Command for SetAutomationOverrideParams {
1482    const METHOD: &'static str = "Emulation.setAutomationOverride";
1483    type Returns = crate::typed::NoReturns;
1484}
1485
1486/// Allows overriding the difference between the small and large viewport
1487/// sizes, which determine the value of the `svh` and `lvh` unit,
1488/// respectively. Only supported for top-level frames.
1489///
1490/// Experimental: may change without notice.
1491///
1492/// Parameters of `Emulation.setSmallViewportHeightDifferenceOverride`.
1493#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1494pub struct SetSmallViewportHeightDifferenceOverrideParams {
1495    /// This will cause an element of size 100svh to be `difference` pixels
1496    /// smaller than an element of size 100lvh.
1497    pub difference: i64,
1498}
1499
1500impl crate::typed::Command for SetSmallViewportHeightDifferenceOverrideParams {
1501    const METHOD: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride";
1502    type Returns = crate::typed::NoReturns;
1503}
1504
1505/// Returns device's screen configuration. In headful mode, the physical
1506/// screens configuration is returned, whereas in headless mode, a virtual
1507/// headless screen configuration is provided instead.
1508///
1509/// Experimental: may change without notice.
1510///
1511/// Parameters of `Emulation.getScreenInfos`.
1512#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1513pub struct GetScreenInfosParams {}
1514
1515/// What `Emulation.getScreenInfos` answers with.
1516#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1517pub struct GetScreenInfosReturns {
1518    #[serde(rename = "screenInfos")]
1519    pub screen_infos: Vec<ScreenInfo>,
1520}
1521
1522impl crate::typed::Command for GetScreenInfosParams {
1523    const METHOD: &'static str = "Emulation.getScreenInfos";
1524    type Returns = GetScreenInfosReturns;
1525}
1526
1527/// Add a new screen to the device. Only supported in headless mode.
1528///
1529/// Experimental: may change without notice.
1530///
1531/// Parameters of `Emulation.addScreen`.
1532#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1533pub struct AddScreenParams {
1534    /// Offset of the left edge of the screen in pixels.
1535    pub left: i64,
1536    /// Offset of the top edge of the screen in pixels.
1537    pub top: i64,
1538    /// The width of the screen in pixels.
1539    pub width: i64,
1540    /// The height of the screen in pixels.
1541    pub height: i64,
1542    /// Specifies the screen's work area. Default is entire screen.
1543    #[serde(
1544        rename = "workAreaInsets",
1545        default,
1546        skip_serializing_if = "Option::is_none"
1547    )]
1548    pub work_area_insets: Option<WorkAreaInsets>,
1549    /// Specifies the screen's device pixel ratio. Default is 1.
1550    #[serde(
1551        rename = "devicePixelRatio",
1552        default,
1553        skip_serializing_if = "Option::is_none"
1554    )]
1555    pub device_pixel_ratio: Option<f64>,
1556    /// Specifies the screen's rotation angle. Available values are 0, 90, 180 and
1557    /// 270. Default is 0.
1558    #[serde(default, skip_serializing_if = "Option::is_none")]
1559    pub rotation: Option<i64>,
1560    /// Specifies the screen's color depth in bits. Default is 24.
1561    #[serde(
1562        rename = "colorDepth",
1563        default,
1564        skip_serializing_if = "Option::is_none"
1565    )]
1566    pub color_depth: Option<i64>,
1567    /// Specifies the descriptive label for the screen. Default is none.
1568    #[serde(default, skip_serializing_if = "Option::is_none")]
1569    pub label: Option<String>,
1570    /// Indicates whether the screen is internal to the device or external,
1571    /// attached to the device. Default is false.
1572    #[serde(
1573        rename = "isInternal",
1574        default,
1575        skip_serializing_if = "Option::is_none"
1576    )]
1577    pub is_internal: Option<bool>,
1578}
1579
1580/// What `Emulation.addScreen` answers with.
1581#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1582pub struct AddScreenReturns {
1583    #[serde(rename = "screenInfo")]
1584    pub screen_info: ScreenInfo,
1585}
1586
1587impl crate::typed::Command for AddScreenParams {
1588    const METHOD: &'static str = "Emulation.addScreen";
1589    type Returns = AddScreenReturns;
1590}
1591
1592/// Updates specified screen parameters. Only supported in headless mode.
1593///
1594/// Experimental: may change without notice.
1595///
1596/// Parameters of `Emulation.updateScreen`.
1597#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1598pub struct UpdateScreenParams {
1599    /// Target screen identifier.
1600    #[serde(rename = "screenId")]
1601    pub screen_id: ScreenId,
1602    /// Offset of the left edge of the screen in pixels.
1603    #[serde(default, skip_serializing_if = "Option::is_none")]
1604    pub left: Option<i64>,
1605    /// Offset of the top edge of the screen in pixels.
1606    #[serde(default, skip_serializing_if = "Option::is_none")]
1607    pub top: Option<i64>,
1608    /// The width of the screen in pixels.
1609    #[serde(default, skip_serializing_if = "Option::is_none")]
1610    pub width: Option<i64>,
1611    /// The height of the screen in pixels.
1612    #[serde(default, skip_serializing_if = "Option::is_none")]
1613    pub height: Option<i64>,
1614    /// Specifies the screen's work area.
1615    #[serde(
1616        rename = "workAreaInsets",
1617        default,
1618        skip_serializing_if = "Option::is_none"
1619    )]
1620    pub work_area_insets: Option<WorkAreaInsets>,
1621    /// Specifies the screen's device pixel ratio.
1622    #[serde(
1623        rename = "devicePixelRatio",
1624        default,
1625        skip_serializing_if = "Option::is_none"
1626    )]
1627    pub device_pixel_ratio: Option<f64>,
1628    /// Specifies the screen's rotation angle. Available values are 0, 90, 180 and
1629    /// 270.
1630    #[serde(default, skip_serializing_if = "Option::is_none")]
1631    pub rotation: Option<i64>,
1632    /// Specifies the screen's color depth in bits.
1633    #[serde(
1634        rename = "colorDepth",
1635        default,
1636        skip_serializing_if = "Option::is_none"
1637    )]
1638    pub color_depth: Option<i64>,
1639    /// Specifies the descriptive label for the screen.
1640    #[serde(default, skip_serializing_if = "Option::is_none")]
1641    pub label: Option<String>,
1642    /// Indicates whether the screen is internal to the device or external,
1643    /// attached to the device. Default is false.
1644    #[serde(
1645        rename = "isInternal",
1646        default,
1647        skip_serializing_if = "Option::is_none"
1648    )]
1649    pub is_internal: Option<bool>,
1650}
1651
1652/// What `Emulation.updateScreen` answers with.
1653#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1654pub struct UpdateScreenReturns {
1655    #[serde(rename = "screenInfo")]
1656    pub screen_info: ScreenInfo,
1657}
1658
1659impl crate::typed::Command for UpdateScreenParams {
1660    const METHOD: &'static str = "Emulation.updateScreen";
1661    type Returns = UpdateScreenReturns;
1662}
1663
1664/// Remove screen from the device. Only supported in headless mode.
1665///
1666/// Experimental: may change without notice.
1667///
1668/// Parameters of `Emulation.removeScreen`.
1669#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1670pub struct RemoveScreenParams {
1671    #[serde(rename = "screenId")]
1672    pub screen_id: ScreenId,
1673}
1674
1675impl crate::typed::Command for RemoveScreenParams {
1676    const METHOD: &'static str = "Emulation.removeScreen";
1677    type Returns = crate::typed::NoReturns;
1678}
1679
1680/// Set primary screen. Only supported in headless mode. Note that this
1681/// changes the coordinate system origin to the top-left of the new primary
1682/// screen, updating the bounds and work areas of all existing screens
1683/// accordingly.
1684///
1685/// Experimental: may change without notice.
1686///
1687/// Parameters of `Emulation.setPrimaryScreen`.
1688#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1689pub struct SetPrimaryScreenParams {
1690    #[serde(rename = "screenId")]
1691    pub screen_id: ScreenId,
1692}
1693
1694impl crate::typed::Command for SetPrimaryScreenParams {
1695    const METHOD: &'static str = "Emulation.setPrimaryScreen";
1696    type Returns = crate::typed::NoReturns;
1697}
1698
1699/// Notification sent after the virtual time budget for the current
1700/// VirtualTimePolicy has run out.
1701///
1702/// Experimental: may change without notice.
1703///
1704/// Payload of the `Emulation.virtualTimeBudgetExpired` event.
1705#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1706pub struct VirtualTimeBudgetExpiredEvent {}
1707
1708impl crate::typed::Event for VirtualTimeBudgetExpiredEvent {
1709    const METHOD: &'static str = "Emulation.virtualTimeBudgetExpired";
1710}
1711
1712/// Fired when a page calls screen.orientation.lock() or
1713/// screen.orientation.unlock() while device emulation is enabled. This allows
1714/// the DevTools frontend to update the emulated device orientation
1715/// accordingly.
1716///
1717/// Experimental: may change without notice.
1718///
1719/// Payload of the `Emulation.screenOrientationLockChanged` event.
1720#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1721pub struct ScreenOrientationLockChangedEvent {
1722    /// Whether the screen orientation is currently locked.
1723    pub locked: bool,
1724    /// The orientation lock type requested by the page. Only set when locked is
1725    /// true.
1726    #[serde(default, skip_serializing_if = "Option::is_none")]
1727    pub orientation: Option<ScreenOrientation>,
1728}
1729
1730impl crate::typed::Event for ScreenOrientationLockChangedEvent {
1731    const METHOD: &'static str = "Emulation.screenOrientationLockChanged";
1732}