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
use serde::{Deserialize, Serialize};
#[doc = "Set permission settings for given embedding and embedded origins.\n[setPermission](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setPermission)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPermissionParams {
    #[doc = "Descriptor of permission to override."]
    #[serde(rename = "permission")]
    pub permission: super::types::PermissionDescriptor,
    #[doc = "Setting of the permission."]
    #[serde(rename = "setting")]
    pub setting: super::types::PermissionSetting,
    #[doc = "Embedding origin the permission applies to, all origins if not specified."]
    #[serde(rename = "origin")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub origin: Option<String>,
    #[doc = "Embedded origin the permission applies to. It is ignored unless the embedding origin is\npresent and valid. If the embedding origin is provided but the embedded origin isn't, the\nembedding origin is used as the embedded origin."]
    #[serde(rename = "embeddedOrigin")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub embedded_origin: Option<String>,
    #[doc = "Context to override. When omitted, default browser context is used."]
    #[serde(rename = "browserContextId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub browser_context_id: Option<Box<super::types::BrowserContextId>>,
}
impl SetPermissionParams {
    pub fn new(
        permission: impl Into<super::types::PermissionDescriptor>,
        setting: impl Into<super::types::PermissionSetting>,
    ) -> Self {
        Self {
            permission: permission.into(),
            setting: setting.into(),
            origin: None,
            embedded_origin: None,
            browser_context_id: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetPermissionMethod {
    #[serde(rename = "Browser.setPermission")]
    SetPermission,
}
#[doc = "Set permission settings for given embedding and embedded origins.\n[setPermission](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setPermission)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetPermission {
    pub method: SetPermissionMethod,
    pub params: SetPermissionParams,
}
impl SetPermission {
    pub const IDENTIFIER: &'static str = "Browser.setPermission";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetPermission {
    type Result = super::results::SetPermissionResult;
}
#[doc = "Reset all permission management for all origins.\n[resetPermissions](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-resetPermissions)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ResetPermissionsParams {
    #[doc = "BrowserContext to reset permissions. When omitted, default browser context is used."]
    #[serde(rename = "browserContextId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub browser_context_id: Option<Box<super::types::BrowserContextId>>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ResetPermissionsMethod {
    #[serde(rename = "Browser.resetPermissions")]
    ResetPermissions,
}
#[doc = "Reset all permission management for all origins.\n[resetPermissions](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-resetPermissions)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResetPermissions {
    pub method: ResetPermissionsMethod,
    pub params: ResetPermissionsParams,
}
impl ResetPermissions {
    pub const IDENTIFIER: &'static str = "Browser.resetPermissions";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ResetPermissions {
    type Result = super::results::ResetPermissionsResult;
}
#[doc = "Set the behavior when downloading a file.\n[setDownloadBehavior](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setDownloadBehavior)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDownloadBehaviorParams {
    #[doc = "Whether to allow all or deny all download requests, or use default Chrome behavior if\navailable (otherwise deny). |allowAndName| allows download and names files according to\ntheir download guids."]
    #[serde(rename = "behavior")]
    pub behavior: SetDownloadBehaviorBehavior,
    #[doc = "BrowserContext to set download behavior. When omitted, default browser context is used."]
    #[serde(rename = "browserContextId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub browser_context_id: Option<Box<super::types::BrowserContextId>>,
    #[doc = "The default path to save downloaded files to. This is required if behavior is set to 'allow'\nor 'allowAndName'."]
    #[serde(rename = "downloadPath")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub download_path: Option<String>,
    #[doc = "Whether to emit download events (defaults to false)."]
    #[serde(rename = "eventsEnabled")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub events_enabled: Option<bool>,
}
#[doc = "Whether to allow all or deny all download requests, or use default Chrome behavior if\navailable (otherwise deny). |allowAndName| allows download and names files according to\ntheir download guids."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SetDownloadBehaviorBehavior {
    #[serde(rename = "deny")]
    Deny,
    #[serde(rename = "allow")]
    Allow,
    #[serde(rename = "allowAndName")]
    AllowAndName,
    #[serde(rename = "default")]
    Default,
}
impl SetDownloadBehaviorParams {
    pub fn new(behavior: impl Into<SetDownloadBehaviorBehavior>) -> Self {
        Self {
            behavior: behavior.into(),
            browser_context_id: None,
            download_path: None,
            events_enabled: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDownloadBehaviorMethod {
    #[serde(rename = "Browser.setDownloadBehavior")]
    SetDownloadBehavior,
}
#[doc = "Set the behavior when downloading a file.\n[setDownloadBehavior](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setDownloadBehavior)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDownloadBehavior {
    pub method: SetDownloadBehaviorMethod,
    pub params: SetDownloadBehaviorParams,
}
impl SetDownloadBehavior {
    pub const IDENTIFIER: &'static str = "Browser.setDownloadBehavior";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDownloadBehavior {
    type Result = super::results::SetDownloadBehaviorResult;
}
#[doc = "Cancel a download if in progress\n[cancelDownload](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-cancelDownload)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CancelDownloadParams {
    #[doc = "Global unique identifier of the download."]
    #[serde(rename = "guid")]
    pub guid: String,
    #[doc = "BrowserContext to perform the action in. When omitted, default browser context is used."]
    #[serde(rename = "browserContextId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub browser_context_id: Option<Box<super::types::BrowserContextId>>,
}
impl CancelDownloadParams {
    pub fn new(guid: impl Into<String>) -> Self {
        Self {
            guid: guid.into(),
            browser_context_id: None,
        }
    }
}
impl<T: Into<String>> From<T> for CancelDownloadParams {
    fn from(url: T) -> Self {
        CancelDownloadParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum CancelDownloadMethod {
    #[serde(rename = "Browser.cancelDownload")]
    CancelDownload,
}
#[doc = "Cancel a download if in progress\n[cancelDownload](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-cancelDownload)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CancelDownload {
    pub method: CancelDownloadMethod,
    pub params: CancelDownloadParams,
}
impl CancelDownload {
    pub const IDENTIFIER: &'static str = "Browser.cancelDownload";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for CancelDownload {
    type Result = super::results::CancelDownloadResult;
}
#[doc = "Close browser gracefully.\n[close](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-close)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CloseParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum CloseMethod {
    #[serde(rename = "Browser.close")]
    Close,
}
#[doc = "Close browser gracefully.\n[close](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-close)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Close {
    pub method: CloseMethod,
    pub params: CloseParams,
}
impl Close {
    pub const IDENTIFIER: &'static str = "Browser.close";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for Close {
    type Result = super::results::CloseResult;
}
#[doc = "Crashes browser on the main thread.\n[crash](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-crash)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CrashParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum CrashMethod {
    #[serde(rename = "Browser.crash")]
    Crash,
}
#[doc = "Crashes browser on the main thread.\n[crash](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-crash)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Crash {
    pub method: CrashMethod,
    pub params: CrashParams,
}
impl Crash {
    pub const IDENTIFIER: &'static str = "Browser.crash";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for Crash {
    type Result = super::results::CrashResult;
}
#[doc = "Crashes GPU process.\n[crashGpuProcess](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-crashGpuProcess)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CrashGpuProcessParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum CrashGpuProcessMethod {
    #[serde(rename = "Browser.crashGpuProcess")]
    CrashGpuProcess,
}
#[doc = "Crashes GPU process.\n[crashGpuProcess](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-crashGpuProcess)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CrashGpuProcess {
    pub method: CrashGpuProcessMethod,
    pub params: CrashGpuProcessParams,
}
impl CrashGpuProcess {
    pub const IDENTIFIER: &'static str = "Browser.crashGpuProcess";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for CrashGpuProcess {
    type Result = super::results::CrashGpuProcessResult;
}
#[doc = "Returns version information.\n[getVersion](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getVersion)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetVersionParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetVersionMethod {
    #[serde(rename = "Browser.getVersion")]
    GetVersion,
}
#[doc = "Returns version information.\n[getVersion](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getVersion)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetVersion {
    pub method: GetVersionMethod,
    pub params: GetVersionParams,
}
impl GetVersion {
    pub const IDENTIFIER: &'static str = "Browser.getVersion";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetVersion {
    type Result = super::results::GetVersionResult;
}
#[doc = "Returns the command line switches for the browser process if, and only if\n--enable-automation is on the commandline.\n[getBrowserCommandLine](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getBrowserCommandLine)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetBrowserCommandLineParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetBrowserCommandLineMethod {
    #[serde(rename = "Browser.getBrowserCommandLine")]
    GetBrowserCommandLine,
}
#[doc = "Returns the command line switches for the browser process if, and only if\n--enable-automation is on the commandline.\n[getBrowserCommandLine](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getBrowserCommandLine)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetBrowserCommandLine {
    pub method: GetBrowserCommandLineMethod,
    pub params: GetBrowserCommandLineParams,
}
impl GetBrowserCommandLine {
    pub const IDENTIFIER: &'static str = "Browser.getBrowserCommandLine";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetBrowserCommandLine {
    type Result = super::results::GetBrowserCommandLineResult;
}
#[doc = "Get Chrome histograms.\n[getHistograms](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getHistograms)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct GetHistogramsParams {
    #[doc = "Requested substring in name. Only histograms which have query as a\nsubstring in their name are extracted. An empty or absent query returns\nall histograms."]
    #[serde(rename = "query")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub query: Option<String>,
    #[doc = "If true, retrieve delta since last delta call."]
    #[serde(rename = "delta")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub delta: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetHistogramsMethod {
    #[serde(rename = "Browser.getHistograms")]
    GetHistograms,
}
#[doc = "Get Chrome histograms.\n[getHistograms](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getHistograms)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetHistograms {
    pub method: GetHistogramsMethod,
    pub params: GetHistogramsParams,
}
impl GetHistograms {
    pub const IDENTIFIER: &'static str = "Browser.getHistograms";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetHistograms {
    type Result = super::results::GetHistogramsResult;
}
#[doc = "Get a Chrome histogram by name.\n[getHistogram](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getHistogram)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetHistogramParams {
    #[doc = "Requested histogram name."]
    #[serde(rename = "name")]
    pub name: String,
    #[doc = "If true, retrieve delta since last delta call."]
    #[serde(rename = "delta")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub delta: Option<bool>,
}
impl GetHistogramParams {
    pub fn new(name: impl Into<String>) -> Self {
        Self {
            name: name.into(),
            delta: None,
        }
    }
}
impl<T: Into<String>> From<T> for GetHistogramParams {
    fn from(url: T) -> Self {
        GetHistogramParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetHistogramMethod {
    #[serde(rename = "Browser.getHistogram")]
    GetHistogram,
}
#[doc = "Get a Chrome histogram by name.\n[getHistogram](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getHistogram)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetHistogram {
    pub method: GetHistogramMethod,
    pub params: GetHistogramParams,
}
impl GetHistogram {
    pub const IDENTIFIER: &'static str = "Browser.getHistogram";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetHistogram {
    type Result = super::results::GetHistogramResult;
}
#[doc = "Get position and size of the browser window.\n[getWindowBounds](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getWindowBounds)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetWindowBoundsParams {
    #[doc = "Browser window id."]
    #[serde(rename = "windowId")]
    pub window_id: super::types::WindowId,
}
impl GetWindowBoundsParams {
    pub fn new(window_id: impl Into<super::types::WindowId>) -> Self {
        Self {
            window_id: window_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetWindowBoundsMethod {
    #[serde(rename = "Browser.getWindowBounds")]
    GetWindowBounds,
}
#[doc = "Get position and size of the browser window.\n[getWindowBounds](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getWindowBounds)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetWindowBounds {
    pub method: GetWindowBoundsMethod,
    pub params: GetWindowBoundsParams,
}
impl GetWindowBounds {
    pub const IDENTIFIER: &'static str = "Browser.getWindowBounds";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetWindowBounds {
    type Result = super::results::GetWindowBoundsResult;
}
#[doc = "Get the browser window that contains the devtools target.\n[getWindowForTarget](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getWindowForTarget)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct GetWindowForTargetParams {
    #[doc = "Devtools agent host id. If called as a part of the session, associated targetId is used."]
    #[serde(rename = "targetId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub target_id: Option<crate::browser_protocol::target::types::TargetId>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum GetWindowForTargetMethod {
    #[serde(rename = "Browser.getWindowForTarget")]
    GetWindowForTarget,
}
#[doc = "Get the browser window that contains the devtools target.\n[getWindowForTarget](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-getWindowForTarget)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetWindowForTarget {
    pub method: GetWindowForTargetMethod,
    pub params: GetWindowForTargetParams,
}
impl GetWindowForTarget {
    pub const IDENTIFIER: &'static str = "Browser.getWindowForTarget";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for GetWindowForTarget {
    type Result = super::results::GetWindowForTargetResult;
}
#[doc = "Set position and/or size of the browser window.\n[setWindowBounds](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setWindowBounds)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetWindowBoundsParams {
    #[doc = "Browser window id."]
    #[serde(rename = "windowId")]
    pub window_id: super::types::WindowId,
    #[doc = "New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined\nwith 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged."]
    #[serde(rename = "bounds")]
    pub bounds: super::types::Bounds,
}
impl SetWindowBoundsParams {
    pub fn new(
        window_id: impl Into<super::types::WindowId>,
        bounds: impl Into<super::types::Bounds>,
    ) -> Self {
        Self {
            window_id: window_id.into(),
            bounds: bounds.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetWindowBoundsMethod {
    #[serde(rename = "Browser.setWindowBounds")]
    SetWindowBounds,
}
#[doc = "Set position and/or size of the browser window.\n[setWindowBounds](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setWindowBounds)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetWindowBounds {
    pub method: SetWindowBoundsMethod,
    pub params: SetWindowBoundsParams,
}
impl SetWindowBounds {
    pub const IDENTIFIER: &'static str = "Browser.setWindowBounds";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetWindowBounds {
    type Result = super::results::SetWindowBoundsResult;
}
#[doc = "Set size of the browser contents resizing browser window as necessary.\n[setContentsSize](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setContentsSize)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetContentsSizeParams {
    #[doc = "Browser window id."]
    #[serde(rename = "windowId")]
    pub window_id: super::types::WindowId,
    #[doc = "The window contents width in DIP. Assumes current width if omitted.\nMust be specified if 'height' is omitted."]
    #[serde(rename = "width")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub width: Option<i64>,
    #[doc = "The window contents height in DIP. Assumes current height if omitted.\nMust be specified if 'width' is omitted."]
    #[serde(rename = "height")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub height: Option<i64>,
}
impl SetContentsSizeParams {
    pub fn new(window_id: impl Into<super::types::WindowId>) -> Self {
        Self {
            window_id: window_id.into(),
            width: None,
            height: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetContentsSizeMethod {
    #[serde(rename = "Browser.setContentsSize")]
    SetContentsSize,
}
#[doc = "Set size of the browser contents resizing browser window as necessary.\n[setContentsSize](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setContentsSize)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetContentsSize {
    pub method: SetContentsSizeMethod,
    pub params: SetContentsSizeParams,
}
impl SetContentsSize {
    pub const IDENTIFIER: &'static str = "Browser.setContentsSize";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetContentsSize {
    type Result = super::results::SetContentsSizeResult;
}
#[doc = "Set dock tile details, platform-specific.\n[setDockTile](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setDockTile)"]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct SetDockTileParams {
    #[serde(rename = "badgeLabel")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub badge_label: Option<String>,
    #[doc = "Png encoded image."]
    #[serde(rename = "image")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub image: Option<crate::Binary>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetDockTileMethod {
    #[serde(rename = "Browser.setDockTile")]
    SetDockTile,
}
#[doc = "Set dock tile details, platform-specific.\n[setDockTile](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-setDockTile)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetDockTile {
    pub method: SetDockTileMethod,
    pub params: SetDockTileParams,
}
impl SetDockTile {
    pub const IDENTIFIER: &'static str = "Browser.setDockTile";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetDockTile {
    type Result = super::results::SetDockTileResult;
}
#[doc = "Invoke custom browser commands used by telemetry.\n[executeBrowserCommand](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-executeBrowserCommand)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ExecuteBrowserCommandParams {
    #[serde(rename = "commandId")]
    pub command_id: super::types::BrowserCommandId,
}
impl ExecuteBrowserCommandParams {
    pub fn new(command_id: impl Into<super::types::BrowserCommandId>) -> Self {
        Self {
            command_id: command_id.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ExecuteBrowserCommandMethod {
    #[serde(rename = "Browser.executeBrowserCommand")]
    ExecuteBrowserCommand,
}
#[doc = "Invoke custom browser commands used by telemetry.\n[executeBrowserCommand](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-executeBrowserCommand)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ExecuteBrowserCommand {
    pub method: ExecuteBrowserCommandMethod,
    pub params: ExecuteBrowserCommandParams,
}
impl ExecuteBrowserCommand {
    pub const IDENTIFIER: &'static str = "Browser.executeBrowserCommand";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ExecuteBrowserCommand {
    type Result = super::results::ExecuteBrowserCommandResult;
}
#[doc = "Allows a site to use privacy sandbox features that require enrollment\nwithout the site actually being enrolled. Only supported on page targets.\n[addPrivacySandboxEnrollmentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-addPrivacySandboxEnrollmentOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddPrivacySandboxEnrollmentOverrideParams {
    #[serde(rename = "url")]
    pub url: String,
}
impl AddPrivacySandboxEnrollmentOverrideParams {
    pub fn new(url: impl Into<String>) -> Self {
        Self { url: url.into() }
    }
}
impl<T: Into<String>> From<T> for AddPrivacySandboxEnrollmentOverrideParams {
    fn from(url: T) -> Self {
        AddPrivacySandboxEnrollmentOverrideParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AddPrivacySandboxEnrollmentOverrideMethod {
    #[serde(rename = "Browser.addPrivacySandboxEnrollmentOverride")]
    AddPrivacySandboxEnrollmentOverride,
}
#[doc = "Allows a site to use privacy sandbox features that require enrollment\nwithout the site actually being enrolled. Only supported on page targets.\n[addPrivacySandboxEnrollmentOverride](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-addPrivacySandboxEnrollmentOverride)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddPrivacySandboxEnrollmentOverride {
    pub method: AddPrivacySandboxEnrollmentOverrideMethod,
    pub params: AddPrivacySandboxEnrollmentOverrideParams,
}
impl AddPrivacySandboxEnrollmentOverride {
    pub const IDENTIFIER: &'static str = "Browser.addPrivacySandboxEnrollmentOverride";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for AddPrivacySandboxEnrollmentOverride {
    type Result = super::results::AddPrivacySandboxEnrollmentOverrideResult;
}
#[doc = "Configures encryption keys used with a given privacy sandbox API to talk\nto a trusted coordinator.  Since this is intended for test automation only,\ncoordinatorOrigin must be a .test domain. No existing coordinator\nconfiguration for the origin may exist.\n[addPrivacySandboxCoordinatorKeyConfig](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-addPrivacySandboxCoordinatorKeyConfig)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddPrivacySandboxCoordinatorKeyConfigParams {
    #[serde(rename = "api")]
    pub api: super::types::PrivacySandboxApi,
    #[serde(rename = "coordinatorOrigin")]
    pub coordinator_origin: String,
    #[serde(rename = "keyConfig")]
    pub key_config: String,
    #[doc = "BrowserContext to perform the action in. When omitted, default browser\ncontext is used."]
    #[serde(rename = "browserContextId")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub browser_context_id: Option<Box<super::types::BrowserContextId>>,
}
impl AddPrivacySandboxCoordinatorKeyConfigParams {
    pub fn new(
        api: impl Into<super::types::PrivacySandboxApi>,
        coordinator_origin: impl Into<String>,
        key_config: impl Into<String>,
    ) -> Self {
        Self {
            api: api.into(),
            coordinator_origin: coordinator_origin.into(),
            key_config: key_config.into(),
            browser_context_id: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AddPrivacySandboxCoordinatorKeyConfigMethod {
    #[serde(rename = "Browser.addPrivacySandboxCoordinatorKeyConfig")]
    AddPrivacySandboxCoordinatorKeyConfig,
}
#[doc = "Configures encryption keys used with a given privacy sandbox API to talk\nto a trusted coordinator.  Since this is intended for test automation only,\ncoordinatorOrigin must be a .test domain. No existing coordinator\nconfiguration for the origin may exist.\n[addPrivacySandboxCoordinatorKeyConfig](https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-addPrivacySandboxCoordinatorKeyConfig)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddPrivacySandboxCoordinatorKeyConfig {
    pub method: AddPrivacySandboxCoordinatorKeyConfigMethod,
    pub params: AddPrivacySandboxCoordinatorKeyConfigParams,
}
impl AddPrivacySandboxCoordinatorKeyConfig {
    pub const IDENTIFIER: &'static str = "Browser.addPrivacySandboxCoordinatorKeyConfig";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for AddPrivacySandboxCoordinatorKeyConfig {
    type Result = super::results::AddPrivacySandboxCoordinatorKeyConfigResult;
}
group_enum ! (BrowserCommands { SetPermission (SetPermission) , ResetPermissions (ResetPermissions) , SetDownloadBehavior (SetDownloadBehavior) , CancelDownload (CancelDownload) , Close (Close) , Crash (Crash) , CrashGpuProcess (CrashGpuProcess) , GetVersion (GetVersion) , GetBrowserCommandLine (GetBrowserCommandLine) , GetHistograms (GetHistograms) , GetHistogram (GetHistogram) , GetWindowBounds (GetWindowBounds) , GetWindowForTarget (GetWindowForTarget) , SetWindowBounds (SetWindowBounds) , SetContentsSize (SetContentsSize) , SetDockTile (SetDockTile) , ExecuteBrowserCommand (ExecuteBrowserCommand) , AddPrivacySandboxEnrollmentOverride (AddPrivacySandboxEnrollmentOverride) , AddPrivacySandboxCoordinatorKeyConfig (AddPrivacySandboxCoordinatorKeyConfig) } + identifiable);