rustenium-cdp-definitions 0.1.1

Generated Chrome DevTools Protocol type definitions for Rustenium
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
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
use serde::{Deserialize, Serialize};
#[doc = "Clears the overridden device metrics.\n[clearDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDeviceMetricsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearDeviceMetricsOverrideParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearDeviceMetricsOverrideMethod {
    #[serde(rename = "Emulation.clearDeviceMetricsOverride")]
    ClearDeviceMetricsOverride,
}
#[doc = "Clears the overridden device metrics.\n[clearDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDeviceMetricsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearDeviceMetricsOverride {
    pub method: ClearDeviceMetricsOverrideMethod,
    pub params: ClearDeviceMetricsOverrideParams,
}
impl ClearDeviceMetricsOverride {
    pub const IDENTIFIER: &'static str = "Emulation.clearDeviceMetricsOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearDeviceMetricsOverride {
    type Result = super::results::ClearDeviceMetricsOverrideResult;
}
#[doc = "Clears the overridden Geolocation Position and Error.\n[clearGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearGeolocationOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearGeolocationOverrideParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearGeolocationOverrideMethod {
    #[serde(rename = "Emulation.clearGeolocationOverride")]
    ClearGeolocationOverride,
}
#[doc = "Clears the overridden Geolocation Position and Error.\n[clearGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearGeolocationOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearGeolocationOverride {
    pub method: ClearGeolocationOverrideMethod,
    pub params: ClearGeolocationOverrideParams,
}
impl ClearGeolocationOverride {
    pub const IDENTIFIER: &'static str = "Emulation.clearGeolocationOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearGeolocationOverride {
    type Result = super::results::ClearGeolocationOverrideResult;
}
#[doc = "Requests that page scale factor is reset to initial values.\n[resetPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-resetPageScaleFactor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResetPageScaleFactorParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ResetPageScaleFactorMethod {
    #[serde(rename = "Emulation.resetPageScaleFactor")]
    ResetPageScaleFactor,
}
#[doc = "Requests that page scale factor is reset to initial values.\n[resetPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-resetPageScaleFactor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResetPageScaleFactor {
    pub method: ResetPageScaleFactorMethod,
    pub params: ResetPageScaleFactorParams,
}
impl ResetPageScaleFactor {
    pub const IDENTIFIER: &'static str = "Emulation.resetPageScaleFactor";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ResetPageScaleFactor {
    type Result = super::results::ResetPageScaleFactorResult;
}
#[doc = "Enables or disables simulating a focused and active page.\n[setFocusEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setFocusEmulationEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetFocusEmulationEnabledParams {
    #[doc = "Whether to enable to disable focus emulation."]
    #[serde(rename = "enabled")]
    pub enabled: bool,
}
impl SetFocusEmulationEnabledParams {
    pub fn new(enabled: impl Into<bool>) -> Self {
        Self {
            enabled: enabled.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetFocusEmulationEnabledMethod {
    #[serde(rename = "Emulation.setFocusEmulationEnabled")]
    SetFocusEmulationEnabled,
}
#[doc = "Enables or disables simulating a focused and active page.\n[setFocusEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setFocusEmulationEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetFocusEmulationEnabled {
    pub method: SetFocusEmulationEnabledMethod,
    pub params: SetFocusEmulationEnabledParams,
}
impl SetFocusEmulationEnabled {
    pub const IDENTIFIER: &'static str = "Emulation.setFocusEmulationEnabled";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetFocusEmulationEnabled {
    type Result = super::results::SetFocusEmulationEnabledResult;
}
#[doc = "Automatically render all web contents using a dark theme.\n[setAutoDarkModeOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutoDarkModeOverride)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetAutoDarkModeOverrideParams {
    #[doc = "Whether to enable or disable automatic dark mode.\nIf not specified, any existing override will be cleared."]
    #[serde(rename = "enabled")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub enabled: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetAutoDarkModeOverrideMethod {
    #[serde(rename = "Emulation.setAutoDarkModeOverride")]
    SetAutoDarkModeOverride,
}
#[doc = "Automatically render all web contents using a dark theme.\n[setAutoDarkModeOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutoDarkModeOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetAutoDarkModeOverride {
    pub method: SetAutoDarkModeOverrideMethod,
    pub params: SetAutoDarkModeOverrideParams,
}
impl SetAutoDarkModeOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setAutoDarkModeOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetAutoDarkModeOverride {
    type Result = super::results::SetAutoDarkModeOverrideResult;
}
#[doc = "Enables CPU throttling to emulate slow CPUs.\n[setCPUThrottlingRate](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCpuThrottlingRateParams {
    #[doc = "Throttling rate as a slowdown factor (1 is no throttle, 2 is 2x slowdown, etc)."]
    #[serde(rename = "rate")]
    pub rate: f64,
}
impl SetCpuThrottlingRateParams {
    pub fn new(rate: impl Into<f64>) -> Self {
        Self { rate: rate.into() }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetCpuThrottlingRateMethod {
    #[serde(rename = "Emulation.setCPUThrottlingRate")]
    SetCpuThrottlingRate,
}
#[doc = "Enables CPU throttling to emulate slow CPUs.\n[setCPUThrottlingRate](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setCPUThrottlingRate)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCpuThrottlingRate {
    pub method: SetCpuThrottlingRateMethod,
    pub params: SetCpuThrottlingRateParams,
}
impl SetCpuThrottlingRate {
    pub const IDENTIFIER: &'static str = "Emulation.setCPUThrottlingRate";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetCpuThrottlingRate {
    type Result = super::results::SetCpuThrottlingRateResult;
}
#[doc = "Sets or clears an override of the default background color of the frame. This override is used\nif the content does not specify one.\n[setDefaultBackgroundColorOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDefaultBackgroundColorOverride)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetDefaultBackgroundColorOverrideParams {
    #[doc = "RGBA of the default background color. If not specified, any existing override will be\ncleared."]
    #[serde(rename = "color")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub color: Option<crate::browser_protocol::dom::types::Rgba>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDefaultBackgroundColorOverrideMethod {
    #[serde(rename = "Emulation.setDefaultBackgroundColorOverride")]
    SetDefaultBackgroundColorOverride,
}
#[doc = "Sets or clears an override of the default background color of the frame. This override is used\nif the content does not specify one.\n[setDefaultBackgroundColorOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDefaultBackgroundColorOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDefaultBackgroundColorOverride {
    pub method: SetDefaultBackgroundColorOverrideMethod,
    pub params: SetDefaultBackgroundColorOverrideParams,
}
impl SetDefaultBackgroundColorOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setDefaultBackgroundColorOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDefaultBackgroundColorOverride {
    type Result = super::results::SetDefaultBackgroundColorOverrideResult;
}
#[doc = "Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the\nrespective variables to be undefined, even if previously overridden.\n[setSafeAreaInsetsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSafeAreaInsetsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSafeAreaInsetsOverrideParams {
    #[serde(rename = "insets")]
    pub insets: super::types::SafeAreaInsets,
}
impl SetSafeAreaInsetsOverrideParams {
    pub fn new(insets: impl Into<super::types::SafeAreaInsets>) -> Self {
        Self {
            insets: insets.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetSafeAreaInsetsOverrideMethod {
    #[serde(rename = "Emulation.setSafeAreaInsetsOverride")]
    SetSafeAreaInsetsOverride,
}
#[doc = "Overrides the values for env(safe-area-inset-*) and env(safe-area-max-inset-*). Unset values will cause the\nrespective variables to be undefined, even if previously overridden.\n[setSafeAreaInsetsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSafeAreaInsetsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSafeAreaInsetsOverride {
    pub method: SetSafeAreaInsetsOverrideMethod,
    pub params: SetSafeAreaInsetsOverrideParams,
}
impl SetSafeAreaInsetsOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setSafeAreaInsetsOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetSafeAreaInsetsOverride {
    type Result = super::results::SetSafeAreaInsetsOverrideResult;
}
#[doc = "Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\nwindow.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media\nquery results).\n[setDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDeviceMetricsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDeviceMetricsOverrideParams {
    #[doc = "Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override."]
    #[serde(rename = "width")]
    pub width: i64,
    #[doc = "Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override."]
    #[serde(rename = "height")]
    pub height: i64,
    #[doc = "Overriding device scale factor value. 0 disables the override."]
    #[serde(rename = "deviceScaleFactor")]
    pub device_scale_factor: f64,
    #[doc = "Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text\nautosizing and more."]
    #[serde(rename = "mobile")]
    pub mobile: bool,
    #[doc = "Scale to apply to resulting view image."]
    #[serde(rename = "scale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub scale: Option<f64>,
    #[doc = "Overriding screen width value in pixels (minimum 0, maximum 10000000)."]
    #[serde(rename = "screenWidth")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub screen_width: Option<i64>,
    #[doc = "Overriding screen height value in pixels (minimum 0, maximum 10000000)."]
    #[serde(rename = "screenHeight")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub screen_height: Option<i64>,
    #[doc = "Overriding view X position on screen in pixels (minimum 0, maximum 10000000)."]
    #[serde(rename = "positionX")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub position_x: Option<i64>,
    #[doc = "Overriding view Y position on screen in pixels (minimum 0, maximum 10000000)."]
    #[serde(rename = "positionY")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub position_y: Option<i64>,
    #[doc = "Do not set visible view size, rely upon explicit setVisibleSize call."]
    #[serde(rename = "dontSetVisibleSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub dont_set_visible_size: Option<bool>,
    #[doc = "Screen orientation override."]
    #[serde(rename = "screenOrientation")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub screen_orientation: Option<super::types::ScreenOrientation>,
    #[doc = "If set, the visible area of the page will be overridden to this viewport. This viewport\nchange is not observed by the page, e.g. viewport-relative elements do not change positions."]
    #[serde(rename = "viewport")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub viewport: Option<crate::browser_protocol::page::types::Viewport>,
    #[doc = "Scrollbar type. Default: `default`."]
    #[serde(rename = "scrollbarType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub scrollbar_type: Option<SetDeviceMetricsOverrideScrollbarType>,
}
#[doc = "Scrollbar type. Default: `default`."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SetDeviceMetricsOverrideScrollbarType {
    #[doc = "Emulates scrollbars that float over the content, typically appearing\nonly when scrolling."]
    #[serde(rename = "overlay")]
    Overlay,
    #[doc = "Restores the platform's default scrollbar behavior, which might be\nclassic (occupying space within the layout) or overlay, depending\non the platform. Note: if `mobile` is `true`, the default scrollbar type is `overlay`."]
    #[serde(rename = "default")]
    Default,
}
impl SetDeviceMetricsOverrideParams {
    pub fn new(
        width: impl Into<i64>,
        height: impl Into<i64>,
        device_scale_factor: impl Into<f64>,
        mobile: impl Into<bool>,
    ) -> Self {
        Self {
            width: width.into(),
            height: height.into(),
            device_scale_factor: device_scale_factor.into(),
            mobile: mobile.into(),
            scale: None,
            screen_width: None,
            screen_height: None,
            position_x: None,
            position_y: None,
            dont_set_visible_size: None,
            screen_orientation: None,
            viewport: None,
            scrollbar_type: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDeviceMetricsOverrideMethod {
    #[serde(rename = "Emulation.setDeviceMetricsOverride")]
    SetDeviceMetricsOverride,
}
#[doc = "Overrides the values of device screen dimensions (window.screen.width, window.screen.height,\nwindow.innerWidth, window.innerHeight, and \"device-width\"/\"device-height\"-related CSS media\nquery results).\n[setDeviceMetricsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDeviceMetricsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDeviceMetricsOverride {
    pub method: SetDeviceMetricsOverrideMethod,
    pub params: SetDeviceMetricsOverrideParams,
}
impl SetDeviceMetricsOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setDeviceMetricsOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDeviceMetricsOverride {
    type Result = super::results::SetDeviceMetricsOverrideResult;
}
#[doc = "Start reporting the given posture value to the Device Posture API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDevicePostureOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDevicePostureOverrideParams {
    #[serde(rename = "posture")]
    pub posture: super::types::DevicePosture,
}
impl SetDevicePostureOverrideParams {
    pub fn new(posture: impl Into<super::types::DevicePosture>) -> Self {
        Self {
            posture: posture.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDevicePostureOverrideMethod {
    #[serde(rename = "Emulation.setDevicePostureOverride")]
    SetDevicePostureOverride,
}
#[doc = "Start reporting the given posture value to the Device Posture API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDevicePostureOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDevicePostureOverride {
    pub method: SetDevicePostureOverrideMethod,
    pub params: SetDevicePostureOverrideParams,
}
impl SetDevicePostureOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setDevicePostureOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDevicePostureOverride {
    type Result = super::results::SetDevicePostureOverrideResult;
}
#[doc = "Clears a device posture override set with either setDeviceMetricsOverride()\nor setDevicePostureOverride() and starts using posture information from the\nplatform again.\nDoes nothing if no override is set.\n[clearDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDevicePostureOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearDevicePostureOverrideParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearDevicePostureOverrideMethod {
    #[serde(rename = "Emulation.clearDevicePostureOverride")]
    ClearDevicePostureOverride,
}
#[doc = "Clears a device posture override set with either setDeviceMetricsOverride()\nor setDevicePostureOverride() and starts using posture information from the\nplatform again.\nDoes nothing if no override is set.\n[clearDevicePostureOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDevicePostureOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearDevicePostureOverride {
    pub method: ClearDevicePostureOverrideMethod,
    pub params: ClearDevicePostureOverrideParams,
}
impl ClearDevicePostureOverride {
    pub const IDENTIFIER: &'static str = "Emulation.clearDevicePostureOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearDevicePostureOverride {
    type Result = super::results::ClearDevicePostureOverrideResult;
}
#[doc = "Start using the given display features to pupulate the Viewport Segments API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDisplayFeaturesOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDisplayFeaturesOverrideParams {
    #[serde(rename = "features")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub features: Vec<super::types::DisplayFeature>,
}
impl SetDisplayFeaturesOverrideParams {
    pub fn new(features: Vec<super::types::DisplayFeature>) -> Self {
        Self { features }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDisplayFeaturesOverrideMethod {
    #[serde(rename = "Emulation.setDisplayFeaturesOverride")]
    SetDisplayFeaturesOverride,
}
#[doc = "Start using the given display features to pupulate the Viewport Segments API.\nThis override can also be set in setDeviceMetricsOverride().\n[setDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDisplayFeaturesOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDisplayFeaturesOverride {
    pub method: SetDisplayFeaturesOverrideMethod,
    pub params: SetDisplayFeaturesOverrideParams,
}
impl SetDisplayFeaturesOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setDisplayFeaturesOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDisplayFeaturesOverride {
    type Result = super::results::SetDisplayFeaturesOverrideResult;
}
#[doc = "Clears the display features override set with either setDeviceMetricsOverride()\nor setDisplayFeaturesOverride() and starts using display features from the\nplatform again.\nDoes nothing if no override is set.\n[clearDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDisplayFeaturesOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearDisplayFeaturesOverrideParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearDisplayFeaturesOverrideMethod {
    #[serde(rename = "Emulation.clearDisplayFeaturesOverride")]
    ClearDisplayFeaturesOverride,
}
#[doc = "Clears the display features override set with either setDeviceMetricsOverride()\nor setDisplayFeaturesOverride() and starts using display features from the\nplatform again.\nDoes nothing if no override is set.\n[clearDisplayFeaturesOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearDisplayFeaturesOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearDisplayFeaturesOverride {
    pub method: ClearDisplayFeaturesOverrideMethod,
    pub params: ClearDisplayFeaturesOverrideParams,
}
impl ClearDisplayFeaturesOverride {
    pub const IDENTIFIER: &'static str = "Emulation.clearDisplayFeaturesOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearDisplayFeaturesOverride {
    type Result = super::results::ClearDisplayFeaturesOverrideResult;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetScrollbarsHiddenParams {
    #[doc = "Whether scrollbars should be always hidden."]
    #[serde(rename = "hidden")]
    pub hidden: bool,
}
impl SetScrollbarsHiddenParams {
    pub fn new(hidden: impl Into<bool>) -> Self {
        Self {
            hidden: hidden.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetScrollbarsHiddenMethod {
    #[serde(rename = "Emulation.setScrollbarsHidden")]
    SetScrollbarsHidden,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetScrollbarsHidden {
    pub method: SetScrollbarsHiddenMethod,
    pub params: SetScrollbarsHiddenParams,
}
impl SetScrollbarsHidden {
    pub const IDENTIFIER: &'static str = "Emulation.setScrollbarsHidden";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetScrollbarsHidden {
    type Result = super::results::SetScrollbarsHiddenResult;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDocumentCookieDisabledParams {
    #[doc = "Whether document.coookie API should be disabled."]
    #[serde(rename = "disabled")]
    pub disabled: bool,
}
impl SetDocumentCookieDisabledParams {
    pub fn new(disabled: impl Into<bool>) -> Self {
        Self {
            disabled: disabled.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDocumentCookieDisabledMethod {
    #[serde(rename = "Emulation.setDocumentCookieDisabled")]
    SetDocumentCookieDisabled,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDocumentCookieDisabled {
    pub method: SetDocumentCookieDisabledMethod,
    pub params: SetDocumentCookieDisabledParams,
}
impl SetDocumentCookieDisabled {
    pub const IDENTIFIER: &'static str = "Emulation.setDocumentCookieDisabled";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDocumentCookieDisabled {
    type Result = super::results::SetDocumentCookieDisabledResult;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetEmitTouchEventsForMouseParams {
    #[doc = "Whether touch emulation based on mouse input should be enabled."]
    #[serde(rename = "enabled")]
    pub enabled: bool,
    #[doc = "Touch/gesture events configuration. Default: current platform."]
    #[serde(rename = "configuration")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub configuration: Option<SetEmitTouchEventsForMouseConfiguration>,
}
#[doc = "Touch/gesture events configuration. Default: current platform."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SetEmitTouchEventsForMouseConfiguration {
    #[serde(rename = "mobile")]
    Mobile,
    #[serde(rename = "desktop")]
    Desktop,
}
impl SetEmitTouchEventsForMouseParams {
    pub fn new(enabled: impl Into<bool>) -> Self {
        Self {
            enabled: enabled.into(),
            configuration: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetEmitTouchEventsForMouseMethod {
    #[serde(rename = "Emulation.setEmitTouchEventsForMouse")]
    SetEmitTouchEventsForMouse,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetEmitTouchEventsForMouse {
    pub method: SetEmitTouchEventsForMouseMethod,
    pub params: SetEmitTouchEventsForMouseParams,
}
impl SetEmitTouchEventsForMouse {
    pub const IDENTIFIER: &'static str = "Emulation.setEmitTouchEventsForMouse";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetEmitTouchEventsForMouse {
    type Result = super::results::SetEmitTouchEventsForMouseResult;
}
#[doc = "Emulates the given media type or media feature for CSS media queries.\n[setEmulatedMedia](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetEmulatedMediaParams {
    #[doc = "Media type to emulate. Empty string disables the override."]
    #[serde(rename = "media")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub media: Option<String>,
    #[doc = "Media features to emulate."]
    #[serde(rename = "features")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub features: Option<Vec<super::types::MediaFeature>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetEmulatedMediaMethod {
    #[serde(rename = "Emulation.setEmulatedMedia")]
    SetEmulatedMedia,
}
#[doc = "Emulates the given media type or media feature for CSS media queries.\n[setEmulatedMedia](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedMedia)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetEmulatedMedia {
    pub method: SetEmulatedMediaMethod,
    pub params: SetEmulatedMediaParams,
}
impl SetEmulatedMedia {
    pub const IDENTIFIER: &'static str = "Emulation.setEmulatedMedia";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetEmulatedMedia {
    type Result = super::results::SetEmulatedMediaResult;
}
#[doc = "Emulates the given vision deficiency.\n[setEmulatedVisionDeficiency](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedVisionDeficiency)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetEmulatedVisionDeficiencyParams {
    #[doc = "Vision deficiency to emulate. Order: best-effort emulations come first, followed by any\nphysiologically accurate emulations for medically recognized color vision deficiencies."]
    #[serde(rename = "type")]
    pub r#type: SetEmulatedVisionDeficiencyType,
}
#[doc = "Vision deficiency to emulate. Order: best-effort emulations come first, followed by any\nphysiologically accurate emulations for medically recognized color vision deficiencies."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SetEmulatedVisionDeficiencyType {
    #[serde(rename = "none")]
    None,
    #[serde(rename = "blurredVision")]
    BlurredVision,
    #[serde(rename = "reducedContrast")]
    ReducedContrast,
    #[serde(rename = "achromatopsia")]
    Achromatopsia,
    #[serde(rename = "deuteranopia")]
    Deuteranopia,
    #[serde(rename = "protanopia")]
    Protanopia,
    #[serde(rename = "tritanopia")]
    Tritanopia,
}
impl SetEmulatedVisionDeficiencyParams {
    pub fn new(r#type: impl Into<SetEmulatedVisionDeficiencyType>) -> Self {
        Self {
            r#type: r#type.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetEmulatedVisionDeficiencyMethod {
    #[serde(rename = "Emulation.setEmulatedVisionDeficiency")]
    SetEmulatedVisionDeficiency,
}
#[doc = "Emulates the given vision deficiency.\n[setEmulatedVisionDeficiency](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedVisionDeficiency)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetEmulatedVisionDeficiency {
    pub method: SetEmulatedVisionDeficiencyMethod,
    pub params: SetEmulatedVisionDeficiencyParams,
}
impl SetEmulatedVisionDeficiency {
    pub const IDENTIFIER: &'static str = "Emulation.setEmulatedVisionDeficiency";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetEmulatedVisionDeficiency {
    type Result = super::results::SetEmulatedVisionDeficiencyResult;
}
#[doc = "Emulates the given OS text scale.\n[setEmulatedOSTextScale](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedOSTextScale)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetEmulatedOsTextScaleParams {
    #[serde(rename = "scale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub scale: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetEmulatedOsTextScaleMethod {
    #[serde(rename = "Emulation.setEmulatedOSTextScale")]
    SetEmulatedOsTextScale,
}
#[doc = "Emulates the given OS text scale.\n[setEmulatedOSTextScale](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setEmulatedOSTextScale)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetEmulatedOsTextScale {
    pub method: SetEmulatedOsTextScaleMethod,
    pub params: SetEmulatedOsTextScaleParams,
}
impl SetEmulatedOsTextScale {
    pub const IDENTIFIER: &'static str = "Emulation.setEmulatedOSTextScale";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetEmulatedOsTextScale {
    type Result = super::results::SetEmulatedOsTextScaleResult;
}
#[doc = "Overrides the Geolocation Position or Error. Omitting latitude, longitude or\naccuracy emulates position unavailable.\n[setGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setGeolocationOverride)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetGeolocationOverrideParams {
    #[doc = "Mock latitude"]
    #[serde(rename = "latitude")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub latitude: Option<f64>,
    #[doc = "Mock longitude"]
    #[serde(rename = "longitude")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub longitude: Option<f64>,
    #[doc = "Mock accuracy"]
    #[serde(rename = "accuracy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub accuracy: Option<f64>,
    #[doc = "Mock altitude"]
    #[serde(rename = "altitude")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub altitude: Option<f64>,
    #[doc = "Mock altitudeAccuracy"]
    #[serde(rename = "altitudeAccuracy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub altitude_accuracy: Option<f64>,
    #[doc = "Mock heading"]
    #[serde(rename = "heading")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub heading: Option<f64>,
    #[doc = "Mock speed"]
    #[serde(rename = "speed")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub speed: Option<f64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetGeolocationOverrideMethod {
    #[serde(rename = "Emulation.setGeolocationOverride")]
    SetGeolocationOverride,
}
#[doc = "Overrides the Geolocation Position or Error. Omitting latitude, longitude or\naccuracy emulates position unavailable.\n[setGeolocationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setGeolocationOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetGeolocationOverride {
    pub method: SetGeolocationOverrideMethod,
    pub params: SetGeolocationOverrideParams,
}
impl SetGeolocationOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setGeolocationOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetGeolocationOverride {
    type Result = super::results::SetGeolocationOverrideResult;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetOverriddenSensorInformationParams {
    #[serde(rename = "type")]
    pub r#type: super::types::SensorType,
}
impl GetOverriddenSensorInformationParams {
    pub fn new(r#type: impl Into<super::types::SensorType>) -> Self {
        Self {
            r#type: r#type.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetOverriddenSensorInformationMethod {
    #[serde(rename = "Emulation.getOverriddenSensorInformation")]
    GetOverriddenSensorInformation,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetOverriddenSensorInformation {
    pub method: GetOverriddenSensorInformationMethod,
    pub params: GetOverriddenSensorInformationParams,
}
impl GetOverriddenSensorInformation {
    pub const IDENTIFIER: &'static str = "Emulation.getOverriddenSensorInformation";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetOverriddenSensorInformation {
    type Result = super::results::GetOverriddenSensorInformationResult;
}
#[doc = "Overrides a platform sensor of a given type. If |enabled| is true, calls to\nSensor.start() will use a virtual sensor as backend rather than fetching\ndata from a real hardware sensor. Otherwise, existing virtual\nsensor-backend Sensor objects will fire an error event and new calls to\nSensor.start() will attempt to use a real sensor instead.\n[setSensorOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSensorOverrideEnabledParams {
    #[serde(rename = "enabled")]
    pub enabled: bool,
    #[serde(rename = "type")]
    pub r#type: super::types::SensorType,
    #[serde(rename = "metadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub metadata: Option<super::types::SensorMetadata>,
}
impl SetSensorOverrideEnabledParams {
    pub fn new(enabled: impl Into<bool>, r#type: impl Into<super::types::SensorType>) -> Self {
        Self {
            enabled: enabled.into(),
            r#type: r#type.into(),
            metadata: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetSensorOverrideEnabledMethod {
    #[serde(rename = "Emulation.setSensorOverrideEnabled")]
    SetSensorOverrideEnabled,
}
#[doc = "Overrides a platform sensor of a given type. If |enabled| is true, calls to\nSensor.start() will use a virtual sensor as backend rather than fetching\ndata from a real hardware sensor. Otherwise, existing virtual\nsensor-backend Sensor objects will fire an error event and new calls to\nSensor.start() will attempt to use a real sensor instead.\n[setSensorOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSensorOverrideEnabled {
    pub method: SetSensorOverrideEnabledMethod,
    pub params: SetSensorOverrideEnabledParams,
}
impl SetSensorOverrideEnabled {
    pub const IDENTIFIER: &'static str = "Emulation.setSensorOverrideEnabled";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetSensorOverrideEnabled {
    type Result = super::results::SetSensorOverrideEnabledResult;
}
#[doc = "Updates the sensor readings reported by a sensor type previously overridden\nby setSensorOverrideEnabled.\n[setSensorOverrideReadings](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideReadings)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSensorOverrideReadingsParams {
    #[serde(rename = "type")]
    pub r#type: super::types::SensorType,
    #[serde(rename = "reading")]
    pub reading: super::types::SensorReading,
}
impl SetSensorOverrideReadingsParams {
    pub fn new(
        r#type: impl Into<super::types::SensorType>,
        reading: impl Into<super::types::SensorReading>,
    ) -> Self {
        Self {
            r#type: r#type.into(),
            reading: reading.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetSensorOverrideReadingsMethod {
    #[serde(rename = "Emulation.setSensorOverrideReadings")]
    SetSensorOverrideReadings,
}
#[doc = "Updates the sensor readings reported by a sensor type previously overridden\nby setSensorOverrideEnabled.\n[setSensorOverrideReadings](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSensorOverrideReadings)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSensorOverrideReadings {
    pub method: SetSensorOverrideReadingsMethod,
    pub params: SetSensorOverrideReadingsParams,
}
impl SetSensorOverrideReadings {
    pub const IDENTIFIER: &'static str = "Emulation.setSensorOverrideReadings";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetSensorOverrideReadings {
    type Result = super::results::SetSensorOverrideReadingsResult;
}
#[doc = "Overrides a pressure source of a given type, as used by the Compute\nPressure API, so that updates to PressureObserver.observe() are provided\nvia setPressureStateOverride instead of being retrieved from\nplatform-provided telemetry data.\n[setPressureSourceOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureSourceOverrideEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPressureSourceOverrideEnabledParams {
    #[serde(rename = "enabled")]
    pub enabled: bool,
    #[serde(rename = "source")]
    pub source: super::types::PressureSource,
    #[serde(rename = "metadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub metadata: Option<super::types::PressureMetadata>,
}
impl SetPressureSourceOverrideEnabledParams {
    pub fn new(enabled: impl Into<bool>, source: impl Into<super::types::PressureSource>) -> Self {
        Self {
            enabled: enabled.into(),
            source: source.into(),
            metadata: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetPressureSourceOverrideEnabledMethod {
    #[serde(rename = "Emulation.setPressureSourceOverrideEnabled")]
    SetPressureSourceOverrideEnabled,
}
#[doc = "Overrides a pressure source of a given type, as used by the Compute\nPressure API, so that updates to PressureObserver.observe() are provided\nvia setPressureStateOverride instead of being retrieved from\nplatform-provided telemetry data.\n[setPressureSourceOverrideEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureSourceOverrideEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPressureSourceOverrideEnabled {
    pub method: SetPressureSourceOverrideEnabledMethod,
    pub params: SetPressureSourceOverrideEnabledParams,
}
impl SetPressureSourceOverrideEnabled {
    pub const IDENTIFIER: &'static str = "Emulation.setPressureSourceOverrideEnabled";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetPressureSourceOverrideEnabled {
    type Result = super::results::SetPressureSourceOverrideEnabledResult;
}
#[doc = "TODO: OBSOLETE: To remove when setPressureDataOverride is merged.\nProvides a given pressure state that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureStateOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureStateOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPressureStateOverrideParams {
    #[serde(rename = "source")]
    pub source: super::types::PressureSource,
    #[serde(rename = "state")]
    pub state: super::types::PressureState,
}
impl SetPressureStateOverrideParams {
    pub fn new(
        source: impl Into<super::types::PressureSource>,
        state: impl Into<super::types::PressureState>,
    ) -> Self {
        Self {
            source: source.into(),
            state: state.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetPressureStateOverrideMethod {
    #[serde(rename = "Emulation.setPressureStateOverride")]
    SetPressureStateOverride,
}
#[doc = "TODO: OBSOLETE: To remove when setPressureDataOverride is merged.\nProvides a given pressure state that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureStateOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureStateOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPressureStateOverride {
    pub method: SetPressureStateOverrideMethod,
    pub params: SetPressureStateOverrideParams,
}
impl SetPressureStateOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setPressureStateOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetPressureStateOverride {
    type Result = super::results::SetPressureStateOverrideResult;
}
#[doc = "Provides a given pressure data set that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureDataOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureDataOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPressureDataOverrideParams {
    #[serde(rename = "source")]
    pub source: super::types::PressureSource,
    #[serde(rename = "state")]
    pub state: super::types::PressureState,
    #[serde(rename = "ownContributionEstimate")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub own_contribution_estimate: Option<f64>,
}
impl SetPressureDataOverrideParams {
    pub fn new(
        source: impl Into<super::types::PressureSource>,
        state: impl Into<super::types::PressureState>,
    ) -> Self {
        Self {
            source: source.into(),
            state: state.into(),
            own_contribution_estimate: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetPressureDataOverrideMethod {
    #[serde(rename = "Emulation.setPressureDataOverride")]
    SetPressureDataOverride,
}
#[doc = "Provides a given pressure data set that will be processed and eventually be\ndelivered to PressureObserver users. |source| must have been previously\noverridden by setPressureSourceOverrideEnabled.\n[setPressureDataOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPressureDataOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPressureDataOverride {
    pub method: SetPressureDataOverrideMethod,
    pub params: SetPressureDataOverrideParams,
}
impl SetPressureDataOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setPressureDataOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetPressureDataOverride {
    type Result = super::results::SetPressureDataOverrideResult;
}
#[doc = "Overrides the Idle state.\n[setIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setIdleOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetIdleOverrideParams {
    #[doc = "Mock isUserActive"]
    #[serde(rename = "isUserActive")]
    pub is_user_active: bool,
    #[doc = "Mock isScreenUnlocked"]
    #[serde(rename = "isScreenUnlocked")]
    pub is_screen_unlocked: bool,
}
impl SetIdleOverrideParams {
    pub fn new(is_user_active: impl Into<bool>, is_screen_unlocked: impl Into<bool>) -> Self {
        Self {
            is_user_active: is_user_active.into(),
            is_screen_unlocked: is_screen_unlocked.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetIdleOverrideMethod {
    #[serde(rename = "Emulation.setIdleOverride")]
    SetIdleOverride,
}
#[doc = "Overrides the Idle state.\n[setIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setIdleOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetIdleOverride {
    pub method: SetIdleOverrideMethod,
    pub params: SetIdleOverrideParams,
}
impl SetIdleOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setIdleOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetIdleOverride {
    type Result = super::results::SetIdleOverrideResult;
}
#[doc = "Clears Idle state overrides.\n[clearIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearIdleOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearIdleOverrideParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearIdleOverrideMethod {
    #[serde(rename = "Emulation.clearIdleOverride")]
    ClearIdleOverride,
}
#[doc = "Clears Idle state overrides.\n[clearIdleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-clearIdleOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearIdleOverride {
    pub method: ClearIdleOverrideMethod,
    pub params: ClearIdleOverrideParams,
}
impl ClearIdleOverride {
    pub const IDENTIFIER: &'static str = "Emulation.clearIdleOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearIdleOverride {
    type Result = super::results::ClearIdleOverrideResult;
}
#[doc = "Sets a specified page scale factor.\n[setPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPageScaleFactor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPageScaleFactorParams {
    #[doc = "Page scale factor."]
    #[serde(rename = "pageScaleFactor")]
    pub page_scale_factor: f64,
}
impl SetPageScaleFactorParams {
    pub fn new(page_scale_factor: impl Into<f64>) -> Self {
        Self {
            page_scale_factor: page_scale_factor.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetPageScaleFactorMethod {
    #[serde(rename = "Emulation.setPageScaleFactor")]
    SetPageScaleFactor,
}
#[doc = "Sets a specified page scale factor.\n[setPageScaleFactor](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setPageScaleFactor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPageScaleFactor {
    pub method: SetPageScaleFactorMethod,
    pub params: SetPageScaleFactorParams,
}
impl SetPageScaleFactor {
    pub const IDENTIFIER: &'static str = "Emulation.setPageScaleFactor";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetPageScaleFactor {
    type Result = super::results::SetPageScaleFactorResult;
}
#[doc = "Switches script execution in the page.\n[setScriptExecutionDisabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScriptExecutionDisabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetScriptExecutionDisabledParams {
    #[doc = "Whether script execution should be disabled in the page."]
    #[serde(rename = "value")]
    pub value: bool,
}
impl SetScriptExecutionDisabledParams {
    pub fn new(value: impl Into<bool>) -> Self {
        Self {
            value: value.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetScriptExecutionDisabledMethod {
    #[serde(rename = "Emulation.setScriptExecutionDisabled")]
    SetScriptExecutionDisabled,
}
#[doc = "Switches script execution in the page.\n[setScriptExecutionDisabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setScriptExecutionDisabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetScriptExecutionDisabled {
    pub method: SetScriptExecutionDisabledMethod,
    pub params: SetScriptExecutionDisabledParams,
}
impl SetScriptExecutionDisabled {
    pub const IDENTIFIER: &'static str = "Emulation.setScriptExecutionDisabled";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetScriptExecutionDisabled {
    type Result = super::results::SetScriptExecutionDisabledResult;
}
#[doc = "Enables touch on platforms which do not support them.\n[setTouchEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTouchEmulationEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetTouchEmulationEnabledParams {
    #[doc = "Whether the touch event emulation should be enabled."]
    #[serde(rename = "enabled")]
    pub enabled: bool,
    #[doc = "Maximum touch points supported. Defaults to one."]
    #[serde(rename = "maxTouchPoints")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub max_touch_points: Option<i64>,
}
impl SetTouchEmulationEnabledParams {
    pub fn new(enabled: impl Into<bool>) -> Self {
        Self {
            enabled: enabled.into(),
            max_touch_points: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetTouchEmulationEnabledMethod {
    #[serde(rename = "Emulation.setTouchEmulationEnabled")]
    SetTouchEmulationEnabled,
}
#[doc = "Enables touch on platforms which do not support them.\n[setTouchEmulationEnabled](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTouchEmulationEnabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetTouchEmulationEnabled {
    pub method: SetTouchEmulationEnabledMethod,
    pub params: SetTouchEmulationEnabledParams,
}
impl SetTouchEmulationEnabled {
    pub const IDENTIFIER: &'static str = "Emulation.setTouchEmulationEnabled";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetTouchEmulationEnabled {
    type Result = super::results::SetTouchEmulationEnabledResult;
}
#[doc = "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\nthe current virtual time policy.  Note this supersedes any previous time budget.\n[setVirtualTimePolicy](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVirtualTimePolicy)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetVirtualTimePolicyParams {
    #[serde(rename = "policy")]
    pub policy: super::types::VirtualTimePolicy,
    #[doc = "If set, after this many virtual milliseconds have elapsed virtual time will be paused and a\nvirtualTimeBudgetExpired event is sent."]
    #[serde(rename = "budget")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub budget: Option<f64>,
    #[doc = "If set this specifies the maximum number of tasks that can be run before virtual is forced\nforwards to prevent deadlock."]
    #[serde(rename = "maxVirtualTimeTaskStarvationCount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub max_virtual_time_task_starvation_count: Option<i64>,
    #[doc = "If set, base::Time::Now will be overridden to initially return this value."]
    #[serde(rename = "initialVirtualTime")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub initial_virtual_time: Option<crate::browser_protocol::network::types::TimeSinceEpoch>,
}
impl SetVirtualTimePolicyParams {
    pub fn new(policy: impl Into<super::types::VirtualTimePolicy>) -> Self {
        Self {
            policy: policy.into(),
            budget: None,
            max_virtual_time_task_starvation_count: None,
            initial_virtual_time: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetVirtualTimePolicyMethod {
    #[serde(rename = "Emulation.setVirtualTimePolicy")]
    SetVirtualTimePolicy,
}
#[doc = "Turns on virtual time for all frames (replacing real-time with a synthetic time source) and sets\nthe current virtual time policy.  Note this supersedes any previous time budget.\n[setVirtualTimePolicy](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setVirtualTimePolicy)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetVirtualTimePolicy {
    pub method: SetVirtualTimePolicyMethod,
    pub params: SetVirtualTimePolicyParams,
}
impl SetVirtualTimePolicy {
    pub const IDENTIFIER: &'static str = "Emulation.setVirtualTimePolicy";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetVirtualTimePolicy {
    type Result = super::results::SetVirtualTimePolicyResult;
}
#[doc = "Overrides default host system locale with the specified one.\n[setLocaleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setLocaleOverride)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetLocaleOverrideParams {
    #[doc = "ICU style C locale (e.g. \"en_US\"). If not specified or empty, disables the override and\nrestores default host system locale."]
    #[serde(rename = "locale")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub locale: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetLocaleOverrideMethod {
    #[serde(rename = "Emulation.setLocaleOverride")]
    SetLocaleOverride,
}
#[doc = "Overrides default host system locale with the specified one.\n[setLocaleOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setLocaleOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetLocaleOverride {
    pub method: SetLocaleOverrideMethod,
    pub params: SetLocaleOverrideParams,
}
impl SetLocaleOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setLocaleOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetLocaleOverride {
    type Result = super::results::SetLocaleOverrideResult;
}
#[doc = "Overrides default host system timezone with the specified one.\n[setTimezoneOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTimezoneOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetTimezoneOverrideParams {
    #[doc = "The timezone identifier. List of supported timezones:\nhttps://source.chromium.org/chromium/chromium/deps/icu.git/+/faee8bc70570192d82d2978a71e2a615788597d1:source/data/misc/metaZones.txt\nIf empty, disables the override and restores default host system timezone."]
    #[serde(rename = "timezoneId")]
    pub timezone_id: String,
}
impl SetTimezoneOverrideParams {
    pub fn new(timezone_id: impl Into<String>) -> Self {
        Self {
            timezone_id: timezone_id.into(),
        }
    }
}
impl<T: Into<String>> From<T> for SetTimezoneOverrideParams {
    fn from(url: T) -> Self {
        SetTimezoneOverrideParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetTimezoneOverrideMethod {
    #[serde(rename = "Emulation.setTimezoneOverride")]
    SetTimezoneOverride,
}
#[doc = "Overrides default host system timezone with the specified one.\n[setTimezoneOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setTimezoneOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetTimezoneOverride {
    pub method: SetTimezoneOverrideMethod,
    pub params: SetTimezoneOverrideParams,
}
impl SetTimezoneOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setTimezoneOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetTimezoneOverride {
    type Result = super::results::SetTimezoneOverrideResult;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDisabledImageTypesParams {
    #[doc = "Image types to disable."]
    #[serde(rename = "imageTypes")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub image_types: Vec<super::types::DisabledImageType>,
}
impl SetDisabledImageTypesParams {
    pub fn new(image_types: Vec<super::types::DisabledImageType>) -> Self {
        Self { image_types }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDisabledImageTypesMethod {
    #[serde(rename = "Emulation.setDisabledImageTypes")]
    SetDisabledImageTypes,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDisabledImageTypes {
    pub method: SetDisabledImageTypesMethod,
    pub params: SetDisabledImageTypesParams,
}
impl SetDisabledImageTypes {
    pub const IDENTIFIER: &'static str = "Emulation.setDisabledImageTypes";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDisabledImageTypes {
    type Result = super::results::SetDisabledImageTypesResult;
}
#[doc = "Override the value of navigator.connection.saveData\n[setDataSaverOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDataSaverOverride)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetDataSaverOverrideParams {
    #[doc = "Override value. Omitting the parameter disables the override."]
    #[serde(rename = "dataSaverEnabled")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub data_saver_enabled: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDataSaverOverrideMethod {
    #[serde(rename = "Emulation.setDataSaverOverride")]
    SetDataSaverOverride,
}
#[doc = "Override the value of navigator.connection.saveData\n[setDataSaverOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setDataSaverOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDataSaverOverride {
    pub method: SetDataSaverOverrideMethod,
    pub params: SetDataSaverOverrideParams,
}
impl SetDataSaverOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setDataSaverOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDataSaverOverride {
    type Result = super::results::SetDataSaverOverrideResult;
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetHardwareConcurrencyOverrideParams {
    #[doc = "Hardware concurrency to report"]
    #[serde(rename = "hardwareConcurrency")]
    pub hardware_concurrency: i64,
}
impl SetHardwareConcurrencyOverrideParams {
    pub fn new(hardware_concurrency: impl Into<i64>) -> Self {
        Self {
            hardware_concurrency: hardware_concurrency.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetHardwareConcurrencyOverrideMethod {
    #[serde(rename = "Emulation.setHardwareConcurrencyOverride")]
    SetHardwareConcurrencyOverride,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetHardwareConcurrencyOverride {
    pub method: SetHardwareConcurrencyOverrideMethod,
    pub params: SetHardwareConcurrencyOverrideParams,
}
impl SetHardwareConcurrencyOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setHardwareConcurrencyOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetHardwareConcurrencyOverride {
    type Result = super::results::SetHardwareConcurrencyOverrideResult;
}
#[doc = "Allows overriding user agent with the given string.\n`userAgentMetadata` must be set for Client Hint headers to be sent.\n[setUserAgentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setUserAgentOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetUserAgentOverrideParams {
    #[doc = "User agent to use."]
    #[serde(rename = "userAgent")]
    pub user_agent: String,
    #[doc = "Browser language to emulate."]
    #[serde(rename = "acceptLanguage")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub accept_language: Option<String>,
    #[doc = "The platform navigator.platform should return."]
    #[serde(rename = "platform")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub platform: Option<String>,
    #[doc = "To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData"]
    #[serde(rename = "userAgentMetadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub user_agent_metadata: Option<super::types::UserAgentMetadata>,
}
impl SetUserAgentOverrideParams {
    pub fn new(user_agent: impl Into<String>) -> Self {
        Self {
            user_agent: user_agent.into(),
            accept_language: None,
            platform: None,
            user_agent_metadata: None,
        }
    }
}
impl<T: Into<String>> From<T> for SetUserAgentOverrideParams {
    fn from(url: T) -> Self {
        SetUserAgentOverrideParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetUserAgentOverrideMethod {
    #[serde(rename = "Emulation.setUserAgentOverride")]
    SetUserAgentOverride,
}
#[doc = "Allows overriding user agent with the given string.\n`userAgentMetadata` must be set for Client Hint headers to be sent.\n[setUserAgentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setUserAgentOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetUserAgentOverride {
    pub method: SetUserAgentOverrideMethod,
    pub params: SetUserAgentOverrideParams,
}
impl SetUserAgentOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setUserAgentOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetUserAgentOverride {
    type Result = super::results::SetUserAgentOverrideResult;
}
#[doc = "Allows overriding the automation flag.\n[setAutomationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutomationOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetAutomationOverrideParams {
    #[doc = "Whether the override should be enabled."]
    #[serde(rename = "enabled")]
    pub enabled: bool,
}
impl SetAutomationOverrideParams {
    pub fn new(enabled: impl Into<bool>) -> Self {
        Self {
            enabled: enabled.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetAutomationOverrideMethod {
    #[serde(rename = "Emulation.setAutomationOverride")]
    SetAutomationOverride,
}
#[doc = "Allows overriding the automation flag.\n[setAutomationOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setAutomationOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetAutomationOverride {
    pub method: SetAutomationOverrideMethod,
    pub params: SetAutomationOverrideParams,
}
impl SetAutomationOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setAutomationOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetAutomationOverride {
    type Result = super::results::SetAutomationOverrideResult;
}
#[doc = "Allows overriding the difference between the small and large viewport sizes, which determine the\nvalue of the `svh` and `lvh` unit, respectively. Only supported for top-level frames.\n[setSmallViewportHeightDifferenceOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSmallViewportHeightDifferenceOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSmallViewportHeightDifferenceOverrideParams {
    #[doc = "This will cause an element of size 100svh to be `difference` pixels smaller than an element\nof size 100lvh."]
    #[serde(rename = "difference")]
    pub difference: i64,
}
impl SetSmallViewportHeightDifferenceOverrideParams {
    pub fn new(difference: impl Into<i64>) -> Self {
        Self {
            difference: difference.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetSmallViewportHeightDifferenceOverrideMethod {
    #[serde(rename = "Emulation.setSmallViewportHeightDifferenceOverride")]
    SetSmallViewportHeightDifferenceOverride,
}
#[doc = "Allows overriding the difference between the small and large viewport sizes, which determine the\nvalue of the `svh` and `lvh` unit, respectively. Only supported for top-level frames.\n[setSmallViewportHeightDifferenceOverride](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-setSmallViewportHeightDifferenceOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSmallViewportHeightDifferenceOverride {
    pub method: SetSmallViewportHeightDifferenceOverrideMethod,
    pub params: SetSmallViewportHeightDifferenceOverrideParams,
}
impl SetSmallViewportHeightDifferenceOverride {
    pub const IDENTIFIER: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetSmallViewportHeightDifferenceOverride {
    type Result = super::results::SetSmallViewportHeightDifferenceOverrideResult;
}
#[doc = "Returns device's screen configuration. In headful mode, the physical screens configuration is returned,\nwhereas in headless mode, a virtual headless screen configuration is provided instead.\n[getScreenInfos](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-getScreenInfos)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetScreenInfosParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetScreenInfosMethod {
    #[serde(rename = "Emulation.getScreenInfos")]
    GetScreenInfos,
}
#[doc = "Returns device's screen configuration. In headful mode, the physical screens configuration is returned,\nwhereas in headless mode, a virtual headless screen configuration is provided instead.\n[getScreenInfos](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-getScreenInfos)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetScreenInfos {
    pub method: GetScreenInfosMethod,
    pub params: GetScreenInfosParams,
}
impl GetScreenInfos {
    pub const IDENTIFIER: &'static str = "Emulation.getScreenInfos";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetScreenInfos {
    type Result = super::results::GetScreenInfosResult;
}
#[doc = "Add a new screen to the device. Only supported in headless mode.\n[addScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-addScreen)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddScreenParams {
    #[doc = "Offset of the left edge of the screen in pixels."]
    #[serde(rename = "left")]
    pub left: i64,
    #[doc = "Offset of the top edge of the screen in pixels."]
    #[serde(rename = "top")]
    pub top: i64,
    #[doc = "The width of the screen in pixels."]
    #[serde(rename = "width")]
    pub width: i64,
    #[doc = "The height of the screen in pixels."]
    #[serde(rename = "height")]
    pub height: i64,
    #[doc = "Specifies the screen's work area. Default is entire screen."]
    #[serde(rename = "workAreaInsets")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub work_area_insets: Option<super::types::WorkAreaInsets>,
    #[doc = "Specifies the screen's device pixel ratio. Default is 1."]
    #[serde(rename = "devicePixelRatio")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub device_pixel_ratio: Option<f64>,
    #[doc = "Specifies the screen's rotation angle. Available values are 0, 90, 180 and 270. Default is 0."]
    #[serde(rename = "rotation")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub rotation: Option<i64>,
    #[doc = "Specifies the screen's color depth in bits. Default is 24."]
    #[serde(rename = "colorDepth")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub color_depth: Option<i64>,
    #[doc = "Specifies the descriptive label for the screen. Default is none."]
    #[serde(rename = "label")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub label: Option<String>,
    #[doc = "Indicates whether the screen is internal to the device or external, attached to the device. Default is false."]
    #[serde(rename = "isInternal")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub is_internal: Option<bool>,
}
impl AddScreenParams {
    pub fn new(
        left: impl Into<i64>,
        top: impl Into<i64>,
        width: impl Into<i64>,
        height: impl Into<i64>,
    ) -> Self {
        Self {
            left: left.into(),
            top: top.into(),
            width: width.into(),
            height: height.into(),
            work_area_insets: None,
            device_pixel_ratio: None,
            rotation: None,
            color_depth: None,
            label: None,
            is_internal: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AddScreenMethod {
    #[serde(rename = "Emulation.addScreen")]
    AddScreen,
}
#[doc = "Add a new screen to the device. Only supported in headless mode.\n[addScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-addScreen)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddScreen {
    pub method: AddScreenMethod,
    pub params: AddScreenParams,
}
impl AddScreen {
    pub const IDENTIFIER: &'static str = "Emulation.addScreen";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for AddScreen {
    type Result = super::results::AddScreenResult;
}
#[doc = "Remove screen from the device. Only supported in headless mode.\n[removeScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-removeScreen)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveScreenParams {
    #[serde(rename = "screenId")]
    pub screen_id: super::types::ScreenId,
}
impl RemoveScreenParams {
    pub fn new(screen_id: impl Into<super::types::ScreenId>) -> Self {
        Self {
            screen_id: screen_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum RemoveScreenMethod {
    #[serde(rename = "Emulation.removeScreen")]
    RemoveScreen,
}
#[doc = "Remove screen from the device. Only supported in headless mode.\n[removeScreen](https://chromedevtools.github.io/devtools-protocol/tot/Emulation/#method-removeScreen)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveScreen {
    pub method: RemoveScreenMethod,
    pub params: RemoveScreenParams,
}
impl RemoveScreen {
    pub const IDENTIFIER: &'static str = "Emulation.removeScreen";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for RemoveScreen {
    type Result = super::results::RemoveScreenResult;
}
group_enum ! (EmulationCommands { ClearDeviceMetricsOverride (ClearDeviceMetricsOverride) , ClearGeolocationOverride (ClearGeolocationOverride) , ResetPageScaleFactor (ResetPageScaleFactor) , SetFocusEmulationEnabled (SetFocusEmulationEnabled) , SetAutoDarkModeOverride (SetAutoDarkModeOverride) , SetCpuThrottlingRate (SetCpuThrottlingRate) , SetDefaultBackgroundColorOverride (SetDefaultBackgroundColorOverride) , SetSafeAreaInsetsOverride (SetSafeAreaInsetsOverride) , SetDeviceMetricsOverride (SetDeviceMetricsOverride) , SetDevicePostureOverride (SetDevicePostureOverride) , ClearDevicePostureOverride (ClearDevicePostureOverride) , SetDisplayFeaturesOverride (SetDisplayFeaturesOverride) , ClearDisplayFeaturesOverride (ClearDisplayFeaturesOverride) , SetScrollbarsHidden (SetScrollbarsHidden) , SetDocumentCookieDisabled (SetDocumentCookieDisabled) , SetEmitTouchEventsForMouse (SetEmitTouchEventsForMouse) , SetEmulatedMedia (SetEmulatedMedia) , SetEmulatedVisionDeficiency (SetEmulatedVisionDeficiency) , SetEmulatedOsTextScale (SetEmulatedOsTextScale) , SetGeolocationOverride (SetGeolocationOverride) , GetOverriddenSensorInformation (GetOverriddenSensorInformation) , SetSensorOverrideEnabled (SetSensorOverrideEnabled) , SetSensorOverrideReadings (SetSensorOverrideReadings) , SetPressureSourceOverrideEnabled (SetPressureSourceOverrideEnabled) , SetPressureStateOverride (SetPressureStateOverride) , SetPressureDataOverride (SetPressureDataOverride) , SetIdleOverride (SetIdleOverride) , ClearIdleOverride (ClearIdleOverride) , SetPageScaleFactor (SetPageScaleFactor) , SetScriptExecutionDisabled (SetScriptExecutionDisabled) , SetTouchEmulationEnabled (SetTouchEmulationEnabled) , SetVirtualTimePolicy (SetVirtualTimePolicy) , SetLocaleOverride (SetLocaleOverride) , SetTimezoneOverride (SetTimezoneOverride) , SetDisabledImageTypes (SetDisabledImageTypes) , SetDataSaverOverride (SetDataSaverOverride) , SetHardwareConcurrencyOverride (SetHardwareConcurrencyOverride) , SetUserAgentOverride (SetUserAgentOverride) , SetAutomationOverride (SetAutomationOverride) , SetSmallViewportHeightDifferenceOverride (SetSmallViewportHeightDifferenceOverride) , GetScreenInfos (GetScreenInfos) , AddScreen (AddScreen) , RemoveScreen (RemoveScreen) } + identifiable);