cdp-protocol 0.3.1

A Rust implementation of the Chrome DevTools 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
// Auto-generated from Chrome at version 146.0.7680.165 domain: Browser
#![allow(dead_code)]
use super::target;
#[allow(unused_imports)]
use super::types::*;
#[allow(unused_imports)]
use derive_builder::Builder;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use serde_json::Value as Json;
pub type BrowserContextId = String;
pub type WindowId = JsUInt;
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum WindowState {
    #[serde(rename = "normal")]
    Normal,
    #[serde(rename = "minimized")]
    Minimized,
    #[serde(rename = "maximized")]
    Maximized,
    #[serde(rename = "fullscreen")]
    Fullscreen,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum PermissionType {
    #[serde(rename = "ar")]
    Ar,
    #[serde(rename = "audioCapture")]
    AudioCapture,
    #[serde(rename = "automaticFullscreen")]
    AutomaticFullscreen,
    #[serde(rename = "backgroundFetch")]
    BackgroundFetch,
    #[serde(rename = "backgroundSync")]
    BackgroundSync,
    #[serde(rename = "cameraPanTiltZoom")]
    CameraPanTiltZoom,
    #[serde(rename = "capturedSurfaceControl")]
    CapturedSurfaceControl,
    #[serde(rename = "clipboardReadWrite")]
    ClipboardReadWrite,
    #[serde(rename = "clipboardSanitizedWrite")]
    ClipboardSanitizedWrite,
    #[serde(rename = "displayCapture")]
    DisplayCapture,
    #[serde(rename = "durableStorage")]
    DurableStorage,
    #[serde(rename = "geolocation")]
    Geolocation,
    #[serde(rename = "handTracking")]
    HandTracking,
    #[serde(rename = "idleDetection")]
    IdleDetection,
    #[serde(rename = "keyboardLock")]
    KeyboardLock,
    #[serde(rename = "localFonts")]
    LocalFonts,
    #[serde(rename = "localNetwork")]
    LocalNetwork,
    #[serde(rename = "localNetworkAccess")]
    LocalNetworkAccess,
    #[serde(rename = "loopbackNetwork")]
    LoopbackNetwork,
    #[serde(rename = "midi")]
    Midi,
    #[serde(rename = "midiSysex")]
    MidiSysex,
    #[serde(rename = "nfc")]
    Nfc,
    #[serde(rename = "notifications")]
    Notifications,
    #[serde(rename = "paymentHandler")]
    PaymentHandler,
    #[serde(rename = "periodicBackgroundSync")]
    PeriodicBackgroundSync,
    #[serde(rename = "pointerLock")]
    PointerLock,
    #[serde(rename = "protectedMediaIdentifier")]
    ProtectedMediaIdentifier,
    #[serde(rename = "sensors")]
    Sensors,
    #[serde(rename = "smartCard")]
    SmartCard,
    #[serde(rename = "speakerSelection")]
    SpeakerSelection,
    #[serde(rename = "storageAccess")]
    StorageAccess,
    #[serde(rename = "topLevelStorageAccess")]
    TopLevelStorageAccess,
    #[serde(rename = "videoCapture")]
    VideoCapture,
    #[serde(rename = "vr")]
    Vr,
    #[serde(rename = "wakeLockScreen")]
    WakeLockScreen,
    #[serde(rename = "wakeLockSystem")]
    WakeLockSystem,
    #[serde(rename = "webAppInstallation")]
    WebAppInstallation,
    #[serde(rename = "webPrinting")]
    WebPrinting,
    #[serde(rename = "windowManagement")]
    WindowManagement,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum PermissionSetting {
    #[serde(rename = "granted")]
    Granted,
    #[serde(rename = "denied")]
    Denied,
    #[serde(rename = "prompt")]
    Prompt,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum BrowserCommandId {
    #[serde(rename = "openTabSearch")]
    OpenTabSearch,
    #[serde(rename = "closeTabSearch")]
    CloseTabSearch,
    #[serde(rename = "openGlic")]
    OpenGlic,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum PrivacySandboxApi {
    #[serde(rename = "BiddingAndAuctionServices")]
    BiddingAndAuctionServices,
    #[serde(rename = "TrustedKeyValue")]
    TrustedKeyValue,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum SetDownloadBehaviorBehaviorOption {
    #[serde(rename = "deny")]
    Deny,
    #[serde(rename = "allow")]
    Allow,
    #[serde(rename = "allowAndName")]
    AllowAndName,
    #[serde(rename = "default")]
    Default,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub enum DownloadProgressStateOption {
    #[serde(rename = "inProgress")]
    InProgress,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "canceled")]
    Canceled,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Browser window bounds information"]
pub struct Bounds {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The offset from the left edge of the screen to the window in pixels."]
    pub left: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The offset from the top edge of the screen to the window in pixels."]
    pub top: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The window width in pixels."]
    pub width: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The window height in pixels."]
    pub height: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The window state. Default to normal."]
    pub window_state: Option<WindowState>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Definition of PermissionDescriptor defined in the Permissions API:\n <https://w3c.github.io/permissions/#dom-permissiondescriptor>."]
pub struct PermissionDescriptor {
    #[serde(default)]
    #[doc = "Name of permission.\n See <https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/permissions/permission_descriptor.idl> for valid permission names."]
    pub name: String,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "For \"midi\" permission, may also specify sysex control."]
    pub sysex: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "For \"push\" permission, may specify userVisibleOnly.\n Note that userVisibleOnly = true is the only currently supported type."]
    pub user_visible_only: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "For \"clipboard\" permission, may specify allowWithoutSanitization."]
    pub allow_without_sanitization: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "For \"fullscreen\" permission, must specify allowWithoutGesture:true."]
    pub allow_without_gesture: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "For \"camera\" permission, may specify panTiltZoom."]
    pub pan_tilt_zoom: Option<bool>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Chrome histogram bucket."]
pub struct Bucket {
    #[serde(default)]
    #[doc = "Minimum value (inclusive)."]
    pub low: JsUInt,
    #[serde(default)]
    #[doc = "Maximum value (exclusive)."]
    pub high: JsUInt,
    #[serde(default)]
    #[doc = "Number of samples."]
    pub count: JsUInt,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Chrome histogram."]
pub struct Histogram {
    #[serde(default)]
    #[doc = "Name."]
    pub name: String,
    #[serde(default)]
    #[doc = "Sum of sample values."]
    pub sum: JsUInt,
    #[serde(default)]
    #[doc = "Total number of samples."]
    pub count: JsUInt,
    #[doc = "Buckets."]
    pub buckets: Vec<Bucket>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Set permission settings for given embedding and embedded origins."]
pub struct SetPermission {
    #[doc = "Descriptor of permission to override."]
    pub permission: PermissionDescriptor,
    #[doc = "Setting of the permission."]
    pub setting: PermissionSetting,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Embedding origin the permission applies to, all origins if not specified."]
    pub origin: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Embedded origin the permission applies to. It is ignored unless the embedding origin is\n present and valid. If the embedding origin is provided but the embedded origin isn't, the\n embedding origin is used as the embedded origin."]
    pub embedded_origin: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Context to override. When omitted, default browser context is used."]
    pub browser_context_id: Option<BrowserContextId>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Grant specific permissions to the given origin and reject all others. Deprecated. Use\n setPermission instead."]
#[deprecated]
pub struct GrantPermissions {
    pub permissions: Vec<PermissionType>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Origin the permission applies to, all origins if not specified."]
    pub origin: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "BrowserContext to override permissions. When omitted, default browser context is used."]
    pub browser_context_id: Option<BrowserContextId>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Reset all permission management for all origins."]
pub struct ResetPermissions {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "BrowserContext to reset permissions. When omitted, default browser context is used."]
    pub browser_context_id: Option<BrowserContextId>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Set the behavior when downloading a file."]
pub struct SetDownloadBehavior {
    #[doc = "Whether to allow all or deny all download requests, or use default Chrome behavior if\n available (otherwise deny). |allowAndName| allows download and names files according to\n their download guids."]
    pub behavior: SetDownloadBehaviorBehaviorOption,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "BrowserContext to set download behavior. When omitted, default browser context is used."]
    pub browser_context_id: Option<BrowserContextId>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The default path to save downloaded files to. This is required if behavior is set to 'allow'\n or 'allowAndName'."]
    pub download_path: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether to emit download events (defaults to false)."]
    pub events_enabled: Option<bool>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Cancel a download if in progress"]
pub struct CancelDownload {
    #[serde(default)]
    #[doc = "Global unique identifier of the download."]
    pub guid: String,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "BrowserContext to perform the action in. When omitted, default browser context is used."]
    pub browser_context_id: Option<BrowserContextId>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct Close(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct Crash(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct CrashGpuProcess(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct GetVersion(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct GetBrowserCommandLine(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Get Chrome histograms."]
pub struct GetHistograms {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Requested substring in name. Only histograms which have query as a\n substring in their name are extracted. An empty or absent query returns\n all histograms."]
    pub query: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "If true, retrieve delta since last delta call."]
    pub delta: Option<bool>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Get a Chrome histogram by name."]
pub struct GetHistogram {
    #[serde(default)]
    #[doc = "Requested histogram name."]
    pub name: String,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "If true, retrieve delta since last delta call."]
    pub delta: Option<bool>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Get position and size of the browser window."]
pub struct GetWindowBounds {
    #[doc = "Browser window id."]
    pub window_id: WindowId,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Get the browser window that contains the devtools target."]
pub struct GetWindowForTarget {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Devtools agent host id. If called as a part of the session, associated targetId is used."]
    pub target_id: Option<target::TargetId>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Set position and/or size of the browser window."]
pub struct SetWindowBounds {
    #[doc = "Browser window id."]
    pub window_id: WindowId,
    #[doc = "New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined\n with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged."]
    pub bounds: Bounds,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Set size of the browser contents resizing browser window as necessary."]
pub struct SetContentsSize {
    #[doc = "Browser window id."]
    pub window_id: WindowId,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The window contents width in DIP. Assumes current width if omitted.\n Must be specified if 'height' is omitted."]
    pub width: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The window contents height in DIP. Assumes current height if omitted.\n Must be specified if 'width' is omitted."]
    pub height: Option<JsUInt>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Set dock tile details, platform-specific."]
pub struct SetDockTile {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub badge_label: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Png encoded image."]
    pub image: Option<Vec<u8>>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Invoke custom browser commands used by telemetry."]
pub struct ExecuteBrowserCommand {
    pub command_id: BrowserCommandId,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Allows a site to use privacy sandbox features that require enrollment\n without the site actually being enrolled. Only supported on page targets."]
pub struct AddPrivacySandboxEnrollmentOverride {
    #[serde(default)]
    pub url: String,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Configures encryption keys used with a given privacy sandbox API to talk\n to a trusted coordinator.  Since this is intended for test automation only,\n coordinatorOrigin must be a .test domain. No existing coordinator\n configuration for the origin may exist."]
pub struct AddPrivacySandboxCoordinatorKeyConfig {
    pub api: PrivacySandboxApi,
    #[serde(default)]
    pub coordinator_origin: String,
    #[serde(default)]
    pub key_config: String,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "BrowserContext to perform the action in. When omitted, default browser\n context is used."]
    pub browser_context_id: Option<BrowserContextId>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Set permission settings for given embedding and embedded origins."]
pub struct SetPermissionReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Grant specific permissions to the given origin and reject all others. Deprecated. Use\n setPermission instead."]
#[deprecated]
pub struct GrantPermissionsReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Reset all permission management for all origins."]
pub struct ResetPermissionsReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Set the behavior when downloading a file."]
pub struct SetDownloadBehaviorReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Cancel a download if in progress"]
pub struct CancelDownloadReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Close browser gracefully."]
pub struct CloseReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Crashes browser on the main thread."]
pub struct CrashReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Crashes GPU process."]
pub struct CrashGpuProcessReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Returns version information."]
pub struct GetVersionReturnObject {
    #[serde(default)]
    #[doc = "Protocol version."]
    pub protocol_version: String,
    #[serde(default)]
    #[doc = "Product name."]
    pub product: String,
    #[serde(default)]
    #[doc = "Product revision."]
    pub revision: String,
    #[serde(default)]
    #[doc = "User-Agent."]
    pub user_agent: String,
    #[serde(default)]
    #[doc = "V8 version."]
    pub js_version: String,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Returns the command line switches for the browser process if, and only if\n --enable-automation is on the commandline."]
pub struct GetBrowserCommandLineReturnObject {
    #[doc = "Commandline parameters"]
    pub arguments: Vec<String>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Get Chrome histograms."]
pub struct GetHistogramsReturnObject {
    #[doc = "Histograms."]
    pub histograms: Vec<Histogram>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Get a Chrome histogram by name."]
pub struct GetHistogramReturnObject {
    #[doc = "Histogram."]
    pub histogram: Histogram,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Get position and size of the browser window."]
pub struct GetWindowBoundsReturnObject {
    #[doc = "Bounds information of the window. When window state is 'minimized', the restored window\n position and size are returned."]
    pub bounds: Bounds,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Get the browser window that contains the devtools target."]
pub struct GetWindowForTargetReturnObject {
    #[doc = "Browser window id."]
    pub window_id: WindowId,
    #[doc = "Bounds information of the window. When window state is 'minimized', the restored window\n position and size are returned."]
    pub bounds: Bounds,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Set position and/or size of the browser window."]
pub struct SetWindowBoundsReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Set size of the browser contents resizing browser window as necessary."]
pub struct SetContentsSizeReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Set dock tile details, platform-specific."]
pub struct SetDockTileReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Invoke custom browser commands used by telemetry."]
pub struct ExecuteBrowserCommandReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Allows a site to use privacy sandbox features that require enrollment\n without the site actually being enrolled. Only supported on page targets."]
pub struct AddPrivacySandboxEnrollmentOverrideReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Configures encryption keys used with a given privacy sandbox API to talk\n to a trusted coordinator.  Since this is intended for test automation only,\n coordinatorOrigin must be a .test domain. No existing coordinator\n configuration for the origin may exist."]
pub struct AddPrivacySandboxCoordinatorKeyConfigReturnObject(pub Option<Json>);
#[allow(deprecated)]
impl Method for SetPermission {
    const NAME: &'static str = "Browser.setPermission";
    type ReturnObject = SetPermissionReturnObject;
}
#[allow(deprecated)]
impl Method for GrantPermissions {
    const NAME: &'static str = "Browser.grantPermissions";
    type ReturnObject = GrantPermissionsReturnObject;
}
#[allow(deprecated)]
impl Method for ResetPermissions {
    const NAME: &'static str = "Browser.resetPermissions";
    type ReturnObject = ResetPermissionsReturnObject;
}
#[allow(deprecated)]
impl Method for SetDownloadBehavior {
    const NAME: &'static str = "Browser.setDownloadBehavior";
    type ReturnObject = SetDownloadBehaviorReturnObject;
}
#[allow(deprecated)]
impl Method for CancelDownload {
    const NAME: &'static str = "Browser.cancelDownload";
    type ReturnObject = CancelDownloadReturnObject;
}
#[allow(deprecated)]
impl Method for Close {
    const NAME: &'static str = "Browser.close";
    type ReturnObject = CloseReturnObject;
}
#[allow(deprecated)]
impl Method for Crash {
    const NAME: &'static str = "Browser.crash";
    type ReturnObject = CrashReturnObject;
}
#[allow(deprecated)]
impl Method for CrashGpuProcess {
    const NAME: &'static str = "Browser.crashGpuProcess";
    type ReturnObject = CrashGpuProcessReturnObject;
}
#[allow(deprecated)]
impl Method for GetVersion {
    const NAME: &'static str = "Browser.getVersion";
    type ReturnObject = GetVersionReturnObject;
}
#[allow(deprecated)]
impl Method for GetBrowserCommandLine {
    const NAME: &'static str = "Browser.getBrowserCommandLine";
    type ReturnObject = GetBrowserCommandLineReturnObject;
}
#[allow(deprecated)]
impl Method for GetHistograms {
    const NAME: &'static str = "Browser.getHistograms";
    type ReturnObject = GetHistogramsReturnObject;
}
#[allow(deprecated)]
impl Method for GetHistogram {
    const NAME: &'static str = "Browser.getHistogram";
    type ReturnObject = GetHistogramReturnObject;
}
#[allow(deprecated)]
impl Method for GetWindowBounds {
    const NAME: &'static str = "Browser.getWindowBounds";
    type ReturnObject = GetWindowBoundsReturnObject;
}
#[allow(deprecated)]
impl Method for GetWindowForTarget {
    const NAME: &'static str = "Browser.getWindowForTarget";
    type ReturnObject = GetWindowForTargetReturnObject;
}
#[allow(deprecated)]
impl Method for SetWindowBounds {
    const NAME: &'static str = "Browser.setWindowBounds";
    type ReturnObject = SetWindowBoundsReturnObject;
}
#[allow(deprecated)]
impl Method for SetContentsSize {
    const NAME: &'static str = "Browser.setContentsSize";
    type ReturnObject = SetContentsSizeReturnObject;
}
#[allow(deprecated)]
impl Method for SetDockTile {
    const NAME: &'static str = "Browser.setDockTile";
    type ReturnObject = SetDockTileReturnObject;
}
#[allow(deprecated)]
impl Method for ExecuteBrowserCommand {
    const NAME: &'static str = "Browser.executeBrowserCommand";
    type ReturnObject = ExecuteBrowserCommandReturnObject;
}
#[allow(deprecated)]
impl Method for AddPrivacySandboxEnrollmentOverride {
    const NAME: &'static str = "Browser.addPrivacySandboxEnrollmentOverride";
    type ReturnObject = AddPrivacySandboxEnrollmentOverrideReturnObject;
}
#[allow(deprecated)]
impl Method for AddPrivacySandboxCoordinatorKeyConfig {
    const NAME: &'static str = "Browser.addPrivacySandboxCoordinatorKeyConfig";
    type ReturnObject = AddPrivacySandboxCoordinatorKeyConfigReturnObject;
}
#[allow(dead_code)]
pub mod events {
    #[allow(unused_imports)]
    use super::super::types::*;
    #[allow(unused_imports)]
    use derive_builder::Builder;
    #[allow(unused_imports)]
    use serde::{Deserialize, Serialize};
    #[allow(unused_imports)]
    use serde_json::Value as Json;
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
    pub struct DownloadWillBeginEvent {
        pub params: DownloadWillBeginEventParams,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
    #[serde(rename_all = "camelCase")]
    pub struct DownloadWillBeginEventParams {
        #[doc = "Id of the frame that caused the download to begin."]
        pub frame_id: super::super::page::FrameId,
        #[serde(default)]
        #[doc = "Global unique identifier of the download."]
        pub guid: String,
        #[serde(default)]
        #[doc = "URL of the resource being downloaded."]
        pub url: String,
        #[serde(default)]
        #[doc = "Suggested file name of the resource (the actual name of the file saved on disk may differ)."]
        pub suggested_filename: String,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
    pub struct DownloadProgressEvent {
        pub params: DownloadProgressEventParams,
    }
    #[allow(deprecated)]
    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
    #[serde(rename_all = "camelCase")]
    pub struct DownloadProgressEventParams {
        #[serde(default)]
        #[doc = "Global unique identifier of the download."]
        pub guid: String,
        #[serde(default)]
        #[doc = "Total expected bytes to download."]
        pub total_bytes: JsFloat,
        #[serde(default)]
        #[doc = "Total bytes received."]
        pub received_bytes: JsFloat,
        #[doc = "Download status."]
        pub state: super::DownloadProgressStateOption,
        #[builder(default)]
        #[serde(skip_serializing_if = "Option::is_none")]
        #[serde(default)]
        #[doc = "If download is \"completed\", provides the path of the downloaded file.\n Depending on the platform, it is not guaranteed to be set, nor the file\n is guaranteed to exist."]
        pub file_path: Option<String>,
    }
}