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
use serde::{Deserialize, Serialize};
#[doc = "Dispatches a drag event into the page.\n[dispatchDragEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchDragEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchDragEventParams {
    #[doc = "Type of the drag event."]
    #[serde(rename = "type")]
    pub r#type: DispatchDragEventType,
    #[doc = "X coordinate of the event relative to the main frame's viewport in CSS pixels."]
    #[serde(rename = "x")]
    pub x: f64,
    #[doc = "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\nthe top of the viewport and Y increases as it proceeds towards the bottom of the viewport."]
    #[serde(rename = "y")]
    pub y: f64,
    #[serde(rename = "data")]
    pub data: super::types::DragData,
    #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0)."]
    #[serde(rename = "modifiers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub modifiers: Option<i64>,
}
#[doc = "Type of the drag event."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DispatchDragEventType {
    #[serde(rename = "dragEnter")]
    DragEnter,
    #[serde(rename = "dragOver")]
    DragOver,
    #[serde(rename = "drop")]
    Drop,
    #[serde(rename = "dragCancel")]
    DragCancel,
}
impl DispatchDragEventParams {
    pub fn new(
        r#type: impl Into<DispatchDragEventType>,
        x: impl Into<f64>,
        y: impl Into<f64>,
        data: impl Into<super::types::DragData>,
    ) -> Self {
        Self {
            r#type: r#type.into(),
            x: x.into(),
            y: y.into(),
            data: data.into(),
            modifiers: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum DispatchDragEventMethod {
    #[serde(rename = "Input.dispatchDragEvent")]
    DispatchDragEvent,
}
#[doc = "Dispatches a drag event into the page.\n[dispatchDragEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchDragEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchDragEvent {
    pub method: DispatchDragEventMethod,
    pub params: DispatchDragEventParams,
}
impl DispatchDragEvent {
    pub const IDENTIFIER: &'static str = "Input.dispatchDragEvent";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for DispatchDragEvent {
    type Result = super::results::DispatchDragEventResult;
}
#[doc = "Dispatches a key event to the page.\n[dispatchKeyEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchKeyEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchKeyEventParams {
    #[doc = "Type of the key event."]
    #[serde(rename = "type")]
    pub r#type: DispatchKeyEventType,
    #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0)."]
    #[serde(rename = "modifiers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub modifiers: Option<i64>,
    #[doc = "Time at which the event occurred."]
    #[serde(rename = "timestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub timestamp: Option<super::types::TimeSinceEpoch>,
    #[doc = "Text as generated by processing a virtual key code with a keyboard layout. Not needed for\nfor `keyUp` and `rawKeyDown` events (default: \"\")"]
    #[serde(rename = "text")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub text: Option<String>,
    #[doc = "Text that would have been generated by the keyboard if no modifiers were pressed (except for\nshift). Useful for shortcut (accelerator) key handling (default: \"\")."]
    #[serde(rename = "unmodifiedText")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub unmodified_text: Option<String>,
    #[doc = "Unique key identifier (e.g., 'U+0041') (default: \"\")."]
    #[serde(rename = "keyIdentifier")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub key_identifier: Option<String>,
    #[doc = "Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: \"\")."]
    #[serde(rename = "code")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub code: Option<String>,
    #[doc = "Unique DOM defined string value describing the meaning of the key in the context of active\nmodifiers, keyboard layout, etc (e.g., 'AltGr') (default: \"\")."]
    #[serde(rename = "key")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub key: Option<String>,
    #[doc = "Windows virtual key code (default: 0)."]
    #[serde(rename = "windowsVirtualKeyCode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub windows_virtual_key_code: Option<i64>,
    #[doc = "Native virtual key code (default: 0)."]
    #[serde(rename = "nativeVirtualKeyCode")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub native_virtual_key_code: Option<i64>,
    #[doc = "Whether the event was generated from auto repeat (default: false)."]
    #[serde(rename = "autoRepeat")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub auto_repeat: Option<bool>,
    #[doc = "Whether the event was generated from the keypad (default: false)."]
    #[serde(rename = "isKeypad")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub is_keypad: Option<bool>,
    #[doc = "Whether the event was a system key event (default: false)."]
    #[serde(rename = "isSystemKey")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub is_system_key: Option<bool>,
    #[doc = "Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default:\n0)."]
    #[serde(rename = "location")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub location: Option<i64>,
    #[doc = "Editing commands to send with the key event (e.g., 'selectAll') (default: []).\nThese are related to but not equal the command names used in `document.execCommand` and NSStandardKeyBindingResponding.\nSee https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names."]
    #[serde(rename = "commands")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub commands: Option<Vec<String>>,
}
#[doc = "Type of the key event."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DispatchKeyEventType {
    #[serde(rename = "keyDown")]
    KeyDown,
    #[serde(rename = "keyUp")]
    KeyUp,
    #[serde(rename = "rawKeyDown")]
    RawKeyDown,
    #[serde(rename = "char")]
    Char,
}
impl DispatchKeyEventParams {
    pub fn new(r#type: impl Into<DispatchKeyEventType>) -> Self {
        Self {
            r#type: r#type.into(),
            modifiers: None,
            timestamp: None,
            text: None,
            unmodified_text: None,
            key_identifier: None,
            code: None,
            key: None,
            windows_virtual_key_code: None,
            native_virtual_key_code: None,
            auto_repeat: None,
            is_keypad: None,
            is_system_key: None,
            location: None,
            commands: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum DispatchKeyEventMethod {
    #[serde(rename = "Input.dispatchKeyEvent")]
    DispatchKeyEvent,
}
#[doc = "Dispatches a key event to the page.\n[dispatchKeyEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchKeyEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchKeyEvent {
    pub method: DispatchKeyEventMethod,
    pub params: DispatchKeyEventParams,
}
impl DispatchKeyEvent {
    pub const IDENTIFIER: &'static str = "Input.dispatchKeyEvent";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for DispatchKeyEvent {
    type Result = super::results::DispatchKeyEventResult;
}
#[doc = "This method emulates inserting text that doesn't come from a key press,\nfor example an emoji keyboard or an IME.\n[insertText](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-insertText)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InsertTextParams {
    #[doc = "The text to insert."]
    #[serde(rename = "text")]
    pub text: String,
}
impl InsertTextParams {
    pub fn new(text: impl Into<String>) -> Self {
        Self { text: text.into() }
    }
}
impl<T: Into<String>> From<T> for InsertTextParams {
    fn from(url: T) -> Self {
        InsertTextParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum InsertTextMethod {
    #[serde(rename = "Input.insertText")]
    InsertText,
}
#[doc = "This method emulates inserting text that doesn't come from a key press,\nfor example an emoji keyboard or an IME.\n[insertText](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-insertText)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InsertText {
    pub method: InsertTextMethod,
    pub params: InsertTextParams,
}
impl InsertText {
    pub const IDENTIFIER: &'static str = "Input.insertText";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for InsertText {
    type Result = super::results::InsertTextResult;
}
#[doc = "This method sets the current candidate text for IME.\nUse imeCommitComposition to commit the final text.\nUse imeSetComposition with empty string as text to cancel composition.\n[imeSetComposition](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-imeSetComposition)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ImeSetCompositionParams {
    #[doc = "The text to insert"]
    #[serde(rename = "text")]
    pub text: String,
    #[doc = "selection start"]
    #[serde(rename = "selectionStart")]
    pub selection_start: i64,
    #[doc = "selection end"]
    #[serde(rename = "selectionEnd")]
    pub selection_end: i64,
    #[doc = "replacement start"]
    #[serde(rename = "replacementStart")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub replacement_start: Option<i64>,
    #[doc = "replacement end"]
    #[serde(rename = "replacementEnd")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub replacement_end: Option<i64>,
}
impl ImeSetCompositionParams {
    pub fn new(
        text: impl Into<String>,
        selection_start: impl Into<i64>,
        selection_end: impl Into<i64>,
    ) -> Self {
        Self {
            text: text.into(),
            selection_start: selection_start.into(),
            selection_end: selection_end.into(),
            replacement_start: None,
            replacement_end: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum ImeSetCompositionMethod {
    #[serde(rename = "Input.imeSetComposition")]
    ImeSetComposition,
}
#[doc = "This method sets the current candidate text for IME.\nUse imeCommitComposition to commit the final text.\nUse imeSetComposition with empty string as text to cancel composition.\n[imeSetComposition](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-imeSetComposition)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ImeSetComposition {
    pub method: ImeSetCompositionMethod,
    pub params: ImeSetCompositionParams,
}
impl ImeSetComposition {
    pub const IDENTIFIER: &'static str = "Input.imeSetComposition";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for ImeSetComposition {
    type Result = super::results::ImeSetCompositionResult;
}
#[doc = "Dispatches a mouse event to the page.\n[dispatchMouseEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchMouseEventParams {
    #[doc = "Type of the mouse event."]
    #[serde(rename = "type")]
    pub r#type: DispatchMouseEventType,
    #[doc = "X coordinate of the event relative to the main frame's viewport in CSS pixels."]
    #[serde(rename = "x")]
    pub x: f64,
    #[doc = "Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to\nthe top of the viewport and Y increases as it proceeds towards the bottom of the viewport."]
    #[serde(rename = "y")]
    pub y: f64,
    #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0)."]
    #[serde(rename = "modifiers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub modifiers: Option<i64>,
    #[doc = "Time at which the event occurred."]
    #[serde(rename = "timestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub timestamp: Option<super::types::TimeSinceEpoch>,
    #[doc = "Mouse button (default: \"none\")."]
    #[serde(rename = "button")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub button: Option<super::types::MouseButton>,
    #[doc = "A number indicating which buttons are pressed on the mouse when a mouse event is triggered.\nLeft=1, Right=2, Middle=4, Back=8, Forward=16, None=0."]
    #[serde(rename = "buttons")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub buttons: Option<i64>,
    #[doc = "Number of times the mouse button was clicked (default: 0)."]
    #[serde(rename = "clickCount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub click_count: Option<i64>,
    #[doc = "The normalized pressure, which has a range of [0,1] (default: 0)."]
    #[serde(rename = "force")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub force: Option<f64>,
    #[doc = "The normalized tangential pressure, which has a range of [-1,1] (default: 0)."]
    #[serde(rename = "tangentialPressure")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub tangential_pressure: Option<f64>,
    #[doc = "The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0)."]
    #[serde(rename = "tiltX")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub tilt_x: Option<f64>,
    #[doc = "The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0)."]
    #[serde(rename = "tiltY")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub tilt_y: Option<f64>,
    #[doc = "The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0)."]
    #[serde(rename = "twist")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub twist: Option<i64>,
    #[doc = "X delta in CSS pixels for mouse wheel event (default: 0)."]
    #[serde(rename = "deltaX")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub delta_x: Option<f64>,
    #[doc = "Y delta in CSS pixels for mouse wheel event (default: 0)."]
    #[serde(rename = "deltaY")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub delta_y: Option<f64>,
    #[doc = "Pointer type (default: \"mouse\")."]
    #[serde(rename = "pointerType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub pointer_type: Option<DispatchMouseEventPointerType>,
}
#[doc = "Type of the mouse event."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DispatchMouseEventType {
    #[serde(rename = "mousePressed")]
    MousePressed,
    #[serde(rename = "mouseReleased")]
    MouseReleased,
    #[serde(rename = "mouseMoved")]
    MouseMoved,
    #[serde(rename = "mouseWheel")]
    MouseWheel,
}
#[doc = "Pointer type (default: \"mouse\")."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DispatchMouseEventPointerType {
    #[serde(rename = "mouse")]
    Mouse,
    #[serde(rename = "pen")]
    Pen,
}
impl DispatchMouseEventParams {
    pub fn new(
        r#type: impl Into<DispatchMouseEventType>,
        x: impl Into<f64>,
        y: impl Into<f64>,
    ) -> Self {
        Self {
            r#type: r#type.into(),
            x: x.into(),
            y: y.into(),
            modifiers: None,
            timestamp: None,
            button: None,
            buttons: None,
            click_count: None,
            force: None,
            tangential_pressure: None,
            tilt_x: None,
            tilt_y: None,
            twist: None,
            delta_x: None,
            delta_y: None,
            pointer_type: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum DispatchMouseEventMethod {
    #[serde(rename = "Input.dispatchMouseEvent")]
    DispatchMouseEvent,
}
#[doc = "Dispatches a mouse event to the page.\n[dispatchMouseEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchMouseEvent {
    pub method: DispatchMouseEventMethod,
    pub params: DispatchMouseEventParams,
}
impl DispatchMouseEvent {
    pub const IDENTIFIER: &'static str = "Input.dispatchMouseEvent";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for DispatchMouseEvent {
    type Result = super::results::DispatchMouseEventResult;
}
#[doc = "Dispatches a touch event to the page.\n[dispatchTouchEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchTouchEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchTouchEventParams {
    #[doc = "Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while\nTouchStart and TouchMove must contains at least one."]
    #[serde(rename = "type")]
    pub r#type: DispatchTouchEventType,
    #[doc = "Active touch points on the touch device. One event per any changed point (compared to\nprevious touch event in a sequence) is generated, emulating pressing/moving/releasing points\none by one."]
    #[serde(rename = "touchPoints")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub touch_points: Vec<super::types::TouchPoint>,
    #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0)."]
    #[serde(rename = "modifiers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub modifiers: Option<i64>,
    #[doc = "Time at which the event occurred."]
    #[serde(rename = "timestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub timestamp: Option<super::types::TimeSinceEpoch>,
}
#[doc = "Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while\nTouchStart and TouchMove must contains at least one."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DispatchTouchEventType {
    #[serde(rename = "touchStart")]
    TouchStart,
    #[serde(rename = "touchEnd")]
    TouchEnd,
    #[serde(rename = "touchMove")]
    TouchMove,
    #[serde(rename = "touchCancel")]
    TouchCancel,
}
impl DispatchTouchEventParams {
    pub fn new(
        r#type: impl Into<DispatchTouchEventType>,
        touch_points: Vec<super::types::TouchPoint>,
    ) -> Self {
        Self {
            r#type: r#type.into(),
            touch_points,
            modifiers: None,
            timestamp: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum DispatchTouchEventMethod {
    #[serde(rename = "Input.dispatchTouchEvent")]
    DispatchTouchEvent,
}
#[doc = "Dispatches a touch event to the page.\n[dispatchTouchEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchTouchEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DispatchTouchEvent {
    pub method: DispatchTouchEventMethod,
    pub params: DispatchTouchEventParams,
}
impl DispatchTouchEvent {
    pub const IDENTIFIER: &'static str = "Input.dispatchTouchEvent";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for DispatchTouchEvent {
    type Result = super::results::DispatchTouchEventResult;
}
#[doc = "Cancels any active dragging in the page.\n[cancelDragging](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-cancelDragging)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CancelDraggingParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum CancelDraggingMethod {
    #[serde(rename = "Input.cancelDragging")]
    CancelDragging,
}
#[doc = "Cancels any active dragging in the page.\n[cancelDragging](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-cancelDragging)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CancelDragging {
    pub method: CancelDraggingMethod,
    pub params: CancelDraggingParams,
}
impl CancelDragging {
    pub const IDENTIFIER: &'static str = "Input.cancelDragging";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for CancelDragging {
    type Result = super::results::CancelDraggingResult;
}
#[doc = "Emulates touch event from the mouse event parameters.\n[emulateTouchFromMouseEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-emulateTouchFromMouseEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EmulateTouchFromMouseEventParams {
    #[doc = "Type of the mouse event."]
    #[serde(rename = "type")]
    pub r#type: EmulateTouchFromMouseEventType,
    #[doc = "X coordinate of the mouse pointer in DIP."]
    #[serde(rename = "x")]
    pub x: i64,
    #[doc = "Y coordinate of the mouse pointer in DIP."]
    #[serde(rename = "y")]
    pub y: i64,
    #[doc = "Mouse button. Only \"none\", \"left\", \"right\" are supported."]
    #[serde(rename = "button")]
    pub button: super::types::MouseButton,
    #[doc = "Time at which the event occurred (default: current time)."]
    #[serde(rename = "timestamp")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub timestamp: Option<super::types::TimeSinceEpoch>,
    #[doc = "X delta in DIP for mouse wheel event (default: 0)."]
    #[serde(rename = "deltaX")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub delta_x: Option<f64>,
    #[doc = "Y delta in DIP for mouse wheel event (default: 0)."]
    #[serde(rename = "deltaY")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub delta_y: Option<f64>,
    #[doc = "Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8\n(default: 0)."]
    #[serde(rename = "modifiers")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub modifiers: Option<i64>,
    #[doc = "Number of times the mouse button was clicked (default: 0)."]
    #[serde(rename = "clickCount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub click_count: Option<i64>,
}
#[doc = "Type of the mouse event."]
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum EmulateTouchFromMouseEventType {
    #[serde(rename = "mousePressed")]
    MousePressed,
    #[serde(rename = "mouseReleased")]
    MouseReleased,
    #[serde(rename = "mouseMoved")]
    MouseMoved,
    #[serde(rename = "mouseWheel")]
    MouseWheel,
}
impl EmulateTouchFromMouseEventParams {
    pub fn new(
        r#type: impl Into<EmulateTouchFromMouseEventType>,
        x: impl Into<i64>,
        y: impl Into<i64>,
        button: impl Into<super::types::MouseButton>,
    ) -> Self {
        Self {
            r#type: r#type.into(),
            x: x.into(),
            y: y.into(),
            button: button.into(),
            timestamp: None,
            delta_x: None,
            delta_y: None,
            modifiers: None,
            click_count: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum EmulateTouchFromMouseEventMethod {
    #[serde(rename = "Input.emulateTouchFromMouseEvent")]
    EmulateTouchFromMouseEvent,
}
#[doc = "Emulates touch event from the mouse event parameters.\n[emulateTouchFromMouseEvent](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-emulateTouchFromMouseEvent)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EmulateTouchFromMouseEvent {
    pub method: EmulateTouchFromMouseEventMethod,
    pub params: EmulateTouchFromMouseEventParams,
}
impl EmulateTouchFromMouseEvent {
    pub const IDENTIFIER: &'static str = "Input.emulateTouchFromMouseEvent";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for EmulateTouchFromMouseEvent {
    type Result = super::results::EmulateTouchFromMouseEventResult;
}
#[doc = "Ignores input events (useful while auditing page).\n[setIgnoreInputEvents](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-setIgnoreInputEvents)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetIgnoreInputEventsParams {
    #[doc = "Ignores input events processing when set to true."]
    #[serde(rename = "ignore")]
    pub ignore: bool,
}
impl SetIgnoreInputEventsParams {
    pub fn new(ignore: impl Into<bool>) -> Self {
        Self {
            ignore: ignore.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetIgnoreInputEventsMethod {
    #[serde(rename = "Input.setIgnoreInputEvents")]
    SetIgnoreInputEvents,
}
#[doc = "Ignores input events (useful while auditing page).\n[setIgnoreInputEvents](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-setIgnoreInputEvents)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetIgnoreInputEvents {
    pub method: SetIgnoreInputEventsMethod,
    pub params: SetIgnoreInputEventsParams,
}
impl SetIgnoreInputEvents {
    pub const IDENTIFIER: &'static str = "Input.setIgnoreInputEvents";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetIgnoreInputEvents {
    type Result = super::results::SetIgnoreInputEventsResult;
}
#[doc = "Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events.\nDrag and drop behavior can be directly controlled via `Input.dispatchDragEvent`.\n[setInterceptDrags](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-setInterceptDrags)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetInterceptDragsParams {
    #[serde(rename = "enabled")]
    pub enabled: bool,
}
impl SetInterceptDragsParams {
    pub fn new(enabled: impl Into<bool>) -> Self {
        Self {
            enabled: enabled.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetInterceptDragsMethod {
    #[serde(rename = "Input.setInterceptDrags")]
    SetInterceptDrags,
}
#[doc = "Prevents default drag and drop behavior and instead emits `Input.dragIntercepted` events.\nDrag and drop behavior can be directly controlled via `Input.dispatchDragEvent`.\n[setInterceptDrags](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-setInterceptDrags)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetInterceptDrags {
    pub method: SetInterceptDragsMethod,
    pub params: SetInterceptDragsParams,
}
impl SetInterceptDrags {
    pub const IDENTIFIER: &'static str = "Input.setInterceptDrags";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetInterceptDrags {
    type Result = super::results::SetInterceptDragsResult;
}
#[doc = "Synthesizes a pinch gesture over a time period by issuing appropriate touch events.\n[synthesizePinchGesture](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizePinchGesture)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SynthesizePinchGestureParams {
    #[doc = "X coordinate of the start of the gesture in CSS pixels."]
    #[serde(rename = "x")]
    pub x: f64,
    #[doc = "Y coordinate of the start of the gesture in CSS pixels."]
    #[serde(rename = "y")]
    pub y: f64,
    #[doc = "Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out)."]
    #[serde(rename = "scaleFactor")]
    pub scale_factor: f64,
    #[doc = "Relative pointer speed in pixels per second (default: 800)."]
    #[serde(rename = "relativeSpeed")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub relative_speed: Option<i64>,
    #[doc = "Which type of input events to be generated (default: 'default', which queries the platform\nfor the preferred input type)."]
    #[serde(rename = "gestureSourceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub gesture_source_type: Option<super::types::GestureSourceType>,
}
impl SynthesizePinchGestureParams {
    pub fn new(x: impl Into<f64>, y: impl Into<f64>, scale_factor: impl Into<f64>) -> Self {
        Self {
            x: x.into(),
            y: y.into(),
            scale_factor: scale_factor.into(),
            relative_speed: None,
            gesture_source_type: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SynthesizePinchGestureMethod {
    #[serde(rename = "Input.synthesizePinchGesture")]
    SynthesizePinchGesture,
}
#[doc = "Synthesizes a pinch gesture over a time period by issuing appropriate touch events.\n[synthesizePinchGesture](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizePinchGesture)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SynthesizePinchGesture {
    pub method: SynthesizePinchGestureMethod,
    pub params: SynthesizePinchGestureParams,
}
impl SynthesizePinchGesture {
    pub const IDENTIFIER: &'static str = "Input.synthesizePinchGesture";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SynthesizePinchGesture {
    type Result = super::results::SynthesizePinchGestureResult;
}
#[doc = "Synthesizes a scroll gesture over a time period by issuing appropriate touch events.\n[synthesizeScrollGesture](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeScrollGesture)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SynthesizeScrollGestureParams {
    #[doc = "X coordinate of the start of the gesture in CSS pixels."]
    #[serde(rename = "x")]
    pub x: f64,
    #[doc = "Y coordinate of the start of the gesture in CSS pixels."]
    #[serde(rename = "y")]
    pub y: f64,
    #[doc = "The distance to scroll along the X axis (positive to scroll left)."]
    #[serde(rename = "xDistance")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub x_distance: Option<f64>,
    #[doc = "The distance to scroll along the Y axis (positive to scroll up)."]
    #[serde(rename = "yDistance")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub y_distance: Option<f64>,
    #[doc = "The number of additional pixels to scroll back along the X axis, in addition to the given\ndistance."]
    #[serde(rename = "xOverscroll")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub x_overscroll: Option<f64>,
    #[doc = "The number of additional pixels to scroll back along the Y axis, in addition to the given\ndistance."]
    #[serde(rename = "yOverscroll")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub y_overscroll: Option<f64>,
    #[doc = "Prevent fling (default: true)."]
    #[serde(rename = "preventFling")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub prevent_fling: Option<bool>,
    #[doc = "Swipe speed in pixels per second (default: 800)."]
    #[serde(rename = "speed")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub speed: Option<i64>,
    #[doc = "Which type of input events to be generated (default: 'default', which queries the platform\nfor the preferred input type)."]
    #[serde(rename = "gestureSourceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub gesture_source_type: Option<super::types::GestureSourceType>,
    #[doc = "The number of times to repeat the gesture (default: 0)."]
    #[serde(rename = "repeatCount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub repeat_count: Option<i64>,
    #[doc = "The number of milliseconds delay between each repeat. (default: 250)."]
    #[serde(rename = "repeatDelayMs")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub repeat_delay_ms: Option<i64>,
    #[doc = "The name of the interaction markers to generate, if not empty (default: \"\")."]
    #[serde(rename = "interactionMarkerName")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub interaction_marker_name: Option<String>,
}
impl SynthesizeScrollGestureParams {
    pub fn new(x: impl Into<f64>, y: impl Into<f64>) -> Self {
        Self {
            x: x.into(),
            y: y.into(),
            x_distance: None,
            y_distance: None,
            x_overscroll: None,
            y_overscroll: None,
            prevent_fling: None,
            speed: None,
            gesture_source_type: None,
            repeat_count: None,
            repeat_delay_ms: None,
            interaction_marker_name: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SynthesizeScrollGestureMethod {
    #[serde(rename = "Input.synthesizeScrollGesture")]
    SynthesizeScrollGesture,
}
#[doc = "Synthesizes a scroll gesture over a time period by issuing appropriate touch events.\n[synthesizeScrollGesture](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeScrollGesture)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SynthesizeScrollGesture {
    pub method: SynthesizeScrollGestureMethod,
    pub params: SynthesizeScrollGestureParams,
}
impl SynthesizeScrollGesture {
    pub const IDENTIFIER: &'static str = "Input.synthesizeScrollGesture";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SynthesizeScrollGesture {
    type Result = super::results::SynthesizeScrollGestureResult;
}
#[doc = "Synthesizes a tap gesture over a time period by issuing appropriate touch events.\n[synthesizeTapGesture](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeTapGesture)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SynthesizeTapGestureParams {
    #[doc = "X coordinate of the start of the gesture in CSS pixels."]
    #[serde(rename = "x")]
    pub x: f64,
    #[doc = "Y coordinate of the start of the gesture in CSS pixels."]
    #[serde(rename = "y")]
    pub y: f64,
    #[doc = "Duration between touchdown and touchup events in ms (default: 50)."]
    #[serde(rename = "duration")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub duration: Option<i64>,
    #[doc = "Number of times to perform the tap (e.g. 2 for double tap, default: 1)."]
    #[serde(rename = "tapCount")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub tap_count: Option<i64>,
    #[doc = "Which type of input events to be generated (default: 'default', which queries the platform\nfor the preferred input type)."]
    #[serde(rename = "gestureSourceType")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub gesture_source_type: Option<super::types::GestureSourceType>,
}
impl SynthesizeTapGestureParams {
    pub fn new(x: impl Into<f64>, y: impl Into<f64>) -> Self {
        Self {
            x: x.into(),
            y: y.into(),
            duration: None,
            tap_count: None,
            gesture_source_type: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SynthesizeTapGestureMethod {
    #[serde(rename = "Input.synthesizeTapGesture")]
    SynthesizeTapGesture,
}
#[doc = "Synthesizes a tap gesture over a time period by issuing appropriate touch events.\n[synthesizeTapGesture](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-synthesizeTapGesture)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SynthesizeTapGesture {
    pub method: SynthesizeTapGestureMethod,
    pub params: SynthesizeTapGestureParams,
}
impl SynthesizeTapGesture {
    pub const IDENTIFIER: &'static str = "Input.synthesizeTapGesture";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SynthesizeTapGesture {
    type Result = super::results::SynthesizeTapGestureResult;
}
group_enum ! (InputCommands { DispatchDragEvent (DispatchDragEvent) , DispatchKeyEvent (DispatchKeyEvent) , InsertText (InsertText) , ImeSetComposition (ImeSetComposition) , DispatchMouseEvent (DispatchMouseEvent) , DispatchTouchEvent (DispatchTouchEvent) , CancelDragging (CancelDragging) , EmulateTouchFromMouseEvent (EmulateTouchFromMouseEvent) , SetIgnoreInputEvents (SetIgnoreInputEvents) , SetInterceptDrags (SetInterceptDrags) , SynthesizePinchGesture (SynthesizePinchGesture) , SynthesizeScrollGesture (SynthesizeScrollGesture) , SynthesizeTapGesture (SynthesizeTapGesture) } + identifiable);