browser-protocol 0.1.2

Generated Rust types and commands for the Chrome DevTools Protocol (browser-protocol)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
//! This domain emulates different environments for the page.
use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SafeAreaInsets {
    /// Overrides safe-area-inset-top.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub top: Option<i64>,
    /// Overrides safe-area-max-inset-top.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub topMax: Option<i64>,
    /// Overrides safe-area-inset-left.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub left: Option<i64>,
    /// Overrides safe-area-max-inset-left.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub leftMax: Option<i64>,
    /// Overrides safe-area-inset-bottom.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub bottom: Option<i64>,
    /// Overrides safe-area-max-inset-bottom.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub bottomMax: Option<i64>,
    /// Overrides safe-area-inset-right.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub right: Option<i64>,
    /// Overrides safe-area-max-inset-right.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub rightMax: Option<i64>,
}

/// Screen orientation.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ScreenOrientation {
    /// Orientation type.

    #[serde(rename = "type")]
    pub type_: String,
    /// Orientation angle.

    pub angle: i64,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DisplayFeature {
    /// Orientation of a display feature in relation to screen

    pub orientation: String,
    /// The offset from the screen origin in either the x (for vertical
    /// orientation) or y (for horizontal orientation) direction.

    pub offset: i32,
    /// A display feature may mask content such that it is not physically
    /// displayed - this length along with the offset describes this area.
    /// A display feature that only splits content will have a 0 mask_length.

    pub maskLength: u64,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DevicePosture {
    /// Current posture of the device

    #[serde(rename = "type")]
    pub type_: String,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct MediaFeature {

    pub name: String,

    pub value: String,
}

/// advance: If the scheduler runs out of immediate work, the virtual time base may fast forward to
/// allow the next delayed task (if any) to run; pause: The virtual time base may not advance;
/// pauseIfNetworkFetchesPending: The virtual time base may not advance if there are any pending
/// resource fetches.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum VirtualTimePolicy {
    #[default]
    Advance,
    Pause,
    PauseIfNetworkFetchesPending,
}

/// Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UserAgentBrandVersion {

    pub brand: String,

    pub version: String,
}

/// Used to specify User Agent Client Hints to emulate. See https://wicg.github.io/ua-client-hints
/// Missing optional values will be filled in by the target with what it would normally use.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UserAgentMetadata {
    /// Brands appearing in Sec-CH-UA.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub brands: Option<Vec<UserAgentBrandVersion>>,
    /// Brands appearing in Sec-CH-UA-Full-Version-List.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub fullVersionList: Option<Vec<UserAgentBrandVersion>>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub fullVersion: Option<String>,

    pub platform: String,

    pub platformVersion: String,

    pub architecture: String,

    pub model: String,

    pub mobile: bool,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub bitness: Option<String>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub wow64: Option<bool>,
    /// Used to specify User Agent form-factor values.
    /// See https://wicg.github.io/ua-client-hints/#sec-ch-ua-form-factors

    #[serde(skip_serializing_if = "Option::is_none")]
    pub formFactors: Option<Vec<String>>,
}

/// Used to specify sensor types to emulate.
/// See https://w3c.github.io/sensors/#automation for more information.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum SensorType {
    #[default]
    AbsoluteOrientation,
    Accelerometer,
    AmbientLight,
    Gravity,
    Gyroscope,
    LinearAcceleration,
    Magnetometer,
    RelativeOrientation,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SensorMetadata {

    #[serde(skip_serializing_if = "Option::is_none")]
    pub available: Option<bool>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub minimumFrequency: Option<f64>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maximumFrequency: Option<f64>,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SensorReadingSingle {

    pub value: f64,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SensorReadingXYZ {

    pub x: f64,

    pub y: f64,

    pub z: f64,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SensorReadingQuaternion {

    pub x: f64,

    pub y: f64,

    pub z: f64,

    pub w: f64,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SensorReading {

    #[serde(skip_serializing_if = "Option::is_none")]
    pub single: Option<SensorReadingSingle>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub xyz: Option<SensorReadingXYZ>,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub quaternion: Option<SensorReadingQuaternion>,
}


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum PressureSource {
    #[default]
    Cpu,
}


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum PressureState {
    #[default]
    Nominal,
    Fair,
    Serious,
    Critical,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct PressureMetadata {

    #[serde(skip_serializing_if = "Option::is_none")]
    pub available: Option<bool>,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct WorkAreaInsets {
    /// Work area top inset in pixels. Default is 0;

    #[serde(skip_serializing_if = "Option::is_none")]
    pub top: Option<i64>,
    /// Work area left inset in pixels. Default is 0;

    #[serde(skip_serializing_if = "Option::is_none")]
    pub left: Option<i64>,
    /// Work area bottom inset in pixels. Default is 0;

    #[serde(skip_serializing_if = "Option::is_none")]
    pub bottom: Option<i64>,
    /// Work area right inset in pixels. Default is 0;

    #[serde(skip_serializing_if = "Option::is_none")]
    pub right: Option<i64>,
}


pub type ScreenId = String;

/// Screen information similar to the one returned by window.getScreenDetails() method,
/// see https://w3c.github.io/window-management/#screendetailed.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ScreenInfo {
    /// Offset of the left edge of the screen.

    pub left: i64,
    /// Offset of the top edge of the screen.

    pub top: i64,
    /// Width of the screen.

    pub width: u64,
    /// Height of the screen.

    pub height: i64,
    /// Offset of the left edge of the available screen area.

    pub availLeft: i64,
    /// Offset of the top edge of the available screen area.

    pub availTop: i64,
    /// Width of the available screen area.

    pub availWidth: u64,
    /// Height of the available screen area.

    pub availHeight: i64,
    /// Specifies the screen's device pixel ratio.

    pub devicePixelRatio: f64,
    /// Specifies the screen's orientation.

    pub orientation: ScreenOrientation,
    /// Specifies the screen's color depth in bits.

    pub colorDepth: i64,
    /// Indicates whether the device has multiple screens.

    pub isExtended: bool,
    /// Indicates whether the screen is internal to the device or external, attached to the device.

    pub isInternal: bool,
    /// Indicates whether the screen is set as the the operating system primary screen.

    pub isPrimary: bool,
    /// Specifies the descriptive label for the screen.

    pub label: String,
    /// Specifies the unique identifier of the screen.

    pub id: ScreenId,
}

/// Enum of image types that can be disabled.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum DisabledImageType {
    #[default]
    Avif,
    Jxl,
    Webp,
}

/// Tells whether emulation is supported.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CanEmulateReturns {
    /// True if emulation is supported.

    pub result: bool,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct CanEmulateParams {}

impl CanEmulateParams { pub const METHOD: &'static str = "Emulation.canEmulate"; }

impl crate::CdpCommand for CanEmulateParams {
    const METHOD: &'static str = "Emulation.canEmulate";
    type Response = CanEmulateReturns;
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ClearDeviceMetricsOverrideParams {}

impl ClearDeviceMetricsOverrideParams { pub const METHOD: &'static str = "Emulation.clearDeviceMetricsOverride"; }

impl crate::CdpCommand for ClearDeviceMetricsOverrideParams {
    const METHOD: &'static str = "Emulation.clearDeviceMetricsOverride";
    type Response = crate::EmptyReturns;
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ClearGeolocationOverrideParams {}

impl ClearGeolocationOverrideParams { pub const METHOD: &'static str = "Emulation.clearGeolocationOverride"; }

impl crate::CdpCommand for ClearGeolocationOverrideParams {
    const METHOD: &'static str = "Emulation.clearGeolocationOverride";
    type Response = crate::EmptyReturns;
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ResetPageScaleFactorParams {}

impl ResetPageScaleFactorParams { pub const METHOD: &'static str = "Emulation.resetPageScaleFactor"; }

impl crate::CdpCommand for ResetPageScaleFactorParams {
    const METHOD: &'static str = "Emulation.resetPageScaleFactor";
    type Response = crate::EmptyReturns;
}

/// Enables or disables simulating a focused and active page.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetFocusEmulationEnabledParams {
    /// Whether to enable to disable focus emulation.

    pub enabled: bool,
}

impl SetFocusEmulationEnabledParams { pub const METHOD: &'static str = "Emulation.setFocusEmulationEnabled"; }

impl crate::CdpCommand for SetFocusEmulationEnabledParams {
    const METHOD: &'static str = "Emulation.setFocusEmulationEnabled";
    type Response = crate::EmptyReturns;
}

/// Automatically render all web contents using a dark theme.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetAutoDarkModeOverrideParams {
    /// Whether to enable or disable automatic dark mode.
    /// If not specified, any existing override will be cleared.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
}

impl SetAutoDarkModeOverrideParams { pub const METHOD: &'static str = "Emulation.setAutoDarkModeOverride"; }

impl crate::CdpCommand for SetAutoDarkModeOverrideParams {
    const METHOD: &'static str = "Emulation.setAutoDarkModeOverride";
    type Response = crate::EmptyReturns;
}

/// Enables CPU throttling to emulate slow CPUs.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetCPUThrottlingRateParams {
    /// Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc).

    pub rate: f64,
}

impl SetCPUThrottlingRateParams { pub const METHOD: &'static str = "Emulation.setCPUThrottlingRate"; }

impl crate::CdpCommand for SetCPUThrottlingRateParams {
    const METHOD: &'static str = "Emulation.setCPUThrottlingRate";
    type Response = crate::EmptyReturns;
}

/// Sets or clears an override of the default background color of the frame. This override is used
/// if the content does not specify one.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetDefaultBackgroundColorOverrideParams {
    /// RGBA of the default background color. If not specified, any existing override will be
    /// cleared.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub color: Option<crate::dom::RGBA>,
}

impl SetDefaultBackgroundColorOverrideParams { pub const METHOD: &'static str = "Emulation.setDefaultBackgroundColorOverride"; }

impl crate::CdpCommand for SetDefaultBackgroundColorOverrideParams {
    const METHOD: &'static str = "Emulation.setDefaultBackgroundColorOverride";
    type Response = crate::EmptyReturns;
}

/// Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the
/// respective variables to be undefined, even if previously overridden.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSafeAreaInsetsOverrideParams {

    pub insets: SafeAreaInsets,
}

impl SetSafeAreaInsetsOverrideParams { pub const METHOD: &'static str = "Emulation.setSafeAreaInsetsOverride"; }

impl crate::CdpCommand for SetSafeAreaInsetsOverrideParams {
    const METHOD: &'static str = "Emulation.setSafeAreaInsetsOverride";
    type Response = crate::EmptyReturns;
}

/// Overrides the values of device screen dimensions (window.screen.width, window.screen.height,
/// window.innerWidth, window.innerHeight, and "device-width"/"device-height"-related CSS media
/// query results).

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetDeviceMetricsOverrideParams {
    /// Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.

    pub width: u64,
    /// Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.

    pub height: i64,
    /// Overriding device scale factor value. 0 disables the override.

    pub deviceScaleFactor: f64,
    /// Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text
    /// autosizing and more.

    pub mobile: bool,
    /// Scale to apply to resulting view image.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub scale: Option<f64>,
    /// Overriding screen width value in pixels (minimum 0, maximum 10000000).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub screenWidth: Option<u64>,
    /// Overriding screen height value in pixels (minimum 0, maximum 10000000).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub screenHeight: Option<i64>,
    /// Overriding view X position on screen in pixels (minimum 0, maximum 10000000).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub positionX: Option<i64>,
    /// Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub positionY: Option<i64>,
    /// Do not set visible view size, rely upon explicit setVisibleSize call.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub dontSetVisibleSize: Option<bool>,
    /// Screen orientation override.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub screenOrientation: Option<ScreenOrientation>,
    /// If set, the visible area of the page will be overridden to this viewport. This viewport
    /// change is not observed by the page, e.g. viewport-relative elements do not change positions.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewport: Option<crate::page::Viewport>,
    /// If set, the display feature of a multi-segment screen. If not set, multi-segment support
    /// is turned-off.
    /// Deprecated, use Emulation.setDisplayFeaturesOverride.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub displayFeature: Option<DisplayFeature>,
    /// If set, the posture of a foldable device. If not set the posture is set
    /// to continuous.
    /// Deprecated, use Emulation.setDevicePostureOverride.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub devicePosture: Option<DevicePosture>,
    /// Scrollbar type. Default: 'default'.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub scrollbarType: Option<String>,
    /// If set to true, enables screen orientation lock emulation, which
    /// intercepts screen.orientation.lock() calls from the page and reports
    /// orientation changes via screenOrientationLockChanged events. This is
    /// useful for emulating mobile device orientation lock behavior in
    /// responsive design mode.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub screenOrientationLockEmulation: Option<bool>,
}

impl SetDeviceMetricsOverrideParams { pub const METHOD: &'static str = "Emulation.setDeviceMetricsOverride"; }

impl crate::CdpCommand for SetDeviceMetricsOverrideParams {
    const METHOD: &'static str = "Emulation.setDeviceMetricsOverride";
    type Response = crate::EmptyReturns;
}

/// Start reporting the given posture value to the Device Posture API.
/// This override can also be set in setDeviceMetricsOverride().

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetDevicePostureOverrideParams {

    pub posture: DevicePosture,
}

impl SetDevicePostureOverrideParams { pub const METHOD: &'static str = "Emulation.setDevicePostureOverride"; }

impl crate::CdpCommand for SetDevicePostureOverrideParams {
    const METHOD: &'static str = "Emulation.setDevicePostureOverride";
    type Response = crate::EmptyReturns;
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ClearDevicePostureOverrideParams {}

impl ClearDevicePostureOverrideParams { pub const METHOD: &'static str = "Emulation.clearDevicePostureOverride"; }

impl crate::CdpCommand for ClearDevicePostureOverrideParams {
    const METHOD: &'static str = "Emulation.clearDevicePostureOverride";
    type Response = crate::EmptyReturns;
}

/// Start using the given display features to pupulate the Viewport Segments API.
/// This override can also be set in setDeviceMetricsOverride().

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetDisplayFeaturesOverrideParams {

    pub features: Vec<DisplayFeature>,
}

impl SetDisplayFeaturesOverrideParams { pub const METHOD: &'static str = "Emulation.setDisplayFeaturesOverride"; }

impl crate::CdpCommand for SetDisplayFeaturesOverrideParams {
    const METHOD: &'static str = "Emulation.setDisplayFeaturesOverride";
    type Response = crate::EmptyReturns;
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ClearDisplayFeaturesOverrideParams {}

impl ClearDisplayFeaturesOverrideParams { pub const METHOD: &'static str = "Emulation.clearDisplayFeaturesOverride"; }

impl crate::CdpCommand for ClearDisplayFeaturesOverrideParams {
    const METHOD: &'static str = "Emulation.clearDisplayFeaturesOverride";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetScrollbarsHiddenParams {
    /// Whether scrollbars should be always hidden.

    pub hidden: bool,
}

impl SetScrollbarsHiddenParams { pub const METHOD: &'static str = "Emulation.setScrollbarsHidden"; }

impl crate::CdpCommand for SetScrollbarsHiddenParams {
    const METHOD: &'static str = "Emulation.setScrollbarsHidden";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetDocumentCookieDisabledParams {
    /// Whether document.coookie API should be disabled.

    pub disabled: bool,
}

impl SetDocumentCookieDisabledParams { pub const METHOD: &'static str = "Emulation.setDocumentCookieDisabled"; }

impl crate::CdpCommand for SetDocumentCookieDisabledParams {
    const METHOD: &'static str = "Emulation.setDocumentCookieDisabled";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetEmitTouchEventsForMouseParams {
    /// Whether touch emulation based on mouse input should be enabled.

    pub enabled: bool,
    /// Touch/gesture events configuration. Default: current platform.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub configuration: Option<String>,
}

impl SetEmitTouchEventsForMouseParams { pub const METHOD: &'static str = "Emulation.setEmitTouchEventsForMouse"; }

impl crate::CdpCommand for SetEmitTouchEventsForMouseParams {
    const METHOD: &'static str = "Emulation.setEmitTouchEventsForMouse";
    type Response = crate::EmptyReturns;
}

/// Emulates the given media type or media feature for CSS media queries.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetEmulatedMediaParams {
    /// Media type to emulate. Empty string disables the override.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub media: Option<String>,
    /// Media features to emulate.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub features: Option<Vec<MediaFeature>>,
}

impl SetEmulatedMediaParams { pub const METHOD: &'static str = "Emulation.setEmulatedMedia"; }

impl crate::CdpCommand for SetEmulatedMediaParams {
    const METHOD: &'static str = "Emulation.setEmulatedMedia";
    type Response = crate::EmptyReturns;
}

/// Emulates the given vision deficiency.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetEmulatedVisionDeficiencyParams {
    /// Vision deficiency to emulate. Order: best-effort emulations come first, followed by any
    /// physiologically accurate emulations for medically recognized color vision deficiencies.

    #[serde(rename = "type")]
    pub type_: String,
}

impl SetEmulatedVisionDeficiencyParams { pub const METHOD: &'static str = "Emulation.setEmulatedVisionDeficiency"; }

impl crate::CdpCommand for SetEmulatedVisionDeficiencyParams {
    const METHOD: &'static str = "Emulation.setEmulatedVisionDeficiency";
    type Response = crate::EmptyReturns;
}

/// Emulates the given OS text scale.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetEmulatedOSTextScaleParams {

    #[serde(skip_serializing_if = "Option::is_none")]
    pub scale: Option<f64>,
}

impl SetEmulatedOSTextScaleParams { pub const METHOD: &'static str = "Emulation.setEmulatedOSTextScale"; }

impl crate::CdpCommand for SetEmulatedOSTextScaleParams {
    const METHOD: &'static str = "Emulation.setEmulatedOSTextScale";
    type Response = crate::EmptyReturns;
}

/// Overrides the Geolocation Position or Error. Omitting latitude, longitude or
/// accuracy emulates position unavailable.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetGeolocationOverrideParams {
    /// Mock latitude

    #[serde(skip_serializing_if = "Option::is_none")]
    pub latitude: Option<f64>,
    /// Mock longitude

    #[serde(skip_serializing_if = "Option::is_none")]
    pub longitude: Option<f64>,
    /// Mock accuracy

    #[serde(skip_serializing_if = "Option::is_none")]
    pub accuracy: Option<f64>,
    /// Mock altitude

    #[serde(skip_serializing_if = "Option::is_none")]
    pub altitude: Option<f64>,
    /// Mock altitudeAccuracy

    #[serde(skip_serializing_if = "Option::is_none")]
    pub altitudeAccuracy: Option<f64>,
    /// Mock heading

    #[serde(skip_serializing_if = "Option::is_none")]
    pub heading: Option<f64>,
    /// Mock speed

    #[serde(skip_serializing_if = "Option::is_none")]
    pub speed: Option<f64>,
}

impl SetGeolocationOverrideParams { pub const METHOD: &'static str = "Emulation.setGeolocationOverride"; }

impl crate::CdpCommand for SetGeolocationOverrideParams {
    const METHOD: &'static str = "Emulation.setGeolocationOverride";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetOverriddenSensorInformationParams {

    #[serde(rename = "type")]
    pub type_: SensorType,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetOverriddenSensorInformationReturns {

    pub requestedSamplingFrequency: f64,
}

impl GetOverriddenSensorInformationParams { pub const METHOD: &'static str = "Emulation.getOverriddenSensorInformation"; }

impl crate::CdpCommand for GetOverriddenSensorInformationParams {
    const METHOD: &'static str = "Emulation.getOverriddenSensorInformation";
    type Response = GetOverriddenSensorInformationReturns;
}

/// Overrides a platform sensor of a given type. If |enabled| is true, calls to
/// Sensor.start() will use a virtual sensor as backend rather than fetching
/// data from a real hardware sensor. Otherwise, existing virtual
/// sensor-backend Sensor objects will fire an error event and new calls to
/// Sensor.start() will attempt to use a real sensor instead.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSensorOverrideEnabledParams {

    pub enabled: bool,

    #[serde(rename = "type")]
    pub type_: SensorType,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<SensorMetadata>,
}

impl SetSensorOverrideEnabledParams { pub const METHOD: &'static str = "Emulation.setSensorOverrideEnabled"; }

impl crate::CdpCommand for SetSensorOverrideEnabledParams {
    const METHOD: &'static str = "Emulation.setSensorOverrideEnabled";
    type Response = crate::EmptyReturns;
}

/// Updates the sensor readings reported by a sensor type previously overridden
/// by setSensorOverrideEnabled.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSensorOverrideReadingsParams {

    #[serde(rename = "type")]
    pub type_: SensorType,

    pub reading: SensorReading,
}

impl SetSensorOverrideReadingsParams { pub const METHOD: &'static str = "Emulation.setSensorOverrideReadings"; }

impl crate::CdpCommand for SetSensorOverrideReadingsParams {
    const METHOD: &'static str = "Emulation.setSensorOverrideReadings";
    type Response = crate::EmptyReturns;
}

/// Overrides a pressure source of a given type, as used by the Compute
/// Pressure API, so that updates to PressureObserver.observe() are provided
/// via setPressureStateOverride instead of being retrieved from
/// platform-provided telemetry data.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetPressureSourceOverrideEnabledParams {

    pub enabled: bool,

    pub source: PressureSource,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub metadata: Option<PressureMetadata>,
}

impl SetPressureSourceOverrideEnabledParams { pub const METHOD: &'static str = "Emulation.setPressureSourceOverrideEnabled"; }

impl crate::CdpCommand for SetPressureSourceOverrideEnabledParams {
    const METHOD: &'static str = "Emulation.setPressureSourceOverrideEnabled";
    type Response = crate::EmptyReturns;
}

/// TODO: OBSOLETE: To remove when setPressureDataOverride is merged.
/// Provides a given pressure state that will be processed and eventually be
/// delivered to PressureObserver users. |source| must have been previously
/// overridden by setPressureSourceOverrideEnabled.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetPressureStateOverrideParams {

    pub source: PressureSource,

    pub state: PressureState,
}

impl SetPressureStateOverrideParams { pub const METHOD: &'static str = "Emulation.setPressureStateOverride"; }

impl crate::CdpCommand for SetPressureStateOverrideParams {
    const METHOD: &'static str = "Emulation.setPressureStateOverride";
    type Response = crate::EmptyReturns;
}

/// Provides a given pressure data set that will be processed and eventually be
/// delivered to PressureObserver users. |source| must have been previously
/// overridden by setPressureSourceOverrideEnabled.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetPressureDataOverrideParams {

    pub source: PressureSource,

    pub state: PressureState,

    #[serde(skip_serializing_if = "Option::is_none")]
    pub ownContributionEstimate: Option<f64>,
}

impl SetPressureDataOverrideParams { pub const METHOD: &'static str = "Emulation.setPressureDataOverride"; }

impl crate::CdpCommand for SetPressureDataOverrideParams {
    const METHOD: &'static str = "Emulation.setPressureDataOverride";
    type Response = crate::EmptyReturns;
}

/// Overrides the Idle state.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetIdleOverrideParams {
    /// Mock isUserActive

    pub isUserActive: bool,
    /// Mock isScreenUnlocked

    pub isScreenUnlocked: bool,
}

impl SetIdleOverrideParams { pub const METHOD: &'static str = "Emulation.setIdleOverride"; }

impl crate::CdpCommand for SetIdleOverrideParams {
    const METHOD: &'static str = "Emulation.setIdleOverride";
    type Response = crate::EmptyReturns;
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ClearIdleOverrideParams {}

impl ClearIdleOverrideParams { pub const METHOD: &'static str = "Emulation.clearIdleOverride"; }

impl crate::CdpCommand for ClearIdleOverrideParams {
    const METHOD: &'static str = "Emulation.clearIdleOverride";
    type Response = crate::EmptyReturns;
}

/// Overrides value returned by the javascript navigator object.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetNavigatorOverridesParams {
    /// The platform navigator.platform should return.

    pub platform: String,
}

impl SetNavigatorOverridesParams { pub const METHOD: &'static str = "Emulation.setNavigatorOverrides"; }

impl crate::CdpCommand for SetNavigatorOverridesParams {
    const METHOD: &'static str = "Emulation.setNavigatorOverrides";
    type Response = crate::EmptyReturns;
}

/// Sets a specified page scale factor.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetPageScaleFactorParams {
    /// Page scale factor.

    pub pageScaleFactor: f64,
}

impl SetPageScaleFactorParams { pub const METHOD: &'static str = "Emulation.setPageScaleFactor"; }

impl crate::CdpCommand for SetPageScaleFactorParams {
    const METHOD: &'static str = "Emulation.setPageScaleFactor";
    type Response = crate::EmptyReturns;
}

/// Switches script execution in the page.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetScriptExecutionDisabledParams {
    /// Whether script execution should be disabled in the page.

    pub value: bool,
}

impl SetScriptExecutionDisabledParams { pub const METHOD: &'static str = "Emulation.setScriptExecutionDisabled"; }

impl crate::CdpCommand for SetScriptExecutionDisabledParams {
    const METHOD: &'static str = "Emulation.setScriptExecutionDisabled";
    type Response = crate::EmptyReturns;
}

/// Enables touch on platforms which do not support them.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetTouchEmulationEnabledParams {
    /// Whether the touch event emulation should be enabled.

    pub enabled: bool,
    /// Maximum touch points supported. Defaults to one.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maxTouchPoints: Option<i64>,
}

impl SetTouchEmulationEnabledParams { pub const METHOD: &'static str = "Emulation.setTouchEmulationEnabled"; }

impl crate::CdpCommand for SetTouchEmulationEnabledParams {
    const METHOD: &'static str = "Emulation.setTouchEmulationEnabled";
    type Response = crate::EmptyReturns;
}

/// Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets
/// the current virtual time policy.  Note this supersedes any previous time budget.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetVirtualTimePolicyParams {

    pub policy: VirtualTimePolicy,
    /// If set, after this many virtual milliseconds have elapsed virtual time will be paused and a
    /// virtualTimeBudgetExpired event is sent.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub budget: Option<f64>,
    /// If set this specifies the maximum number of tasks that can be run before virtual is forced
    /// forwards to prevent deadlock.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maxVirtualTimeTaskStarvationCount: Option<u64>,
    /// If set, base::Time::Now will be overridden to initially return this value.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub initialVirtualTime: Option<crate::network::TimeSinceEpoch>,
}

/// Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets
/// the current virtual time policy.  Note this supersedes any previous time budget.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetVirtualTimePolicyReturns {
    /// Absolute timestamp at which virtual time was first enabled (up time in milliseconds).

    pub virtualTimeTicksBase: f64,
}

impl SetVirtualTimePolicyParams { pub const METHOD: &'static str = "Emulation.setVirtualTimePolicy"; }

impl crate::CdpCommand for SetVirtualTimePolicyParams {
    const METHOD: &'static str = "Emulation.setVirtualTimePolicy";
    type Response = SetVirtualTimePolicyReturns;
}

/// Overrides default host system locale with the specified one.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetLocaleOverrideParams {
    /// ICU style C locale (e.g. "en_US"). If not specified or empty, disables the override and
    /// restores default host system locale.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub locale: Option<String>,
}

impl SetLocaleOverrideParams { pub const METHOD: &'static str = "Emulation.setLocaleOverride"; }

impl crate::CdpCommand for SetLocaleOverrideParams {
    const METHOD: &'static str = "Emulation.setLocaleOverride";
    type Response = crate::EmptyReturns;
}

/// Overrides default host system timezone with the specified one.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetTimezoneOverrideParams {
    /// The timezone identifier. List of supported timezones:
    /// https://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt
    /// If empty, disables the override and restores default host system timezone.

    pub timezoneId: String,
}

impl SetTimezoneOverrideParams { pub const METHOD: &'static str = "Emulation.setTimezoneOverride"; }

impl crate::CdpCommand for SetTimezoneOverrideParams {
    const METHOD: &'static str = "Emulation.setTimezoneOverride";
    type Response = crate::EmptyReturns;
}

/// Resizes the frame/viewport of the page. Note that this does not affect the frame's container
/// (e.g. browser window). Can be used to produce screenshots of the specified size. Not supported
/// on Android.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetVisibleSizeParams {
    /// Frame width (DIP).

    pub width: u64,
    /// Frame height (DIP).

    pub height: i64,
}

impl SetVisibleSizeParams { pub const METHOD: &'static str = "Emulation.setVisibleSize"; }

impl crate::CdpCommand for SetVisibleSizeParams {
    const METHOD: &'static str = "Emulation.setVisibleSize";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetDisabledImageTypesParams {
    /// Image types to disable.

    pub imageTypes: Vec<DisabledImageType>,
}

impl SetDisabledImageTypesParams { pub const METHOD: &'static str = "Emulation.setDisabledImageTypes"; }

impl crate::CdpCommand for SetDisabledImageTypesParams {
    const METHOD: &'static str = "Emulation.setDisabledImageTypes";
    type Response = crate::EmptyReturns;
}

/// Override the value of navigator.connection.saveData

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetDataSaverOverrideParams {
    /// Override value. Omitting the parameter disables the override.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub dataSaverEnabled: Option<bool>,
}

impl SetDataSaverOverrideParams { pub const METHOD: &'static str = "Emulation.setDataSaverOverride"; }

impl crate::CdpCommand for SetDataSaverOverrideParams {
    const METHOD: &'static str = "Emulation.setDataSaverOverride";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetHardwareConcurrencyOverrideParams {
    /// Hardware concurrency to report

    pub hardwareConcurrency: i64,
}

impl SetHardwareConcurrencyOverrideParams { pub const METHOD: &'static str = "Emulation.setHardwareConcurrencyOverride"; }

impl crate::CdpCommand for SetHardwareConcurrencyOverrideParams {
    const METHOD: &'static str = "Emulation.setHardwareConcurrencyOverride";
    type Response = crate::EmptyReturns;
}

/// Allows overriding user agent with the given string.
/// 'userAgentMetadata' must be set for Client Hint headers to be sent.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetUserAgentOverrideParams {
    /// User agent to use.

    pub userAgent: String,
    /// Browser language to emulate.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub acceptLanguage: Option<String>,
    /// The platform navigator.platform should return.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub platform: Option<String>,
    /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData

    #[serde(skip_serializing_if = "Option::is_none")]
    pub userAgentMetadata: Option<UserAgentMetadata>,
}

impl SetUserAgentOverrideParams { pub const METHOD: &'static str = "Emulation.setUserAgentOverride"; }

impl crate::CdpCommand for SetUserAgentOverrideParams {
    const METHOD: &'static str = "Emulation.setUserAgentOverride";
    type Response = crate::EmptyReturns;
}

/// Allows overriding the automation flag.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetAutomationOverrideParams {
    /// Whether the override should be enabled.

    pub enabled: bool,
}

impl SetAutomationOverrideParams { pub const METHOD: &'static str = "Emulation.setAutomationOverride"; }

impl crate::CdpCommand for SetAutomationOverrideParams {
    const METHOD: &'static str = "Emulation.setAutomationOverride";
    type Response = crate::EmptyReturns;
}

/// Allows overriding the difference between the small and large viewport sizes, which determine the
/// value of the 'svh' and 'lvh' unit, respectively. Only supported for top-level frames.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSmallViewportHeightDifferenceOverrideParams {
    /// This will cause an element of size 100svh to be 'difference' pixels smaller than an element
    /// of size 100lvh.

    pub difference: i64,
}

impl SetSmallViewportHeightDifferenceOverrideParams { pub const METHOD: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride"; }

impl crate::CdpCommand for SetSmallViewportHeightDifferenceOverrideParams {
    const METHOD: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride";
    type Response = crate::EmptyReturns;
}

/// Returns device's screen configuration. In headful mode, the physical screens configuration is returned,
/// whereas in headless mode, a virtual headless screen configuration is provided instead.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetScreenInfosReturns {

    pub screenInfos: Vec<ScreenInfo>,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetScreenInfosParams {}

impl GetScreenInfosParams { pub const METHOD: &'static str = "Emulation.getScreenInfos"; }

impl crate::CdpCommand for GetScreenInfosParams {
    const METHOD: &'static str = "Emulation.getScreenInfos";
    type Response = GetScreenInfosReturns;
}

/// Add a new screen to the device. Only supported in headless mode.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AddScreenParams {
    /// Offset of the left edge of the screen in pixels.

    pub left: i64,
    /// Offset of the top edge of the screen in pixels.

    pub top: i64,
    /// The width of the screen in pixels.

    pub width: u64,
    /// The height of the screen in pixels.

    pub height: i64,
    /// Specifies the screen's work area. Default is entire screen.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub workAreaInsets: Option<WorkAreaInsets>,
    /// Specifies the screen's device pixel ratio. Default is 1.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub devicePixelRatio: Option<f64>,
    /// Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub rotation: Option<i64>,
    /// Specifies the screen's color depth in bits. Default is 24.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub colorDepth: Option<i64>,
    /// Specifies the descriptive label for the screen. Default is none.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// Indicates whether the screen is internal to the device or external, attached to the device. Default is false.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub isInternal: Option<bool>,
}

/// Add a new screen to the device. Only supported in headless mode.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AddScreenReturns {

    pub screenInfo: ScreenInfo,
}

impl AddScreenParams { pub const METHOD: &'static str = "Emulation.addScreen"; }

impl crate::CdpCommand for AddScreenParams {
    const METHOD: &'static str = "Emulation.addScreen";
    type Response = AddScreenReturns;
}

/// Updates specified screen parameters. Only supported in headless mode.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UpdateScreenParams {
    /// Target screen identifier.

    pub screenId: ScreenId,
    /// Offset of the left edge of the screen in pixels.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub left: Option<i64>,
    /// Offset of the top edge of the screen in pixels.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub top: Option<i64>,
    /// The width of the screen in pixels.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub width: Option<u64>,
    /// The height of the screen in pixels.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub height: Option<i64>,
    /// Specifies the screen's work area.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub workAreaInsets: Option<WorkAreaInsets>,
    /// Specifies the screen's device pixel ratio.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub devicePixelRatio: Option<f64>,
    /// Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub rotation: Option<i64>,
    /// Specifies the screen's color depth in bits.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub colorDepth: Option<i64>,
    /// Specifies the descriptive label for the screen.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub label: Option<String>,
    /// Indicates whether the screen is internal to the device or external, attached to the device. Default is false.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub isInternal: Option<bool>,
}

/// Updates specified screen parameters. Only supported in headless mode.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UpdateScreenReturns {

    pub screenInfo: ScreenInfo,
}

impl UpdateScreenParams { pub const METHOD: &'static str = "Emulation.updateScreen"; }

impl crate::CdpCommand for UpdateScreenParams {
    const METHOD: &'static str = "Emulation.updateScreen";
    type Response = UpdateScreenReturns;
}

/// Remove screen from the device. Only supported in headless mode.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RemoveScreenParams {

    pub screenId: ScreenId,
}

impl RemoveScreenParams { pub const METHOD: &'static str = "Emulation.removeScreen"; }

impl crate::CdpCommand for RemoveScreenParams {
    const METHOD: &'static str = "Emulation.removeScreen";
    type Response = crate::EmptyReturns;
}

/// Set primary screen. Only supported in headless mode.
/// Note that this changes the coordinate system origin to the top-left
/// of the new primary screen, updating the bounds and work areas
/// of all existing screens accordingly.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetPrimaryScreenParams {

    pub screenId: ScreenId,
}

impl SetPrimaryScreenParams { pub const METHOD: &'static str = "Emulation.setPrimaryScreen"; }

impl crate::CdpCommand for SetPrimaryScreenParams {
    const METHOD: &'static str = "Emulation.setPrimaryScreen";
    type Response = crate::EmptyReturns;
}