Skip to main content

cdp_protocol/
emulation.rs

1// Auto-generated from Chrome at version 146.0.7680.165 domain: Emulation
2#![allow(dead_code)]
3use super::dom;
4use super::network;
5use super::page;
6#[allow(unused_imports)]
7use super::types::*;
8#[allow(unused_imports)]
9use derive_builder::Builder;
10#[allow(unused_imports)]
11use serde::{Deserialize, Serialize};
12#[allow(unused_imports)]
13use serde_json::Value as Json;
14pub type ScreenId = String;
15#[allow(deprecated)]
16#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
17pub enum ScreenOrientationType {
18    #[serde(rename = "portraitPrimary")]
19    PortraitPrimary,
20    #[serde(rename = "portraitSecondary")]
21    PortraitSecondary,
22    #[serde(rename = "landscapePrimary")]
23    LandscapePrimary,
24    #[serde(rename = "landscapeSecondary")]
25    LandscapeSecondary,
26}
27#[allow(deprecated)]
28#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
29pub enum DisplayFeatureOrientation {
30    #[serde(rename = "vertical")]
31    Vertical,
32    #[serde(rename = "horizontal")]
33    Horizontal,
34}
35#[allow(deprecated)]
36#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
37pub enum DevicePostureType {
38    #[serde(rename = "continuous")]
39    Continuous,
40    #[serde(rename = "folded")]
41    Folded,
42}
43#[allow(deprecated)]
44#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
45pub enum VirtualTimePolicy {
46    #[serde(rename = "advance")]
47    Advance,
48    #[serde(rename = "pause")]
49    Pause,
50    #[serde(rename = "pauseIfNetworkFetchesPending")]
51    PauseIfNetworkFetchesPending,
52}
53#[allow(deprecated)]
54#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
55pub enum SensorType {
56    #[serde(rename = "absolute-orientation")]
57    AbsoluteOrientation,
58    #[serde(rename = "accelerometer")]
59    Accelerometer,
60    #[serde(rename = "ambient-light")]
61    AmbientLight,
62    #[serde(rename = "gravity")]
63    Gravity,
64    #[serde(rename = "gyroscope")]
65    Gyroscope,
66    #[serde(rename = "linear-acceleration")]
67    LinearAcceleration,
68    #[serde(rename = "magnetometer")]
69    Magnetometer,
70    #[serde(rename = "relative-orientation")]
71    RelativeOrientation,
72}
73#[allow(deprecated)]
74#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
75pub enum PressureSource {
76    #[serde(rename = "cpu")]
77    Cpu,
78}
79#[allow(deprecated)]
80#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
81pub enum PressureState {
82    #[serde(rename = "nominal")]
83    Nominal,
84    #[serde(rename = "fair")]
85    Fair,
86    #[serde(rename = "serious")]
87    Serious,
88    #[serde(rename = "critical")]
89    Critical,
90}
91#[allow(deprecated)]
92#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
93pub enum DisabledImageType {
94    #[serde(rename = "avif")]
95    Avif,
96    #[serde(rename = "webp")]
97    Webp,
98}
99#[allow(deprecated)]
100#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
101pub enum SetEmitTouchEventsForMouseConfigurationOption {
102    #[serde(rename = "mobile")]
103    Mobile,
104    #[serde(rename = "desktop")]
105    Desktop,
106}
107#[allow(deprecated)]
108#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
109pub enum SetEmulatedVisionDeficiencyTypeOption {
110    #[serde(rename = "none")]
111    None,
112    #[serde(rename = "blurredVision")]
113    BlurredVision,
114    #[serde(rename = "reducedContrast")]
115    ReducedContrast,
116    #[serde(rename = "achromatopsia")]
117    Achromatopsia,
118    #[serde(rename = "deuteranopia")]
119    Deuteranopia,
120    #[serde(rename = "protanopia")]
121    Protanopia,
122    #[serde(rename = "tritanopia")]
123    Tritanopia,
124}
125#[allow(deprecated)]
126#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
127#[builder(setter(into, strip_option))]
128#[serde(rename_all = "camelCase")]
129pub struct SafeAreaInsets {
130    #[builder(default)]
131    #[serde(skip_serializing_if = "Option::is_none")]
132    #[serde(default)]
133    #[doc = "Overrides safe-area-inset-top."]
134    pub top: Option<JsUInt>,
135    #[builder(default)]
136    #[serde(skip_serializing_if = "Option::is_none")]
137    #[serde(default)]
138    #[doc = "Overrides safe-area-max-inset-top."]
139    pub top_max: Option<JsUInt>,
140    #[builder(default)]
141    #[serde(skip_serializing_if = "Option::is_none")]
142    #[serde(default)]
143    #[doc = "Overrides safe-area-inset-left."]
144    pub left: Option<JsUInt>,
145    #[builder(default)]
146    #[serde(skip_serializing_if = "Option::is_none")]
147    #[serde(default)]
148    #[doc = "Overrides safe-area-max-inset-left."]
149    pub left_max: Option<JsUInt>,
150    #[builder(default)]
151    #[serde(skip_serializing_if = "Option::is_none")]
152    #[serde(default)]
153    #[doc = "Overrides safe-area-inset-bottom."]
154    pub bottom: Option<JsUInt>,
155    #[builder(default)]
156    #[serde(skip_serializing_if = "Option::is_none")]
157    #[serde(default)]
158    #[doc = "Overrides safe-area-max-inset-bottom."]
159    pub bottom_max: Option<JsUInt>,
160    #[builder(default)]
161    #[serde(skip_serializing_if = "Option::is_none")]
162    #[serde(default)]
163    #[doc = "Overrides safe-area-inset-right."]
164    pub right: Option<JsUInt>,
165    #[builder(default)]
166    #[serde(skip_serializing_if = "Option::is_none")]
167    #[serde(default)]
168    #[doc = "Overrides safe-area-max-inset-right."]
169    pub right_max: Option<JsUInt>,
170}
171#[allow(deprecated)]
172#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
173#[builder(setter(into, strip_option))]
174#[serde(rename_all = "camelCase")]
175#[doc = "Screen orientation."]
176pub struct ScreenOrientation {
177    #[doc = "Orientation type."]
178    pub r#type: ScreenOrientationType,
179    #[serde(default)]
180    #[doc = "Orientation angle."]
181    pub angle: JsUInt,
182}
183#[allow(deprecated)]
184#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
185#[builder(setter(into, strip_option))]
186#[serde(rename_all = "camelCase")]
187pub struct DisplayFeature {
188    #[doc = "Orientation of a display feature in relation to screen"]
189    pub orientation: DisplayFeatureOrientation,
190    #[serde(default)]
191    #[doc = "The offset from the screen origin in either the x (for vertical\n orientation) or y (for horizontal orientation) direction."]
192    pub offset: JsUInt,
193    #[serde(default)]
194    #[doc = "A display feature may mask content such that it is not physically\n displayed - this length along with the offset describes this area.\n A display feature that only splits content will have a 0 mask_length."]
195    pub mask_length: JsUInt,
196}
197#[allow(deprecated)]
198#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
199#[builder(setter(into, strip_option))]
200#[serde(rename_all = "camelCase")]
201pub struct DevicePosture {
202    #[doc = "Current posture of the device"]
203    pub r#type: DevicePostureType,
204}
205#[allow(deprecated)]
206#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
207#[builder(setter(into, strip_option))]
208#[serde(rename_all = "camelCase")]
209pub struct MediaFeature {
210    #[serde(default)]
211    pub name: String,
212    #[serde(default)]
213    pub value: String,
214}
215#[allow(deprecated)]
216#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
217#[builder(setter(into, strip_option))]
218#[serde(rename_all = "camelCase")]
219#[doc = "Used to specify User Agent Client Hints to emulate. See <https://wicg.github.io/ua-client-hints>"]
220pub struct UserAgentBrandVersion {
221    #[serde(default)]
222    pub brand: String,
223    #[serde(default)]
224    pub version: String,
225}
226#[allow(deprecated)]
227#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
228#[builder(setter(into, strip_option))]
229#[serde(rename_all = "camelCase")]
230#[doc = "Used to specify User Agent Client Hints to emulate. See <https://wicg.github.io/ua-client-hints>\n Missing optional values will be filled in by the target with what it would normally use."]
231pub struct UserAgentMetadata {
232    #[builder(default)]
233    #[serde(skip_serializing_if = "Option::is_none")]
234    #[doc = "Brands appearing in Sec-CH-UA."]
235    pub brands: Option<Vec<UserAgentBrandVersion>>,
236    #[builder(default)]
237    #[serde(skip_serializing_if = "Option::is_none")]
238    #[doc = "Brands appearing in Sec-CH-UA-Full-Version-List."]
239    pub full_version_list: Option<Vec<UserAgentBrandVersion>>,
240    #[builder(default)]
241    #[serde(skip_serializing_if = "Option::is_none")]
242    #[serde(default)]
243    #[deprecated]
244    pub full_version: Option<String>,
245    #[serde(default)]
246    pub platform: String,
247    #[serde(default)]
248    pub platform_version: String,
249    #[serde(default)]
250    pub architecture: String,
251    #[serde(default)]
252    pub model: String,
253    #[serde(default)]
254    pub mobile: bool,
255    #[builder(default)]
256    #[serde(skip_serializing_if = "Option::is_none")]
257    #[serde(default)]
258    pub bitness: Option<String>,
259    #[builder(default)]
260    #[serde(skip_serializing_if = "Option::is_none")]
261    #[serde(default)]
262    pub wow_64: Option<bool>,
263    #[builder(default)]
264    #[serde(skip_serializing_if = "Option::is_none")]
265    #[serde(default)]
266    #[doc = "Used to specify User Agent form-factor values.\n See <https://wicg.github.io/ua-client-hints/#sec-ch-ua-form-factors>"]
267    pub form_factors: Option<Vec<String>>,
268}
269#[allow(deprecated)]
270#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
271#[builder(setter(into, strip_option))]
272#[serde(rename_all = "camelCase")]
273pub struct SensorMetadata {
274    #[builder(default)]
275    #[serde(skip_serializing_if = "Option::is_none")]
276    #[serde(default)]
277    pub available: Option<bool>,
278    #[builder(default)]
279    #[serde(skip_serializing_if = "Option::is_none")]
280    #[serde(default)]
281    pub minimum_frequency: Option<JsFloat>,
282    #[builder(default)]
283    #[serde(skip_serializing_if = "Option::is_none")]
284    #[serde(default)]
285    pub maximum_frequency: Option<JsFloat>,
286}
287#[allow(deprecated)]
288#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
289#[builder(setter(into, strip_option))]
290#[serde(rename_all = "camelCase")]
291pub struct SensorReadingSingle {
292    #[serde(default)]
293    pub value: JsFloat,
294}
295#[allow(deprecated)]
296#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
297#[builder(setter(into, strip_option))]
298#[serde(rename_all = "camelCase")]
299pub struct SensorReadingXyz {
300    #[serde(default)]
301    pub x: JsFloat,
302    #[serde(default)]
303    pub y: JsFloat,
304    #[serde(default)]
305    pub z: JsFloat,
306}
307#[allow(deprecated)]
308#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
309#[builder(setter(into, strip_option))]
310#[serde(rename_all = "camelCase")]
311pub struct SensorReadingQuaternion {
312    #[serde(default)]
313    pub x: JsFloat,
314    #[serde(default)]
315    pub y: JsFloat,
316    #[serde(default)]
317    pub z: JsFloat,
318    #[serde(default)]
319    pub w: JsFloat,
320}
321#[allow(deprecated)]
322#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
323#[builder(setter(into, strip_option))]
324#[serde(rename_all = "camelCase")]
325pub struct SensorReading {
326    #[builder(default)]
327    #[serde(skip_serializing_if = "Option::is_none")]
328    pub single: Option<SensorReadingSingle>,
329    #[builder(default)]
330    #[serde(skip_serializing_if = "Option::is_none")]
331    pub xyz: Option<SensorReadingXyz>,
332    #[builder(default)]
333    #[serde(skip_serializing_if = "Option::is_none")]
334    pub quaternion: Option<SensorReadingQuaternion>,
335}
336#[allow(deprecated)]
337#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
338#[builder(setter(into, strip_option))]
339#[serde(rename_all = "camelCase")]
340pub struct PressureMetadata {
341    #[builder(default)]
342    #[serde(skip_serializing_if = "Option::is_none")]
343    #[serde(default)]
344    pub available: Option<bool>,
345}
346#[allow(deprecated)]
347#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
348#[builder(setter(into, strip_option))]
349#[serde(rename_all = "camelCase")]
350pub struct WorkAreaInsets {
351    #[builder(default)]
352    #[serde(skip_serializing_if = "Option::is_none")]
353    #[serde(default)]
354    #[doc = "Work area top inset in pixels. Default is 0;"]
355    pub top: Option<JsUInt>,
356    #[builder(default)]
357    #[serde(skip_serializing_if = "Option::is_none")]
358    #[serde(default)]
359    #[doc = "Work area left inset in pixels. Default is 0;"]
360    pub left: Option<JsUInt>,
361    #[builder(default)]
362    #[serde(skip_serializing_if = "Option::is_none")]
363    #[serde(default)]
364    #[doc = "Work area bottom inset in pixels. Default is 0;"]
365    pub bottom: Option<JsUInt>,
366    #[builder(default)]
367    #[serde(skip_serializing_if = "Option::is_none")]
368    #[serde(default)]
369    #[doc = "Work area right inset in pixels. Default is 0;"]
370    pub right: Option<JsUInt>,
371}
372#[allow(deprecated)]
373#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
374#[builder(setter(into, strip_option))]
375#[serde(rename_all = "camelCase")]
376#[doc = "Screen information similar to the one returned by window.getScreenDetails() method,\n see <https://w3c.github.io/window-management/#screendetailed>."]
377pub struct ScreenInfo {
378    #[serde(default)]
379    #[doc = "Offset of the left edge of the screen."]
380    pub left: JsUInt,
381    #[serde(default)]
382    #[doc = "Offset of the top edge of the screen."]
383    pub top: JsUInt,
384    #[serde(default)]
385    #[doc = "Width of the screen."]
386    pub width: JsUInt,
387    #[serde(default)]
388    #[doc = "Height of the screen."]
389    pub height: JsUInt,
390    #[serde(default)]
391    #[doc = "Offset of the left edge of the available screen area."]
392    pub avail_left: JsUInt,
393    #[serde(default)]
394    #[doc = "Offset of the top edge of the available screen area."]
395    pub avail_top: JsUInt,
396    #[serde(default)]
397    #[doc = "Width of the available screen area."]
398    pub avail_width: JsUInt,
399    #[serde(default)]
400    #[doc = "Height of the available screen area."]
401    pub avail_height: JsUInt,
402    #[serde(default)]
403    #[doc = "Specifies the screen's device pixel ratio."]
404    pub device_pixel_ratio: JsFloat,
405    #[doc = "Specifies the screen's orientation."]
406    pub orientation: ScreenOrientation,
407    #[serde(default)]
408    #[doc = "Specifies the screen's color depth in bits."]
409    pub color_depth: JsUInt,
410    #[serde(default)]
411    #[doc = "Indicates whether the device has multiple screens."]
412    pub is_extended: bool,
413    #[serde(default)]
414    #[doc = "Indicates whether the screen is internal to the device or external, attached to the device."]
415    pub is_internal: bool,
416    #[serde(default)]
417    #[doc = "Indicates whether the screen is set as the the operating system primary screen."]
418    pub is_primary: bool,
419    #[serde(default)]
420    #[doc = "Specifies the descriptive label for the screen."]
421    pub label: String,
422    #[doc = "Specifies the unique identifier of the screen."]
423    pub id: ScreenId,
424}
425#[allow(deprecated)]
426#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
427pub struct CanEmulate(pub Option<Json>);
428#[allow(deprecated)]
429#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
430pub struct ClearDeviceMetricsOverride(pub Option<Json>);
431#[allow(deprecated)]
432#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
433pub struct ClearGeolocationOverride(pub Option<Json>);
434#[allow(deprecated)]
435#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
436pub struct ResetPageScaleFactor(pub Option<Json>);
437#[allow(deprecated)]
438#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
439#[builder(setter(into, strip_option))]
440#[serde(rename_all = "camelCase")]
441#[doc = "Enables or disables simulating a focused and active page."]
442pub struct SetFocusEmulationEnabled {
443    #[serde(default)]
444    #[doc = "Whether to enable to disable focus emulation."]
445    pub enabled: bool,
446}
447#[allow(deprecated)]
448#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
449#[builder(setter(into, strip_option))]
450#[serde(rename_all = "camelCase")]
451#[doc = "Automatically render all web contents using a dark theme."]
452pub struct SetAutoDarkModeOverride {
453    #[builder(default)]
454    #[serde(skip_serializing_if = "Option::is_none")]
455    #[serde(default)]
456    #[doc = "Whether to enable or disable automatic dark mode.\n If not specified, any existing override will be cleared."]
457    pub enabled: Option<bool>,
458}
459#[allow(deprecated)]
460#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
461#[builder(setter(into, strip_option))]
462#[serde(rename_all = "camelCase")]
463#[doc = "Enables CPU throttling to emulate slow CPUs."]
464pub struct SetCPUThrottlingRate {
465    #[serde(default)]
466    #[doc = "Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc)."]
467    pub rate: JsFloat,
468}
469#[allow(deprecated)]
470#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
471#[builder(setter(into, strip_option))]
472#[serde(rename_all = "camelCase")]
473#[doc = "Sets or clears an override of the default background color of the frame. This override is used\n if the content does not specify one."]
474pub struct SetDefaultBackgroundColorOverride {
475    #[builder(default)]
476    #[serde(skip_serializing_if = "Option::is_none")]
477    #[doc = "RGBA of the default background color. If not specified, any existing override will be\n cleared."]
478    pub color: Option<dom::Rgba>,
479}
480#[allow(deprecated)]
481#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
482#[builder(setter(into, strip_option))]
483#[serde(rename_all = "camelCase")]
484#[doc = "Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the\n respective variables to be undefined, even if previously overridden."]
485pub struct SetSafeAreaInsetsOverride {
486    pub insets: SafeAreaInsets,
487}
488#[allow(deprecated)]
489#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
490#[builder(setter(into, strip_option))]
491#[serde(rename_all = "camelCase")]
492#[doc = "Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\n window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media\n query results)."]
493pub struct SetDeviceMetricsOverride {
494    #[serde(default)]
495    #[doc = "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override."]
496    pub width: JsUInt,
497    #[serde(default)]
498    #[doc = "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override."]
499    pub height: JsUInt,
500    #[serde(default)]
501    #[doc = "Overriding device scale factor value. 0 disables the override."]
502    pub device_scale_factor: JsFloat,
503    #[serde(default)]
504    #[doc = "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text\n autosizing and more."]
505    pub mobile: bool,
506    #[builder(default)]
507    #[serde(skip_serializing_if = "Option::is_none")]
508    #[serde(default)]
509    #[doc = "Scale to apply to resulting view image."]
510    pub scale: Option<JsFloat>,
511    #[builder(default)]
512    #[serde(skip_serializing_if = "Option::is_none")]
513    #[serde(default)]
514    #[doc = "Overriding screen width value in pixels (minimum 0, maximum 10000000)."]
515    pub screen_width: Option<JsUInt>,
516    #[builder(default)]
517    #[serde(skip_serializing_if = "Option::is_none")]
518    #[serde(default)]
519    #[doc = "Overriding screen height value in pixels (minimum 0, maximum 10000000)."]
520    pub screen_height: Option<JsUInt>,
521    #[builder(default)]
522    #[serde(skip_serializing_if = "Option::is_none")]
523    #[serde(default)]
524    #[doc = "Overriding view X position on screen in pixels (minimum 0, maximum 10000000)."]
525    pub position_x: Option<JsUInt>,
526    #[builder(default)]
527    #[serde(skip_serializing_if = "Option::is_none")]
528    #[serde(default)]
529    #[doc = "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000)."]
530    pub position_y: Option<JsUInt>,
531    #[builder(default)]
532    #[serde(skip_serializing_if = "Option::is_none")]
533    #[serde(default)]
534    #[doc = "Do not set visible view size, rely upon explicit setVisibleSize call."]
535    pub dont_set_visible_size: Option<bool>,
536    #[builder(default)]
537    #[serde(skip_serializing_if = "Option::is_none")]
538    #[doc = "Screen orientation override."]
539    pub screen_orientation: Option<ScreenOrientation>,
540    #[builder(default)]
541    #[serde(skip_serializing_if = "Option::is_none")]
542    #[doc = "If set, the visible area of the page will be overridden to this viewport. This viewport\n change is not observed by the page, e.g. viewport-relative elements do not change positions."]
543    pub viewport: Option<page::Viewport>,
544    #[builder(default)]
545    #[serde(skip_serializing_if = "Option::is_none")]
546    #[doc = "If set, the display feature of a multi-segment screen. If not set, multi-segment support\n is turned-off.\n Deprecated, use Emulation.setDisplayFeaturesOverride."]
547    #[deprecated]
548    pub display_feature: Option<DisplayFeature>,
549    #[builder(default)]
550    #[serde(skip_serializing_if = "Option::is_none")]
551    #[doc = "If set, the posture of a foldable device. If not set the posture is set\n to continuous.\n Deprecated, use Emulation.setDevicePostureOverride."]
552    #[deprecated]
553    pub device_posture: Option<DevicePosture>,
554}
555#[allow(deprecated)]
556#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
557#[builder(setter(into, strip_option))]
558#[serde(rename_all = "camelCase")]
559#[doc = "Start reporting the given posture value to the Device Posture API.\n This override can also be set in setDeviceMetricsOverride()."]
560pub struct SetDevicePostureOverride {
561    pub posture: DevicePosture,
562}
563#[allow(deprecated)]
564#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
565pub struct ClearDevicePostureOverride(pub Option<Json>);
566#[allow(deprecated)]
567#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
568#[builder(setter(into, strip_option))]
569#[serde(rename_all = "camelCase")]
570#[doc = "Start using the given display features to pupulate the Viewport Segments API.\n This override can also be set in setDeviceMetricsOverride()."]
571pub struct SetDisplayFeaturesOverride {
572    pub features: Vec<DisplayFeature>,
573}
574#[allow(deprecated)]
575#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
576pub struct ClearDisplayFeaturesOverride(pub Option<Json>);
577#[allow(deprecated)]
578#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
579#[builder(setter(into, strip_option))]
580#[serde(rename_all = "camelCase")]
581pub struct SetScrollbarsHidden {
582    #[serde(default)]
583    #[doc = "Whether scrollbars should be always hidden."]
584    pub hidden: bool,
585}
586#[allow(deprecated)]
587#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
588#[builder(setter(into, strip_option))]
589#[serde(rename_all = "camelCase")]
590pub struct SetDocumentCookieDisabled {
591    #[serde(default)]
592    #[doc = "Whether document.coookie API should be disabled."]
593    pub disabled: bool,
594}
595#[allow(deprecated)]
596#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
597#[builder(setter(into, strip_option))]
598#[serde(rename_all = "camelCase")]
599pub struct SetEmitTouchEventsForMouse {
600    #[serde(default)]
601    #[doc = "Whether touch emulation based on mouse input should be enabled."]
602    pub enabled: bool,
603    #[builder(default)]
604    #[serde(skip_serializing_if = "Option::is_none")]
605    #[doc = "Touch/gesture events configuration. Default: current platform."]
606    pub configuration: Option<SetEmitTouchEventsForMouseConfigurationOption>,
607}
608#[allow(deprecated)]
609#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
610#[builder(setter(into, strip_option))]
611#[serde(rename_all = "camelCase")]
612#[doc = "Emulates the given media type or media feature for CSS media queries."]
613pub struct SetEmulatedMedia {
614    #[builder(default)]
615    #[serde(skip_serializing_if = "Option::is_none")]
616    #[serde(default)]
617    #[doc = "Media type to emulate. Empty string disables the override."]
618    pub media: Option<String>,
619    #[builder(default)]
620    #[serde(skip_serializing_if = "Option::is_none")]
621    #[doc = "Media features to emulate."]
622    pub features: Option<Vec<MediaFeature>>,
623}
624#[allow(deprecated)]
625#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
626#[builder(setter(into, strip_option))]
627#[serde(rename_all = "camelCase")]
628#[doc = "Emulates the given vision deficiency."]
629pub struct SetEmulatedVisionDeficiency {
630    #[doc = "Vision deficiency to emulate. Order: best-effort emulations come first, followed by any\n physiologically accurate emulations for medically recognized color vision deficiencies."]
631    pub r#type: SetEmulatedVisionDeficiencyTypeOption,
632}
633#[allow(deprecated)]
634#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
635#[builder(setter(into, strip_option))]
636#[serde(rename_all = "camelCase")]
637#[doc = "Emulates the given OS text scale."]
638pub struct SetEmulatedOSTextScale {
639    #[builder(default)]
640    #[serde(skip_serializing_if = "Option::is_none")]
641    #[serde(default)]
642    pub scale: Option<JsFloat>,
643}
644#[allow(deprecated)]
645#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
646#[builder(setter(into, strip_option))]
647#[serde(rename_all = "camelCase")]
648#[doc = "Overrides the Geolocation Position or Error. Omitting latitude, longitude or\n accuracy emulates position unavailable."]
649pub struct SetGeolocationOverride {
650    #[builder(default)]
651    #[serde(skip_serializing_if = "Option::is_none")]
652    #[serde(default)]
653    #[doc = "Mock latitude"]
654    pub latitude: Option<JsFloat>,
655    #[builder(default)]
656    #[serde(skip_serializing_if = "Option::is_none")]
657    #[serde(default)]
658    #[doc = "Mock longitude"]
659    pub longitude: Option<JsFloat>,
660    #[builder(default)]
661    #[serde(skip_serializing_if = "Option::is_none")]
662    #[serde(default)]
663    #[doc = "Mock accuracy"]
664    pub accuracy: Option<JsFloat>,
665    #[builder(default)]
666    #[serde(skip_serializing_if = "Option::is_none")]
667    #[serde(default)]
668    #[doc = "Mock altitude"]
669    pub altitude: Option<JsFloat>,
670    #[builder(default)]
671    #[serde(skip_serializing_if = "Option::is_none")]
672    #[serde(default)]
673    #[doc = "Mock altitudeAccuracy"]
674    pub altitude_accuracy: Option<JsFloat>,
675    #[builder(default)]
676    #[serde(skip_serializing_if = "Option::is_none")]
677    #[serde(default)]
678    #[doc = "Mock heading"]
679    pub heading: Option<JsFloat>,
680    #[builder(default)]
681    #[serde(skip_serializing_if = "Option::is_none")]
682    #[serde(default)]
683    #[doc = "Mock speed"]
684    pub speed: Option<JsFloat>,
685}
686#[allow(deprecated)]
687#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
688#[builder(setter(into, strip_option))]
689#[serde(rename_all = "camelCase")]
690pub struct GetOverriddenSensorInformation {
691    pub r#type: SensorType,
692}
693#[allow(deprecated)]
694#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
695#[builder(setter(into, strip_option))]
696#[serde(rename_all = "camelCase")]
697#[doc = "Overrides a platform sensor of a given type. If |enabled| is true, calls to\n Sensor.start() will use a virtual sensor as backend rather than fetching\n data from a real hardware sensor. Otherwise, existing virtual\n sensor-backend Sensor objects will fire an error event and new calls to\n Sensor.start() will attempt to use a real sensor instead."]
698pub struct SetSensorOverrideEnabled {
699    #[serde(default)]
700    pub enabled: bool,
701    pub r#type: SensorType,
702    #[builder(default)]
703    #[serde(skip_serializing_if = "Option::is_none")]
704    pub metadata: Option<SensorMetadata>,
705}
706#[allow(deprecated)]
707#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
708#[builder(setter(into, strip_option))]
709#[serde(rename_all = "camelCase")]
710#[doc = "Updates the sensor readings reported by a sensor type previously overridden\n by setSensorOverrideEnabled."]
711pub struct SetSensorOverrideReadings {
712    pub r#type: SensorType,
713    pub reading: SensorReading,
714}
715#[allow(deprecated)]
716#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
717#[builder(setter(into, strip_option))]
718#[serde(rename_all = "camelCase")]
719#[doc = "Overrides a pressure source of a given type, as used by the Compute\n Pressure API, so that updates to PressureObserver.observe() are provided\n via setPressureStateOverride instead of being retrieved from\n platform-provided telemetry data."]
720pub struct SetPressureSourceOverrideEnabled {
721    #[serde(default)]
722    pub enabled: bool,
723    pub source: PressureSource,
724    #[builder(default)]
725    #[serde(skip_serializing_if = "Option::is_none")]
726    pub metadata: Option<PressureMetadata>,
727}
728#[allow(deprecated)]
729#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
730#[builder(setter(into, strip_option))]
731#[serde(rename_all = "camelCase")]
732#[doc = "TODO: OBSOLETE: To remove when setPressureDataOverride is merged.\n Provides a given pressure state that will be processed and eventually be\n delivered to PressureObserver users. |source| must have been previously\n overridden by setPressureSourceOverrideEnabled."]
733pub struct SetPressureStateOverride {
734    pub source: PressureSource,
735    pub state: PressureState,
736}
737#[allow(deprecated)]
738#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
739#[builder(setter(into, strip_option))]
740#[serde(rename_all = "camelCase")]
741#[doc = "Provides a given pressure data set that will be processed and eventually be\n delivered to PressureObserver users. |source| must have been previously\n overridden by setPressureSourceOverrideEnabled."]
742pub struct SetPressureDataOverride {
743    pub source: PressureSource,
744    pub state: PressureState,
745    #[builder(default)]
746    #[serde(skip_serializing_if = "Option::is_none")]
747    #[serde(default)]
748    pub own_contribution_estimate: Option<JsFloat>,
749}
750#[allow(deprecated)]
751#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
752#[builder(setter(into, strip_option))]
753#[serde(rename_all = "camelCase")]
754#[doc = "Overrides the Idle state."]
755pub struct SetIdleOverride {
756    #[serde(default)]
757    #[doc = "Mock isUserActive"]
758    pub is_user_active: bool,
759    #[serde(default)]
760    #[doc = "Mock isScreenUnlocked"]
761    pub is_screen_unlocked: bool,
762}
763#[allow(deprecated)]
764#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
765pub struct ClearIdleOverride(pub Option<Json>);
766#[allow(deprecated)]
767#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
768#[builder(setter(into, strip_option))]
769#[serde(rename_all = "camelCase")]
770#[doc = "Overrides value returned by the javascript navigator object."]
771#[deprecated]
772pub struct SetNavigatorOverrides {
773    #[serde(default)]
774    #[doc = "The platform navigator.platform should return."]
775    pub platform: String,
776}
777#[allow(deprecated)]
778#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
779#[builder(setter(into, strip_option))]
780#[serde(rename_all = "camelCase")]
781#[doc = "Sets a specified page scale factor."]
782pub struct SetPageScaleFactor {
783    #[serde(default)]
784    #[doc = "Page scale factor."]
785    pub page_scale_factor: JsFloat,
786}
787#[allow(deprecated)]
788#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
789#[builder(setter(into, strip_option))]
790#[serde(rename_all = "camelCase")]
791#[doc = "Switches script execution in the page."]
792pub struct SetScriptExecutionDisabled {
793    #[serde(default)]
794    #[doc = "Whether script execution should be disabled in the page."]
795    pub value: bool,
796}
797#[allow(deprecated)]
798#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
799#[builder(setter(into, strip_option))]
800#[serde(rename_all = "camelCase")]
801#[doc = "Enables touch on platforms which do not support them."]
802pub struct SetTouchEmulationEnabled {
803    #[serde(default)]
804    #[doc = "Whether the touch event emulation should be enabled."]
805    pub enabled: bool,
806    #[builder(default)]
807    #[serde(skip_serializing_if = "Option::is_none")]
808    #[serde(default)]
809    #[doc = "Maximum touch points supported. Defaults to one."]
810    pub max_touch_points: Option<JsUInt>,
811}
812#[allow(deprecated)]
813#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
814#[builder(setter(into, strip_option))]
815#[serde(rename_all = "camelCase")]
816#[doc = "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\n the current virtual time policy.  Note this supersedes any previous time budget."]
817pub struct SetVirtualTimePolicy {
818    pub policy: VirtualTimePolicy,
819    #[builder(default)]
820    #[serde(skip_serializing_if = "Option::is_none")]
821    #[serde(default)]
822    #[doc = "If set, after this many virtual milliseconds have elapsed virtual time will be paused and a\n virtualTimeBudgetExpired event is sent."]
823    pub budget: Option<JsFloat>,
824    #[builder(default)]
825    #[serde(skip_serializing_if = "Option::is_none")]
826    #[serde(default)]
827    #[doc = "If set this specifies the maximum number of tasks that can be run before virtual is forced\n forwards to prevent deadlock."]
828    pub max_virtual_time_task_starvation_count: Option<JsUInt>,
829    #[builder(default)]
830    #[serde(skip_serializing_if = "Option::is_none")]
831    #[doc = "If set, base::Time::Now will be overridden to initially return this value."]
832    pub initial_virtual_time: Option<network::TimeSinceEpoch>,
833}
834#[allow(deprecated)]
835#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
836#[builder(setter(into, strip_option))]
837#[serde(rename_all = "camelCase")]
838#[doc = "Overrides default host system locale with the specified one."]
839pub struct SetLocaleOverride {
840    #[builder(default)]
841    #[serde(skip_serializing_if = "Option::is_none")]
842    #[serde(default)]
843    #[doc = "ICU style C locale (e.g. \"en_US\"). If not specified or empty, disables the override and\n restores default host system locale."]
844    pub locale: Option<String>,
845}
846#[allow(deprecated)]
847#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
848#[builder(setter(into, strip_option))]
849#[serde(rename_all = "camelCase")]
850#[doc = "Overrides default host system timezone with the specified one."]
851pub struct SetTimezoneOverride {
852    #[serde(default)]
853    #[doc = "The timezone identifier. List of supported timezones:\n <https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt>\n If empty, disables the override and restores default host system timezone."]
854    pub timezone_id: String,
855}
856#[allow(deprecated)]
857#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
858#[builder(setter(into, strip_option))]
859#[serde(rename_all = "camelCase")]
860#[doc = "Resizes the frame/viewport of the page. Note that this does not affect the frame's container\n (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported\n on Android."]
861#[deprecated]
862pub struct SetVisibleSize {
863    #[serde(default)]
864    #[doc = "Frame width (DIP)."]
865    pub width: JsUInt,
866    #[serde(default)]
867    #[doc = "Frame height (DIP)."]
868    pub height: JsUInt,
869}
870#[allow(deprecated)]
871#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
872#[builder(setter(into, strip_option))]
873#[serde(rename_all = "camelCase")]
874pub struct SetDisabledImageTypes {
875    #[doc = "Image types to disable."]
876    pub image_types: Vec<DisabledImageType>,
877}
878#[allow(deprecated)]
879#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
880#[builder(setter(into, strip_option))]
881#[serde(rename_all = "camelCase")]
882#[doc = "Override the value of navigator.connection.saveData"]
883pub struct SetDataSaverOverride {
884    #[builder(default)]
885    #[serde(skip_serializing_if = "Option::is_none")]
886    #[serde(default)]
887    #[doc = "Override value. Omitting the parameter disables the override."]
888    pub data_saver_enabled: Option<bool>,
889}
890#[allow(deprecated)]
891#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
892#[builder(setter(into, strip_option))]
893#[serde(rename_all = "camelCase")]
894pub struct SetHardwareConcurrencyOverride {
895    #[serde(default)]
896    #[doc = "Hardware concurrency to report"]
897    pub hardware_concurrency: JsUInt,
898}
899#[allow(deprecated)]
900#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
901#[builder(setter(into, strip_option))]
902#[serde(rename_all = "camelCase")]
903#[doc = "Allows overriding user agent with the given string.\n `userAgentMetadata` must be set for Client Hint headers to be sent."]
904pub struct SetUserAgentOverride {
905    #[serde(default)]
906    #[doc = "User agent to use."]
907    pub user_agent: String,
908    #[builder(default)]
909    #[serde(skip_serializing_if = "Option::is_none")]
910    #[serde(default)]
911    #[doc = "Browser language to emulate."]
912    pub accept_language: Option<String>,
913    #[builder(default)]
914    #[serde(skip_serializing_if = "Option::is_none")]
915    #[serde(default)]
916    #[doc = "The platform navigator.platform should return."]
917    pub platform: Option<String>,
918    #[builder(default)]
919    #[serde(skip_serializing_if = "Option::is_none")]
920    #[doc = "To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData"]
921    pub user_agent_metadata: Option<UserAgentMetadata>,
922}
923#[allow(deprecated)]
924#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
925#[builder(setter(into, strip_option))]
926#[serde(rename_all = "camelCase")]
927#[doc = "Allows overriding the automation flag."]
928pub struct SetAutomationOverride {
929    #[serde(default)]
930    #[doc = "Whether the override should be enabled."]
931    pub enabled: bool,
932}
933#[allow(deprecated)]
934#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
935#[builder(setter(into, strip_option))]
936#[serde(rename_all = "camelCase")]
937#[doc = "Allows overriding the difference between the small and large viewport sizes, which determine the\n value of the `svh` and `lvh` unit, respectively. Only supported for top-level frames."]
938pub struct SetSmallViewportHeightDifferenceOverride {
939    #[serde(default)]
940    #[doc = "This will cause an element of size 100svh to be `difference` pixels smaller than an element\n of size 100lvh."]
941    pub difference: JsUInt,
942}
943#[allow(deprecated)]
944#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
945pub struct GetScreenInfos(pub Option<Json>);
946#[allow(deprecated)]
947#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
948#[builder(setter(into, strip_option))]
949#[serde(rename_all = "camelCase")]
950#[doc = "Add a new screen to the device. Only supported in headless mode."]
951pub struct AddScreen {
952    #[serde(default)]
953    #[doc = "Offset of the left edge of the screen in pixels."]
954    pub left: JsUInt,
955    #[serde(default)]
956    #[doc = "Offset of the top edge of the screen in pixels."]
957    pub top: JsUInt,
958    #[serde(default)]
959    #[doc = "The width of the screen in pixels."]
960    pub width: JsUInt,
961    #[serde(default)]
962    #[doc = "The height of the screen in pixels."]
963    pub height: JsUInt,
964    #[builder(default)]
965    #[serde(skip_serializing_if = "Option::is_none")]
966    #[doc = "Specifies the screen's work area. Default is entire screen."]
967    pub work_area_insets: Option<WorkAreaInsets>,
968    #[builder(default)]
969    #[serde(skip_serializing_if = "Option::is_none")]
970    #[serde(default)]
971    #[doc = "Specifies the screen's device pixel ratio. Default is 1."]
972    pub device_pixel_ratio: Option<JsFloat>,
973    #[builder(default)]
974    #[serde(skip_serializing_if = "Option::is_none")]
975    #[serde(default)]
976    #[doc = "Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0."]
977    pub rotation: Option<JsUInt>,
978    #[builder(default)]
979    #[serde(skip_serializing_if = "Option::is_none")]
980    #[serde(default)]
981    #[doc = "Specifies the screen's color depth in bits. Default is 24."]
982    pub color_depth: Option<JsUInt>,
983    #[builder(default)]
984    #[serde(skip_serializing_if = "Option::is_none")]
985    #[serde(default)]
986    #[doc = "Specifies the descriptive label for the screen. Default is none."]
987    pub label: Option<String>,
988    #[builder(default)]
989    #[serde(skip_serializing_if = "Option::is_none")]
990    #[serde(default)]
991    #[doc = "Indicates whether the screen is internal to the device or external, attached to the device. Default is false."]
992    pub is_internal: Option<bool>,
993}
994#[allow(deprecated)]
995#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
996#[builder(setter(into, strip_option))]
997#[serde(rename_all = "camelCase")]
998#[doc = "Remove screen from the device. Only supported in headless mode."]
999pub struct RemoveScreen {
1000    pub screen_id: ScreenId,
1001}
1002#[allow(deprecated)]
1003#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1004#[serde(rename_all = "camelCase")]
1005#[doc = "Tells whether emulation is supported."]
1006#[deprecated]
1007pub struct CanEmulateReturnObject {
1008    #[serde(default)]
1009    #[doc = "True if emulation is supported."]
1010    pub result: bool,
1011}
1012#[allow(deprecated)]
1013#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1014#[doc = "Clears the overridden device metrics."]
1015pub struct ClearDeviceMetricsOverrideReturnObject(pub Option<Json>);
1016#[allow(deprecated)]
1017#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1018#[doc = "Clears the overridden Geolocation Position and Error."]
1019pub struct ClearGeolocationOverrideReturnObject(pub Option<Json>);
1020#[allow(deprecated)]
1021#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1022#[doc = "Requests that page scale factor is reset to initial values."]
1023pub struct ResetPageScaleFactorReturnObject(pub Option<Json>);
1024#[allow(deprecated)]
1025#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1026#[doc = "Enables or disables simulating a focused and active page."]
1027pub struct SetFocusEmulationEnabledReturnObject(pub Option<Json>);
1028#[allow(deprecated)]
1029#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1030#[doc = "Automatically render all web contents using a dark theme."]
1031pub struct SetAutoDarkModeOverrideReturnObject(pub Option<Json>);
1032#[allow(deprecated)]
1033#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1034#[doc = "Enables CPU throttling to emulate slow CPUs."]
1035pub struct SetCPUThrottlingRateReturnObject(pub Option<Json>);
1036#[allow(deprecated)]
1037#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1038#[doc = "Sets or clears an override of the default background color of the frame. This override is used\n if the content does not specify one."]
1039pub struct SetDefaultBackgroundColorOverrideReturnObject(pub Option<Json>);
1040#[allow(deprecated)]
1041#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1042#[doc = "Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the\n respective variables to be undefined, even if previously overridden."]
1043pub struct SetSafeAreaInsetsOverrideReturnObject(pub Option<Json>);
1044#[allow(deprecated)]
1045#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1046#[doc = "Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\n window.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media\n query results)."]
1047pub struct SetDeviceMetricsOverrideReturnObject(pub Option<Json>);
1048#[allow(deprecated)]
1049#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1050#[doc = "Start reporting the given posture value to the Device Posture API.\n This override can also be set in setDeviceMetricsOverride()."]
1051pub struct SetDevicePostureOverrideReturnObject(pub Option<Json>);
1052#[allow(deprecated)]
1053#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1054#[doc = "Clears a device posture override set with either setDeviceMetricsOverride()\n or setDevicePostureOverride() and starts using posture information from the\n platform again.\n Does nothing if no override is set."]
1055pub struct ClearDevicePostureOverrideReturnObject(pub Option<Json>);
1056#[allow(deprecated)]
1057#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1058#[doc = "Start using the given display features to pupulate the Viewport Segments API.\n This override can also be set in setDeviceMetricsOverride()."]
1059pub struct SetDisplayFeaturesOverrideReturnObject(pub Option<Json>);
1060#[allow(deprecated)]
1061#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1062#[doc = "Clears the display features override set with either setDeviceMetricsOverride()\n or setDisplayFeaturesOverride() and starts using display features from the\n platform again.\n Does nothing if no override is set."]
1063pub struct ClearDisplayFeaturesOverrideReturnObject(pub Option<Json>);
1064#[allow(deprecated)]
1065#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1066pub struct SetScrollbarsHiddenReturnObject(pub Option<Json>);
1067#[allow(deprecated)]
1068#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1069pub struct SetDocumentCookieDisabledReturnObject(pub Option<Json>);
1070#[allow(deprecated)]
1071#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1072pub struct SetEmitTouchEventsForMouseReturnObject(pub Option<Json>);
1073#[allow(deprecated)]
1074#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1075#[doc = "Emulates the given media type or media feature for CSS media queries."]
1076pub struct SetEmulatedMediaReturnObject(pub Option<Json>);
1077#[allow(deprecated)]
1078#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1079#[doc = "Emulates the given vision deficiency."]
1080pub struct SetEmulatedVisionDeficiencyReturnObject(pub Option<Json>);
1081#[allow(deprecated)]
1082#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1083#[doc = "Emulates the given OS text scale."]
1084pub struct SetEmulatedOSTextScaleReturnObject(pub Option<Json>);
1085#[allow(deprecated)]
1086#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1087#[doc = "Overrides the Geolocation Position or Error. Omitting latitude, longitude or\n accuracy emulates position unavailable."]
1088pub struct SetGeolocationOverrideReturnObject(pub Option<Json>);
1089#[allow(deprecated)]
1090#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1091#[serde(rename_all = "camelCase")]
1092pub struct GetOverriddenSensorInformationReturnObject {
1093    #[serde(default)]
1094    pub requested_sampling_frequency: JsFloat,
1095}
1096#[allow(deprecated)]
1097#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1098#[doc = "Overrides a platform sensor of a given type. If |enabled| is true, calls to\n Sensor.start() will use a virtual sensor as backend rather than fetching\n data from a real hardware sensor. Otherwise, existing virtual\n sensor-backend Sensor objects will fire an error event and new calls to\n Sensor.start() will attempt to use a real sensor instead."]
1099pub struct SetSensorOverrideEnabledReturnObject(pub Option<Json>);
1100#[allow(deprecated)]
1101#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1102#[doc = "Updates the sensor readings reported by a sensor type previously overridden\n by setSensorOverrideEnabled."]
1103pub struct SetSensorOverrideReadingsReturnObject(pub Option<Json>);
1104#[allow(deprecated)]
1105#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1106#[doc = "Overrides a pressure source of a given type, as used by the Compute\n Pressure API, so that updates to PressureObserver.observe() are provided\n via setPressureStateOverride instead of being retrieved from\n platform-provided telemetry data."]
1107pub struct SetPressureSourceOverrideEnabledReturnObject(pub Option<Json>);
1108#[allow(deprecated)]
1109#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1110#[doc = "TODO: OBSOLETE: To remove when setPressureDataOverride is merged.\n Provides a given pressure state that will be processed and eventually be\n delivered to PressureObserver users. |source| must have been previously\n overridden by setPressureSourceOverrideEnabled."]
1111pub struct SetPressureStateOverrideReturnObject(pub Option<Json>);
1112#[allow(deprecated)]
1113#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1114#[doc = "Provides a given pressure data set that will be processed and eventually be\n delivered to PressureObserver users. |source| must have been previously\n overridden by setPressureSourceOverrideEnabled."]
1115pub struct SetPressureDataOverrideReturnObject(pub Option<Json>);
1116#[allow(deprecated)]
1117#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1118#[doc = "Overrides the Idle state."]
1119pub struct SetIdleOverrideReturnObject(pub Option<Json>);
1120#[allow(deprecated)]
1121#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1122#[doc = "Clears Idle state overrides."]
1123pub struct ClearIdleOverrideReturnObject(pub Option<Json>);
1124#[allow(deprecated)]
1125#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1126#[doc = "Overrides value returned by the javascript navigator object."]
1127#[deprecated]
1128pub struct SetNavigatorOverridesReturnObject(pub Option<Json>);
1129#[allow(deprecated)]
1130#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1131#[doc = "Sets a specified page scale factor."]
1132pub struct SetPageScaleFactorReturnObject(pub Option<Json>);
1133#[allow(deprecated)]
1134#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1135#[doc = "Switches script execution in the page."]
1136pub struct SetScriptExecutionDisabledReturnObject(pub Option<Json>);
1137#[allow(deprecated)]
1138#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1139#[doc = "Enables touch on platforms which do not support them."]
1140pub struct SetTouchEmulationEnabledReturnObject(pub Option<Json>);
1141#[allow(deprecated)]
1142#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1143#[serde(rename_all = "camelCase")]
1144#[doc = "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\n the current virtual time policy.  Note this supersedes any previous time budget."]
1145pub struct SetVirtualTimePolicyReturnObject {
1146    #[serde(default)]
1147    #[doc = "Absolute timestamp at which virtual time was first enabled (up time in milliseconds)."]
1148    pub virtual_time_ticks_base: JsFloat,
1149}
1150#[allow(deprecated)]
1151#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1152#[doc = "Overrides default host system locale with the specified one."]
1153pub struct SetLocaleOverrideReturnObject(pub Option<Json>);
1154#[allow(deprecated)]
1155#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1156#[doc = "Overrides default host system timezone with the specified one."]
1157pub struct SetTimezoneOverrideReturnObject(pub Option<Json>);
1158#[allow(deprecated)]
1159#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1160#[doc = "Resizes the frame/viewport of the page. Note that this does not affect the frame's container\n (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported\n on Android."]
1161#[deprecated]
1162pub struct SetVisibleSizeReturnObject(pub Option<Json>);
1163#[allow(deprecated)]
1164#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1165pub struct SetDisabledImageTypesReturnObject(pub Option<Json>);
1166#[allow(deprecated)]
1167#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1168#[doc = "Override the value of navigator.connection.saveData"]
1169pub struct SetDataSaverOverrideReturnObject(pub Option<Json>);
1170#[allow(deprecated)]
1171#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1172pub struct SetHardwareConcurrencyOverrideReturnObject(pub Option<Json>);
1173#[allow(deprecated)]
1174#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1175#[doc = "Allows overriding user agent with the given string.\n `userAgentMetadata` must be set for Client Hint headers to be sent."]
1176pub struct SetUserAgentOverrideReturnObject(pub Option<Json>);
1177#[allow(deprecated)]
1178#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1179#[doc = "Allows overriding the automation flag."]
1180pub struct SetAutomationOverrideReturnObject(pub Option<Json>);
1181#[allow(deprecated)]
1182#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1183#[doc = "Allows overriding the difference between the small and large viewport sizes, which determine the\n value of the `svh` and `lvh` unit, respectively. Only supported for top-level frames."]
1184pub struct SetSmallViewportHeightDifferenceOverrideReturnObject(pub Option<Json>);
1185#[allow(deprecated)]
1186#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1187#[serde(rename_all = "camelCase")]
1188#[doc = "Returns device's screen configuration."]
1189pub struct GetScreenInfosReturnObject {
1190    pub screen_infos: Vec<ScreenInfo>,
1191}
1192#[allow(deprecated)]
1193#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1194#[serde(rename_all = "camelCase")]
1195#[doc = "Add a new screen to the device. Only supported in headless mode."]
1196pub struct AddScreenReturnObject {
1197    pub screen_info: ScreenInfo,
1198}
1199#[allow(deprecated)]
1200#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1201#[doc = "Remove screen from the device. Only supported in headless mode."]
1202pub struct RemoveScreenReturnObject(pub Option<Json>);
1203#[allow(deprecated)]
1204impl Method for CanEmulate {
1205    const NAME: &'static str = "Emulation.canEmulate";
1206    type ReturnObject = CanEmulateReturnObject;
1207}
1208#[allow(deprecated)]
1209impl Method for ClearDeviceMetricsOverride {
1210    const NAME: &'static str = "Emulation.clearDeviceMetricsOverride";
1211    type ReturnObject = ClearDeviceMetricsOverrideReturnObject;
1212}
1213#[allow(deprecated)]
1214impl Method for ClearGeolocationOverride {
1215    const NAME: &'static str = "Emulation.clearGeolocationOverride";
1216    type ReturnObject = ClearGeolocationOverrideReturnObject;
1217}
1218#[allow(deprecated)]
1219impl Method for ResetPageScaleFactor {
1220    const NAME: &'static str = "Emulation.resetPageScaleFactor";
1221    type ReturnObject = ResetPageScaleFactorReturnObject;
1222}
1223#[allow(deprecated)]
1224impl Method for SetFocusEmulationEnabled {
1225    const NAME: &'static str = "Emulation.setFocusEmulationEnabled";
1226    type ReturnObject = SetFocusEmulationEnabledReturnObject;
1227}
1228#[allow(deprecated)]
1229impl Method for SetAutoDarkModeOverride {
1230    const NAME: &'static str = "Emulation.setAutoDarkModeOverride";
1231    type ReturnObject = SetAutoDarkModeOverrideReturnObject;
1232}
1233#[allow(deprecated)]
1234impl Method for SetCPUThrottlingRate {
1235    const NAME: &'static str = "Emulation.setCPUThrottlingRate";
1236    type ReturnObject = SetCPUThrottlingRateReturnObject;
1237}
1238#[allow(deprecated)]
1239impl Method for SetDefaultBackgroundColorOverride {
1240    const NAME: &'static str = "Emulation.setDefaultBackgroundColorOverride";
1241    type ReturnObject = SetDefaultBackgroundColorOverrideReturnObject;
1242}
1243#[allow(deprecated)]
1244impl Method for SetSafeAreaInsetsOverride {
1245    const NAME: &'static str = "Emulation.setSafeAreaInsetsOverride";
1246    type ReturnObject = SetSafeAreaInsetsOverrideReturnObject;
1247}
1248#[allow(deprecated)]
1249impl Method for SetDeviceMetricsOverride {
1250    const NAME: &'static str = "Emulation.setDeviceMetricsOverride";
1251    type ReturnObject = SetDeviceMetricsOverrideReturnObject;
1252}
1253#[allow(deprecated)]
1254impl Method for SetDevicePostureOverride {
1255    const NAME: &'static str = "Emulation.setDevicePostureOverride";
1256    type ReturnObject = SetDevicePostureOverrideReturnObject;
1257}
1258#[allow(deprecated)]
1259impl Method for ClearDevicePostureOverride {
1260    const NAME: &'static str = "Emulation.clearDevicePostureOverride";
1261    type ReturnObject = ClearDevicePostureOverrideReturnObject;
1262}
1263#[allow(deprecated)]
1264impl Method for SetDisplayFeaturesOverride {
1265    const NAME: &'static str = "Emulation.setDisplayFeaturesOverride";
1266    type ReturnObject = SetDisplayFeaturesOverrideReturnObject;
1267}
1268#[allow(deprecated)]
1269impl Method for ClearDisplayFeaturesOverride {
1270    const NAME: &'static str = "Emulation.clearDisplayFeaturesOverride";
1271    type ReturnObject = ClearDisplayFeaturesOverrideReturnObject;
1272}
1273#[allow(deprecated)]
1274impl Method for SetScrollbarsHidden {
1275    const NAME: &'static str = "Emulation.setScrollbarsHidden";
1276    type ReturnObject = SetScrollbarsHiddenReturnObject;
1277}
1278#[allow(deprecated)]
1279impl Method for SetDocumentCookieDisabled {
1280    const NAME: &'static str = "Emulation.setDocumentCookieDisabled";
1281    type ReturnObject = SetDocumentCookieDisabledReturnObject;
1282}
1283#[allow(deprecated)]
1284impl Method for SetEmitTouchEventsForMouse {
1285    const NAME: &'static str = "Emulation.setEmitTouchEventsForMouse";
1286    type ReturnObject = SetEmitTouchEventsForMouseReturnObject;
1287}
1288#[allow(deprecated)]
1289impl Method for SetEmulatedMedia {
1290    const NAME: &'static str = "Emulation.setEmulatedMedia";
1291    type ReturnObject = SetEmulatedMediaReturnObject;
1292}
1293#[allow(deprecated)]
1294impl Method for SetEmulatedVisionDeficiency {
1295    const NAME: &'static str = "Emulation.setEmulatedVisionDeficiency";
1296    type ReturnObject = SetEmulatedVisionDeficiencyReturnObject;
1297}
1298#[allow(deprecated)]
1299impl Method for SetEmulatedOSTextScale {
1300    const NAME: &'static str = "Emulation.setEmulatedOSTextScale";
1301    type ReturnObject = SetEmulatedOSTextScaleReturnObject;
1302}
1303#[allow(deprecated)]
1304impl Method for SetGeolocationOverride {
1305    const NAME: &'static str = "Emulation.setGeolocationOverride";
1306    type ReturnObject = SetGeolocationOverrideReturnObject;
1307}
1308#[allow(deprecated)]
1309impl Method for GetOverriddenSensorInformation {
1310    const NAME: &'static str = "Emulation.getOverriddenSensorInformation";
1311    type ReturnObject = GetOverriddenSensorInformationReturnObject;
1312}
1313#[allow(deprecated)]
1314impl Method for SetSensorOverrideEnabled {
1315    const NAME: &'static str = "Emulation.setSensorOverrideEnabled";
1316    type ReturnObject = SetSensorOverrideEnabledReturnObject;
1317}
1318#[allow(deprecated)]
1319impl Method for SetSensorOverrideReadings {
1320    const NAME: &'static str = "Emulation.setSensorOverrideReadings";
1321    type ReturnObject = SetSensorOverrideReadingsReturnObject;
1322}
1323#[allow(deprecated)]
1324impl Method for SetPressureSourceOverrideEnabled {
1325    const NAME: &'static str = "Emulation.setPressureSourceOverrideEnabled";
1326    type ReturnObject = SetPressureSourceOverrideEnabledReturnObject;
1327}
1328#[allow(deprecated)]
1329impl Method for SetPressureStateOverride {
1330    const NAME: &'static str = "Emulation.setPressureStateOverride";
1331    type ReturnObject = SetPressureStateOverrideReturnObject;
1332}
1333#[allow(deprecated)]
1334impl Method for SetPressureDataOverride {
1335    const NAME: &'static str = "Emulation.setPressureDataOverride";
1336    type ReturnObject = SetPressureDataOverrideReturnObject;
1337}
1338#[allow(deprecated)]
1339impl Method for SetIdleOverride {
1340    const NAME: &'static str = "Emulation.setIdleOverride";
1341    type ReturnObject = SetIdleOverrideReturnObject;
1342}
1343#[allow(deprecated)]
1344impl Method for ClearIdleOverride {
1345    const NAME: &'static str = "Emulation.clearIdleOverride";
1346    type ReturnObject = ClearIdleOverrideReturnObject;
1347}
1348#[allow(deprecated)]
1349impl Method for SetNavigatorOverrides {
1350    const NAME: &'static str = "Emulation.setNavigatorOverrides";
1351    type ReturnObject = SetNavigatorOverridesReturnObject;
1352}
1353#[allow(deprecated)]
1354impl Method for SetPageScaleFactor {
1355    const NAME: &'static str = "Emulation.setPageScaleFactor";
1356    type ReturnObject = SetPageScaleFactorReturnObject;
1357}
1358#[allow(deprecated)]
1359impl Method for SetScriptExecutionDisabled {
1360    const NAME: &'static str = "Emulation.setScriptExecutionDisabled";
1361    type ReturnObject = SetScriptExecutionDisabledReturnObject;
1362}
1363#[allow(deprecated)]
1364impl Method for SetTouchEmulationEnabled {
1365    const NAME: &'static str = "Emulation.setTouchEmulationEnabled";
1366    type ReturnObject = SetTouchEmulationEnabledReturnObject;
1367}
1368#[allow(deprecated)]
1369impl Method for SetVirtualTimePolicy {
1370    const NAME: &'static str = "Emulation.setVirtualTimePolicy";
1371    type ReturnObject = SetVirtualTimePolicyReturnObject;
1372}
1373#[allow(deprecated)]
1374impl Method for SetLocaleOverride {
1375    const NAME: &'static str = "Emulation.setLocaleOverride";
1376    type ReturnObject = SetLocaleOverrideReturnObject;
1377}
1378#[allow(deprecated)]
1379impl Method for SetTimezoneOverride {
1380    const NAME: &'static str = "Emulation.setTimezoneOverride";
1381    type ReturnObject = SetTimezoneOverrideReturnObject;
1382}
1383#[allow(deprecated)]
1384impl Method for SetVisibleSize {
1385    const NAME: &'static str = "Emulation.setVisibleSize";
1386    type ReturnObject = SetVisibleSizeReturnObject;
1387}
1388#[allow(deprecated)]
1389impl Method for SetDisabledImageTypes {
1390    const NAME: &'static str = "Emulation.setDisabledImageTypes";
1391    type ReturnObject = SetDisabledImageTypesReturnObject;
1392}
1393#[allow(deprecated)]
1394impl Method for SetDataSaverOverride {
1395    const NAME: &'static str = "Emulation.setDataSaverOverride";
1396    type ReturnObject = SetDataSaverOverrideReturnObject;
1397}
1398#[allow(deprecated)]
1399impl Method for SetHardwareConcurrencyOverride {
1400    const NAME: &'static str = "Emulation.setHardwareConcurrencyOverride";
1401    type ReturnObject = SetHardwareConcurrencyOverrideReturnObject;
1402}
1403#[allow(deprecated)]
1404impl Method for SetUserAgentOverride {
1405    const NAME: &'static str = "Emulation.setUserAgentOverride";
1406    type ReturnObject = SetUserAgentOverrideReturnObject;
1407}
1408#[allow(deprecated)]
1409impl Method for SetAutomationOverride {
1410    const NAME: &'static str = "Emulation.setAutomationOverride";
1411    type ReturnObject = SetAutomationOverrideReturnObject;
1412}
1413#[allow(deprecated)]
1414impl Method for SetSmallViewportHeightDifferenceOverride {
1415    const NAME: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride";
1416    type ReturnObject = SetSmallViewportHeightDifferenceOverrideReturnObject;
1417}
1418#[allow(deprecated)]
1419impl Method for GetScreenInfos {
1420    const NAME: &'static str = "Emulation.getScreenInfos";
1421    type ReturnObject = GetScreenInfosReturnObject;
1422}
1423#[allow(deprecated)]
1424impl Method for AddScreen {
1425    const NAME: &'static str = "Emulation.addScreen";
1426    type ReturnObject = AddScreenReturnObject;
1427}
1428#[allow(deprecated)]
1429impl Method for RemoveScreen {
1430    const NAME: &'static str = "Emulation.removeScreen";
1431    type ReturnObject = RemoveScreenReturnObject;
1432}
1433#[allow(dead_code)]
1434pub mod events {
1435    #[allow(unused_imports)]
1436    use super::super::types::*;
1437    #[allow(unused_imports)]
1438    use derive_builder::Builder;
1439    #[allow(unused_imports)]
1440    use serde::{Deserialize, Serialize};
1441    #[allow(unused_imports)]
1442    use serde_json::Value as Json;
1443    #[allow(deprecated)]
1444    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1445    pub struct VirtualTimeBudgetExpiredEvent(pub Option<Json>);
1446}