rustenium-cdp-definitions 0.1.1

Generated Chrome DevTools Protocol type definitions for Rustenium
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
use serde::{Deserialize, Serialize};
#[doc = "Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.\n[setAcceptedEncodings](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setAcceptedEncodings)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetAcceptedEncodingsParams {
    #[doc = "List of accepted content encodings."]
    #[serde(rename = "encodings")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub encodings: Vec<super::types::ContentEncoding>,
}
impl SetAcceptedEncodingsParams {
    pub fn new(encodings: Vec<super::types::ContentEncoding>) -> Self {
        Self { encodings }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetAcceptedEncodingsMethod {
    #[serde(rename = "Network.setAcceptedEncodings")]
    SetAcceptedEncodings,
}
#[doc = "Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.\n[setAcceptedEncodings](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setAcceptedEncodings)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetAcceptedEncodings {
    pub method: SetAcceptedEncodingsMethod,
    pub params: SetAcceptedEncodingsParams,
}
impl SetAcceptedEncodings {
    pub const IDENTIFIER: &'static str = "Network.setAcceptedEncodings";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetAcceptedEncodings {
    type Result = super::results::SetAcceptedEncodingsResult;
}
#[doc = "Clears accepted encodings set by setAcceptedEncodings\n[clearAcceptedEncodingsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearAcceptedEncodingsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearAcceptedEncodingsOverrideParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearAcceptedEncodingsOverrideMethod {
    #[serde(rename = "Network.clearAcceptedEncodingsOverride")]
    ClearAcceptedEncodingsOverride,
}
#[doc = "Clears accepted encodings set by setAcceptedEncodings\n[clearAcceptedEncodingsOverride](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearAcceptedEncodingsOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearAcceptedEncodingsOverride {
    pub method: ClearAcceptedEncodingsOverrideMethod,
    pub params: ClearAcceptedEncodingsOverrideParams,
}
impl ClearAcceptedEncodingsOverride {
    pub const IDENTIFIER: &'static str = "Network.clearAcceptedEncodingsOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearAcceptedEncodingsOverride {
    type Result = super::results::ClearAcceptedEncodingsOverrideResult;
}
#[doc = "Clears browser cache.\n[clearBrowserCache](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearBrowserCache)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearBrowserCacheParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearBrowserCacheMethod {
    #[serde(rename = "Network.clearBrowserCache")]
    ClearBrowserCache,
}
#[doc = "Clears browser cache.\n[clearBrowserCache](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearBrowserCache)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearBrowserCache {
    pub method: ClearBrowserCacheMethod,
    pub params: ClearBrowserCacheParams,
}
impl ClearBrowserCache {
    pub const IDENTIFIER: &'static str = "Network.clearBrowserCache";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearBrowserCache {
    type Result = super::results::ClearBrowserCacheResult;
}
#[doc = "Clears browser cookies.\n[clearBrowserCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearBrowserCookies)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearBrowserCookiesParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ClearBrowserCookiesMethod {
    #[serde(rename = "Network.clearBrowserCookies")]
    ClearBrowserCookies,
}
#[doc = "Clears browser cookies.\n[clearBrowserCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-clearBrowserCookies)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClearBrowserCookies {
    pub method: ClearBrowserCookiesMethod,
    pub params: ClearBrowserCookiesParams,
}
impl ClearBrowserCookies {
    pub const IDENTIFIER: &'static str = "Network.clearBrowserCookies";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ClearBrowserCookies {
    type Result = super::results::ClearBrowserCookiesResult;
}
#[doc = "Deletes browser cookies with matching name and url or domain/path/partitionKey pair.\n[deleteCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-deleteCookies)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DeleteCookiesParams {
    #[doc = "Name of the cookies to remove."]
    #[serde(rename = "name")]
    pub name: String,
    #[doc = "If specified, deletes all the cookies with the given name where domain and path match\nprovided URL."]
    #[serde(rename = "url")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub url: Option<String>,
    #[doc = "If specified, deletes only cookies with the exact domain."]
    #[serde(rename = "domain")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub domain: Option<String>,
    #[doc = "If specified, deletes only cookies with the exact path."]
    #[serde(rename = "path")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub path: Option<String>,
    #[doc = "If specified, deletes only cookies with the the given name and partitionKey where\nall partition key attributes match the cookie partition key attribute."]
    #[serde(rename = "partitionKey")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub partition_key: Option<super::types::CookiePartitionKey>,
}
impl DeleteCookiesParams {
    pub fn new(name: impl Into<String>) -> Self {
        Self {
            name: name.into(),
            url: None,
            domain: None,
            path: None,
            partition_key: None,
        }
    }
}
impl<T: Into<String>> From<T> for DeleteCookiesParams {
    fn from(url: T) -> Self {
        DeleteCookiesParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum DeleteCookiesMethod {
    #[serde(rename = "Network.deleteCookies")]
    DeleteCookies,
}
#[doc = "Deletes browser cookies with matching name and url or domain/path/partitionKey pair.\n[deleteCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-deleteCookies)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DeleteCookies {
    pub method: DeleteCookiesMethod,
    pub params: DeleteCookiesParams,
}
impl DeleteCookies {
    pub const IDENTIFIER: &'static str = "Network.deleteCookies";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for DeleteCookies {
    type Result = super::results::DeleteCookiesResult;
}
#[doc = "Disables network tracking, prevents network events from being sent to the client.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-disable)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum DisableMethod {
    #[serde(rename = "Network.disable")]
    Disable,
}
#[doc = "Disables network tracking, prevents network events from being sent to the client.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-disable)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Disable {
    pub method: DisableMethod,
    pub params: DisableParams,
}
impl Disable {
    pub const IDENTIFIER: &'static str = "Network.disable";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for Disable {
    type Result = super::results::DisableResult;
}
#[doc = "Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated\nNetwork.emulateNetworkConditions this method does not affect `navigator` state. Use Network.overrideNetworkState to\nexplicitly modify `navigator` behavior.\n[emulateNetworkConditionsByRule](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-emulateNetworkConditionsByRule)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EmulateNetworkConditionsByRuleParams {
    #[doc = "True to emulate internet disconnection."]
    #[serde(rename = "offline")]
    pub offline: bool,
    #[doc = "Configure conditions for matching requests. If multiple entries match a request, the first entry wins.  Global\nconditions can be configured by leaving the urlPattern for the conditions empty. These global conditions are\nalso applied for throttling of p2p connections."]
    #[serde(rename = "matchedNetworkConditions")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub matched_network_conditions: Vec<super::types::NetworkConditions>,
}
impl EmulateNetworkConditionsByRuleParams {
    pub fn new(
        offline: impl Into<bool>,
        matched_network_conditions: Vec<super::types::NetworkConditions>,
    ) -> Self {
        Self {
            offline: offline.into(),
            matched_network_conditions,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum EmulateNetworkConditionsByRuleMethod {
    #[serde(rename = "Network.emulateNetworkConditionsByRule")]
    EmulateNetworkConditionsByRule,
}
#[doc = "Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated\nNetwork.emulateNetworkConditions this method does not affect `navigator` state. Use Network.overrideNetworkState to\nexplicitly modify `navigator` behavior.\n[emulateNetworkConditionsByRule](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-emulateNetworkConditionsByRule)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EmulateNetworkConditionsByRule {
    pub method: EmulateNetworkConditionsByRuleMethod,
    pub params: EmulateNetworkConditionsByRuleParams,
}
impl EmulateNetworkConditionsByRule {
    pub const IDENTIFIER: &'static str = "Network.emulateNetworkConditionsByRule";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for EmulateNetworkConditionsByRule {
    type Result = super::results::EmulateNetworkConditionsByRuleResult;
}
#[doc = "Override the state of navigator.onLine and navigator.connection.\n[overrideNetworkState](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-overrideNetworkState)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OverrideNetworkStateParams {
    #[doc = "True to emulate internet disconnection."]
    #[serde(rename = "offline")]
    pub offline: bool,
    #[doc = "Minimum latency from request sent to response headers received (ms)."]
    #[serde(rename = "latency")]
    pub latency: f64,
    #[doc = "Maximal aggregated download throughput (bytes/sec). -1 disables download throttling."]
    #[serde(rename = "downloadThroughput")]
    pub download_throughput: f64,
    #[doc = "Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling."]
    #[serde(rename = "uploadThroughput")]
    pub upload_throughput: f64,
    #[doc = "Connection type if known."]
    #[serde(rename = "connectionType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub connection_type: Option<super::types::ConnectionType>,
}
impl OverrideNetworkStateParams {
    pub fn new(
        offline: impl Into<bool>,
        latency: impl Into<f64>,
        download_throughput: impl Into<f64>,
        upload_throughput: impl Into<f64>,
    ) -> Self {
        Self {
            offline: offline.into(),
            latency: latency.into(),
            download_throughput: download_throughput.into(),
            upload_throughput: upload_throughput.into(),
            connection_type: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum OverrideNetworkStateMethod {
    #[serde(rename = "Network.overrideNetworkState")]
    OverrideNetworkState,
}
#[doc = "Override the state of navigator.onLine and navigator.connection.\n[overrideNetworkState](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-overrideNetworkState)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OverrideNetworkState {
    pub method: OverrideNetworkStateMethod,
    pub params: OverrideNetworkStateParams,
}
impl OverrideNetworkState {
    pub const IDENTIFIER: &'static str = "Network.overrideNetworkState";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for OverrideNetworkState {
    type Result = super::results::OverrideNetworkStateResult;
}
#[doc = "Enables network tracking, network events will now be delivered to the client.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enable)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct EnableParams {
    #[doc = "Buffer size in bytes to use when preserving network payloads (XHRs, etc).\nThis is the maximum number of bytes that will be collected by this\nDevTools session."]
    #[serde(rename = "maxTotalBufferSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub max_total_buffer_size: Option<i64>,
    #[doc = "Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc)."]
    #[serde(rename = "maxResourceBufferSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub max_resource_buffer_size: Option<i64>,
    #[doc = "Longest post body size (in bytes) that would be included in requestWillBeSent notification"]
    #[serde(rename = "maxPostDataSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub max_post_data_size: Option<i64>,
    #[doc = "Whether DirectSocket chunk send/receive events should be reported."]
    #[serde(rename = "reportDirectSocketTraffic")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub report_direct_socket_traffic: Option<bool>,
    #[doc = "Enable storing response bodies outside of renderer, so that these survive\na cross-process navigation. Requires maxTotalBufferSize to be set.\nCurrently defaults to false. This field is being deprecated in favor of the dedicated\nconfigureDurableMessages command, due to the possibility of deadlocks when awaiting\nNetwork.enable before issuing Runtime.runIfWaitingForDebugger."]
    #[serde(rename = "enableDurableMessages")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub enable_durable_messages: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum EnableMethod {
    #[serde(rename = "Network.enable")]
    Enable,
}
#[doc = "Enables network tracking, network events will now be delivered to the client.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enable)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Enable {
    pub method: EnableMethod,
    pub params: EnableParams,
}
impl Enable {
    pub const IDENTIFIER: &'static str = "Network.enable";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for Enable {
    type Result = super::results::EnableResult;
}
#[doc = "Configures storing response bodies outside of renderer, so that these survive\na cross-process navigation.\nIf maxTotalBufferSize is not set, durable messages are disabled.\n[configureDurableMessages](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-configureDurableMessages)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ConfigureDurableMessagesParams {
    #[doc = "Buffer size in bytes to use when preserving network payloads (XHRs, etc)."]
    #[serde(rename = "maxTotalBufferSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub max_total_buffer_size: Option<i64>,
    #[doc = "Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc)."]
    #[serde(rename = "maxResourceBufferSize")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub max_resource_buffer_size: Option<i64>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ConfigureDurableMessagesMethod {
    #[serde(rename = "Network.configureDurableMessages")]
    ConfigureDurableMessages,
}
#[doc = "Configures storing response bodies outside of renderer, so that these survive\na cross-process navigation.\nIf maxTotalBufferSize is not set, durable messages are disabled.\n[configureDurableMessages](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-configureDurableMessages)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConfigureDurableMessages {
    pub method: ConfigureDurableMessagesMethod,
    pub params: ConfigureDurableMessagesParams,
}
impl ConfigureDurableMessages {
    pub const IDENTIFIER: &'static str = "Network.configureDurableMessages";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ConfigureDurableMessages {
    type Result = super::results::ConfigureDurableMessagesResult;
}
#[doc = "Returns the DER-encoded certificate.\n[getCertificate](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getCertificate)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetCertificateParams {
    #[doc = "Origin to get certificate for."]
    #[serde(rename = "origin")]
    pub origin: String,
}
impl GetCertificateParams {
    pub fn new(origin: impl Into<String>) -> Self {
        Self {
            origin: origin.into(),
        }
    }
}
impl<T: Into<String>> From<T> for GetCertificateParams {
    fn from(url: T) -> Self {
        GetCertificateParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetCertificateMethod {
    #[serde(rename = "Network.getCertificate")]
    GetCertificate,
}
#[doc = "Returns the DER-encoded certificate.\n[getCertificate](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getCertificate)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetCertificate {
    pub method: GetCertificateMethod,
    pub params: GetCertificateParams,
}
impl GetCertificate {
    pub const IDENTIFIER: &'static str = "Network.getCertificate";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetCertificate {
    type Result = super::results::GetCertificateResult;
}
#[doc = "Returns all browser cookies for the current URL. Depending on the backend support, will return\ndetailed cookie information in the `cookies` field.\n[getCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getCookies)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct GetCookiesParams {
    #[doc = "The list of URLs for which applicable cookies will be fetched.\nIf not specified, it's assumed to be set to the list containing\nthe URLs of the page and all of its subframes."]
    #[serde(rename = "urls")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub urls: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetCookiesMethod {
    #[serde(rename = "Network.getCookies")]
    GetCookies,
}
#[doc = "Returns all browser cookies for the current URL. Depending on the backend support, will return\ndetailed cookie information in the `cookies` field.\n[getCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getCookies)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetCookies {
    pub method: GetCookiesMethod,
    pub params: GetCookiesParams,
}
impl GetCookies {
    pub const IDENTIFIER: &'static str = "Network.getCookies";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetCookies {
    type Result = super::results::GetCookiesResult;
}
#[doc = "Returns content served for the given request.\n[getResponseBody](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetResponseBodyParams {
    #[doc = "Identifier of the network request to get content for."]
    #[serde(rename = "requestId")]
    pub request_id: super::types::RequestId,
}
impl GetResponseBodyParams {
    pub fn new(request_id: impl Into<super::types::RequestId>) -> Self {
        Self {
            request_id: request_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetResponseBodyMethod {
    #[serde(rename = "Network.getResponseBody")]
    GetResponseBody,
}
#[doc = "Returns content served for the given request.\n[getResponseBody](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBody)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetResponseBody {
    pub method: GetResponseBodyMethod,
    pub params: GetResponseBodyParams,
}
impl GetResponseBody {
    pub const IDENTIFIER: &'static str = "Network.getResponseBody";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetResponseBody {
    type Result = super::results::GetResponseBodyResult;
}
#[doc = "Returns post data sent with the request. Returns an error when no data was sent with the request.\n[getRequestPostData](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getRequestPostData)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetRequestPostDataParams {
    #[doc = "Identifier of the network request to get content for."]
    #[serde(rename = "requestId")]
    pub request_id: super::types::RequestId,
}
impl GetRequestPostDataParams {
    pub fn new(request_id: impl Into<super::types::RequestId>) -> Self {
        Self {
            request_id: request_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetRequestPostDataMethod {
    #[serde(rename = "Network.getRequestPostData")]
    GetRequestPostData,
}
#[doc = "Returns post data sent with the request. Returns an error when no data was sent with the request.\n[getRequestPostData](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getRequestPostData)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetRequestPostData {
    pub method: GetRequestPostDataMethod,
    pub params: GetRequestPostDataParams,
}
impl GetRequestPostData {
    pub const IDENTIFIER: &'static str = "Network.getRequestPostData";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetRequestPostData {
    type Result = super::results::GetRequestPostDataResult;
}
#[doc = "Returns content served for the given currently intercepted request.\n[getResponseBodyForInterception](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBodyForInterception)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetResponseBodyForInterceptionParams {
    #[doc = "Identifier for the intercepted request to get body for."]
    #[serde(rename = "interceptionId")]
    pub interception_id: super::types::InterceptionId,
}
impl GetResponseBodyForInterceptionParams {
    pub fn new(interception_id: impl Into<super::types::InterceptionId>) -> Self {
        Self {
            interception_id: interception_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetResponseBodyForInterceptionMethod {
    #[serde(rename = "Network.getResponseBodyForInterception")]
    GetResponseBodyForInterception,
}
#[doc = "Returns content served for the given currently intercepted request.\n[getResponseBodyForInterception](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getResponseBodyForInterception)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetResponseBodyForInterception {
    pub method: GetResponseBodyForInterceptionMethod,
    pub params: GetResponseBodyForInterceptionParams,
}
impl GetResponseBodyForInterception {
    pub const IDENTIFIER: &'static str = "Network.getResponseBodyForInterception";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetResponseBodyForInterception {
    type Result = super::results::GetResponseBodyForInterceptionResult;
}
#[doc = "Returns a handle to the stream representing the response body. Note that after this command,\nthe intercepted request can't be continued as is -- you either need to cancel it or to provide\nthe response body. The stream only supports sequential read, IO.read will fail if the position\nis specified.\n[takeResponseBodyForInterceptionAsStream](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-takeResponseBodyForInterceptionAsStream)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TakeResponseBodyForInterceptionAsStreamParams {
    #[serde(rename = "interceptionId")]
    pub interception_id: super::types::InterceptionId,
}
impl TakeResponseBodyForInterceptionAsStreamParams {
    pub fn new(interception_id: impl Into<super::types::InterceptionId>) -> Self {
        Self {
            interception_id: interception_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum TakeResponseBodyForInterceptionAsStreamMethod {
    #[serde(rename = "Network.takeResponseBodyForInterceptionAsStream")]
    TakeResponseBodyForInterceptionAsStream,
}
#[doc = "Returns a handle to the stream representing the response body. Note that after this command,\nthe intercepted request can't be continued as is -- you either need to cancel it or to provide\nthe response body. The stream only supports sequential read, IO.read will fail if the position\nis specified.\n[takeResponseBodyForInterceptionAsStream](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-takeResponseBodyForInterceptionAsStream)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct TakeResponseBodyForInterceptionAsStream {
    pub method: TakeResponseBodyForInterceptionAsStreamMethod,
    pub params: TakeResponseBodyForInterceptionAsStreamParams,
}
impl TakeResponseBodyForInterceptionAsStream {
    pub const IDENTIFIER: &'static str = "Network.takeResponseBodyForInterceptionAsStream";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for TakeResponseBodyForInterceptionAsStream {
    type Result = super::results::TakeResponseBodyForInterceptionAsStreamResult;
}
#[doc = "This method sends a new XMLHttpRequest which is identical to the original one. The following\nparameters should be identical: method, url, async, request body, extra headers, withCredentials\nattribute, user, password.\n[replayXHR](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-replayXHR)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ReplayXhrParams {
    #[doc = "Identifier of XHR to replay."]
    #[serde(rename = "requestId")]
    pub request_id: super::types::RequestId,
}
impl ReplayXhrParams {
    pub fn new(request_id: impl Into<super::types::RequestId>) -> Self {
        Self {
            request_id: request_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ReplayXhrMethod {
    #[serde(rename = "Network.replayXHR")]
    ReplayXhr,
}
#[doc = "This method sends a new XMLHttpRequest which is identical to the original one. The following\nparameters should be identical: method, url, async, request body, extra headers, withCredentials\nattribute, user, password.\n[replayXHR](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-replayXHR)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ReplayXhr {
    pub method: ReplayXhrMethod,
    pub params: ReplayXhrParams,
}
impl ReplayXhr {
    pub const IDENTIFIER: &'static str = "Network.replayXHR";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ReplayXhr {
    type Result = super::results::ReplayXhrResult;
}
#[doc = "Searches for given string in response content.\n[searchInResponseBody](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-searchInResponseBody)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SearchInResponseBodyParams {
    #[doc = "Identifier of the network response to search."]
    #[serde(rename = "requestId")]
    pub request_id: super::types::RequestId,
    #[doc = "String to search for."]
    #[serde(rename = "query")]
    pub query: String,
    #[doc = "If true, search is case sensitive."]
    #[serde(rename = "caseSensitive")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub case_sensitive: Option<bool>,
    #[doc = "If true, treats string parameter as regex."]
    #[serde(rename = "isRegex")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub is_regex: Option<bool>,
}
impl SearchInResponseBodyParams {
    pub fn new(request_id: impl Into<super::types::RequestId>, query: impl Into<String>) -> Self {
        Self {
            request_id: request_id.into(),
            query: query.into(),
            case_sensitive: None,
            is_regex: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SearchInResponseBodyMethod {
    #[serde(rename = "Network.searchInResponseBody")]
    SearchInResponseBody,
}
#[doc = "Searches for given string in response content.\n[searchInResponseBody](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-searchInResponseBody)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SearchInResponseBody {
    pub method: SearchInResponseBodyMethod,
    pub params: SearchInResponseBodyParams,
}
impl SearchInResponseBody {
    pub const IDENTIFIER: &'static str = "Network.searchInResponseBody";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SearchInResponseBody {
    type Result = super::results::SearchInResponseBodyResult;
}
#[doc = "Blocks URLs from loading.\n[setBlockedURLs](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setBlockedURLs)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetBlockedUrLsParams {
    #[doc = "Patterns to match in the order in which they are given. These patterns\nalso take precedence over any wildcard patterns defined in `urls`."]
    #[serde(rename = "urlPatterns")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub url_patterns: Option<Vec<super::types::BlockPattern>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetBlockedUrLsMethod {
    #[serde(rename = "Network.setBlockedURLs")]
    SetBlockedUrLs,
}
#[doc = "Blocks URLs from loading.\n[setBlockedURLs](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setBlockedURLs)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetBlockedUrLs {
    pub method: SetBlockedUrLsMethod,
    pub params: SetBlockedUrLsParams,
}
impl SetBlockedUrLs {
    pub const IDENTIFIER: &'static str = "Network.setBlockedURLs";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetBlockedUrLs {
    type Result = super::results::SetBlockedUrLsResult;
}
#[doc = "Toggles ignoring of service worker for each request.\n[setBypassServiceWorker](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setBypassServiceWorker)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetBypassServiceWorkerParams {
    #[doc = "Bypass service worker and load from network."]
    #[serde(rename = "bypass")]
    pub bypass: bool,
}
impl SetBypassServiceWorkerParams {
    pub fn new(bypass: impl Into<bool>) -> Self {
        Self {
            bypass: bypass.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetBypassServiceWorkerMethod {
    #[serde(rename = "Network.setBypassServiceWorker")]
    SetBypassServiceWorker,
}
#[doc = "Toggles ignoring of service worker for each request.\n[setBypassServiceWorker](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setBypassServiceWorker)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetBypassServiceWorker {
    pub method: SetBypassServiceWorkerMethod,
    pub params: SetBypassServiceWorkerParams,
}
impl SetBypassServiceWorker {
    pub const IDENTIFIER: &'static str = "Network.setBypassServiceWorker";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetBypassServiceWorker {
    type Result = super::results::SetBypassServiceWorkerResult;
}
#[doc = "Toggles ignoring cache for each request. If `true`, cache will not be used.\n[setCacheDisabled](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCacheDisabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCacheDisabledParams {
    #[doc = "Cache disabled state."]
    #[serde(rename = "cacheDisabled")]
    pub cache_disabled: bool,
}
impl SetCacheDisabledParams {
    pub fn new(cache_disabled: impl Into<bool>) -> Self {
        Self {
            cache_disabled: cache_disabled.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetCacheDisabledMethod {
    #[serde(rename = "Network.setCacheDisabled")]
    SetCacheDisabled,
}
#[doc = "Toggles ignoring cache for each request. If `true`, cache will not be used.\n[setCacheDisabled](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCacheDisabled)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCacheDisabled {
    pub method: SetCacheDisabledMethod,
    pub params: SetCacheDisabledParams,
}
impl SetCacheDisabled {
    pub const IDENTIFIER: &'static str = "Network.setCacheDisabled";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetCacheDisabled {
    type Result = super::results::SetCacheDisabledResult;
}
#[doc = "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.\n[setCookie](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookie)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCookieParams {
    #[doc = "Cookie name."]
    #[serde(rename = "name")]
    pub name: String,
    #[doc = "Cookie value."]
    #[serde(rename = "value")]
    pub value: String,
    #[doc = "The request-URI to associate with the setting of the cookie. This value can affect the\ndefault domain, path, source port, and source scheme values of the created cookie."]
    #[serde(rename = "url")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub url: Option<String>,
    #[doc = "Cookie domain."]
    #[serde(rename = "domain")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub domain: Option<String>,
    #[doc = "Cookie path."]
    #[serde(rename = "path")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub path: Option<String>,
    #[doc = "True if cookie is secure."]
    #[serde(rename = "secure")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub secure: Option<bool>,
    #[doc = "True if cookie is http-only."]
    #[serde(rename = "httpOnly")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub http_only: Option<bool>,
    #[doc = "Cookie SameSite type."]
    #[serde(rename = "sameSite")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub same_site: Option<super::types::CookieSameSite>,
    #[doc = "Cookie expiration date, session cookie if not set"]
    #[serde(rename = "expires")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub expires: Option<super::types::TimeSinceEpoch>,
    #[doc = "Cookie Priority type."]
    #[serde(rename = "priority")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub priority: Option<super::types::CookiePriority>,
    #[doc = "Cookie source scheme type."]
    #[serde(rename = "sourceScheme")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub source_scheme: Option<super::types::CookieSourceScheme>,
    #[doc = "Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.\nAn unspecified port value allows protocol clients to emulate legacy cookie scope for the port.\nThis is a temporary ability and it will be removed in the future."]
    #[serde(rename = "sourcePort")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub source_port: Option<i64>,
    #[doc = "Cookie partition key. If not set, the cookie will be set as not partitioned."]
    #[serde(rename = "partitionKey")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub partition_key: Option<super::types::CookiePartitionKey>,
}
impl SetCookieParams {
    pub fn new(name: impl Into<String>, value: impl Into<String>) -> Self {
        Self {
            name: name.into(),
            value: value.into(),
            url: None,
            domain: None,
            path: None,
            secure: None,
            http_only: None,
            same_site: None,
            expires: None,
            priority: None,
            source_scheme: None,
            source_port: None,
            partition_key: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetCookieMethod {
    #[serde(rename = "Network.setCookie")]
    SetCookie,
}
#[doc = "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.\n[setCookie](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookie)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCookie {
    pub method: SetCookieMethod,
    pub params: SetCookieParams,
}
impl SetCookie {
    pub const IDENTIFIER: &'static str = "Network.setCookie";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetCookie {
    type Result = super::results::SetCookieResult;
}
#[doc = "Sets given cookies.\n[setCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookies)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCookiesParams {
    #[doc = "Cookies to be set."]
    #[serde(rename = "cookies")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub cookies: Vec<super::types::CookieParam>,
}
impl SetCookiesParams {
    pub fn new(cookies: Vec<super::types::CookieParam>) -> Self {
        Self { cookies }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetCookiesMethod {
    #[serde(rename = "Network.setCookies")]
    SetCookies,
}
#[doc = "Sets given cookies.\n[setCookies](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookies)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCookies {
    pub method: SetCookiesMethod,
    pub params: SetCookiesParams,
}
impl SetCookies {
    pub const IDENTIFIER: &'static str = "Network.setCookies";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetCookies {
    type Result = super::results::SetCookiesResult;
}
#[doc = "Specifies whether to always send extra HTTP headers with the requests from this page.\n[setExtraHTTPHeaders](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setExtraHTTPHeaders)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetExtraHttpHeadersParams {
    #[doc = "Map with extra HTTP headers."]
    #[serde(rename = "headers")]
    pub headers: super::types::Headers,
}
impl SetExtraHttpHeadersParams {
    pub fn new(headers: impl Into<super::types::Headers>) -> Self {
        Self {
            headers: headers.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetExtraHttpHeadersMethod {
    #[serde(rename = "Network.setExtraHTTPHeaders")]
    SetExtraHttpHeaders,
}
#[doc = "Specifies whether to always send extra HTTP headers with the requests from this page.\n[setExtraHTTPHeaders](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setExtraHTTPHeaders)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetExtraHttpHeaders {
    pub method: SetExtraHttpHeadersMethod,
    pub params: SetExtraHttpHeadersParams,
}
impl SetExtraHttpHeaders {
    pub const IDENTIFIER: &'static str = "Network.setExtraHTTPHeaders";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetExtraHttpHeaders {
    type Result = super::results::SetExtraHttpHeadersResult;
}
#[doc = "Specifies whether to attach a page script stack id in requests\n[setAttachDebugStack](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setAttachDebugStack)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetAttachDebugStackParams {
    #[doc = "Whether to attach a page script stack for debugging purpose."]
    #[serde(rename = "enabled")]
    pub enabled: bool,
}
impl SetAttachDebugStackParams {
    pub fn new(enabled: impl Into<bool>) -> Self {
        Self {
            enabled: enabled.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetAttachDebugStackMethod {
    #[serde(rename = "Network.setAttachDebugStack")]
    SetAttachDebugStack,
}
#[doc = "Specifies whether to attach a page script stack id in requests\n[setAttachDebugStack](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setAttachDebugStack)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetAttachDebugStack {
    pub method: SetAttachDebugStackMethod,
    pub params: SetAttachDebugStackParams,
}
impl SetAttachDebugStack {
    pub const IDENTIFIER: &'static str = "Network.setAttachDebugStack";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetAttachDebugStack {
    type Result = super::results::SetAttachDebugStackResult;
}
#[doc = "Allows overriding user agent with the given string.\n[setUserAgentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setUserAgentOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetUserAgentOverrideParams {
    #[doc = "User agent to use."]
    #[serde(rename = "userAgent")]
    pub user_agent: String,
    #[doc = "Browser language to emulate."]
    #[serde(rename = "acceptLanguage")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub accept_language: Option<String>,
    #[doc = "The platform navigator.platform should return."]
    #[serde(rename = "platform")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub platform: Option<String>,
    #[doc = "To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData"]
    #[serde(rename = "userAgentMetadata")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub user_agent_metadata: Option<crate::browser_protocol::emulation::types::UserAgentMetadata>,
}
impl SetUserAgentOverrideParams {
    pub fn new(user_agent: impl Into<String>) -> Self {
        Self {
            user_agent: user_agent.into(),
            accept_language: None,
            platform: None,
            user_agent_metadata: None,
        }
    }
}
impl<T: Into<String>> From<T> for SetUserAgentOverrideParams {
    fn from(url: T) -> Self {
        SetUserAgentOverrideParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetUserAgentOverrideMethod {
    #[serde(rename = "Network.setUserAgentOverride")]
    SetUserAgentOverride,
}
#[doc = "Allows overriding user agent with the given string.\n[setUserAgentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setUserAgentOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetUserAgentOverride {
    pub method: SetUserAgentOverrideMethod,
    pub params: SetUserAgentOverrideParams,
}
impl SetUserAgentOverride {
    pub const IDENTIFIER: &'static str = "Network.setUserAgentOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetUserAgentOverride {
    type Result = super::results::SetUserAgentOverrideResult;
}
#[doc = "Enables streaming of the response for the given requestId.\nIf enabled, the dataReceived event contains the data that was received during streaming.\n[streamResourceContent](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-streamResourceContent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StreamResourceContentParams {
    #[doc = "Identifier of the request to stream."]
    #[serde(rename = "requestId")]
    pub request_id: super::types::RequestId,
}
impl StreamResourceContentParams {
    pub fn new(request_id: impl Into<super::types::RequestId>) -> Self {
        Self {
            request_id: request_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum StreamResourceContentMethod {
    #[serde(rename = "Network.streamResourceContent")]
    StreamResourceContent,
}
#[doc = "Enables streaming of the response for the given requestId.\nIf enabled, the dataReceived event contains the data that was received during streaming.\n[streamResourceContent](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-streamResourceContent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StreamResourceContent {
    pub method: StreamResourceContentMethod,
    pub params: StreamResourceContentParams,
}
impl StreamResourceContent {
    pub const IDENTIFIER: &'static str = "Network.streamResourceContent";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for StreamResourceContent {
    type Result = super::results::StreamResourceContentResult;
}
#[doc = "Returns information about the COEP/COOP isolation status.\n[getSecurityIsolationStatus](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getSecurityIsolationStatus)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct GetSecurityIsolationStatusParams {
    #[doc = "If no frameId is provided, the status of the target is provided."]
    #[serde(rename = "frameId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub frame_id: Option<crate::browser_protocol::page::types::FrameId>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetSecurityIsolationStatusMethod {
    #[serde(rename = "Network.getSecurityIsolationStatus")]
    GetSecurityIsolationStatus,
}
#[doc = "Returns information about the COEP/COOP isolation status.\n[getSecurityIsolationStatus](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-getSecurityIsolationStatus)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetSecurityIsolationStatus {
    pub method: GetSecurityIsolationStatusMethod,
    pub params: GetSecurityIsolationStatusParams,
}
impl GetSecurityIsolationStatus {
    pub const IDENTIFIER: &'static str = "Network.getSecurityIsolationStatus";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetSecurityIsolationStatus {
    type Result = super::results::GetSecurityIsolationStatusResult;
}
#[doc = "Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client.\nEnabling triggers 'reportingApiReportAdded' for all existing reports.\n[enableReportingApi](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enableReportingApi)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EnableReportingApiParams {
    #[doc = "Whether to enable or disable events for the Reporting API"]
    #[serde(rename = "enable")]
    pub enable: bool,
}
impl EnableReportingApiParams {
    pub fn new(enable: impl Into<bool>) -> Self {
        Self {
            enable: enable.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum EnableReportingApiMethod {
    #[serde(rename = "Network.enableReportingApi")]
    EnableReportingApi,
}
#[doc = "Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client.\nEnabling triggers 'reportingApiReportAdded' for all existing reports.\n[enableReportingApi](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enableReportingApi)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EnableReportingApi {
    pub method: EnableReportingApiMethod,
    pub params: EnableReportingApiParams,
}
impl EnableReportingApi {
    pub const IDENTIFIER: &'static str = "Network.enableReportingApi";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for EnableReportingApi {
    type Result = super::results::EnableReportingApiResult;
}
#[doc = "Sets up tracking device bound sessions and fetching of initial set of sessions.\n[enableDeviceBoundSessions](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enableDeviceBoundSessions)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EnableDeviceBoundSessionsParams {
    #[doc = "Whether to enable or disable events."]
    #[serde(rename = "enable")]
    pub enable: bool,
}
impl EnableDeviceBoundSessionsParams {
    pub fn new(enable: impl Into<bool>) -> Self {
        Self {
            enable: enable.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum EnableDeviceBoundSessionsMethod {
    #[serde(rename = "Network.enableDeviceBoundSessions")]
    EnableDeviceBoundSessions,
}
#[doc = "Sets up tracking device bound sessions and fetching of initial set of sessions.\n[enableDeviceBoundSessions](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-enableDeviceBoundSessions)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EnableDeviceBoundSessions {
    pub method: EnableDeviceBoundSessionsMethod,
    pub params: EnableDeviceBoundSessionsParams,
}
impl EnableDeviceBoundSessions {
    pub const IDENTIFIER: &'static str = "Network.enableDeviceBoundSessions";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for EnableDeviceBoundSessions {
    type Result = super::results::EnableDeviceBoundSessionsResult;
}
#[doc = "Fetches the schemeful site for a specific origin.\n[fetchSchemefulSite](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-fetchSchemefulSite)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FetchSchemefulSiteParams {
    #[doc = "The URL origin."]
    #[serde(rename = "origin")]
    pub origin: String,
}
impl FetchSchemefulSiteParams {
    pub fn new(origin: impl Into<String>) -> Self {
        Self {
            origin: origin.into(),
        }
    }
}
impl<T: Into<String>> From<T> for FetchSchemefulSiteParams {
    fn from(url: T) -> Self {
        FetchSchemefulSiteParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum FetchSchemefulSiteMethod {
    #[serde(rename = "Network.fetchSchemefulSite")]
    FetchSchemefulSite,
}
#[doc = "Fetches the schemeful site for a specific origin.\n[fetchSchemefulSite](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-fetchSchemefulSite)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FetchSchemefulSite {
    pub method: FetchSchemefulSiteMethod,
    pub params: FetchSchemefulSiteParams,
}
impl FetchSchemefulSite {
    pub const IDENTIFIER: &'static str = "Network.fetchSchemefulSite";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for FetchSchemefulSite {
    type Result = super::results::FetchSchemefulSiteResult;
}
#[doc = "Fetches the resource and returns the content.\n[loadNetworkResource](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LoadNetworkResourceParams {
    #[doc = "Frame id to get the resource for. Mandatory for frame targets, and\nshould be omitted for worker targets."]
    #[serde(rename = "frameId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub frame_id: Option<crate::browser_protocol::page::types::FrameId>,
    #[doc = "URL of the resource to get content for."]
    #[serde(rename = "url")]
    pub url: String,
    #[doc = "Options for the request."]
    #[serde(rename = "options")]
    pub options: super::types::LoadNetworkResourceOptions,
}
impl LoadNetworkResourceParams {
    pub fn new(
        url: impl Into<String>,
        options: impl Into<super::types::LoadNetworkResourceOptions>,
    ) -> Self {
        Self {
            url: url.into(),
            options: options.into(),
            frame_id: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum LoadNetworkResourceMethod {
    #[serde(rename = "Network.loadNetworkResource")]
    LoadNetworkResource,
}
#[doc = "Fetches the resource and returns the content.\n[loadNetworkResource](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LoadNetworkResource {
    pub method: LoadNetworkResourceMethod,
    pub params: LoadNetworkResourceParams,
}
impl LoadNetworkResource {
    pub const IDENTIFIER: &'static str = "Network.loadNetworkResource";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for LoadNetworkResource {
    type Result = super::results::LoadNetworkResourceResult;
}
#[doc = "Sets Controls for third-party cookie access\nPage reload is required before the new cookie behavior will be observed\n[setCookieControls](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookieControls)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCookieControlsParams {
    #[doc = "Whether 3pc restriction is enabled."]
    #[serde(rename = "enableThirdPartyCookieRestriction")]
    pub enable_third_party_cookie_restriction: bool,
    #[doc = "Whether 3pc grace period exception should be enabled; false by default."]
    #[serde(rename = "disableThirdPartyCookieMetadata")]
    pub disable_third_party_cookie_metadata: bool,
    #[doc = "Whether 3pc heuristics exceptions should be enabled; false by default."]
    #[serde(rename = "disableThirdPartyCookieHeuristics")]
    pub disable_third_party_cookie_heuristics: bool,
}
impl SetCookieControlsParams {
    pub fn new(
        enable_third_party_cookie_restriction: impl Into<bool>,
        disable_third_party_cookie_metadata: impl Into<bool>,
        disable_third_party_cookie_heuristics: impl Into<bool>,
    ) -> Self {
        Self {
            enable_third_party_cookie_restriction: enable_third_party_cookie_restriction.into(),
            disable_third_party_cookie_metadata: disable_third_party_cookie_metadata.into(),
            disable_third_party_cookie_heuristics: disable_third_party_cookie_heuristics.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetCookieControlsMethod {
    #[serde(rename = "Network.setCookieControls")]
    SetCookieControls,
}
#[doc = "Sets Controls for third-party cookie access\nPage reload is required before the new cookie behavior will be observed\n[setCookieControls](https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-setCookieControls)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetCookieControls {
    pub method: SetCookieControlsMethod,
    pub params: SetCookieControlsParams,
}
impl SetCookieControls {
    pub const IDENTIFIER: &'static str = "Network.setCookieControls";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetCookieControls {
    type Result = super::results::SetCookieControlsResult;
}
group_enum ! (NetworkCommands { SetAcceptedEncodings (SetAcceptedEncodings) , ClearAcceptedEncodingsOverride (ClearAcceptedEncodingsOverride) , ClearBrowserCache (ClearBrowserCache) , ClearBrowserCookies (ClearBrowserCookies) , DeleteCookies (DeleteCookies) , Disable (Disable) , EmulateNetworkConditionsByRule (EmulateNetworkConditionsByRule) , OverrideNetworkState (OverrideNetworkState) , Enable (Enable) , ConfigureDurableMessages (ConfigureDurableMessages) , GetCertificate (GetCertificate) , GetCookies (GetCookies) , GetResponseBody (GetResponseBody) , GetRequestPostData (GetRequestPostData) , GetResponseBodyForInterception (GetResponseBodyForInterception) , TakeResponseBodyForInterceptionAsStream (TakeResponseBodyForInterceptionAsStream) , ReplayXhr (ReplayXhr) , SearchInResponseBody (SearchInResponseBody) , SetBlockedUrLs (SetBlockedUrLs) , SetBypassServiceWorker (SetBypassServiceWorker) , SetCacheDisabled (SetCacheDisabled) , SetCookie (SetCookie) , SetCookies (SetCookies) , SetExtraHttpHeaders (SetExtraHttpHeaders) , SetAttachDebugStack (SetAttachDebugStack) , SetUserAgentOverride (SetUserAgentOverride) , StreamResourceContent (StreamResourceContent) , GetSecurityIsolationStatus (GetSecurityIsolationStatus) , EnableReportingApi (EnableReportingApi) , EnableDeviceBoundSessions (EnableDeviceBoundSessions) , FetchSchemefulSite (FetchSchemefulSite) , LoadNetworkResource (LoadNetworkResource) , SetCookieControls (SetCookieControls) } + identifiable);