cdp-driver 0.5.0

Chrome DevTools Protocol (CDP) client for Rust: every command, event and type generated from the schema, with sessions, for browser automation and AI agents
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
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.

//! This domain provides various functionality related to drawing atop the
//! inspected page.
//!
//! Types, command parameters and event payloads for the `Overlay`
//! domain. The method-name constants for the same domain are in
//! [`crate::methods`].
//!
//! This domain is experimental and may change without notice.

use serde::{Deserialize, Serialize};

/// Configuration data for drawing the source order of an elements children.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SourceOrderConfig {
    /// the color to outline the given element in.
    #[serde(rename = "parentOutlineColor")]
    pub parent_outline_color: crate::protocol::dom::Rgba,
    /// the color to outline the child elements in.
    #[serde(rename = "childOutlineColor")]
    pub child_outline_color: crate::protocol::dom::Rgba,
}

/// Configuration data for the highlighting of Grid elements.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GridHighlightConfig {
    /// Whether the extension lines from grid cells to the rulers should be shown
    /// (default: false).
    #[serde(
        rename = "showGridExtensionLines",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_grid_extension_lines: Option<bool>,
    /// Show Positive line number labels (default: false).
    #[serde(
        rename = "showPositiveLineNumbers",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_positive_line_numbers: Option<bool>,
    /// Show Negative line number labels (default: false).
    #[serde(
        rename = "showNegativeLineNumbers",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_negative_line_numbers: Option<bool>,
    /// Show area name labels (default: false).
    #[serde(
        rename = "showAreaNames",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_area_names: Option<bool>,
    /// Show line name labels (default: false).
    #[serde(
        rename = "showLineNames",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_line_names: Option<bool>,
    /// Show track size labels (default: false).
    #[serde(
        rename = "showTrackSizes",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_track_sizes: Option<bool>,
    /// The grid container border highlight color (default: transparent).
    #[serde(
        rename = "gridBorderColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub grid_border_color: Option<crate::protocol::dom::Rgba>,
    /// The cell border color (default: transparent). Deprecated, please use
    /// rowLineColor and columnLineColor instead.
    ///
    /// Deprecated in the protocol.
    #[serde(
        rename = "cellBorderColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub cell_border_color: Option<crate::protocol::dom::Rgba>,
    /// The row line color (default: transparent).
    #[serde(
        rename = "rowLineColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub row_line_color: Option<crate::protocol::dom::Rgba>,
    /// The column line color (default: transparent).
    #[serde(
        rename = "columnLineColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub column_line_color: Option<crate::protocol::dom::Rgba>,
    /// Whether the grid border is dashed (default: false).
    #[serde(
        rename = "gridBorderDash",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub grid_border_dash: Option<bool>,
    /// Whether the cell border is dashed (default: false). Deprecated, please us
    /// rowLineDash and columnLineDash instead.
    ///
    /// Deprecated in the protocol.
    #[serde(
        rename = "cellBorderDash",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub cell_border_dash: Option<bool>,
    /// Whether row lines are dashed (default: false).
    #[serde(
        rename = "rowLineDash",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub row_line_dash: Option<bool>,
    /// Whether column lines are dashed (default: false).
    #[serde(
        rename = "columnLineDash",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub column_line_dash: Option<bool>,
    /// The row gap highlight fill color (default: transparent).
    #[serde(
        rename = "rowGapColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub row_gap_color: Option<crate::protocol::dom::Rgba>,
    /// The row gap hatching fill color (default: transparent).
    #[serde(
        rename = "rowHatchColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub row_hatch_color: Option<crate::protocol::dom::Rgba>,
    /// The column gap highlight fill color (default: transparent).
    #[serde(
        rename = "columnGapColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub column_gap_color: Option<crate::protocol::dom::Rgba>,
    /// The column gap hatching fill color (default: transparent).
    #[serde(
        rename = "columnHatchColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub column_hatch_color: Option<crate::protocol::dom::Rgba>,
    /// The named grid areas border color (Default: transparent).
    #[serde(
        rename = "areaBorderColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub area_border_color: Option<crate::protocol::dom::Rgba>,
    /// The grid container background color (Default: transparent).
    #[serde(
        rename = "gridBackgroundColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub grid_background_color: Option<crate::protocol::dom::Rgba>,
}

/// Configuration data for the highlighting of Flex container elements.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct FlexContainerHighlightConfig {
    /// The style of the container border
    #[serde(
        rename = "containerBorder",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub container_border: Option<LineStyle>,
    /// The style of the separator between lines
    #[serde(
        rename = "lineSeparator",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub line_separator: Option<LineStyle>,
    /// The style of the separator between items
    #[serde(
        rename = "itemSeparator",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub item_separator: Option<LineStyle>,
    /// Style of content-distribution space on the main axis (justify-content).
    #[serde(
        rename = "mainDistributedSpace",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub main_distributed_space: Option<BoxStyle>,
    /// Style of content-distribution space on the cross axis (align-content).
    #[serde(
        rename = "crossDistributedSpace",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub cross_distributed_space: Option<BoxStyle>,
    /// Style of empty space caused by row gaps (gap/row-gap).
    #[serde(
        rename = "rowGapSpace",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub row_gap_space: Option<BoxStyle>,
    /// Style of empty space caused by columns gaps (gap/column-gap).
    #[serde(
        rename = "columnGapSpace",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub column_gap_space: Option<BoxStyle>,
    /// Style of the self-alignment line (align-items).
    #[serde(
        rename = "crossAlignment",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub cross_alignment: Option<LineStyle>,
}

/// Configuration data for the highlighting of Flex item elements.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct FlexItemHighlightConfig {
    /// Style of the box representing the item's base size
    #[serde(
        rename = "baseSizeBox",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub base_size_box: Option<BoxStyle>,
    /// Style of the border around the box representing the item's base size
    #[serde(
        rename = "baseSizeBorder",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub base_size_border: Option<LineStyle>,
    /// Style of the arrow representing if the item grew or shrank
    #[serde(
        rename = "flexibilityArrow",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub flexibility_arrow: Option<LineStyle>,
}

/// Style information for drawing a line.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct LineStyle {
    /// The color of the line (default: transparent)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub color: Option<crate::protocol::dom::Rgba>,
    /// The line pattern (default: solid)
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub pattern: Option<LineStylePattern>,
}

/// The values `pattern` accepts on `LineStyle`.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum LineStylePattern {
    /// `dashed`
    #[serde(rename = "dashed")]
    Dashed,
    /// `dotted`
    #[serde(rename = "dotted")]
    Dotted,
    /// A value this vendored schema does not list. Chrome adds values ahead of
    /// the published protocol, so an unrecognised one is kept as it arrived
    /// rather than failing the payload it came in.
    #[serde(untagged)]
    Unrecognized(String),
}

/// Style information for drawing a box.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct BoxStyle {
    /// The background color for the box (default: transparent)
    #[serde(rename = "fillColor", default, skip_serializing_if = "Option::is_none")]
    pub fill_color: Option<crate::protocol::dom::Rgba>,
    /// The hatching color for the box (default: transparent)
    #[serde(
        rename = "hatchColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub hatch_color: Option<crate::protocol::dom::Rgba>,
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ContrastAlgorithm {
    /// `aa`
    #[serde(rename = "aa")]
    Aa,
    /// `aaa`
    #[serde(rename = "aaa")]
    Aaa,
    /// `apca`
    #[serde(rename = "apca")]
    Apca,
    /// A value this vendored schema does not list. Chrome adds values ahead of
    /// the published protocol, so an unrecognised one is kept as it arrived
    /// rather than failing the payload it came in.
    #[serde(untagged)]
    Unrecognized(String),
}

/// Configuration for Inset-Modified Containing Block (IMCB) and CSS Anchor
/// Positioning highlight.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ImcbHighlightConfig {
    /// Border color for the Inset-Modified Containing Block (default:
    /// transparent).
    #[serde(
        rename = "imcbBorderColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub imcb_border_color: Option<crate::protocol::dom::Rgba>,
    /// Background fill color for the Inset-Modified Containing Block (default:
    /// transparent).
    #[serde(
        rename = "imcbBackgroundColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub imcb_background_color: Option<crate::protocol::dom::Rgba>,
    /// Fill color for the inset modifiers area (difference between CB and IMCB).
    #[serde(
        rename = "insetsBackgroundColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub insets_background_color: Option<crate::protocol::dom::Rgba>,
    /// Hatch color for the inset modifiers area.
    #[serde(
        rename = "insetsHatchColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub insets_hatch_color: Option<crate::protocol::dom::Rgba>,
    /// Border color for the referenced target anchor element(s) (when element is
    /// anchor-positioned).
    #[serde(
        rename = "anchorBorderColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub anchor_border_color: Option<crate::protocol::dom::Rgba>,
    /// Background fill color for the referenced target anchor element(s) (when
    /// element is anchor-positioned).
    #[serde(
        rename = "anchorBackgroundColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub anchor_background_color: Option<crate::protocol::dom::Rgba>,
    /// Whether to render the 3x3 position-area grid lines when position-area is
    /// used.
    #[serde(
        rename = "showPositionAreaGrid",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_position_area_grid: Option<bool>,
    /// Line color for the 3x3 position-area grid lines.
    #[serde(
        rename = "positionAreaGridLineColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub position_area_grid_line_color: Option<crate::protocol::dom::Rgba>,
    /// Fill color for the active region within the position-area grid.
    #[serde(
        rename = "positionAreaActiveRegionColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub position_area_active_region_color: Option<crate::protocol::dom::Rgba>,
}

/// Configuration data for the highlighting of page elements.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HighlightConfig {
    /// Whether the node info tooltip should be shown (default: false).
    #[serde(rename = "showInfo", default, skip_serializing_if = "Option::is_none")]
    pub show_info: Option<bool>,
    /// Whether the node styles in the tooltip (default: false).
    #[serde(
        rename = "showStyles",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_styles: Option<bool>,
    /// Whether the rulers should be shown (default: false).
    #[serde(
        rename = "showRulers",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_rulers: Option<bool>,
    /// Whether the a11y info should be shown (default: true).
    #[serde(
        rename = "showAccessibilityInfo",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_accessibility_info: Option<bool>,
    /// Whether the extension lines from node to the rulers should be shown
    /// (default: false).
    #[serde(
        rename = "showExtensionLines",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_extension_lines: Option<bool>,
    /// The content box highlight fill color (default: transparent).
    #[serde(
        rename = "contentColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub content_color: Option<crate::protocol::dom::Rgba>,
    /// The padding highlight fill color (default: transparent).
    #[serde(
        rename = "paddingColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub padding_color: Option<crate::protocol::dom::Rgba>,
    /// The border highlight fill color (default: transparent).
    #[serde(
        rename = "borderColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub border_color: Option<crate::protocol::dom::Rgba>,
    /// The margin highlight fill color (default: transparent).
    #[serde(
        rename = "marginColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub margin_color: Option<crate::protocol::dom::Rgba>,
    /// The event target element highlight fill color (default: transparent).
    #[serde(
        rename = "eventTargetColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub event_target_color: Option<crate::protocol::dom::Rgba>,
    /// The shape outside fill color (default: transparent).
    #[serde(
        rename = "shapeColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub shape_color: Option<crate::protocol::dom::Rgba>,
    /// The shape margin fill color (default: transparent).
    #[serde(
        rename = "shapeMarginColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub shape_margin_color: Option<crate::protocol::dom::Rgba>,
    /// The grid layout color (default: transparent).
    #[serde(
        rename = "cssGridColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub css_grid_color: Option<crate::protocol::dom::Rgba>,
    /// The color format used to format color styles (default: hex).
    #[serde(
        rename = "colorFormat",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub color_format: Option<ColorFormat>,
    /// The grid layout highlight configuration (default: all transparent).
    #[serde(
        rename = "gridHighlightConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub grid_highlight_config: Option<GridHighlightConfig>,
    /// The flex container highlight configuration (default: all transparent).
    #[serde(
        rename = "flexContainerHighlightConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub flex_container_highlight_config: Option<FlexContainerHighlightConfig>,
    /// The flex item highlight configuration (default: all transparent).
    #[serde(
        rename = "flexItemHighlightConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub flex_item_highlight_config: Option<FlexItemHighlightConfig>,
    /// The contrast algorithm to use for the contrast ratio (default: aa).
    #[serde(
        rename = "contrastAlgorithm",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub contrast_algorithm: Option<ContrastAlgorithm>,
    /// The container query container highlight configuration (default: all
    /// transparent).
    #[serde(
        rename = "containerQueryContainerHighlightConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub container_query_container_highlight_config: Option<ContainerQueryContainerHighlightConfig>,
    /// The IMCB highlight configuration (default: all transparent).
    #[serde(
        rename = "imcbHighlightConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub imcb_highlight_config: Option<ImcbHighlightConfig>,
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ColorFormat {
    /// `rgb`
    #[serde(rename = "rgb")]
    Rgb,
    /// `hsl`
    #[serde(rename = "hsl")]
    Hsl,
    /// `hwb`
    #[serde(rename = "hwb")]
    Hwb,
    /// `hex`
    #[serde(rename = "hex")]
    Hex,
    /// A value this vendored schema does not list. Chrome adds values ahead of
    /// the published protocol, so an unrecognised one is kept as it arrived
    /// rather than failing the payload it came in.
    #[serde(untagged)]
    Unrecognized(String),
}

/// Configurations for Persistent Grid Highlight
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GridNodeHighlightConfig {
    /// A descriptor for the highlight appearance.
    #[serde(rename = "gridHighlightConfig")]
    pub grid_highlight_config: GridHighlightConfig,
    /// Identifier of the node to highlight.
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct FlexNodeHighlightConfig {
    /// A descriptor for the highlight appearance of flex containers.
    #[serde(rename = "flexContainerHighlightConfig")]
    pub flex_container_highlight_config: FlexContainerHighlightConfig,
    /// Identifier of the node to highlight.
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ScrollSnapContainerHighlightConfig {
    /// The style of the snapport border (default: transparent)
    #[serde(
        rename = "snapportBorder",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub snapport_border: Option<LineStyle>,
    /// The style of the snap area border (default: transparent)
    #[serde(
        rename = "snapAreaBorder",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub snap_area_border: Option<LineStyle>,
    /// The margin highlight fill color (default: transparent).
    #[serde(
        rename = "scrollMarginColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub scroll_margin_color: Option<crate::protocol::dom::Rgba>,
    /// The padding highlight fill color (default: transparent).
    #[serde(
        rename = "scrollPaddingColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub scroll_padding_color: Option<crate::protocol::dom::Rgba>,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ScrollSnapHighlightConfig {
    /// A descriptor for the highlight appearance of scroll snap containers.
    #[serde(rename = "scrollSnapContainerHighlightConfig")]
    pub scroll_snap_container_highlight_config: ScrollSnapContainerHighlightConfig,
    /// Identifier of the node to highlight.
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
}

/// Configuration for dual screen hinge
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HingeConfig {
    /// A rectangle represent hinge
    pub rect: crate::protocol::dom::Rect,
    /// The content box highlight fill color (default: a dark color).
    #[serde(
        rename = "contentColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub content_color: Option<crate::protocol::dom::Rgba>,
    /// The content box highlight outline color (default: transparent).
    #[serde(
        rename = "outlineColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub outline_color: Option<crate::protocol::dom::Rgba>,
}

/// Supported display cutout shapes.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DisplayCutoutShape {
    /// `pill`
    #[serde(rename = "pill")]
    Pill,
    /// `notch`
    #[serde(rename = "notch")]
    Notch,
    /// `circle`
    #[serde(rename = "circle")]
    Circle,
    /// `rectangle`
    #[serde(rename = "rectangle")]
    Rectangle,
    /// A value this vendored schema does not list. Chrome adds values ahead of
    /// the published protocol, so an unrecognised one is kept as it arrived
    /// rather than failing the payload it came in.
    #[serde(untagged)]
    Unrecognized(String),
}

/// Configuration for a display cutout.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DisplayCutoutConfig {
    /// A rectangle representing the cutout bounds.
    pub rect: crate::protocol::dom::Rect,
    /// Shape used to draw the cutout.
    pub shape: DisplayCutoutShape,
    /// Border radius for rounded cutout shapes.
    #[serde(
        rename = "borderRadius",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub border_radius: Option<i64>,
    /// Upper shoulder radius for notch cutout shapes.
    #[serde(
        rename = "upperRadius",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub upper_radius: Option<i64>,
    /// Lower transition radius for notch cutout shapes.
    #[serde(
        rename = "lowerRadius",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub lower_radius: Option<i64>,
    /// Center x coordinate for circle cutout shapes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cx: Option<i64>,
    /// Center y coordinate for circle cutout shapes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub cy: Option<i64>,
    /// Radius for circle cutout shapes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub radius: Option<i64>,
    /// The cutout fill color (default: black).
    #[serde(
        rename = "contentColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub content_color: Option<crate::protocol::dom::Rgba>,
}

/// Configuration for Window Controls Overlay
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct WindowControlsOverlayConfig {
    /// Whether the title bar CSS should be shown when emulating the Window
    /// Controls Overlay.
    #[serde(rename = "showCSS")]
    pub show_css: bool,
    /// Selected platforms to show the overlay.
    #[serde(rename = "selectedPlatform")]
    pub selected_platform: String,
    /// The theme color defined in app manifest.
    #[serde(rename = "themeColor")]
    pub theme_color: String,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerQueryHighlightConfig {
    /// A descriptor for the highlight appearance of container query containers.
    #[serde(rename = "containerQueryContainerHighlightConfig")]
    pub container_query_container_highlight_config: ContainerQueryContainerHighlightConfig,
    /// Identifier of the container node to highlight.
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ContainerQueryContainerHighlightConfig {
    /// The style of the container border.
    #[serde(
        rename = "containerBorder",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub container_border: Option<LineStyle>,
    /// The style of the descendants' borders.
    #[serde(
        rename = "descendantBorder",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub descendant_border: Option<LineStyle>,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct IsolatedElementHighlightConfig {
    /// A descriptor for the highlight appearance of an element in isolation mode.
    #[serde(rename = "isolationModeHighlightConfig")]
    pub isolation_mode_highlight_config: IsolationModeHighlightConfig,
    /// Identifier of the isolated element to highlight.
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct IsolationModeHighlightConfig {
    /// The fill color of the resizers (default: transparent).
    #[serde(
        rename = "resizerColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub resizer_color: Option<crate::protocol::dom::Rgba>,
    /// The fill color for resizer handles (default: transparent).
    #[serde(
        rename = "resizerHandleColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub resizer_handle_color: Option<crate::protocol::dom::Rgba>,
    /// The fill color for the mask covering non-isolated elements (default:
    /// transparent).
    #[serde(rename = "maskColor", default, skip_serializing_if = "Option::is_none")]
    pub mask_color: Option<crate::protocol::dom::Rgba>,
}

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum InspectMode {
    /// `searchForNode`
    #[serde(rename = "searchForNode")]
    SearchForNode,
    /// `searchForUAShadowDOM`
    #[serde(rename = "searchForUAShadowDOM")]
    SearchForUaShadowDom,
    /// `captureAreaScreenshot`
    #[serde(rename = "captureAreaScreenshot")]
    CaptureAreaScreenshot,
    /// `none`
    #[serde(rename = "none")]
    None,
    /// A value this vendored schema does not list. Chrome adds values ahead of
    /// the published protocol, so an unrecognised one is kept as it arrived
    /// rather than failing the payload it came in.
    #[serde(untagged)]
    Unrecognized(String),
}

#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct InspectedElementAnchorConfig {
    /// Identifier of the node to highlight.
    #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")]
    pub node_id: Option<crate::protocol::dom::NodeId>,
    /// Identifier of the backend node to highlight.
    #[serde(
        rename = "backendNodeId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
}

/// Disables domain notifications.
///
/// Parameters of `Overlay.disable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}

impl crate::typed::Command for DisableParams {
    const METHOD: &'static str = "Overlay.disable";
    type Returns = crate::typed::NoReturns;
}

/// Enables domain notifications.
///
/// Parameters of `Overlay.enable`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {}

impl crate::typed::Command for EnableParams {
    const METHOD: &'static str = "Overlay.enable";
    type Returns = crate::typed::NoReturns;
}

/// For testing.
///
/// Parameters of `Overlay.getHighlightObjectForTest`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetHighlightObjectForTestParams {
    /// Id of the node to get highlight object for.
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
    /// Whether to include distance info.
    #[serde(
        rename = "includeDistance",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub include_distance: Option<bool>,
    /// Whether to include style info.
    #[serde(
        rename = "includeStyle",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub include_style: Option<bool>,
    /// The color format to get config with (default: hex).
    #[serde(
        rename = "colorFormat",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub color_format: Option<ColorFormat>,
    /// Whether to show accessibility info (default: true).
    #[serde(
        rename = "showAccessibilityInfo",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub show_accessibility_info: Option<bool>,
}

/// What `Overlay.getHighlightObjectForTest` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetHighlightObjectForTestReturns {
    /// Highlight data for the node.
    pub highlight: serde_json::Value,
}

impl crate::typed::Command for GetHighlightObjectForTestParams {
    const METHOD: &'static str = "Overlay.getHighlightObjectForTest";
    type Returns = GetHighlightObjectForTestReturns;
}

/// For Persistent Grid testing.
///
/// Parameters of `Overlay.getGridHighlightObjectsForTest`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetGridHighlightObjectsForTestParams {
    /// Ids of the node to get highlight object for.
    #[serde(rename = "nodeIds")]
    pub node_ids: Vec<crate::protocol::dom::NodeId>,
}

/// What `Overlay.getGridHighlightObjectsForTest` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetGridHighlightObjectsForTestReturns {
    /// Grid Highlight data for the node ids provided.
    pub highlights: serde_json::Value,
}

impl crate::typed::Command for GetGridHighlightObjectsForTestParams {
    const METHOD: &'static str = "Overlay.getGridHighlightObjectsForTest";
    type Returns = GetGridHighlightObjectsForTestReturns;
}

/// For Source Order Viewer testing.
///
/// Parameters of `Overlay.getSourceOrderHighlightObjectForTest`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetSourceOrderHighlightObjectForTestParams {
    /// Id of the node to highlight.
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
}

/// What `Overlay.getSourceOrderHighlightObjectForTest` answers with.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetSourceOrderHighlightObjectForTestReturns {
    /// Source order highlight data for the node id provided.
    pub highlight: serde_json::Value,
}

impl crate::typed::Command for GetSourceOrderHighlightObjectForTestParams {
    const METHOD: &'static str = "Overlay.getSourceOrderHighlightObjectForTest";
    type Returns = GetSourceOrderHighlightObjectForTestReturns;
}

/// Hides any highlight.
///
/// Parameters of `Overlay.hideHighlight`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HideHighlightParams {}

impl crate::typed::Command for HideHighlightParams {
    const METHOD: &'static str = "Overlay.hideHighlight";
    type Returns = crate::typed::NoReturns;
}

/// Highlights owner element of the frame with given id. Deprecated: Doesn't
/// work reliably and cannot be fixed due to process separation (the owner
/// node might be in a different process). Determine the owner node in the
/// client and use highlightNode.
///
/// Deprecated in the protocol.
///
/// Parameters of `Overlay.highlightFrame`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HighlightFrameParams {
    /// Identifier of the frame to highlight.
    #[serde(rename = "frameId")]
    pub frame_id: crate::protocol::page::FrameId,
    /// The content box highlight fill color (default: transparent).
    #[serde(
        rename = "contentColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub content_color: Option<crate::protocol::dom::Rgba>,
    /// The content box highlight outline color (default: transparent).
    #[serde(
        rename = "contentOutlineColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub content_outline_color: Option<crate::protocol::dom::Rgba>,
}

impl crate::typed::Command for HighlightFrameParams {
    const METHOD: &'static str = "Overlay.highlightFrame";
    type Returns = crate::typed::NoReturns;
}

/// Highlights DOM node with given id or with the given JavaScript object
/// wrapper. Either nodeId or objectId must be specified.
///
/// Parameters of `Overlay.highlightNode`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HighlightNodeParams {
    /// A descriptor for the highlight appearance.
    #[serde(rename = "highlightConfig")]
    pub highlight_config: HighlightConfig,
    /// Identifier of the node to highlight.
    #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")]
    pub node_id: Option<crate::protocol::dom::NodeId>,
    /// Identifier of the backend node to highlight.
    #[serde(
        rename = "backendNodeId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
    /// JavaScript object id of the node to be highlighted.
    #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
    pub object_id: Option<crate::protocol::runtime::RemoteObjectId>,
    /// Selectors to highlight relevant nodes.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub selector: Option<String>,
}

impl crate::typed::Command for HighlightNodeParams {
    const METHOD: &'static str = "Overlay.highlightNode";
    type Returns = crate::typed::NoReturns;
}

/// Highlights given quad. Coordinates are absolute with respect to the main
/// frame viewport.
///
/// Parameters of `Overlay.highlightQuad`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HighlightQuadParams {
    /// Quad to highlight
    pub quad: crate::protocol::dom::Quad,
    /// The highlight fill color (default: transparent).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub color: Option<crate::protocol::dom::Rgba>,
    /// The highlight outline color (default: transparent).
    #[serde(
        rename = "outlineColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub outline_color: Option<crate::protocol::dom::Rgba>,
}

impl crate::typed::Command for HighlightQuadParams {
    const METHOD: &'static str = "Overlay.highlightQuad";
    type Returns = crate::typed::NoReturns;
}

/// Highlights given rectangle. Coordinates are absolute with respect to the
/// main frame viewport. Issue: the method does not handle device pixel ratio
/// (DPR) correctly. The coordinates currently have to be adjusted by the
/// client if DPR is not 1 (see crbug.com/437807128).
///
/// Parameters of `Overlay.highlightRect`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HighlightRectParams {
    /// X coordinate
    pub x: i64,
    /// Y coordinate
    pub y: i64,
    /// Rectangle width
    pub width: i64,
    /// Rectangle height
    pub height: i64,
    /// The highlight fill color (default: transparent).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub color: Option<crate::protocol::dom::Rgba>,
    /// The highlight outline color (default: transparent).
    #[serde(
        rename = "outlineColor",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub outline_color: Option<crate::protocol::dom::Rgba>,
}

impl crate::typed::Command for HighlightRectParams {
    const METHOD: &'static str = "Overlay.highlightRect";
    type Returns = crate::typed::NoReturns;
}

/// Highlights the source order of the children of the DOM node with given id
/// or with the given JavaScript object wrapper. Either nodeId or objectId
/// must be specified.
///
/// Parameters of `Overlay.highlightSourceOrder`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HighlightSourceOrderParams {
    /// A descriptor for the appearance of the overlay drawing.
    #[serde(rename = "sourceOrderConfig")]
    pub source_order_config: SourceOrderConfig,
    /// Identifier of the node to highlight.
    #[serde(rename = "nodeId", default, skip_serializing_if = "Option::is_none")]
    pub node_id: Option<crate::protocol::dom::NodeId>,
    /// Identifier of the backend node to highlight.
    #[serde(
        rename = "backendNodeId",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub backend_node_id: Option<crate::protocol::dom::BackendNodeId>,
    /// JavaScript object id of the node to be highlighted.
    #[serde(rename = "objectId", default, skip_serializing_if = "Option::is_none")]
    pub object_id: Option<crate::protocol::runtime::RemoteObjectId>,
}

impl crate::typed::Command for HighlightSourceOrderParams {
    const METHOD: &'static str = "Overlay.highlightSourceOrder";
    type Returns = crate::typed::NoReturns;
}

/// Enters the 'inspect' mode. In this mode, elements that user is hovering
/// over are highlighted. Backend then generates 'inspectNodeRequested' event
/// upon element selection.
///
/// Parameters of `Overlay.setInspectMode`.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetInspectModeParams {
    /// Set an inspection mode.
    pub mode: InspectMode,
    /// A descriptor for the highlight appearance of hovered-over nodes. May be
    /// omitted if `enabled == false`.
    #[serde(
        rename = "highlightConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub highlight_config: Option<HighlightConfig>,
}

impl crate::typed::Command for SetInspectModeParams {
    const METHOD: &'static str = "Overlay.setInspectMode";
    type Returns = crate::typed::NoReturns;
}

/// Highlights owner element of all frames detected to be ads.
///
/// Parameters of `Overlay.setShowAdHighlights`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowAdHighlightsParams {
    /// True for showing ad highlights
    pub show: bool,
}

impl crate::typed::Command for SetShowAdHighlightsParams {
    const METHOD: &'static str = "Overlay.setShowAdHighlights";
    type Returns = crate::typed::NoReturns;
}

/// Parameters of `Overlay.setPausedInDebuggerMessage`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetPausedInDebuggerMessageParams {
    /// The message to display, also triggers resume and step over controls.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub message: Option<String>,
}

impl crate::typed::Command for SetPausedInDebuggerMessageParams {
    const METHOD: &'static str = "Overlay.setPausedInDebuggerMessage";
    type Returns = crate::typed::NoReturns;
}

/// Requests that backend shows debug borders on layers
///
/// Parameters of `Overlay.setShowDebugBorders`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowDebugBordersParams {
    /// True for showing debug borders
    pub show: bool,
}

impl crate::typed::Command for SetShowDebugBordersParams {
    const METHOD: &'static str = "Overlay.setShowDebugBorders";
    type Returns = crate::typed::NoReturns;
}

/// Requests that backend shows the FPS counter
///
/// Parameters of `Overlay.setShowFPSCounter`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowFpsCounterParams {
    /// True for showing the FPS counter
    pub show: bool,
}

impl crate::typed::Command for SetShowFpsCounterParams {
    const METHOD: &'static str = "Overlay.setShowFPSCounter";
    type Returns = crate::typed::NoReturns;
}

/// Highlight multiple elements with the CSS Grid overlay.
///
/// Parameters of `Overlay.setShowGridOverlays`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowGridOverlaysParams {
    /// An array of node identifiers and descriptors for the highlight appearance.
    #[serde(rename = "gridNodeHighlightConfigs")]
    pub grid_node_highlight_configs: Vec<GridNodeHighlightConfig>,
}

impl crate::typed::Command for SetShowGridOverlaysParams {
    const METHOD: &'static str = "Overlay.setShowGridOverlays";
    type Returns = crate::typed::NoReturns;
}

/// Parameters of `Overlay.setShowFlexOverlays`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowFlexOverlaysParams {
    /// An array of node identifiers and descriptors for the highlight appearance.
    #[serde(rename = "flexNodeHighlightConfigs")]
    pub flex_node_highlight_configs: Vec<FlexNodeHighlightConfig>,
}

impl crate::typed::Command for SetShowFlexOverlaysParams {
    const METHOD: &'static str = "Overlay.setShowFlexOverlays";
    type Returns = crate::typed::NoReturns;
}

/// Parameters of `Overlay.setShowScrollSnapOverlays`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowScrollSnapOverlaysParams {
    /// An array of node identifiers and descriptors for the highlight appearance.
    #[serde(rename = "scrollSnapHighlightConfigs")]
    pub scroll_snap_highlight_configs: Vec<ScrollSnapHighlightConfig>,
}

impl crate::typed::Command for SetShowScrollSnapOverlaysParams {
    const METHOD: &'static str = "Overlay.setShowScrollSnapOverlays";
    type Returns = crate::typed::NoReturns;
}

/// Parameters of `Overlay.setShowContainerQueryOverlays`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowContainerQueryOverlaysParams {
    /// An array of node identifiers and descriptors for the highlight appearance.
    #[serde(rename = "containerQueryHighlightConfigs")]
    pub container_query_highlight_configs: Vec<ContainerQueryHighlightConfig>,
}

impl crate::typed::Command for SetShowContainerQueryOverlaysParams {
    const METHOD: &'static str = "Overlay.setShowContainerQueryOverlays";
    type Returns = crate::typed::NoReturns;
}

/// Parameters of `Overlay.setShowInspectedElementAnchor`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowInspectedElementAnchorParams {
    /// Node identifier for which to show an anchor for.
    #[serde(rename = "inspectedElementAnchorConfig")]
    pub inspected_element_anchor_config: InspectedElementAnchorConfig,
}

impl crate::typed::Command for SetShowInspectedElementAnchorParams {
    const METHOD: &'static str = "Overlay.setShowInspectedElementAnchor";
    type Returns = crate::typed::NoReturns;
}

/// Requests that backend shows paint rectangles
///
/// Parameters of `Overlay.setShowPaintRects`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowPaintRectsParams {
    /// True for showing paint rectangles
    pub result: bool,
}

impl crate::typed::Command for SetShowPaintRectsParams {
    const METHOD: &'static str = "Overlay.setShowPaintRects";
    type Returns = crate::typed::NoReturns;
}

/// Requests that backend shows layout shift regions
///
/// Parameters of `Overlay.setShowLayoutShiftRegions`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowLayoutShiftRegionsParams {
    /// True for showing layout shift regions
    pub result: bool,
}

impl crate::typed::Command for SetShowLayoutShiftRegionsParams {
    const METHOD: &'static str = "Overlay.setShowLayoutShiftRegions";
    type Returns = crate::typed::NoReturns;
}

/// Requests that backend shows scroll bottleneck rects
///
/// Parameters of `Overlay.setShowScrollBottleneckRects`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowScrollBottleneckRectsParams {
    /// True for showing scroll bottleneck rects
    pub show: bool,
}

impl crate::typed::Command for SetShowScrollBottleneckRectsParams {
    const METHOD: &'static str = "Overlay.setShowScrollBottleneckRects";
    type Returns = crate::typed::NoReturns;
}

/// Deprecated, no longer has any effect.
///
/// Deprecated in the protocol.
///
/// Parameters of `Overlay.setShowHitTestBorders`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowHitTestBordersParams {
    /// True for showing hit-test borders
    pub show: bool,
}

impl crate::typed::Command for SetShowHitTestBordersParams {
    const METHOD: &'static str = "Overlay.setShowHitTestBorders";
    type Returns = crate::typed::NoReturns;
}

/// Deprecated, no longer has any effect.
///
/// Deprecated in the protocol.
///
/// Parameters of `Overlay.setShowWebVitals`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowWebVitalsParams {
    pub show: bool,
}

impl crate::typed::Command for SetShowWebVitalsParams {
    const METHOD: &'static str = "Overlay.setShowWebVitals";
    type Returns = crate::typed::NoReturns;
}

/// Paints viewport size upon main frame resize.
///
/// Parameters of `Overlay.setShowViewportSizeOnResize`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowViewportSizeOnResizeParams {
    /// Whether to paint size or not.
    pub show: bool,
}

impl crate::typed::Command for SetShowViewportSizeOnResizeParams {
    const METHOD: &'static str = "Overlay.setShowViewportSizeOnResize";
    type Returns = crate::typed::NoReturns;
}

/// Add a dual screen device hinge
///
/// Parameters of `Overlay.setShowHinge`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowHingeParams {
    /// hinge data, null means hideHinge
    #[serde(
        rename = "hingeConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub hinge_config: Option<HingeConfig>,
}

impl crate::typed::Command for SetShowHingeParams {
    const METHOD: &'static str = "Overlay.setShowHinge";
    type Returns = crate::typed::NoReturns;
}

/// Add a display cutout overlay.
///
/// Parameters of `Overlay.setShowDisplayCutout`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowDisplayCutoutParams {
    /// display cutout data, null means hide display cutout
    #[serde(
        rename = "displayCutoutConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub display_cutout_config: Option<DisplayCutoutConfig>,
}

impl crate::typed::Command for SetShowDisplayCutoutParams {
    const METHOD: &'static str = "Overlay.setShowDisplayCutout";
    type Returns = crate::typed::NoReturns;
}

/// Show elements in isolation mode with overlays.
///
/// Parameters of `Overlay.setShowIsolatedElements`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowIsolatedElementsParams {
    /// An array of node identifiers and descriptors for the highlight appearance.
    #[serde(rename = "isolatedElementHighlightConfigs")]
    pub isolated_element_highlight_configs: Vec<IsolatedElementHighlightConfig>,
}

impl crate::typed::Command for SetShowIsolatedElementsParams {
    const METHOD: &'static str = "Overlay.setShowIsolatedElements";
    type Returns = crate::typed::NoReturns;
}

/// Show Window Controls Overlay for PWA
///
/// Parameters of `Overlay.setShowWindowControlsOverlay`.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetShowWindowControlsOverlayParams {
    /// Window Controls Overlay data, null means hide Window Controls Overlay
    #[serde(
        rename = "windowControlsOverlayConfig",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub window_controls_overlay_config: Option<WindowControlsOverlayConfig>,
}

impl crate::typed::Command for SetShowWindowControlsOverlayParams {
    const METHOD: &'static str = "Overlay.setShowWindowControlsOverlay";
    type Returns = crate::typed::NoReturns;
}

/// Fired when the node should be inspected. This happens after call to
/// `setInspectMode` or when user manually inspects an element.
///
/// Payload of the `Overlay.inspectNodeRequested` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct InspectNodeRequestedEvent {
    /// Id of the node to inspect.
    #[serde(rename = "backendNodeId")]
    pub backend_node_id: crate::protocol::dom::BackendNodeId,
}

impl crate::typed::Event for InspectNodeRequestedEvent {
    const METHOD: &'static str = "Overlay.inspectNodeRequested";
}

/// Fired when the node should be highlighted. This happens after call to
/// `setInspectMode`.
///
/// Payload of the `Overlay.nodeHighlightRequested` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NodeHighlightRequestedEvent {
    #[serde(rename = "nodeId")]
    pub node_id: crate::protocol::dom::NodeId,
}

impl crate::typed::Event for NodeHighlightRequestedEvent {
    const METHOD: &'static str = "Overlay.nodeHighlightRequested";
}

/// Fired when user asks to capture screenshot of some area on the page.
///
/// Payload of the `Overlay.screenshotRequested` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ScreenshotRequestedEvent {
    /// Viewport to capture, in device independent pixels (dip).
    pub viewport: crate::protocol::page::Viewport,
}

impl crate::typed::Event for ScreenshotRequestedEvent {
    const METHOD: &'static str = "Overlay.screenshotRequested";
}

/// Fired when user asks to show the Inspect panel.
///
/// Payload of the `Overlay.inspectPanelShowRequested` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct InspectPanelShowRequestedEvent {
    /// Id of the node to show in the panel.
    #[serde(rename = "backendNodeId")]
    pub backend_node_id: crate::protocol::dom::BackendNodeId,
}

impl crate::typed::Event for InspectPanelShowRequestedEvent {
    const METHOD: &'static str = "Overlay.inspectPanelShowRequested";
}

/// Fired when user asks to restore the Inspected Element floating window.
///
/// Payload of the `Overlay.inspectedElementWindowRestored` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct InspectedElementWindowRestoredEvent {
    /// Id of the node to restore the floating window for.
    #[serde(rename = "backendNodeId")]
    pub backend_node_id: crate::protocol::dom::BackendNodeId,
}

impl crate::typed::Event for InspectedElementWindowRestoredEvent {
    const METHOD: &'static str = "Overlay.inspectedElementWindowRestored";
}

/// Fired when user cancels the inspect mode.
///
/// Payload of the `Overlay.inspectModeCanceled` event.
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct InspectModeCanceledEvent {}

impl crate::typed::Event for InspectModeCanceledEvent {
    const METHOD: &'static str = "Overlay.inspectModeCanceled";
}