browser-protocol 0.1.1

Generated Rust types and commands for the Chrome DevTools Protocol (browser-protocol)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
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
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
//! Network domain allows tracking network activities of the page. It exposes information about http,
//! file, data and other requests and responses, their headers, bodies, timing, etc.

use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;

/// Resource type as it was perceived by the rendering engine.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ResourceType {
    #[default]
    Document,
    Stylesheet,
    Image,
    Media,
    Font,
    Script,
    TextTrack,
    XHR,
    Fetch,
    Prefetch,
    EventSource,
    WebSocket,
    Manifest,
    SignedExchange,
    Ping,
    CSPViolationReport,
    Preflight,
    FedCM,
    Other,
}

/// Unique loader identifier.

pub type LoaderId = String;

/// Unique network request identifier.
/// Note that this does not identify individual HTTP requests that are part of
/// a network request.

pub type RequestId = String;

/// Unique intercepted request identifier.

pub type InterceptionId = String;

/// Network level fetch failure reason.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ErrorReason {
    #[default]
    Failed,
    Aborted,
    TimedOut,
    AccessDenied,
    ConnectionClosed,
    ConnectionReset,
    ConnectionRefused,
    ConnectionAborted,
    ConnectionFailed,
    NameNotResolved,
    InternetDisconnected,
    AddressUnreachable,
    BlockedByClient,
    BlockedByResponse,
}

/// UTC time in seconds, counted from January 1, 1970.

pub type TimeSinceEpoch = f64;

/// Monotonically increasing time in seconds since an arbitrary point in the past.

pub type MonotonicTime = f64;

/// Request / response headers as keys / values of JSON object.

pub type Headers = serde_json::Map<String, JsonValue>;

/// The underlying connection technology that the browser is supposedly using.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ConnectionType {
    #[default]
    None,
    Cellular2g,
    Cellular3g,
    Cellular4g,
    Bluetooth,
    Ethernet,
    Wifi,
    Wimax,
    Other,
}

/// Represents the cookie's 'SameSite' status:
/// <https://tools.ietf.org/html/draft-west-first-party-cookies>

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CookieSameSite {
    #[default]
    Strict,
    Lax,
    None,
}

/// Represents the cookie's 'Priority' status:
/// <https://tools.ietf.org/html/draft-west-cookie-priority-00>

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CookiePriority {
    #[default]
    Low,
    Medium,
    High,
}

/// Represents the source scheme of the origin that originally set the cookie.
/// A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme.
/// This is a temporary ability and it will be removed in the future.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CookieSourceScheme {
    #[default]
    Unset,
    NonSecure,
    Secure,
}

/// Timing information for the request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ResourceTiming {
    /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in
    /// milliseconds relatively to this requestTime.

    pub requestTime: f64,
    /// Started resolving proxy.

    pub proxyStart: f64,
    /// Finished resolving proxy.

    pub proxyEnd: f64,
    /// Started DNS address resolve.

    pub dnsStart: f64,
    /// Finished DNS address resolve.

    pub dnsEnd: f64,
    /// Started connecting to the remote host.

    pub connectStart: f64,
    /// Connected to the remote host.

    pub connectEnd: f64,
    /// Started SSL handshake.

    pub sslStart: f64,
    /// Finished SSL handshake.

    pub sslEnd: f64,
    /// Started running ServiceWorker.

    pub workerStart: f64,
    /// Finished Starting ServiceWorker.

    pub workerReady: f64,
    /// Started fetch event.

    pub workerFetchStart: f64,
    /// Settled fetch event respondWith promise.

    pub workerRespondWithSettled: f64,
    /// Started ServiceWorker static routing source evaluation.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub workerRouterEvaluationStart: Option<f64>,
    /// Started cache lookup when the source was evaluated to 'cache'.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub workerCacheLookupStart: Option<f64>,
    /// Started sending request.

    pub sendStart: f64,
    /// Finished sending request.

    pub sendEnd: f64,
    /// Time the server started pushing request.

    pub pushStart: f64,
    /// Time the server finished pushing request.

    pub pushEnd: f64,
    /// Started receiving response headers.

    pub receiveHeadersStart: f64,
    /// Finished receiving response headers.

    pub receiveHeadersEnd: f64,
}

/// Loading priority of a resource request.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ResourcePriority {
    #[default]
    VeryLow,
    Low,
    Medium,
    High,
    VeryHigh,
}

/// The render-blocking behavior of a resource request.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum RenderBlockingBehavior {
    #[default]
    Blocking,
    InBodyParserBlocking,
    NonBlocking,
    NonBlockingDynamic,
    PotentiallyBlocking,
}

/// Post data entry for HTTP request

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

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

/// HTTP request data.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Request {
    /// Request URL (without fragment).

    pub url: String,
    /// Fragment of the requested URL starting with hash, if present.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub urlFragment: Option<String>,
    /// HTTP request method.

    pub method: String,
    /// HTTP request headers.

    pub headers: Headers,
    /// HTTP POST request data.
    /// Use postDataEntries instead.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub postData: Option<String>,
    /// True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub hasPostData: Option<bool>,
    /// Request body elements (post data broken into individual entries).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub postDataEntries: Option<Vec<PostDataEntry>>,
    /// The mixed content type of the request.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub mixedContentType: Option<crate::security::MixedContentType>,
    /// Priority of the resource request at the time request is sent.

    pub initialPriority: ResourcePriority,
    /// The referrer policy of the request, as defined in <https://www.w3.org/TR/referrer-policy/>

    pub referrerPolicy: String,
    /// Whether is loaded via link preload.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub isLinkPreload: Option<bool>,
    /// Set for requests when the TrustToken API is used. Contains the parameters
    /// passed by the developer (e.g. via "fetch") as understood by the backend.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub trustTokenParams: Option<TrustTokenParams>,
    /// True if this resource request is considered to be the 'same site' as the
    /// request corresponding to the main frame.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub isSameSite: Option<bool>,
    /// True when the resource request is ad-related.

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

/// Details of a signed certificate timestamp (SCT).

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SignedCertificateTimestamp {
    /// Validation status.

    pub status: String,
    /// Origin.

    pub origin: String,
    /// Log name / description.

    pub logDescription: String,
    /// Log ID.

    pub logId: String,
    /// Issuance date. Unlike TimeSinceEpoch, this contains the number of
    /// milliseconds since January 1, 1970, UTC, not the number of seconds.

    pub timestamp: f64,
    /// Hash algorithm.

    pub hashAlgorithm: String,
    /// Signature algorithm.

    pub signatureAlgorithm: String,
    /// Signature data.

    pub signatureData: String,
}

/// Security details about a request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SecurityDetails {
    /// Protocol name (e.g. "TLS 1.2" or "QUIC").

    pub protocol: String,
    /// Key Exchange used by the connection, or the empty string if not applicable.

    pub keyExchange: String,
    /// (EC)DH group used by the connection, if applicable.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub keyExchangeGroup: Option<String>,
    /// Cipher name.

    pub cipher: String,
    /// TLS MAC. Note that AEAD ciphers do not have separate MACs.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub mac: Option<String>,
    /// Certificate ID value.

    pub certificateId: crate::security::CertificateId,
    /// Certificate subject name.

    pub subjectName: String,
    /// Subject Alternative Name (SAN) DNS names and IP addresses.

    pub sanList: Vec<String>,
    /// Name of the issuing CA.

    pub issuer: String,
    /// Certificate valid from date.

    pub validFrom: TimeSinceEpoch,
    /// Certificate valid to (expiration) date

    pub validTo: TimeSinceEpoch,
    /// List of signed certificate timestamps (SCTs).

    pub signedCertificateTimestampList: Vec<SignedCertificateTimestamp>,
    /// Whether the request complied with Certificate Transparency policy

    pub certificateTransparencyCompliance: CertificateTransparencyCompliance,
    /// The signature algorithm used by the server in the TLS server signature,
    /// represented as a TLS SignatureScheme code point. Omitted if not
    /// applicable or not known.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub serverSignatureAlgorithm: Option<i64>,
    /// Whether the connection used Encrypted ClientHello

    pub encryptedClientHello: bool,
}

/// Whether the request complied with Certificate Transparency policy.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CertificateTransparencyCompliance {
    #[default]
    Unknown,
    NotCompliant,
    Compliant,
}

/// The reason why request was blocked.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum BlockedReason {
    #[default]
    Other,
    Csp,
    MixedContent,
    Origin,
    Inspector,
    Integrity,
    SubresourceFilter,
    ContentType,
    CoepFrameResourceNeedsCoepHeader,
    CoopSandboxedIframeCannotNavigateToCoopPage,
    CorpNotSameOrigin,
    CorpNotSameOriginAfterDefaultedToSameOriginByCoep,
    CorpNotSameOriginAfterDefaultedToSameOriginByDip,
    CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip,
    CorpNotSameSite,
    SriMessageSignatureMismatch,
}

/// The reason why request was blocked.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CorsError {
    #[default]
    DisallowedByMode,
    InvalidResponse,
    WildcardOriginNotAllowed,
    MissingAllowOriginHeader,
    MultipleAllowOriginValues,
    InvalidAllowOriginValue,
    AllowOriginMismatch,
    InvalidAllowCredentials,
    CorsDisabledScheme,
    PreflightInvalidStatus,
    PreflightDisallowedRedirect,
    PreflightWildcardOriginNotAllowed,
    PreflightMissingAllowOriginHeader,
    PreflightMultipleAllowOriginValues,
    PreflightInvalidAllowOriginValue,
    PreflightAllowOriginMismatch,
    PreflightInvalidAllowCredentials,
    PreflightMissingAllowExternal,
    PreflightInvalidAllowExternal,
    InvalidAllowMethodsPreflightResponse,
    InvalidAllowHeadersPreflightResponse,
    MethodDisallowedByPreflightResponse,
    HeaderDisallowedByPreflightResponse,
    RedirectContainsCredentials,
    InsecureLocalNetwork,
    InvalidLocalNetworkAccess,
    NoCorsRedirectModeNotFollow,
    LocalNetworkAccessPermissionDenied,
}


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

    pub corsError: CorsError,

    pub failedParameter: String,
}

/// Source of serviceworker response.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ServiceWorkerResponseSource {
    #[default]
    CacheStorage,
    HttpCache,
    FallbackCode,
    Network,
}

/// Determines what type of Trust Token operation is executed and
/// depending on the type, some additional parameters. The values
/// are specified in third_party/blink/renderer/core/fetch/trust_token.idl.

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

    pub operation: TrustTokenOperationType,
    /// Only set for "token-redemption" operation and determine whether
    /// to request a fresh SRR or use a still valid cached SRR.

    pub refreshPolicy: String,
    /// Origins of issuers from whom to request tokens or redemption
    /// records.

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


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum TrustTokenOperationType {
    #[default]
    Issuance,
    Redemption,
    Signing,
}

/// The reason why Chrome uses a specific transport protocol for HTTP semantics.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum AlternateProtocolUsage {
    #[default]
    AlternativeJobWonWithoutRace,
    AlternativeJobWonRace,
    MainJobWonRace,
    MappingMissing,
    Broken,
    DnsAlpnH3JobWonWithoutRace,
    DnsAlpnH3JobWonRace,
    UnspecifiedReason,
}

/// Source of service worker router.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ServiceWorkerRouterSource {
    #[default]
    Network,
    Cache,
    FetchEvent,
    RaceNetworkAndFetchHandler,
    RaceNetworkAndCache,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ServiceWorkerRouterInfo {
    /// ID of the rule matched. If there is a matched rule, this field will
    /// be set, otherwiser no value will be set.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub ruleIdMatched: Option<u64>,
    /// The router source of the matched rule. If there is a matched rule, this
    /// field will be set, otherwise no value will be set.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub matchedSourceType: Option<ServiceWorkerRouterSource>,
    /// The actual router source used.

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

/// HTTP response data.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Response {
    /// Response URL. This URL can be different from CachedResource.url in case of redirect.

    pub url: String,
    /// HTTP response status code.

    pub status: i64,
    /// HTTP response status text.

    pub statusText: String,
    /// HTTP response headers.

    pub headers: Headers,
    /// HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub headersText: Option<String>,
    /// Resource mimeType as determined by the browser.

    pub mimeType: String,
    /// Resource charset as determined by the browser (if applicable).

    pub charset: String,
    /// Refined HTTP request headers that were actually transmitted over the network.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub requestHeaders: Option<Headers>,
    /// HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub requestHeadersText: Option<String>,
    /// Specifies whether physical connection was actually reused for this request.

    pub connectionReused: bool,
    /// Physical connection id that was actually used for this request.

    pub connectionId: f64,
    /// Remote IP address.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub remoteIPAddress: Option<String>,
    /// Remote port.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub remotePort: Option<i64>,
    /// Specifies that the request was served from the disk cache.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub fromDiskCache: Option<bool>,
    /// Specifies that the request was served from the ServiceWorker.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub fromServiceWorker: Option<bool>,
    /// Specifies that the request was served from the prefetch cache.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub fromPrefetchCache: Option<bool>,
    /// Specifies that the request was served from the prefetch cache.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub fromEarlyHints: Option<bool>,
    /// Information about how ServiceWorker Static Router API was used. If this
    /// field is set with 'matchedSourceType' field, a matching rule is found.
    /// If this field is set without 'matchedSource', no matching rule is found.
    /// Otherwise, the API is not used.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub serviceWorkerRouterInfo: Option<ServiceWorkerRouterInfo>,
    /// Total number of bytes received for this request so far.

    pub encodedDataLength: f64,
    /// Timing information for the given request.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub timing: Option<ResourceTiming>,
    /// Response source of response from ServiceWorker.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub serviceWorkerResponseSource: Option<ServiceWorkerResponseSource>,
    /// The time at which the returned response was generated.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub responseTime: Option<TimeSinceEpoch>,
    /// Cache Storage Cache Name.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub cacheStorageCacheName: Option<String>,
    /// Protocol used to fetch this request.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub protocol: Option<String>,
    /// The reason why Chrome uses a specific transport protocol for HTTP semantics.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub alternateProtocolUsage: Option<AlternateProtocolUsage>,
    /// Security state of the request resource.

    pub securityState: crate::security::SecurityState,
    /// Security details for the request.

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

/// WebSocket request data.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct WebSocketRequest {
    /// HTTP request headers.

    pub headers: Headers,
}

/// WebSocket response data.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct WebSocketResponse {
    /// HTTP response status code.

    pub status: i64,
    /// HTTP response status text.

    pub statusText: String,
    /// HTTP response headers.

    pub headers: Headers,
    /// HTTP response headers text.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub headersText: Option<String>,
    /// HTTP request headers.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub requestHeaders: Option<Headers>,
    /// HTTP request headers text.

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

/// WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct WebSocketFrame {
    /// WebSocket message opcode.

    pub opcode: f64,
    /// WebSocket message mask.

    pub mask: bool,
    /// WebSocket message payload data.
    /// If the opcode is 1, this is a text message and payloadData is a UTF-8 string.
    /// If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data.

    pub payloadData: String,
}

/// Information about the cached resource.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CachedResource {
    /// Resource URL. This is the url of the original network request.

    pub url: String,
    /// Type of this resource.

    #[serde(rename = "type")]
    pub type_: ResourceType,
    /// Cached response data.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub response: Option<Response>,
    /// Cached response body size.

    pub bodySize: f64,
}

/// Information about the request initiator.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Initiator {
    /// Type of this initiator.

    #[serde(rename = "type")]
    pub type_: String,
    /// Initiator JavaScript stack trace, set for Script only.
    /// Requires the Debugger domain to be enabled.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub stack: Option<crate::runtime::StackTrace>,
    /// Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Initiator line number, set for Parser type or for Script type (when script is importing
    /// module) (0-based).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub lineNumber: Option<f64>,
    /// Initiator column number, set for Parser type or for Script type (when script is importing
    /// module) (0-based).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub columnNumber: Option<f64>,
    /// Set if another request triggered this request (e.g. preflight).

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

/// cookiePartitionKey object
/// The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CookiePartitionKey {
    /// The site of the top-level URL the browser was visiting at the start
    /// of the request to the endpoint that set the cookie.

    pub topLevelSite: String,
    /// Indicates if the cookie has any ancestors that are cross-site to the topLevelSite.

    pub hasCrossSiteAncestor: bool,
}

/// Cookie object

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

    pub name: String,
    /// Cookie value.

    pub value: String,
    /// Cookie domain.

    pub domain: String,
    /// Cookie path.

    pub path: String,
    /// Cookie expiration date as the number of seconds since the UNIX epoch.
    /// The value is set to -1 if the expiry date is not set.
    /// The value can be null for values that cannot be represented in
    /// JSON (±Inf).

    pub expires: f64,
    /// Cookie size.

    pub size: u64,
    /// True if cookie is http-only.

    pub httpOnly: bool,
    /// True if cookie is secure.

    pub secure: bool,
    /// True in case of session cookie.

    pub session: bool,
    /// Cookie SameSite type.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sameSite: Option<CookieSameSite>,
    /// Cookie Priority

    pub priority: CookiePriority,
    /// Cookie source scheme type.

    pub sourceScheme: CookieSourceScheme,
    /// Cookie source port. Valid values are {-1, \[1, 65535\]}, -1 indicates an unspecified port.
    /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.
    /// This is a temporary ability and it will be removed in the future.

    pub sourcePort: i64,
    /// Cookie partition key.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub partitionKey: Option<CookiePartitionKey>,
    /// True if cookie partition key is opaque.

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

/// Types of reasons why a cookie may not be stored from a response.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum SetCookieBlockedReason {
    #[default]
    SecureOnly,
    SameSiteStrict,
    SameSiteLax,
    SameSiteUnspecifiedTreatedAsLax,
    SameSiteNoneInsecure,
    UserPreferences,
    ThirdPartyPhaseout,
    ThirdPartyBlockedInFirstPartySet,
    SyntaxError,
    SchemeNotSupported,
    OverwriteSecure,
    InvalidDomain,
    InvalidPrefix,
    UnknownError,
    SchemefulSameSiteStrict,
    SchemefulSameSiteLax,
    SchemefulSameSiteUnspecifiedTreatedAsLax,
    NameValuePairExceedsMaxSize,
    DisallowedCharacter,
    NoCookieContent,
}

/// Types of reasons why a cookie may not be sent with a request.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CookieBlockedReason {
    #[default]
    SecureOnly,
    NotOnPath,
    DomainMismatch,
    SameSiteStrict,
    SameSiteLax,
    SameSiteUnspecifiedTreatedAsLax,
    SameSiteNoneInsecure,
    UserPreferences,
    ThirdPartyPhaseout,
    ThirdPartyBlockedInFirstPartySet,
    UnknownError,
    SchemefulSameSiteStrict,
    SchemefulSameSiteLax,
    SchemefulSameSiteUnspecifiedTreatedAsLax,
    NameValuePairExceedsMaxSize,
    PortMismatch,
    SchemeMismatch,
    AnonymousContext,
}

/// Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CookieExemptionReason {
    #[default]
    None,
    UserSetting,
    TPCDMetadata,
    TPCDDeprecationTrial,
    TopLevelTPCDDeprecationTrial,
    TPCDHeuristics,
    EnterprisePolicy,
    StorageAccess,
    TopLevelStorageAccess,
    Scheme,
    SameSiteNoneCookiesInSandbox,
}

/// A cookie which was not stored from a response with the corresponding reason.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct BlockedSetCookieWithReason {
    /// The reason(s) this cookie was blocked.

    pub blockedReasons: Vec<SetCookieBlockedReason>,
    /// The string representing this individual cookie as it would appear in the header.
    /// This is not the entire "cookie" or "set-cookie" header which could have multiple cookies.

    pub cookieLine: String,
    /// The cookie object which represents the cookie which was not stored. It is optional because
    /// sometimes complete cookie information is not available, such as in the case of parsing
    /// errors.

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

/// A cookie should have been blocked by 3PCD but is exempted and stored from a response with the
/// corresponding reason. A cookie could only have at most one exemption reason.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ExemptedSetCookieWithReason {
    /// The reason the cookie was exempted.

    pub exemptionReason: CookieExemptionReason,
    /// The string representing this individual cookie as it would appear in the header.

    pub cookieLine: String,
    /// The cookie object representing the cookie.

    pub cookie: Cookie,
}

/// A cookie associated with the request which may or may not be sent with it.
/// Includes the cookies itself and reasons for blocking or exemption.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AssociatedCookie {
    /// The cookie object representing the cookie which was not sent.

    pub cookie: Cookie,
    /// The reason(s) the cookie was blocked. If empty means the cookie is included.

    pub blockedReasons: Vec<CookieBlockedReason>,
    /// The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could
    /// only have at most one exemption reason.

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

/// Cookie parameter object

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CookieParam {
    /// Cookie name.

    pub name: String,
    /// Cookie value.

    pub value: String,
    /// The request-URI to associate with the setting of the cookie. This value can affect the
    /// default domain, path, source port, and source scheme values of the created cookie.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Cookie domain.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub domain: Option<String>,
    /// Cookie path.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// True if cookie is secure.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub secure: Option<bool>,
    /// True if cookie is http-only.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub httpOnly: Option<bool>,
    /// Cookie SameSite type.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sameSite: Option<CookieSameSite>,
    /// Cookie expiration date, session cookie if not set

    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires: Option<TimeSinceEpoch>,
    /// Cookie Priority.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub priority: Option<CookiePriority>,
    /// Cookie source scheme type.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sourceScheme: Option<CookieSourceScheme>,
    /// Cookie source port. Valid values are {-1, \[1, 65535\]}, -1 indicates an unspecified port.
    /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.
    /// This is a temporary ability and it will be removed in the future.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sourcePort: Option<i64>,
    /// Cookie partition key. If not set, the cookie will be set as not partitioned.

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

/// Authorization challenge for HTTP status code 401 or 407.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AuthChallenge {
    /// Source of the authentication challenge.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub source: Option<String>,
    /// Origin of the challenger.

    pub origin: String,
    /// The authentication scheme used, such as basic or digest

    pub scheme: String,
    /// The realm of the challenge. May be empty.

    pub realm: String,
}

/// Response to an AuthChallenge.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AuthChallengeResponse {
    /// The decision on what to do in response to the authorization challenge.  Default means
    /// deferring to the default behavior of the net stack, which will likely either the Cancel
    /// authentication or display a popup dialog box.

    pub response: String,
    /// The username to provide, possibly empty. Should only be set if response is
    /// ProvideCredentials.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
    /// The password to provide, possibly empty. Should only be set if response is
    /// ProvideCredentials.

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

/// Stages of the interception to begin intercepting. Request will intercept before the request is
/// sent. Response will intercept after the response is received.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum InterceptionStage {
    #[default]
    Request,
    HeadersReceived,
}

/// Request pattern for interception.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestPattern {
    /// Wildcards (''*'' -\> zero or more, ''?'' -\> exactly one) are allowed. Escape character is
    /// backslash. Omitting is equivalent to '"*"'.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub urlPattern: Option<String>,
    /// If set, only requests for matching resource types will be intercepted.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub resourceType: Option<ResourceType>,
    /// Stage at which to begin intercepting requests. Default is Request.

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

/// Information about a signed exchange signature.
/// <https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1>

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SignedExchangeSignature {
    /// Signed exchange signature label.

    pub label: String,
    /// The hex string of signed exchange signature.

    pub signature: String,
    /// Signed exchange signature integrity.

    pub integrity: String,
    /// Signed exchange signature cert Url.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub certUrl: Option<String>,
    /// The hex string of signed exchange signature cert sha256.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub certSha256: Option<String>,
    /// Signed exchange signature validity Url.

    pub validityUrl: String,
    /// Signed exchange signature date.

    pub date: i64,
    /// Signed exchange signature expires.

    pub expires: i64,
    /// The encoded certificates.

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

/// Information about a signed exchange header.
/// <https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation>

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SignedExchangeHeader {
    /// Signed exchange request URL.

    pub requestUrl: String,
    /// Signed exchange response code.

    pub responseCode: i64,
    /// Signed exchange response headers.

    pub responseHeaders: Headers,
    /// Signed exchange response signature.

    pub signatures: Vec<SignedExchangeSignature>,
    /// Signed exchange header integrity hash in the form of 'sha256-\<base64-hash-value\>'.

    pub headerIntegrity: String,
}

/// Field type for a signed exchange related error.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum SignedExchangeErrorField {
    #[default]
    SignatureSig,
    SignatureIntegrity,
    SignatureCertUrl,
    SignatureCertSha256,
    SignatureValidityUrl,
    SignatureTimestamps,
}

/// Information about a signed exchange response.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SignedExchangeError {
    /// Error message.

    pub message: String,
    /// The index of the signature which caused the error.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub signatureIndex: Option<u64>,
    /// The field which caused the error.

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

/// Information about a signed exchange response.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SignedExchangeInfo {
    /// The outer response of signed HTTP exchange which was received from network.

    pub outerResponse: Response,
    /// Whether network response for the signed exchange was accompanied by
    /// extra headers.

    pub hasExtraInfo: bool,
    /// Information about the signed exchange header.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub header: Option<SignedExchangeHeader>,
    /// Security details for the signed exchange header.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub securityDetails: Option<SecurityDetails>,
    /// Errors occurred while handling the signed exchange.

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

/// List of content encodings supported by the backend.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ContentEncoding {
    #[default]
    Deflate,
    Gzip,
    Br,
    Zstd,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct NetworkConditions {
    /// Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string
    /// syntax (<https://urlpattern.spec.whatwg.org/>) and must be absolute. If the pattern is empty, all requests are
    /// matched (including p2p connections).

    pub urlPattern: String,
    /// Minimum latency from request sent to response headers received (ms).

    pub latency: f64,
    /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.

    pub downloadThroughput: f64,
    /// Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling.

    pub uploadThroughput: f64,
    /// Connection type if known.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub connectionType: Option<ConnectionType>,
    /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub packetLoss: Option<f64>,
    /// WebRTC packet queue length (packet). 0 removes any queue length limitations.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub packetQueueLength: Option<u64>,
    /// WebRTC packetReordering feature.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub packetReordering: Option<bool>,
    /// True to emulate internet disconnection.

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


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct BlockPattern {
    /// URL pattern to match. Patterns use the URLPattern constructor string syntax
    /// (<https://urlpattern.spec.whatwg.org/>) and must be absolute. Example: '*://*:*/*.css'.

    pub urlPattern: String,
    /// Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later
    /// 'BlockPattern'.

    pub block: bool,
}


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum DirectSocketDnsQueryType {
    #[default]
    Ipv4,
    Ipv6,
}


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

    pub noDelay: bool,
    /// Expected to be unsigned integer.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub keepAliveDelay: Option<f64>,
    /// Expected to be unsigned integer.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sendBufferSize: Option<f64>,
    /// Expected to be unsigned integer.

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

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


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

    #[serde(skip_serializing_if = "Option::is_none")]
    pub remoteAddr: Option<String>,
    /// Unsigned int 16.

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

    #[serde(skip_serializing_if = "Option::is_none")]
    pub localAddr: Option<String>,
    /// Unsigned int 16.

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

    #[serde(skip_serializing_if = "Option::is_none")]
    pub dnsQueryType: Option<DirectSocketDnsQueryType>,
    /// Expected to be unsigned integer.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sendBufferSize: Option<f64>,
    /// Expected to be unsigned integer.

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

    #[serde(skip_serializing_if = "Option::is_none")]
    pub multicastLoopback: Option<bool>,
    /// Unsigned int 8.

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

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


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

    pub data: String,
    /// Null for connected mode.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub remoteAddr: Option<String>,
    /// Null for connected mode.
    /// Expected to be unsigned integer.

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


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum LocalNetworkAccessRequestPolicy {
    #[default]
    Allow,
    BlockFromInsecureToMorePrivate,
    WarnFromInsecureToMorePrivate,
    PermissionBlock,
    PermissionWarn,
}


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum IPAddressSpace {
    #[default]
    Loopback,
    Local,
    Public,
    Unknown,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ConnectTiming {
    /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in
    /// milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for
    /// the same request (but not for redirected requests).

    pub requestTime: f64,
}


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

    pub initiatorIsSecureContext: bool,

    pub initiatorIPAddressSpace: IPAddressSpace,

    pub localNetworkAccessRequestPolicy: LocalNetworkAccessRequestPolicy,
}

/// Identifies the script on the stack that caused a resource or element to be
/// labeled as an ad. For resources, this indicates the context that triggered
/// the fetch. For elements, this indicates the context that caused the element
/// to be appended to the DOM.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AdScriptIdentifier {
    /// The script's V8 identifier.

    pub scriptId: crate::runtime::ScriptId,
    /// V8's debugging ID for the v8::Context.

    pub debuggerId: crate::runtime::UniqueDebuggerId,
    /// The script's url (or generated name based on id if inline script).

    pub name: String,
}

/// Encapsulates the script ancestry and the root script filter list rule that
/// caused the resource or element to be labeled as an ad.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AdAncestry {
    /// A chain of 'AdScriptIdentifier's representing the ancestry of an ad
    /// script that led to the creation of a resource or element. The chain is
    /// ordered from the script itself (lowest level) up to its root ancestor
    /// that was flagged by a filter list.

    pub ancestryChain: Vec<AdScriptIdentifier>,
    /// The filter list rule that caused the root (last) script in
    /// 'ancestryChain' to be tagged as an ad.

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

/// Represents the provenance of an ad resource or element. Only one of
/// 'filterlistRule' or 'adScriptAncestry' can be set. If 'filterlistRule'
/// is provided, the resource URL directly matches a filter list rule. If
/// 'adScriptAncestry' is provided, an ad script initiated the resource fetch or
/// appended the element to the DOM. If neither is provided, the entity is
/// known to be an ad, but provenance tracking information is unavailable.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct AdProvenance {
    /// The filterlist rule that matched, if any.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub filterlistRule: Option<String>,
    /// The script ancestry that created the ad, if any.

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


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CrossOriginOpenerPolicyValue {
    #[default]
    SameOrigin,
    SameOriginAllowPopups,
    RestrictProperties,
    UnsafeNone,
    SameOriginPlusCoep,
    RestrictPropertiesPlusCoep,
    NoopenerAllowPopups,
}


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

    pub value: CrossOriginOpenerPolicyValue,

    pub reportOnlyValue: CrossOriginOpenerPolicyValue,

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

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


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum CrossOriginEmbedderPolicyValue {
    #[default]
    None,
    Credentialless,
    RequireCorp,
}


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

    pub value: CrossOriginEmbedderPolicyValue,

    pub reportOnlyValue: CrossOriginEmbedderPolicyValue,

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

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


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ContentSecurityPolicySource {
    #[default]
    HTTP,
    Meta,
}


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

    pub effectiveDirectives: String,

    pub isEnforced: bool,

    pub source: ContentSecurityPolicySource,
}


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

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

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

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

/// The status of a Reporting API report.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ReportStatus {
    #[default]
    Queued,
    Pending,
    MarkedForRemoval,
    Success,
}


pub type ReportId = String;

/// An object representing a report generated by the Reporting API.

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

    pub id: ReportId,
    /// The URL of the document that triggered the report.

    pub initiatorUrl: String,
    /// The name of the endpoint group that should be used to deliver the report.

    pub destination: String,
    /// The type of the report (specifies the set of data that is contained in the report body).

    #[serde(rename = "type")]
    pub type_: String,
    /// When the report was generated.

    pub timestamp: crate::network::TimeSinceEpoch,
    /// How many uploads deep the related request was.

    pub depth: i64,
    /// The number of delivery attempts made so far, not including an active attempt.

    pub completedAttempts: i64,

    pub body: serde_json::Map<String, JsonValue>,

    pub status: ReportStatus,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ReportingApiEndpoint {
    /// The URL of the endpoint to which reports may be delivered.

    pub url: String,
    /// Name of the endpoint group.

    pub groupName: String,
}

/// Unique identifier for a device bound session.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeviceBoundSessionKey {
    /// The site the session is set up for.

    pub site: String,
    /// The id of the session.

    pub id: String,
}

/// How a device bound session was used during a request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeviceBoundSessionWithUsage {
    /// The key for the session.

    pub sessionKey: DeviceBoundSessionKey,
    /// How the session was used (or not used).

    pub usage: String,
}

/// A device bound session's cookie craving.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeviceBoundSessionCookieCraving {
    /// The name of the craving.

    pub name: String,
    /// The domain of the craving.

    pub domain: String,
    /// The path of the craving.

    pub path: String,
    /// The 'Secure' attribute of the craving attributes.

    pub secure: bool,
    /// The 'HttpOnly' attribute of the craving attributes.

    pub httpOnly: bool,
    /// The 'SameSite' attribute of the craving attributes.

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

/// A device bound session's inclusion URL rule.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeviceBoundSessionUrlRule {
    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type'.

    pub ruleType: String,
    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern'.

    pub hostPattern: String,
    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix'.

    pub pathPrefix: String,
}

/// A device bound session's inclusion rules.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeviceBoundSessionInclusionRules {
    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::origin_'.

    pub origin: String,
    /// Whether the whole site is included. See comments on
    /// 'net::device_bound_sessions::SessionInclusionRules::include_site_' for more
    /// details; this boolean is true if that value is populated.

    pub includeSite: bool,
    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::url_rules_'.

    pub urlRules: Vec<DeviceBoundSessionUrlRule>,
}

/// A device bound session.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeviceBoundSession {
    /// The site and session ID of the session.

    pub key: DeviceBoundSessionKey,
    /// See comments on 'net::device_bound_sessions::Session::refresh_url_'.

    pub refreshUrl: String,
    /// See comments on 'net::device_bound_sessions::Session::inclusion_rules_'.

    pub inclusionRules: DeviceBoundSessionInclusionRules,
    /// See comments on 'net::device_bound_sessions::Session::cookie_cravings_'.

    pub cookieCravings: Vec<DeviceBoundSessionCookieCraving>,
    /// See comments on 'net::device_bound_sessions::Session::expiry_date_'.

    pub expiryDate: crate::network::TimeSinceEpoch,
    /// See comments on 'net::device_bound_sessions::Session::cached_challenge__'.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub cachedChallenge: Option<String>,
    /// See comments on 'net::device_bound_sessions::Session::allowed_refresh_initiators_'.

    pub allowedRefreshInitiators: Vec<String>,
}

/// A unique identifier for a device bound session event.

pub type DeviceBoundSessionEventId = String;

/// A fetch result for a device bound session creation or refresh.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum DeviceBoundSessionFetchResult {
    #[default]
    Success,
    KeyError,
    SigningError,
    ServerRequestedTermination,
    InvalidSessionId,
    InvalidChallenge,
    TooManyChallenges,
    InvalidFetcherUrl,
    InvalidRefreshUrl,
    TransientHttpError,
    ScopeOriginSameSiteMismatch,
    RefreshUrlSameSiteMismatch,
    MismatchedSessionId,
    MissingScope,
    NoCredentials,
    SubdomainRegistrationWellKnownUnavailable,
    SubdomainRegistrationUnauthorized,
    SubdomainRegistrationWellKnownMalformed,
    SessionProviderWellKnownUnavailable,
    RelyingPartyWellKnownUnavailable,
    FederatedKeyThumbprintMismatch,
    InvalidFederatedSessionUrl,
    InvalidFederatedKey,
    TooManyRelyingOriginLabels,
    BoundCookieSetForbidden,
    NetError,
    ProxyError,
    EmptySessionConfig,
    InvalidCredentialsConfig,
    InvalidCredentialsType,
    InvalidCredentialsEmptyName,
    InvalidCredentialsCookie,
    PersistentHttpError,
    RegistrationAttemptedChallenge,
    InvalidScopeOrigin,
    ScopeOriginContainsPath,
    RefreshInitiatorNotString,
    RefreshInitiatorInvalidHostPattern,
    InvalidScopeSpecification,
    MissingScopeSpecificationType,
    EmptyScopeSpecificationDomain,
    EmptyScopeSpecificationPath,
    InvalidScopeSpecificationType,
    InvalidScopeIncludeSite,
    MissingScopeIncludeSite,
    FederatedNotAuthorizedByProvider,
    FederatedNotAuthorizedByRelyingParty,
    SessionProviderWellKnownMalformed,
    SessionProviderWellKnownHasProviderOrigin,
    RelyingPartyWellKnownMalformed,
    RelyingPartyWellKnownHasRelyingOrigins,
    InvalidFederatedSessionProviderSessionMissing,
    InvalidFederatedSessionWrongProviderOrigin,
    InvalidCredentialsCookieCreationTime,
    InvalidCredentialsCookieName,
    InvalidCredentialsCookieParsing,
    InvalidCredentialsCookieUnpermittedAttribute,
    InvalidCredentialsCookieInvalidDomain,
    InvalidCredentialsCookiePrefix,
    InvalidScopeRulePath,
    InvalidScopeRuleHostPattern,
    ScopeRuleOriginScopedHostPatternMismatch,
    ScopeRuleSiteScopedHostPatternMismatch,
    SigningQuotaExceeded,
    InvalidConfigJson,
    InvalidFederatedSessionProviderFailedToRestoreKey,
    FailedToUnwrapKey,
    SessionDeletedDuringRefresh,
}

/// Details about a failed device bound session network request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeviceBoundSessionFailedRequest {
    /// The failed request URL.

    pub requestUrl: String,
    /// The net error of the response if it was not OK.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub netError: Option<String>,
    /// The response code if the net error was OK and the response code was not
    /// 200.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub responseError: Option<i64>,
    /// The body of the response if the net error was OK, the response code was
    /// not 200, and the response body was not empty.

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

/// Session event details specific to creation.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CreationEventDetails {
    /// The result of the fetch attempt.

    pub fetchResult: DeviceBoundSessionFetchResult,
    /// The session if there was a newly created session. This is populated for
    /// all successful creation events.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub newSession: Option<DeviceBoundSession>,
    /// Details about a failed device bound session network request if there was
    /// one.

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

/// Session event details specific to refresh.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RefreshEventDetails {
    /// The result of a refresh.

    pub refreshResult: String,
    /// If there was a fetch attempt, the result of that.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub fetchResult: Option<DeviceBoundSessionFetchResult>,
    /// The session display if there was a newly created session. This is populated
    /// for any refresh event that modifies the session config.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub newSession: Option<DeviceBoundSession>,
    /// See comments on 'net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh'.

    pub wasFullyProactiveRefresh: bool,
    /// Details about a failed device bound session network request if there was
    /// one.

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

/// Session event details specific to termination.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TerminationEventDetails {
    /// The reason for a session being deleted.

    pub deletionReason: String,
}

/// Session event details specific to challenges.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ChallengeEventDetails {
    /// The result of a challenge.

    pub challengeResult: String,
    /// The challenge set.

    pub challenge: String,
}

/// An object providing the result of a network resource load.

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

    pub success: bool,
    /// Optional values used for error reporting.

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

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

    #[serde(skip_serializing_if = "Option::is_none")]
    pub httpStatusCode: Option<f64>,
    /// If successful, one of the following two fields holds the result.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub stream: Option<crate::io::StreamHandle>,
    /// Response headers.

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

/// An options object that may be extended later to better support CORS,
/// CORB and streaming.

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

    pub disableCache: bool,

    pub includeCredentials: bool,
}

/// Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetAcceptedEncodingsParams {
    /// List of accepted content encodings.

    pub encodings: Vec<ContentEncoding>,
}

/// Tells whether clearing browser cache is supported.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CanClearBrowserCacheReturns {
    /// True if browser cache can be cleared.

    pub result: bool,
}

/// Tells whether clearing browser cookies is supported.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct CanClearBrowserCookiesReturns {
    /// True if browser cookies can be cleared.

    pub result: bool,
}

/// Tells whether emulation of network conditions is supported.

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

    pub result: bool,
}

/// Response to Network.requestIntercepted which either modifies the request to continue with any
/// modifications, or blocks it, or completes it with the provided response bytes. If a network
/// fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted
/// event will be sent with the same InterceptionId.
/// Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.

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

    pub interceptionId: InterceptionId,
    /// If set this causes the request to fail with the given reason. Passing 'Aborted' for requests
    /// marked with 'isNavigationRequest' also cancels the navigation. Must not be set in response
    /// to an authChallenge.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub errorReason: Option<ErrorReason>,
    /// If set the requests completes using with the provided base64 encoded raw response, including
    /// HTTP status line and headers etc... Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON)

    #[serde(skip_serializing_if = "Option::is_none")]
    pub rawResponse: Option<String>,
    /// If set the request url will be modified in a way that's not observable by page. Must not be
    /// set in response to an authChallenge.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// If set this allows the request method to be overridden. Must not be set in response to an
    /// authChallenge.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub method: Option<String>,
    /// If set this allows postData to be set. Must not be set in response to an authChallenge.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub postData: Option<String>,
    /// If set this allows the request headers to be changed. Must not be set in response to an
    /// authChallenge.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub headers: Option<Headers>,
    /// Response to a requestIntercepted with an authChallenge. Must not be set otherwise.

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

/// Deletes browser cookies with matching name and url or domain/path/partitionKey pair.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeleteCookiesParams {
    /// Name of the cookies to remove.

    pub name: String,
    /// If specified, deletes all the cookies with the given name where domain and path match
    /// provided URL.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// If specified, deletes only cookies with the exact domain.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub domain: Option<String>,
    /// If specified, deletes only cookies with the exact path.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// If specified, deletes only cookies with the the given name and partitionKey where
    /// all partition key attributes match the cookie partition key attribute.

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

/// Activates emulation of network conditions. This command is deprecated in favor of the emulateNetworkConditionsByRule
/// and overrideNetworkState commands, which can be used together to the same effect.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct EmulateNetworkConditionsParams {
    /// True to emulate internet disconnection.

    pub offline: bool,
    /// Minimum latency from request sent to response headers received (ms).

    pub latency: f64,
    /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.

    pub downloadThroughput: f64,
    /// Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling.

    pub uploadThroughput: f64,
    /// Connection type if known.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub connectionType: Option<ConnectionType>,
    /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub packetLoss: Option<f64>,
    /// WebRTC packet queue length (packet). 0 removes any queue length limitations.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub packetQueueLength: Option<u64>,
    /// WebRTC packetReordering feature.

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

/// Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated
/// Network.emulateNetworkConditions this method does not affect 'navigator' state. Use Network.overrideNetworkState to
/// explicitly modify 'navigator' behavior.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct EmulateNetworkConditionsByRuleParams {
    /// True to emulate internet disconnection. Deprecated, use the offline property in matchedNetworkConditions
    /// or emulateOfflineServiceWorker instead.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub offline: Option<bool>,
    /// True to emulate offline service worker.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub emulateOfflineServiceWorker: Option<bool>,
    /// Configure conditions for matching requests. If multiple entries match a request, the first entry wins.  Global
    /// conditions can be configured by leaving the urlPattern for the conditions empty. These global conditions are
    /// also applied for throttling of p2p connections.

    pub matchedNetworkConditions: Vec<NetworkConditions>,
}

/// Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated
/// Network.emulateNetworkConditions this method does not affect 'navigator' state. Use Network.overrideNetworkState to
/// explicitly modify 'navigator' behavior.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct EmulateNetworkConditionsByRuleReturns {
    /// An id for each entry in matchedNetworkConditions. The id will be included in the requestWillBeSentExtraInfo for
    /// requests affected by a rule.

    pub ruleIds: Vec<String>,
}

/// Override the state of navigator.onLine and navigator.connection.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct OverrideNetworkStateParams {
    /// True to emulate internet disconnection.

    pub offline: bool,
    /// Minimum latency from request sent to response headers received (ms).

    pub latency: f64,
    /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.

    pub downloadThroughput: f64,
    /// Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling.

    pub uploadThroughput: f64,
    /// Connection type if known.

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

/// Enables network tracking, network events will now be delivered to the client.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct EnableParams {
    /// Buffer size in bytes to use when preserving network payloads (XHRs, etc).
    /// This is the maximum number of bytes that will be collected by this
    /// DevTools session.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maxTotalBufferSize: Option<u64>,
    /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maxResourceBufferSize: Option<u64>,
    /// Longest post body size (in bytes) that would be included in requestWillBeSent notification

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maxPostDataSize: Option<u64>,
    /// Whether DirectSocket chunk send/receive events should be reported.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub reportDirectSocketTraffic: Option<bool>,
    /// Enable storing response bodies outside of renderer, so that these survive
    /// a cross-process navigation. Requires maxTotalBufferSize to be set.
    /// Currently defaults to false. This field is being deprecated in favor of the dedicated
    /// configureDurableMessages command, due to the possibility of deadlocks when awaiting
    /// Network.enable before issuing Runtime.runIfWaitingForDebugger.

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

/// Configures storing response bodies outside of renderer, so that these survive
/// a cross-process navigation.
/// If maxTotalBufferSize is not set, durable messages are disabled.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ConfigureDurableMessagesParams {
    /// Buffer size in bytes to use when preserving network payloads (XHRs, etc).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maxTotalBufferSize: Option<u64>,
    /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).

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

/// Returns all browser cookies. Depending on the backend support, will return detailed cookie
/// information in the 'cookies' field.
/// Deprecated. Use Storage.getCookies instead.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetAllCookiesReturns {
    /// Array of cookie objects.

    pub cookies: Vec<Cookie>,
}

/// Returns the DER-encoded certificate.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetCertificateParams {
    /// Origin to get certificate for.

    pub origin: String,
}

/// Returns the DER-encoded certificate.

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

    pub tableNames: Vec<String>,
}

/// Returns all browser cookies for the current URL. Depending on the backend support, will return
/// detailed cookie information in the 'cookies' field.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetCookiesParams {
    /// The list of URLs for which applicable cookies will be fetched.
    /// If not specified, it's assumed to be set to the list containing
    /// the URLs of the page and all of its subframes.

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

/// Returns all browser cookies for the current URL. Depending on the backend support, will return
/// detailed cookie information in the 'cookies' field.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetCookiesReturns {
    /// Array of cookie objects.

    pub cookies: Vec<Cookie>,
}

/// Returns content served for the given request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetResponseBodyParams {
    /// Identifier of the network request to get content for.

    pub requestId: RequestId,
}

/// Returns content served for the given request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetResponseBodyReturns {
    /// Response body.

    pub body: String,
    /// True, if content was sent as base64.

    pub base64Encoded: bool,
}

/// Returns post data sent with the request. Returns an error when no data was sent with the request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetRequestPostDataParams {
    /// Identifier of the network request to get content for.

    pub requestId: RequestId,
}

/// Returns post data sent with the request. Returns an error when no data was sent with the request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetRequestPostDataReturns {
    /// Request body string, omitting files from multipart requests

    pub postData: String,
    /// True, if content was sent as base64.

    pub base64Encoded: bool,
}

/// Returns content served for the given currently intercepted request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetResponseBodyForInterceptionParams {
    /// Identifier for the intercepted request to get body for.

    pub interceptionId: InterceptionId,
}

/// Returns content served for the given currently intercepted request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetResponseBodyForInterceptionReturns {
    /// Response body.

    pub body: String,
    /// True, if content was sent as base64.

    pub base64Encoded: bool,
}

/// Returns a handle to the stream representing the response body. Note that after this command,
/// the intercepted request can't be continued as is -- you either need to cancel it or to provide
/// the response body. The stream only supports sequential read, IO.read will fail if the position
/// is specified.

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

    pub interceptionId: InterceptionId,
}

/// Returns a handle to the stream representing the response body. Note that after this command,
/// the intercepted request can't be continued as is -- you either need to cancel it or to provide
/// the response body. The stream only supports sequential read, IO.read will fail if the position
/// is specified.

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

    pub stream: crate::io::StreamHandle,
}

/// This method sends a new XMLHttpRequest which is identical to the original one. The following
/// parameters should be identical: method, url, async, request body, extra headers, withCredentials
/// attribute, user, password.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ReplayXHRParams {
    /// Identifier of XHR to replay.

    pub requestId: RequestId,
}

/// Searches for given string in response content.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SearchInResponseBodyParams {
    /// Identifier of the network response to search.

    pub requestId: RequestId,
    /// String to search for.

    pub query: String,
    /// If true, search is case sensitive.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub caseSensitive: Option<bool>,
    /// If true, treats string parameter as regex.

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

/// Searches for given string in response content.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SearchInResponseBodyReturns {
    /// List of search matches.

    pub result: Vec<crate::debugger::SearchMatch>,
}

/// Blocks URLs from loading.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetBlockedURLsParams {
    /// Patterns to match in the order in which they are given. These patterns
    /// also take precedence over any wildcard patterns defined in 'urls'.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub urlPatterns: Option<Vec<BlockPattern>>,
    /// URL patterns to block. Wildcards ('*') are allowed.

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

/// Toggles ignoring of service worker for each request.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetBypassServiceWorkerParams {
    /// Bypass service worker and load from network.

    pub bypass: bool,
}

/// Toggles ignoring cache for each request. If 'true', cache will not be used.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetCacheDisabledParams {
    /// Cache disabled state.

    pub cacheDisabled: bool,
}

/// Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetCookieParams {
    /// Cookie name.

    pub name: String,
    /// Cookie value.

    pub value: String,
    /// The request-URI to associate with the setting of the cookie. This value can affect the
    /// default domain, path, source port, and source scheme values of the created cookie.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    /// Cookie domain.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub domain: Option<String>,
    /// Cookie path.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// True if cookie is secure.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub secure: Option<bool>,
    /// True if cookie is http-only.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub httpOnly: Option<bool>,
    /// Cookie SameSite type.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sameSite: Option<CookieSameSite>,
    /// Cookie expiration date, session cookie if not set

    #[serde(skip_serializing_if = "Option::is_none")]
    pub expires: Option<TimeSinceEpoch>,
    /// Cookie Priority type.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub priority: Option<CookiePriority>,
    /// Cookie source scheme type.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sourceScheme: Option<CookieSourceScheme>,
    /// Cookie source port. Valid values are {-1, \[1, 65535\]}, -1 indicates an unspecified port.
    /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.
    /// This is a temporary ability and it will be removed in the future.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub sourcePort: Option<i64>,
    /// Cookie partition key. If not set, the cookie will be set as not partitioned.

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

/// Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetCookieReturns {
    /// Always set to true. If an error occurs, the response indicates protocol error.

    pub success: bool,
}

/// Sets given cookies.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetCookiesParams {
    /// Cookies to be set.

    pub cookies: Vec<CookieParam>,
}

/// Specifies whether to always send extra HTTP headers with the requests from this page.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetExtraHTTPHeadersParams {
    /// Map with extra HTTP headers.

    pub headers: Headers,
}

/// Specifies whether to attach a page script stack id in requests

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetAttachDebugStackParams {
    /// Whether to attach a page script stack for debugging purpose.

    pub enabled: bool,
}

/// Sets the requests to intercept that match the provided patterns and optionally resource types.
/// Deprecated, please use Fetch.enable instead.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetRequestInterceptionParams {
    /// Requests matching any of these patterns will be forwarded and wait for the corresponding
    /// continueInterceptedRequest call.

    pub patterns: Vec<RequestPattern>,
}

/// Allows overriding user agent with the given string.

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

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

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

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

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

/// Enables streaming of the response for the given requestId.
/// If enabled, the dataReceived event contains the data that was received during streaming.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StreamResourceContentParams {
    /// Identifier of the request to stream.

    pub requestId: RequestId,
}

/// Enables streaming of the response for the given requestId.
/// If enabled, the dataReceived event contains the data that was received during streaming.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StreamResourceContentReturns {
    /// Data that has been buffered until streaming is enabled. (Encoded as a base64 string when passed over JSON)

    pub bufferedData: String,
}

/// Returns information about the COEP/COOP isolation status.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSecurityIsolationStatusParams {
    /// If no frameId is provided, the status of the target is provided.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub frameId: Option<crate::page::FrameId>,
}

/// Returns information about the COEP/COOP isolation status.

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

    pub status: SecurityIsolationStatus,
}

/// Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client.
/// Enabling triggers 'reportingApiReportAdded' for all existing reports.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct EnableReportingApiParams {
    /// Whether to enable or disable events for the Reporting API

    pub enable: bool,
}

/// Sets up tracking device bound sessions and fetching of initial set of sessions.

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

    pub enable: bool,
}

/// Deletes a device bound session.

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

    pub key: DeviceBoundSessionKey,
}

/// Fetches the schemeful site for a specific origin.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct FetchSchemefulSiteParams {
    /// The URL origin.

    pub origin: String,
}

/// Fetches the schemeful site for a specific origin.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct FetchSchemefulSiteReturns {
    /// The corresponding schemeful site.

    pub schemefulSite: String,
}

/// Fetches the resource and returns the content.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct LoadNetworkResourceParams {
    /// Frame id to get the resource for. Mandatory for frame targets, and
    /// should be omitted for worker targets.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub frameId: Option<crate::page::FrameId>,
    /// URL of the resource to get content for.

    pub url: String,
    /// Options for the request.

    pub options: LoadNetworkResourceOptions,
}

/// Fetches the resource and returns the content.

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

    pub resource: LoadNetworkResourcePageResult,
}

/// Sets Controls for third-party cookie access
/// Page reload is required before the new cookie behavior will be observed

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetCookieControlsParams {
    /// Whether 3pc restriction is enabled.

    pub enableThirdPartyCookieRestriction: bool,
}