1use serde::{Serialize, Deserialize};
5use serde_json::Value as JsonValue;
6use std::borrow::Cow;
7
8
9#[derive(Debug, Clone, Serialize, Deserialize, Default)]
10#[serde(rename_all = "camelCase")]
11pub struct SafeAreaInsets {
12 #[serde(skip_serializing_if = "Option::is_none")]
14 top: Option<i64>,
15 #[serde(skip_serializing_if = "Option::is_none", rename = "topMax")]
17 top_max: Option<i64>,
18 #[serde(skip_serializing_if = "Option::is_none")]
20 left: Option<i64>,
21 #[serde(skip_serializing_if = "Option::is_none", rename = "leftMax")]
23 left_max: Option<i64>,
24 #[serde(skip_serializing_if = "Option::is_none")]
26 bottom: Option<i64>,
27 #[serde(skip_serializing_if = "Option::is_none", rename = "bottomMax")]
29 bottom_max: Option<i64>,
30 #[serde(skip_serializing_if = "Option::is_none")]
32 right: Option<i64>,
33 #[serde(skip_serializing_if = "Option::is_none", rename = "rightMax")]
35 right_max: Option<i64>,
36}
37
38impl SafeAreaInsets {
39 pub fn builder() -> SafeAreaInsetsBuilder {
41 SafeAreaInsetsBuilder {
42 top: None,
43 top_max: None,
44 left: None,
45 left_max: None,
46 bottom: None,
47 bottom_max: None,
48 right: None,
49 right_max: None,
50 }
51 }
52 pub fn top(&self) -> Option<i64> { self.top }
54 pub fn top_max(&self) -> Option<i64> { self.top_max }
56 pub fn left(&self) -> Option<i64> { self.left }
58 pub fn left_max(&self) -> Option<i64> { self.left_max }
60 pub fn bottom(&self) -> Option<i64> { self.bottom }
62 pub fn bottom_max(&self) -> Option<i64> { self.bottom_max }
64 pub fn right(&self) -> Option<i64> { self.right }
66 pub fn right_max(&self) -> Option<i64> { self.right_max }
68}
69
70#[derive(Default)]
71pub struct SafeAreaInsetsBuilder {
72 top: Option<i64>,
73 top_max: Option<i64>,
74 left: Option<i64>,
75 left_max: Option<i64>,
76 bottom: Option<i64>,
77 bottom_max: Option<i64>,
78 right: Option<i64>,
79 right_max: Option<i64>,
80}
81
82impl SafeAreaInsetsBuilder {
83 pub fn top(mut self, top: i64) -> Self { self.top = Some(top); self }
85 pub fn top_max(mut self, top_max: i64) -> Self { self.top_max = Some(top_max); self }
87 pub fn left(mut self, left: i64) -> Self { self.left = Some(left); self }
89 pub fn left_max(mut self, left_max: i64) -> Self { self.left_max = Some(left_max); self }
91 pub fn bottom(mut self, bottom: i64) -> Self { self.bottom = Some(bottom); self }
93 pub fn bottom_max(mut self, bottom_max: i64) -> Self { self.bottom_max = Some(bottom_max); self }
95 pub fn right(mut self, right: i64) -> Self { self.right = Some(right); self }
97 pub fn right_max(mut self, right_max: i64) -> Self { self.right_max = Some(right_max); self }
99 pub fn build(self) -> SafeAreaInsets {
100 SafeAreaInsets {
101 top: self.top,
102 top_max: self.top_max,
103 left: self.left,
104 left_max: self.left_max,
105 bottom: self.bottom,
106 bottom_max: self.bottom_max,
107 right: self.right,
108 right_max: self.right_max,
109 }
110 }
111}
112
113#[derive(Debug, Clone, Serialize, Deserialize, Default)]
116#[serde(rename_all = "camelCase")]
117pub struct ScreenOrientation<'a> {
118 #[serde(rename = "type")]
120 type_: Cow<'a, str>,
121 angle: i64,
123}
124
125impl<'a> ScreenOrientation<'a> {
126 pub fn builder(type_: impl Into<Cow<'a, str>>, angle: i64) -> ScreenOrientationBuilder<'a> {
130 ScreenOrientationBuilder {
131 type_: type_.into(),
132 angle: angle,
133 }
134 }
135 pub fn type_(&self) -> &str { self.type_.as_ref() }
137 pub fn angle(&self) -> i64 { self.angle }
139}
140
141
142pub struct ScreenOrientationBuilder<'a> {
143 type_: Cow<'a, str>,
144 angle: i64,
145}
146
147impl<'a> ScreenOrientationBuilder<'a> {
148 pub fn build(self) -> ScreenOrientation<'a> {
149 ScreenOrientation {
150 type_: self.type_,
151 angle: self.angle,
152 }
153 }
154}
155
156
157#[derive(Debug, Clone, Serialize, Deserialize, Default)]
158#[serde(rename_all = "camelCase")]
159pub struct DisplayFeature<'a> {
160 orientation: Cow<'a, str>,
162 offset: i32,
165 #[serde(rename = "maskLength")]
169 mask_length: u64,
170}
171
172impl<'a> DisplayFeature<'a> {
173 pub fn builder(orientation: impl Into<Cow<'a, str>>, offset: i32, mask_length: u64) -> DisplayFeatureBuilder<'a> {
178 DisplayFeatureBuilder {
179 orientation: orientation.into(),
180 offset: offset,
181 mask_length: mask_length,
182 }
183 }
184 pub fn orientation(&self) -> &str { self.orientation.as_ref() }
186 pub fn offset(&self) -> i32 { self.offset }
189 pub fn mask_length(&self) -> u64 { self.mask_length }
193}
194
195
196pub struct DisplayFeatureBuilder<'a> {
197 orientation: Cow<'a, str>,
198 offset: i32,
199 mask_length: u64,
200}
201
202impl<'a> DisplayFeatureBuilder<'a> {
203 pub fn build(self) -> DisplayFeature<'a> {
204 DisplayFeature {
205 orientation: self.orientation,
206 offset: self.offset,
207 mask_length: self.mask_length,
208 }
209 }
210}
211
212
213#[derive(Debug, Clone, Serialize, Deserialize, Default)]
214#[serde(rename_all = "camelCase")]
215pub struct DevicePosture<'a> {
216 #[serde(rename = "type")]
218 type_: Cow<'a, str>,
219}
220
221impl<'a> DevicePosture<'a> {
222 pub fn builder(type_: impl Into<Cow<'a, str>>) -> DevicePostureBuilder<'a> {
225 DevicePostureBuilder {
226 type_: type_.into(),
227 }
228 }
229 pub fn type_(&self) -> &str { self.type_.as_ref() }
231}
232
233
234pub struct DevicePostureBuilder<'a> {
235 type_: Cow<'a, str>,
236}
237
238impl<'a> DevicePostureBuilder<'a> {
239 pub fn build(self) -> DevicePosture<'a> {
240 DevicePosture {
241 type_: self.type_,
242 }
243 }
244}
245
246
247#[derive(Debug, Clone, Serialize, Deserialize, Default)]
248#[serde(rename_all = "camelCase")]
249pub struct MediaFeature<'a> {
250 name: Cow<'a, str>,
251 value: Cow<'a, str>,
252}
253
254impl<'a> MediaFeature<'a> {
255 pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> MediaFeatureBuilder<'a> {
259 MediaFeatureBuilder {
260 name: name.into(),
261 value: value.into(),
262 }
263 }
264 pub fn name(&self) -> &str { self.name.as_ref() }
265 pub fn value(&self) -> &str { self.value.as_ref() }
266}
267
268
269pub struct MediaFeatureBuilder<'a> {
270 name: Cow<'a, str>,
271 value: Cow<'a, str>,
272}
273
274impl<'a> MediaFeatureBuilder<'a> {
275 pub fn build(self) -> MediaFeature<'a> {
276 MediaFeature {
277 name: self.name,
278 value: self.value,
279 }
280 }
281}
282
283#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
289pub enum VirtualTimePolicy {
290 #[default]
291 #[serde(rename = "advance")]
292 Advance,
293 #[serde(rename = "pause")]
294 Pause,
295 #[serde(rename = "pauseIfNetworkFetchesPending")]
296 PauseIfNetworkFetchesPending,
297}
298
299#[derive(Debug, Clone, Serialize, Deserialize, Default)]
302#[serde(rename_all = "camelCase")]
303pub struct UserAgentBrandVersion<'a> {
304 brand: Cow<'a, str>,
305 version: Cow<'a, str>,
306}
307
308impl<'a> UserAgentBrandVersion<'a> {
309 pub fn builder(brand: impl Into<Cow<'a, str>>, version: impl Into<Cow<'a, str>>) -> UserAgentBrandVersionBuilder<'a> {
313 UserAgentBrandVersionBuilder {
314 brand: brand.into(),
315 version: version.into(),
316 }
317 }
318 pub fn brand(&self) -> &str { self.brand.as_ref() }
319 pub fn version(&self) -> &str { self.version.as_ref() }
320}
321
322
323pub struct UserAgentBrandVersionBuilder<'a> {
324 brand: Cow<'a, str>,
325 version: Cow<'a, str>,
326}
327
328impl<'a> UserAgentBrandVersionBuilder<'a> {
329 pub fn build(self) -> UserAgentBrandVersion<'a> {
330 UserAgentBrandVersion {
331 brand: self.brand,
332 version: self.version,
333 }
334 }
335}
336
337#[derive(Debug, Clone, Serialize, Deserialize, Default)]
341#[serde(rename_all = "camelCase")]
342pub struct UserAgentMetadata<'a> {
343 #[serde(skip_serializing_if = "Option::is_none")]
345 brands: Option<Vec<UserAgentBrandVersion<'a>>>,
346 #[serde(skip_serializing_if = "Option::is_none", rename = "fullVersionList")]
348 full_version_list: Option<Vec<UserAgentBrandVersion<'a>>>,
349 #[serde(skip_serializing_if = "Option::is_none", rename = "fullVersion")]
350 full_version: Option<Cow<'a, str>>,
351 platform: Cow<'a, str>,
352 #[serde(rename = "platformVersion")]
353 platform_version: Cow<'a, str>,
354 architecture: Cow<'a, str>,
355 model: Cow<'a, str>,
356 mobile: bool,
357 #[serde(skip_serializing_if = "Option::is_none")]
358 bitness: Option<Cow<'a, str>>,
359 #[serde(skip_serializing_if = "Option::is_none")]
360 wow64: Option<bool>,
361 #[serde(skip_serializing_if = "Option::is_none", rename = "formFactors")]
364 form_factors: Option<Vec<Cow<'a, str>>>,
365}
366
367impl<'a> UserAgentMetadata<'a> {
368 pub fn builder(platform: impl Into<Cow<'a, str>>, platform_version: impl Into<Cow<'a, str>>, architecture: impl Into<Cow<'a, str>>, model: impl Into<Cow<'a, str>>, mobile: bool) -> UserAgentMetadataBuilder<'a> {
375 UserAgentMetadataBuilder {
376 brands: None,
377 full_version_list: None,
378 full_version: None,
379 platform: platform.into(),
380 platform_version: platform_version.into(),
381 architecture: architecture.into(),
382 model: model.into(),
383 mobile: mobile,
384 bitness: None,
385 wow64: None,
386 form_factors: None,
387 }
388 }
389 pub fn brands(&self) -> Option<&[UserAgentBrandVersion<'a>]> { self.brands.as_deref() }
391 pub fn full_version_list(&self) -> Option<&[UserAgentBrandVersion<'a>]> { self.full_version_list.as_deref() }
393 pub fn full_version(&self) -> Option<&str> { self.full_version.as_deref() }
394 pub fn platform(&self) -> &str { self.platform.as_ref() }
395 pub fn platform_version(&self) -> &str { self.platform_version.as_ref() }
396 pub fn architecture(&self) -> &str { self.architecture.as_ref() }
397 pub fn model(&self) -> &str { self.model.as_ref() }
398 pub fn mobile(&self) -> bool { self.mobile }
399 pub fn bitness(&self) -> Option<&str> { self.bitness.as_deref() }
400 pub fn wow64(&self) -> Option<bool> { self.wow64 }
401 pub fn form_factors(&self) -> Option<&[Cow<'a, str>]> { self.form_factors.as_deref() }
404}
405
406
407pub struct UserAgentMetadataBuilder<'a> {
408 brands: Option<Vec<UserAgentBrandVersion<'a>>>,
409 full_version_list: Option<Vec<UserAgentBrandVersion<'a>>>,
410 full_version: Option<Cow<'a, str>>,
411 platform: Cow<'a, str>,
412 platform_version: Cow<'a, str>,
413 architecture: Cow<'a, str>,
414 model: Cow<'a, str>,
415 mobile: bool,
416 bitness: Option<Cow<'a, str>>,
417 wow64: Option<bool>,
418 form_factors: Option<Vec<Cow<'a, str>>>,
419}
420
421impl<'a> UserAgentMetadataBuilder<'a> {
422 pub fn brands(mut self, brands: Vec<UserAgentBrandVersion<'a>>) -> Self { self.brands = Some(brands); self }
424 pub fn full_version_list(mut self, full_version_list: Vec<UserAgentBrandVersion<'a>>) -> Self { self.full_version_list = Some(full_version_list); self }
426 pub fn full_version(mut self, full_version: impl Into<Cow<'a, str>>) -> Self { self.full_version = Some(full_version.into()); self }
427 pub fn bitness(mut self, bitness: impl Into<Cow<'a, str>>) -> Self { self.bitness = Some(bitness.into()); self }
428 pub fn wow64(mut self, wow64: bool) -> Self { self.wow64 = Some(wow64); self }
429 pub fn form_factors(mut self, form_factors: Vec<Cow<'a, str>>) -> Self { self.form_factors = Some(form_factors); self }
432 pub fn build(self) -> UserAgentMetadata<'a> {
433 UserAgentMetadata {
434 brands: self.brands,
435 full_version_list: self.full_version_list,
436 full_version: self.full_version,
437 platform: self.platform,
438 platform_version: self.platform_version,
439 architecture: self.architecture,
440 model: self.model,
441 mobile: self.mobile,
442 bitness: self.bitness,
443 wow64: self.wow64,
444 form_factors: self.form_factors,
445 }
446 }
447}
448
449#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
453pub enum SensorType {
454 #[default]
455 #[serde(rename = "absolute-orientation")]
456 AbsoluteOrientation,
457 #[serde(rename = "accelerometer")]
458 Accelerometer,
459 #[serde(rename = "ambient-light")]
460 AmbientLight,
461 #[serde(rename = "gravity")]
462 Gravity,
463 #[serde(rename = "gyroscope")]
464 Gyroscope,
465 #[serde(rename = "linear-acceleration")]
466 LinearAcceleration,
467 #[serde(rename = "magnetometer")]
468 Magnetometer,
469 #[serde(rename = "relative-orientation")]
470 RelativeOrientation,
471}
472
473
474#[derive(Debug, Clone, Serialize, Deserialize, Default)]
475#[serde(rename_all = "camelCase")]
476pub struct SensorMetadata {
477 #[serde(skip_serializing_if = "Option::is_none")]
478 available: Option<bool>,
479 #[serde(skip_serializing_if = "Option::is_none", rename = "minimumFrequency")]
480 minimum_frequency: Option<f64>,
481 #[serde(skip_serializing_if = "Option::is_none", rename = "maximumFrequency")]
482 maximum_frequency: Option<f64>,
483}
484
485impl SensorMetadata {
486 pub fn builder() -> SensorMetadataBuilder {
488 SensorMetadataBuilder {
489 available: None,
490 minimum_frequency: None,
491 maximum_frequency: None,
492 }
493 }
494 pub fn available(&self) -> Option<bool> { self.available }
495 pub fn minimum_frequency(&self) -> Option<f64> { self.minimum_frequency }
496 pub fn maximum_frequency(&self) -> Option<f64> { self.maximum_frequency }
497}
498
499#[derive(Default)]
500pub struct SensorMetadataBuilder {
501 available: Option<bool>,
502 minimum_frequency: Option<f64>,
503 maximum_frequency: Option<f64>,
504}
505
506impl SensorMetadataBuilder {
507 pub fn available(mut self, available: bool) -> Self { self.available = Some(available); self }
508 pub fn minimum_frequency(mut self, minimum_frequency: f64) -> Self { self.minimum_frequency = Some(minimum_frequency); self }
509 pub fn maximum_frequency(mut self, maximum_frequency: f64) -> Self { self.maximum_frequency = Some(maximum_frequency); self }
510 pub fn build(self) -> SensorMetadata {
511 SensorMetadata {
512 available: self.available,
513 minimum_frequency: self.minimum_frequency,
514 maximum_frequency: self.maximum_frequency,
515 }
516 }
517}
518
519
520#[derive(Debug, Clone, Serialize, Deserialize, Default)]
521#[serde(rename_all = "camelCase")]
522pub struct SensorReadingSingle {
523 value: f64,
524}
525
526impl SensorReadingSingle {
527 pub fn builder(value: f64) -> SensorReadingSingleBuilder {
530 SensorReadingSingleBuilder {
531 value: value,
532 }
533 }
534 pub fn value(&self) -> f64 { self.value }
535}
536
537
538pub struct SensorReadingSingleBuilder {
539 value: f64,
540}
541
542impl SensorReadingSingleBuilder {
543 pub fn build(self) -> SensorReadingSingle {
544 SensorReadingSingle {
545 value: self.value,
546 }
547 }
548}
549
550
551#[derive(Debug, Clone, Serialize, Deserialize, Default)]
552#[serde(rename_all = "camelCase")]
553pub struct SensorReadingXYZ {
554 x: f64,
555 y: f64,
556 z: f64,
557}
558
559impl SensorReadingXYZ {
560 pub fn builder(x: f64, y: f64, z: f64) -> SensorReadingXYZBuilder {
565 SensorReadingXYZBuilder {
566 x: x,
567 y: y,
568 z: z,
569 }
570 }
571 pub fn x(&self) -> f64 { self.x }
572 pub fn y(&self) -> f64 { self.y }
573 pub fn z(&self) -> f64 { self.z }
574}
575
576
577pub struct SensorReadingXYZBuilder {
578 x: f64,
579 y: f64,
580 z: f64,
581}
582
583impl SensorReadingXYZBuilder {
584 pub fn build(self) -> SensorReadingXYZ {
585 SensorReadingXYZ {
586 x: self.x,
587 y: self.y,
588 z: self.z,
589 }
590 }
591}
592
593
594#[derive(Debug, Clone, Serialize, Deserialize, Default)]
595#[serde(rename_all = "camelCase")]
596pub struct SensorReadingQuaternion {
597 x: f64,
598 y: f64,
599 z: f64,
600 w: f64,
601}
602
603impl SensorReadingQuaternion {
604 pub fn builder(x: f64, y: f64, z: f64, w: f64) -> SensorReadingQuaternionBuilder {
610 SensorReadingQuaternionBuilder {
611 x: x,
612 y: y,
613 z: z,
614 w: w,
615 }
616 }
617 pub fn x(&self) -> f64 { self.x }
618 pub fn y(&self) -> f64 { self.y }
619 pub fn z(&self) -> f64 { self.z }
620 pub fn w(&self) -> f64 { self.w }
621}
622
623
624pub struct SensorReadingQuaternionBuilder {
625 x: f64,
626 y: f64,
627 z: f64,
628 w: f64,
629}
630
631impl SensorReadingQuaternionBuilder {
632 pub fn build(self) -> SensorReadingQuaternion {
633 SensorReadingQuaternion {
634 x: self.x,
635 y: self.y,
636 z: self.z,
637 w: self.w,
638 }
639 }
640}
641
642
643#[derive(Debug, Clone, Serialize, Deserialize, Default)]
644#[serde(rename_all = "camelCase")]
645pub struct SensorReading {
646 #[serde(skip_serializing_if = "Option::is_none")]
647 single: Option<SensorReadingSingle>,
648 #[serde(skip_serializing_if = "Option::is_none")]
649 xyz: Option<SensorReadingXYZ>,
650 #[serde(skip_serializing_if = "Option::is_none")]
651 quaternion: Option<SensorReadingQuaternion>,
652}
653
654impl SensorReading {
655 pub fn builder() -> SensorReadingBuilder {
657 SensorReadingBuilder {
658 single: None,
659 xyz: None,
660 quaternion: None,
661 }
662 }
663 pub fn single(&self) -> Option<&SensorReadingSingle> { self.single.as_ref() }
664 pub fn xyz(&self) -> Option<&SensorReadingXYZ> { self.xyz.as_ref() }
665 pub fn quaternion(&self) -> Option<&SensorReadingQuaternion> { self.quaternion.as_ref() }
666}
667
668#[derive(Default)]
669pub struct SensorReadingBuilder {
670 single: Option<SensorReadingSingle>,
671 xyz: Option<SensorReadingXYZ>,
672 quaternion: Option<SensorReadingQuaternion>,
673}
674
675impl SensorReadingBuilder {
676 pub fn single(mut self, single: SensorReadingSingle) -> Self { self.single = Some(single); self }
677 pub fn xyz(mut self, xyz: SensorReadingXYZ) -> Self { self.xyz = Some(xyz); self }
678 pub fn quaternion(mut self, quaternion: SensorReadingQuaternion) -> Self { self.quaternion = Some(quaternion); self }
679 pub fn build(self) -> SensorReading {
680 SensorReading {
681 single: self.single,
682 xyz: self.xyz,
683 quaternion: self.quaternion,
684 }
685 }
686}
687
688
689#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
690pub enum PressureSource {
691 #[default]
692 #[serde(rename = "cpu")]
693 Cpu,
694}
695
696
697#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
698pub enum PressureState {
699 #[default]
700 #[serde(rename = "nominal")]
701 Nominal,
702 #[serde(rename = "fair")]
703 Fair,
704 #[serde(rename = "serious")]
705 Serious,
706 #[serde(rename = "critical")]
707 Critical,
708}
709
710
711#[derive(Debug, Clone, Serialize, Deserialize, Default)]
712#[serde(rename_all = "camelCase")]
713pub struct PressureMetadata {
714 #[serde(skip_serializing_if = "Option::is_none")]
715 available: Option<bool>,
716}
717
718impl PressureMetadata {
719 pub fn builder() -> PressureMetadataBuilder {
721 PressureMetadataBuilder {
722 available: None,
723 }
724 }
725 pub fn available(&self) -> Option<bool> { self.available }
726}
727
728#[derive(Default)]
729pub struct PressureMetadataBuilder {
730 available: Option<bool>,
731}
732
733impl PressureMetadataBuilder {
734 pub fn available(mut self, available: bool) -> Self { self.available = Some(available); self }
735 pub fn build(self) -> PressureMetadata {
736 PressureMetadata {
737 available: self.available,
738 }
739 }
740}
741
742
743#[derive(Debug, Clone, Serialize, Deserialize, Default)]
744#[serde(rename_all = "camelCase")]
745pub struct WorkAreaInsets {
746 #[serde(skip_serializing_if = "Option::is_none")]
748 top: Option<i64>,
749 #[serde(skip_serializing_if = "Option::is_none")]
751 left: Option<i64>,
752 #[serde(skip_serializing_if = "Option::is_none")]
754 bottom: Option<i64>,
755 #[serde(skip_serializing_if = "Option::is_none")]
757 right: Option<i64>,
758}
759
760impl WorkAreaInsets {
761 pub fn builder() -> WorkAreaInsetsBuilder {
763 WorkAreaInsetsBuilder {
764 top: None,
765 left: None,
766 bottom: None,
767 right: None,
768 }
769 }
770 pub fn top(&self) -> Option<i64> { self.top }
772 pub fn left(&self) -> Option<i64> { self.left }
774 pub fn bottom(&self) -> Option<i64> { self.bottom }
776 pub fn right(&self) -> Option<i64> { self.right }
778}
779
780#[derive(Default)]
781pub struct WorkAreaInsetsBuilder {
782 top: Option<i64>,
783 left: Option<i64>,
784 bottom: Option<i64>,
785 right: Option<i64>,
786}
787
788impl WorkAreaInsetsBuilder {
789 pub fn top(mut self, top: i64) -> Self { self.top = Some(top); self }
791 pub fn left(mut self, left: i64) -> Self { self.left = Some(left); self }
793 pub fn bottom(mut self, bottom: i64) -> Self { self.bottom = Some(bottom); self }
795 pub fn right(mut self, right: i64) -> Self { self.right = Some(right); self }
797 pub fn build(self) -> WorkAreaInsets {
798 WorkAreaInsets {
799 top: self.top,
800 left: self.left,
801 bottom: self.bottom,
802 right: self.right,
803 }
804 }
805}
806
807
808pub type ScreenId<'a> = Cow<'a, str>;
809
810#[derive(Debug, Clone, Serialize, Deserialize, Default)]
814#[serde(rename_all = "camelCase")]
815pub struct ScreenInfo<'a> {
816 left: i64,
818 top: i64,
820 width: u64,
822 height: i64,
824 #[serde(rename = "availLeft")]
826 avail_left: i64,
827 #[serde(rename = "availTop")]
829 avail_top: i64,
830 #[serde(rename = "availWidth")]
832 avail_width: u64,
833 #[serde(rename = "availHeight")]
835 avail_height: i64,
836 #[serde(rename = "devicePixelRatio")]
838 device_pixel_ratio: f64,
839 orientation: ScreenOrientation<'a>,
841 #[serde(rename = "colorDepth")]
843 color_depth: i64,
844 #[serde(rename = "isExtended")]
846 is_extended: bool,
847 #[serde(rename = "isInternal")]
849 is_internal: bool,
850 #[serde(rename = "isPrimary")]
852 is_primary: bool,
853 label: Cow<'a, str>,
855 id: ScreenId<'a>,
857}
858
859impl<'a> ScreenInfo<'a> {
860 pub fn builder(left: i64, top: i64, width: u64, height: i64, avail_left: i64, avail_top: i64, avail_width: u64, avail_height: i64, device_pixel_ratio: f64, orientation: ScreenOrientation<'a>, color_depth: i64, is_extended: bool, is_internal: bool, is_primary: bool, label: impl Into<Cow<'a, str>>, id: impl Into<ScreenId<'a>>) -> ScreenInfoBuilder<'a> {
878 ScreenInfoBuilder {
879 left: left,
880 top: top,
881 width: width,
882 height: height,
883 avail_left: avail_left,
884 avail_top: avail_top,
885 avail_width: avail_width,
886 avail_height: avail_height,
887 device_pixel_ratio: device_pixel_ratio,
888 orientation: orientation,
889 color_depth: color_depth,
890 is_extended: is_extended,
891 is_internal: is_internal,
892 is_primary: is_primary,
893 label: label.into(),
894 id: id.into(),
895 }
896 }
897 pub fn left(&self) -> i64 { self.left }
899 pub fn top(&self) -> i64 { self.top }
901 pub fn width(&self) -> u64 { self.width }
903 pub fn height(&self) -> i64 { self.height }
905 pub fn avail_left(&self) -> i64 { self.avail_left }
907 pub fn avail_top(&self) -> i64 { self.avail_top }
909 pub fn avail_width(&self) -> u64 { self.avail_width }
911 pub fn avail_height(&self) -> i64 { self.avail_height }
913 pub fn device_pixel_ratio(&self) -> f64 { self.device_pixel_ratio }
915 pub fn orientation(&self) -> &ScreenOrientation<'a> { &self.orientation }
917 pub fn color_depth(&self) -> i64 { self.color_depth }
919 pub fn is_extended(&self) -> bool { self.is_extended }
921 pub fn is_internal(&self) -> bool { self.is_internal }
923 pub fn is_primary(&self) -> bool { self.is_primary }
925 pub fn label(&self) -> &str { self.label.as_ref() }
927 pub fn id(&self) -> &ScreenId<'a> { &self.id }
929}
930
931
932pub struct ScreenInfoBuilder<'a> {
933 left: i64,
934 top: i64,
935 width: u64,
936 height: i64,
937 avail_left: i64,
938 avail_top: i64,
939 avail_width: u64,
940 avail_height: i64,
941 device_pixel_ratio: f64,
942 orientation: ScreenOrientation<'a>,
943 color_depth: i64,
944 is_extended: bool,
945 is_internal: bool,
946 is_primary: bool,
947 label: Cow<'a, str>,
948 id: ScreenId<'a>,
949}
950
951impl<'a> ScreenInfoBuilder<'a> {
952 pub fn build(self) -> ScreenInfo<'a> {
953 ScreenInfo {
954 left: self.left,
955 top: self.top,
956 width: self.width,
957 height: self.height,
958 avail_left: self.avail_left,
959 avail_top: self.avail_top,
960 avail_width: self.avail_width,
961 avail_height: self.avail_height,
962 device_pixel_ratio: self.device_pixel_ratio,
963 orientation: self.orientation,
964 color_depth: self.color_depth,
965 is_extended: self.is_extended,
966 is_internal: self.is_internal,
967 is_primary: self.is_primary,
968 label: self.label,
969 id: self.id,
970 }
971 }
972}
973
974#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
977pub enum DisabledImageType {
978 #[default]
979 #[serde(rename = "avif")]
980 Avif,
981 #[serde(rename = "jxl")]
982 Jxl,
983 #[serde(rename = "webp")]
984 Webp,
985}
986
987#[derive(Debug, Clone, Serialize, Deserialize, Default)]
990#[serde(rename_all = "camelCase")]
991pub struct CanEmulateReturns {
992 result: bool,
994}
995
996impl CanEmulateReturns {
997 pub fn builder(result: bool) -> CanEmulateReturnsBuilder {
1000 CanEmulateReturnsBuilder {
1001 result: result,
1002 }
1003 }
1004 pub fn result(&self) -> bool { self.result }
1006}
1007
1008
1009pub struct CanEmulateReturnsBuilder {
1010 result: bool,
1011}
1012
1013impl CanEmulateReturnsBuilder {
1014 pub fn build(self) -> CanEmulateReturns {
1015 CanEmulateReturns {
1016 result: self.result,
1017 }
1018 }
1019}
1020
1021#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1022pub struct CanEmulateParams {}
1023
1024impl CanEmulateParams { pub const METHOD: &'static str = "Emulation.canEmulate"; }
1025
1026impl<'a> crate::CdpCommand<'a> for CanEmulateParams {
1027 const METHOD: &'static str = "Emulation.canEmulate";
1028 type Response = CanEmulateReturns;
1029}
1030
1031#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1032pub struct ClearDeviceMetricsOverrideParams {}
1033
1034impl ClearDeviceMetricsOverrideParams { pub const METHOD: &'static str = "Emulation.clearDeviceMetricsOverride"; }
1035
1036impl<'a> crate::CdpCommand<'a> for ClearDeviceMetricsOverrideParams {
1037 const METHOD: &'static str = "Emulation.clearDeviceMetricsOverride";
1038 type Response = crate::EmptyReturns;
1039}
1040
1041#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1042pub struct ClearGeolocationOverrideParams {}
1043
1044impl ClearGeolocationOverrideParams { pub const METHOD: &'static str = "Emulation.clearGeolocationOverride"; }
1045
1046impl<'a> crate::CdpCommand<'a> for ClearGeolocationOverrideParams {
1047 const METHOD: &'static str = "Emulation.clearGeolocationOverride";
1048 type Response = crate::EmptyReturns;
1049}
1050
1051#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1052pub struct ResetPageScaleFactorParams {}
1053
1054impl ResetPageScaleFactorParams { pub const METHOD: &'static str = "Emulation.resetPageScaleFactor"; }
1055
1056impl<'a> crate::CdpCommand<'a> for ResetPageScaleFactorParams {
1057 const METHOD: &'static str = "Emulation.resetPageScaleFactor";
1058 type Response = crate::EmptyReturns;
1059}
1060
1061#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1064#[serde(rename_all = "camelCase")]
1065pub struct SetFocusEmulationEnabledParams {
1066 enabled: bool,
1068}
1069
1070impl SetFocusEmulationEnabledParams {
1071 pub fn builder(enabled: bool) -> SetFocusEmulationEnabledParamsBuilder {
1074 SetFocusEmulationEnabledParamsBuilder {
1075 enabled: enabled,
1076 }
1077 }
1078 pub fn enabled(&self) -> bool { self.enabled }
1080}
1081
1082
1083pub struct SetFocusEmulationEnabledParamsBuilder {
1084 enabled: bool,
1085}
1086
1087impl SetFocusEmulationEnabledParamsBuilder {
1088 pub fn build(self) -> SetFocusEmulationEnabledParams {
1089 SetFocusEmulationEnabledParams {
1090 enabled: self.enabled,
1091 }
1092 }
1093}
1094
1095impl SetFocusEmulationEnabledParams { pub const METHOD: &'static str = "Emulation.setFocusEmulationEnabled"; }
1096
1097impl<'a> crate::CdpCommand<'a> for SetFocusEmulationEnabledParams {
1098 const METHOD: &'static str = "Emulation.setFocusEmulationEnabled";
1099 type Response = crate::EmptyReturns;
1100}
1101
1102#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1105#[serde(rename_all = "camelCase")]
1106pub struct SetAutoDarkModeOverrideParams {
1107 #[serde(skip_serializing_if = "Option::is_none")]
1110 enabled: Option<bool>,
1111}
1112
1113impl SetAutoDarkModeOverrideParams {
1114 pub fn builder() -> SetAutoDarkModeOverrideParamsBuilder {
1116 SetAutoDarkModeOverrideParamsBuilder {
1117 enabled: None,
1118 }
1119 }
1120 pub fn enabled(&self) -> Option<bool> { self.enabled }
1123}
1124
1125#[derive(Default)]
1126pub struct SetAutoDarkModeOverrideParamsBuilder {
1127 enabled: Option<bool>,
1128}
1129
1130impl SetAutoDarkModeOverrideParamsBuilder {
1131 pub fn enabled(mut self, enabled: bool) -> Self { self.enabled = Some(enabled); self }
1134 pub fn build(self) -> SetAutoDarkModeOverrideParams {
1135 SetAutoDarkModeOverrideParams {
1136 enabled: self.enabled,
1137 }
1138 }
1139}
1140
1141impl SetAutoDarkModeOverrideParams { pub const METHOD: &'static str = "Emulation.setAutoDarkModeOverride"; }
1142
1143impl<'a> crate::CdpCommand<'a> for SetAutoDarkModeOverrideParams {
1144 const METHOD: &'static str = "Emulation.setAutoDarkModeOverride";
1145 type Response = crate::EmptyReturns;
1146}
1147
1148#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1151#[serde(rename_all = "camelCase")]
1152pub struct SetCPUThrottlingRateParams {
1153 rate: f64,
1155}
1156
1157impl SetCPUThrottlingRateParams {
1158 pub fn builder(rate: f64) -> SetCPUThrottlingRateParamsBuilder {
1161 SetCPUThrottlingRateParamsBuilder {
1162 rate: rate,
1163 }
1164 }
1165 pub fn rate(&self) -> f64 { self.rate }
1167}
1168
1169
1170pub struct SetCPUThrottlingRateParamsBuilder {
1171 rate: f64,
1172}
1173
1174impl SetCPUThrottlingRateParamsBuilder {
1175 pub fn build(self) -> SetCPUThrottlingRateParams {
1176 SetCPUThrottlingRateParams {
1177 rate: self.rate,
1178 }
1179 }
1180}
1181
1182impl SetCPUThrottlingRateParams { pub const METHOD: &'static str = "Emulation.setCPUThrottlingRate"; }
1183
1184impl<'a> crate::CdpCommand<'a> for SetCPUThrottlingRateParams {
1185 const METHOD: &'static str = "Emulation.setCPUThrottlingRate";
1186 type Response = crate::EmptyReturns;
1187}
1188
1189#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1193#[serde(rename_all = "camelCase")]
1194pub struct SetDefaultBackgroundColorOverrideParams {
1195 #[serde(skip_serializing_if = "Option::is_none")]
1198 color: Option<crate::dom::RGBA>,
1199}
1200
1201impl SetDefaultBackgroundColorOverrideParams {
1202 pub fn builder() -> SetDefaultBackgroundColorOverrideParamsBuilder {
1204 SetDefaultBackgroundColorOverrideParamsBuilder {
1205 color: None,
1206 }
1207 }
1208 pub fn color(&self) -> Option<&crate::dom::RGBA> { self.color.as_ref() }
1211}
1212
1213#[derive(Default)]
1214pub struct SetDefaultBackgroundColorOverrideParamsBuilder {
1215 color: Option<crate::dom::RGBA>,
1216}
1217
1218impl SetDefaultBackgroundColorOverrideParamsBuilder {
1219 pub fn color(mut self, color: crate::dom::RGBA) -> Self { self.color = Some(color); self }
1222 pub fn build(self) -> SetDefaultBackgroundColorOverrideParams {
1223 SetDefaultBackgroundColorOverrideParams {
1224 color: self.color,
1225 }
1226 }
1227}
1228
1229impl SetDefaultBackgroundColorOverrideParams { pub const METHOD: &'static str = "Emulation.setDefaultBackgroundColorOverride"; }
1230
1231impl<'a> crate::CdpCommand<'a> for SetDefaultBackgroundColorOverrideParams {
1232 const METHOD: &'static str = "Emulation.setDefaultBackgroundColorOverride";
1233 type Response = crate::EmptyReturns;
1234}
1235
1236#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1240#[serde(rename_all = "camelCase")]
1241pub struct SetSafeAreaInsetsOverrideParams {
1242 insets: SafeAreaInsets,
1243}
1244
1245impl SetSafeAreaInsetsOverrideParams {
1246 pub fn builder(insets: SafeAreaInsets) -> SetSafeAreaInsetsOverrideParamsBuilder {
1249 SetSafeAreaInsetsOverrideParamsBuilder {
1250 insets: insets,
1251 }
1252 }
1253 pub fn insets(&self) -> &SafeAreaInsets { &self.insets }
1254}
1255
1256
1257pub struct SetSafeAreaInsetsOverrideParamsBuilder {
1258 insets: SafeAreaInsets,
1259}
1260
1261impl SetSafeAreaInsetsOverrideParamsBuilder {
1262 pub fn build(self) -> SetSafeAreaInsetsOverrideParams {
1263 SetSafeAreaInsetsOverrideParams {
1264 insets: self.insets,
1265 }
1266 }
1267}
1268
1269impl SetSafeAreaInsetsOverrideParams { pub const METHOD: &'static str = "Emulation.setSafeAreaInsetsOverride"; }
1270
1271impl<'a> crate::CdpCommand<'a> for SetSafeAreaInsetsOverrideParams {
1272 const METHOD: &'static str = "Emulation.setSafeAreaInsetsOverride";
1273 type Response = crate::EmptyReturns;
1274}
1275
1276#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1281#[serde(rename_all = "camelCase")]
1282pub struct SetDeviceMetricsOverrideParams<'a> {
1283 width: u64,
1285 height: i64,
1287 #[serde(rename = "deviceScaleFactor")]
1289 device_scale_factor: f64,
1290 mobile: bool,
1293 #[serde(skip_serializing_if = "Option::is_none")]
1295 scale: Option<f64>,
1296 #[serde(skip_serializing_if = "Option::is_none", rename = "screenWidth")]
1298 screen_width: Option<u64>,
1299 #[serde(skip_serializing_if = "Option::is_none", rename = "screenHeight")]
1301 screen_height: Option<i64>,
1302 #[serde(skip_serializing_if = "Option::is_none", rename = "positionX")]
1304 position_x: Option<i64>,
1305 #[serde(skip_serializing_if = "Option::is_none", rename = "positionY")]
1307 position_y: Option<i64>,
1308 #[serde(skip_serializing_if = "Option::is_none", rename = "dontSetVisibleSize")]
1310 dont_set_visible_size: Option<bool>,
1311 #[serde(skip_serializing_if = "Option::is_none", rename = "screenOrientation")]
1313 screen_orientation: Option<ScreenOrientation<'a>>,
1314 #[serde(skip_serializing_if = "Option::is_none")]
1317 viewport: Option<crate::page::Viewport>,
1318 #[serde(skip_serializing_if = "Option::is_none", rename = "displayFeature")]
1322 display_feature: Option<DisplayFeature<'a>>,
1323 #[serde(skip_serializing_if = "Option::is_none", rename = "devicePosture")]
1327 device_posture: Option<DevicePosture<'a>>,
1328 #[serde(skip_serializing_if = "Option::is_none", rename = "scrollbarType")]
1330 scrollbar_type: Option<Cow<'a, str>>,
1331 #[serde(skip_serializing_if = "Option::is_none", rename = "screenOrientationLockEmulation")]
1337 screen_orientation_lock_emulation: Option<bool>,
1338}
1339
1340impl<'a> SetDeviceMetricsOverrideParams<'a> {
1341 pub fn builder(width: u64, height: i64, device_scale_factor: f64, mobile: bool) -> SetDeviceMetricsOverrideParamsBuilder<'a> {
1347 SetDeviceMetricsOverrideParamsBuilder {
1348 width: width,
1349 height: height,
1350 device_scale_factor: device_scale_factor,
1351 mobile: mobile,
1352 scale: None,
1353 screen_width: None,
1354 screen_height: None,
1355 position_x: None,
1356 position_y: None,
1357 dont_set_visible_size: None,
1358 screen_orientation: None,
1359 viewport: None,
1360 display_feature: None,
1361 device_posture: None,
1362 scrollbar_type: None,
1363 screen_orientation_lock_emulation: None,
1364 }
1365 }
1366 pub fn width(&self) -> u64 { self.width }
1368 pub fn height(&self) -> i64 { self.height }
1370 pub fn device_scale_factor(&self) -> f64 { self.device_scale_factor }
1372 pub fn mobile(&self) -> bool { self.mobile }
1375 pub fn scale(&self) -> Option<f64> { self.scale }
1377 pub fn screen_width(&self) -> Option<u64> { self.screen_width }
1379 pub fn screen_height(&self) -> Option<i64> { self.screen_height }
1381 pub fn position_x(&self) -> Option<i64> { self.position_x }
1383 pub fn position_y(&self) -> Option<i64> { self.position_y }
1385 pub fn dont_set_visible_size(&self) -> Option<bool> { self.dont_set_visible_size }
1387 pub fn screen_orientation(&self) -> Option<&ScreenOrientation<'a>> { self.screen_orientation.as_ref() }
1389 pub fn viewport(&self) -> Option<&crate::page::Viewport> { self.viewport.as_ref() }
1392 pub fn display_feature(&self) -> Option<&DisplayFeature<'a>> { self.display_feature.as_ref() }
1396 pub fn device_posture(&self) -> Option<&DevicePosture<'a>> { self.device_posture.as_ref() }
1400 pub fn scrollbar_type(&self) -> Option<&str> { self.scrollbar_type.as_deref() }
1402 pub fn screen_orientation_lock_emulation(&self) -> Option<bool> { self.screen_orientation_lock_emulation }
1408}
1409
1410
1411pub struct SetDeviceMetricsOverrideParamsBuilder<'a> {
1412 width: u64,
1413 height: i64,
1414 device_scale_factor: f64,
1415 mobile: bool,
1416 scale: Option<f64>,
1417 screen_width: Option<u64>,
1418 screen_height: Option<i64>,
1419 position_x: Option<i64>,
1420 position_y: Option<i64>,
1421 dont_set_visible_size: Option<bool>,
1422 screen_orientation: Option<ScreenOrientation<'a>>,
1423 viewport: Option<crate::page::Viewport>,
1424 display_feature: Option<DisplayFeature<'a>>,
1425 device_posture: Option<DevicePosture<'a>>,
1426 scrollbar_type: Option<Cow<'a, str>>,
1427 screen_orientation_lock_emulation: Option<bool>,
1428}
1429
1430impl<'a> SetDeviceMetricsOverrideParamsBuilder<'a> {
1431 pub fn scale(mut self, scale: f64) -> Self { self.scale = Some(scale); self }
1433 pub fn screen_width(mut self, screen_width: u64) -> Self { self.screen_width = Some(screen_width); self }
1435 pub fn screen_height(mut self, screen_height: i64) -> Self { self.screen_height = Some(screen_height); self }
1437 pub fn position_x(mut self, position_x: i64) -> Self { self.position_x = Some(position_x); self }
1439 pub fn position_y(mut self, position_y: i64) -> Self { self.position_y = Some(position_y); self }
1441 pub fn dont_set_visible_size(mut self, dont_set_visible_size: bool) -> Self { self.dont_set_visible_size = Some(dont_set_visible_size); self }
1443 pub fn screen_orientation(mut self, screen_orientation: ScreenOrientation<'a>) -> Self { self.screen_orientation = Some(screen_orientation); self }
1445 pub fn viewport(mut self, viewport: crate::page::Viewport) -> Self { self.viewport = Some(viewport); self }
1448 pub fn display_feature(mut self, display_feature: DisplayFeature<'a>) -> Self { self.display_feature = Some(display_feature); self }
1452 pub fn device_posture(mut self, device_posture: DevicePosture<'a>) -> Self { self.device_posture = Some(device_posture); self }
1456 pub fn scrollbar_type(mut self, scrollbar_type: impl Into<Cow<'a, str>>) -> Self { self.scrollbar_type = Some(scrollbar_type.into()); self }
1458 pub fn screen_orientation_lock_emulation(mut self, screen_orientation_lock_emulation: bool) -> Self { self.screen_orientation_lock_emulation = Some(screen_orientation_lock_emulation); self }
1464 pub fn build(self) -> SetDeviceMetricsOverrideParams<'a> {
1465 SetDeviceMetricsOverrideParams {
1466 width: self.width,
1467 height: self.height,
1468 device_scale_factor: self.device_scale_factor,
1469 mobile: self.mobile,
1470 scale: self.scale,
1471 screen_width: self.screen_width,
1472 screen_height: self.screen_height,
1473 position_x: self.position_x,
1474 position_y: self.position_y,
1475 dont_set_visible_size: self.dont_set_visible_size,
1476 screen_orientation: self.screen_orientation,
1477 viewport: self.viewport,
1478 display_feature: self.display_feature,
1479 device_posture: self.device_posture,
1480 scrollbar_type: self.scrollbar_type,
1481 screen_orientation_lock_emulation: self.screen_orientation_lock_emulation,
1482 }
1483 }
1484}
1485
1486impl<'a> SetDeviceMetricsOverrideParams<'a> { pub const METHOD: &'static str = "Emulation.setDeviceMetricsOverride"; }
1487
1488impl<'a> crate::CdpCommand<'a> for SetDeviceMetricsOverrideParams<'a> {
1489 const METHOD: &'static str = "Emulation.setDeviceMetricsOverride";
1490 type Response = crate::EmptyReturns;
1491}
1492
1493#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1497#[serde(rename_all = "camelCase")]
1498pub struct SetDevicePostureOverrideParams<'a> {
1499 posture: DevicePosture<'a>,
1500}
1501
1502impl<'a> SetDevicePostureOverrideParams<'a> {
1503 pub fn builder(posture: DevicePosture<'a>) -> SetDevicePostureOverrideParamsBuilder<'a> {
1506 SetDevicePostureOverrideParamsBuilder {
1507 posture: posture,
1508 }
1509 }
1510 pub fn posture(&self) -> &DevicePosture<'a> { &self.posture }
1511}
1512
1513
1514pub struct SetDevicePostureOverrideParamsBuilder<'a> {
1515 posture: DevicePosture<'a>,
1516}
1517
1518impl<'a> SetDevicePostureOverrideParamsBuilder<'a> {
1519 pub fn build(self) -> SetDevicePostureOverrideParams<'a> {
1520 SetDevicePostureOverrideParams {
1521 posture: self.posture,
1522 }
1523 }
1524}
1525
1526impl<'a> SetDevicePostureOverrideParams<'a> { pub const METHOD: &'static str = "Emulation.setDevicePostureOverride"; }
1527
1528impl<'a> crate::CdpCommand<'a> for SetDevicePostureOverrideParams<'a> {
1529 const METHOD: &'static str = "Emulation.setDevicePostureOverride";
1530 type Response = crate::EmptyReturns;
1531}
1532
1533#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1534pub struct ClearDevicePostureOverrideParams {}
1535
1536impl ClearDevicePostureOverrideParams { pub const METHOD: &'static str = "Emulation.clearDevicePostureOverride"; }
1537
1538impl<'a> crate::CdpCommand<'a> for ClearDevicePostureOverrideParams {
1539 const METHOD: &'static str = "Emulation.clearDevicePostureOverride";
1540 type Response = crate::EmptyReturns;
1541}
1542
1543#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1547#[serde(rename_all = "camelCase")]
1548pub struct SetDisplayFeaturesOverrideParams<'a> {
1549 features: Vec<DisplayFeature<'a>>,
1550}
1551
1552impl<'a> SetDisplayFeaturesOverrideParams<'a> {
1553 pub fn builder(features: Vec<DisplayFeature<'a>>) -> SetDisplayFeaturesOverrideParamsBuilder<'a> {
1556 SetDisplayFeaturesOverrideParamsBuilder {
1557 features: features,
1558 }
1559 }
1560 pub fn features(&self) -> &[DisplayFeature<'a>] { &self.features }
1561}
1562
1563
1564pub struct SetDisplayFeaturesOverrideParamsBuilder<'a> {
1565 features: Vec<DisplayFeature<'a>>,
1566}
1567
1568impl<'a> SetDisplayFeaturesOverrideParamsBuilder<'a> {
1569 pub fn build(self) -> SetDisplayFeaturesOverrideParams<'a> {
1570 SetDisplayFeaturesOverrideParams {
1571 features: self.features,
1572 }
1573 }
1574}
1575
1576impl<'a> SetDisplayFeaturesOverrideParams<'a> { pub const METHOD: &'static str = "Emulation.setDisplayFeaturesOverride"; }
1577
1578impl<'a> crate::CdpCommand<'a> for SetDisplayFeaturesOverrideParams<'a> {
1579 const METHOD: &'static str = "Emulation.setDisplayFeaturesOverride";
1580 type Response = crate::EmptyReturns;
1581}
1582
1583#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1584pub struct ClearDisplayFeaturesOverrideParams {}
1585
1586impl ClearDisplayFeaturesOverrideParams { pub const METHOD: &'static str = "Emulation.clearDisplayFeaturesOverride"; }
1587
1588impl<'a> crate::CdpCommand<'a> for ClearDisplayFeaturesOverrideParams {
1589 const METHOD: &'static str = "Emulation.clearDisplayFeaturesOverride";
1590 type Response = crate::EmptyReturns;
1591}
1592
1593
1594#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1595#[serde(rename_all = "camelCase")]
1596pub struct SetScrollbarsHiddenParams {
1597 hidden: bool,
1599}
1600
1601impl SetScrollbarsHiddenParams {
1602 pub fn builder(hidden: bool) -> SetScrollbarsHiddenParamsBuilder {
1605 SetScrollbarsHiddenParamsBuilder {
1606 hidden: hidden,
1607 }
1608 }
1609 pub fn hidden(&self) -> bool { self.hidden }
1611}
1612
1613
1614pub struct SetScrollbarsHiddenParamsBuilder {
1615 hidden: bool,
1616}
1617
1618impl SetScrollbarsHiddenParamsBuilder {
1619 pub fn build(self) -> SetScrollbarsHiddenParams {
1620 SetScrollbarsHiddenParams {
1621 hidden: self.hidden,
1622 }
1623 }
1624}
1625
1626impl SetScrollbarsHiddenParams { pub const METHOD: &'static str = "Emulation.setScrollbarsHidden"; }
1627
1628impl<'a> crate::CdpCommand<'a> for SetScrollbarsHiddenParams {
1629 const METHOD: &'static str = "Emulation.setScrollbarsHidden";
1630 type Response = crate::EmptyReturns;
1631}
1632
1633
1634#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1635#[serde(rename_all = "camelCase")]
1636pub struct SetDocumentCookieDisabledParams {
1637 disabled: bool,
1639}
1640
1641impl SetDocumentCookieDisabledParams {
1642 pub fn builder(disabled: bool) -> SetDocumentCookieDisabledParamsBuilder {
1645 SetDocumentCookieDisabledParamsBuilder {
1646 disabled: disabled,
1647 }
1648 }
1649 pub fn disabled(&self) -> bool { self.disabled }
1651}
1652
1653
1654pub struct SetDocumentCookieDisabledParamsBuilder {
1655 disabled: bool,
1656}
1657
1658impl SetDocumentCookieDisabledParamsBuilder {
1659 pub fn build(self) -> SetDocumentCookieDisabledParams {
1660 SetDocumentCookieDisabledParams {
1661 disabled: self.disabled,
1662 }
1663 }
1664}
1665
1666impl SetDocumentCookieDisabledParams { pub const METHOD: &'static str = "Emulation.setDocumentCookieDisabled"; }
1667
1668impl<'a> crate::CdpCommand<'a> for SetDocumentCookieDisabledParams {
1669 const METHOD: &'static str = "Emulation.setDocumentCookieDisabled";
1670 type Response = crate::EmptyReturns;
1671}
1672
1673
1674#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1675#[serde(rename_all = "camelCase")]
1676pub struct SetEmitTouchEventsForMouseParams<'a> {
1677 enabled: bool,
1679 #[serde(skip_serializing_if = "Option::is_none")]
1681 configuration: Option<Cow<'a, str>>,
1682}
1683
1684impl<'a> SetEmitTouchEventsForMouseParams<'a> {
1685 pub fn builder(enabled: bool) -> SetEmitTouchEventsForMouseParamsBuilder<'a> {
1688 SetEmitTouchEventsForMouseParamsBuilder {
1689 enabled: enabled,
1690 configuration: None,
1691 }
1692 }
1693 pub fn enabled(&self) -> bool { self.enabled }
1695 pub fn configuration(&self) -> Option<&str> { self.configuration.as_deref() }
1697}
1698
1699
1700pub struct SetEmitTouchEventsForMouseParamsBuilder<'a> {
1701 enabled: bool,
1702 configuration: Option<Cow<'a, str>>,
1703}
1704
1705impl<'a> SetEmitTouchEventsForMouseParamsBuilder<'a> {
1706 pub fn configuration(mut self, configuration: impl Into<Cow<'a, str>>) -> Self { self.configuration = Some(configuration.into()); self }
1708 pub fn build(self) -> SetEmitTouchEventsForMouseParams<'a> {
1709 SetEmitTouchEventsForMouseParams {
1710 enabled: self.enabled,
1711 configuration: self.configuration,
1712 }
1713 }
1714}
1715
1716impl<'a> SetEmitTouchEventsForMouseParams<'a> { pub const METHOD: &'static str = "Emulation.setEmitTouchEventsForMouse"; }
1717
1718impl<'a> crate::CdpCommand<'a> for SetEmitTouchEventsForMouseParams<'a> {
1719 const METHOD: &'static str = "Emulation.setEmitTouchEventsForMouse";
1720 type Response = crate::EmptyReturns;
1721}
1722
1723#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1726#[serde(rename_all = "camelCase")]
1727pub struct SetEmulatedMediaParams<'a> {
1728 #[serde(skip_serializing_if = "Option::is_none")]
1730 media: Option<Cow<'a, str>>,
1731 #[serde(skip_serializing_if = "Option::is_none")]
1733 features: Option<Vec<MediaFeature<'a>>>,
1734}
1735
1736impl<'a> SetEmulatedMediaParams<'a> {
1737 pub fn builder() -> SetEmulatedMediaParamsBuilder<'a> {
1739 SetEmulatedMediaParamsBuilder {
1740 media: None,
1741 features: None,
1742 }
1743 }
1744 pub fn media(&self) -> Option<&str> { self.media.as_deref() }
1746 pub fn features(&self) -> Option<&[MediaFeature<'a>]> { self.features.as_deref() }
1748}
1749
1750#[derive(Default)]
1751pub struct SetEmulatedMediaParamsBuilder<'a> {
1752 media: Option<Cow<'a, str>>,
1753 features: Option<Vec<MediaFeature<'a>>>,
1754}
1755
1756impl<'a> SetEmulatedMediaParamsBuilder<'a> {
1757 pub fn media(mut self, media: impl Into<Cow<'a, str>>) -> Self { self.media = Some(media.into()); self }
1759 pub fn features(mut self, features: Vec<MediaFeature<'a>>) -> Self { self.features = Some(features); self }
1761 pub fn build(self) -> SetEmulatedMediaParams<'a> {
1762 SetEmulatedMediaParams {
1763 media: self.media,
1764 features: self.features,
1765 }
1766 }
1767}
1768
1769impl<'a> SetEmulatedMediaParams<'a> { pub const METHOD: &'static str = "Emulation.setEmulatedMedia"; }
1770
1771impl<'a> crate::CdpCommand<'a> for SetEmulatedMediaParams<'a> {
1772 const METHOD: &'static str = "Emulation.setEmulatedMedia";
1773 type Response = crate::EmptyReturns;
1774}
1775
1776#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1779#[serde(rename_all = "camelCase")]
1780pub struct SetEmulatedVisionDeficiencyParams<'a> {
1781 #[serde(rename = "type")]
1784 type_: Cow<'a, str>,
1785}
1786
1787impl<'a> SetEmulatedVisionDeficiencyParams<'a> {
1788 pub fn builder(type_: impl Into<Cow<'a, str>>) -> SetEmulatedVisionDeficiencyParamsBuilder<'a> {
1791 SetEmulatedVisionDeficiencyParamsBuilder {
1792 type_: type_.into(),
1793 }
1794 }
1795 pub fn type_(&self) -> &str { self.type_.as_ref() }
1798}
1799
1800
1801pub struct SetEmulatedVisionDeficiencyParamsBuilder<'a> {
1802 type_: Cow<'a, str>,
1803}
1804
1805impl<'a> SetEmulatedVisionDeficiencyParamsBuilder<'a> {
1806 pub fn build(self) -> SetEmulatedVisionDeficiencyParams<'a> {
1807 SetEmulatedVisionDeficiencyParams {
1808 type_: self.type_,
1809 }
1810 }
1811}
1812
1813impl<'a> SetEmulatedVisionDeficiencyParams<'a> { pub const METHOD: &'static str = "Emulation.setEmulatedVisionDeficiency"; }
1814
1815impl<'a> crate::CdpCommand<'a> for SetEmulatedVisionDeficiencyParams<'a> {
1816 const METHOD: &'static str = "Emulation.setEmulatedVisionDeficiency";
1817 type Response = crate::EmptyReturns;
1818}
1819
1820#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1823#[serde(rename_all = "camelCase")]
1824pub struct SetEmulatedOSTextScaleParams {
1825 #[serde(skip_serializing_if = "Option::is_none")]
1826 scale: Option<f64>,
1827}
1828
1829impl SetEmulatedOSTextScaleParams {
1830 pub fn builder() -> SetEmulatedOSTextScaleParamsBuilder {
1832 SetEmulatedOSTextScaleParamsBuilder {
1833 scale: None,
1834 }
1835 }
1836 pub fn scale(&self) -> Option<f64> { self.scale }
1837}
1838
1839#[derive(Default)]
1840pub struct SetEmulatedOSTextScaleParamsBuilder {
1841 scale: Option<f64>,
1842}
1843
1844impl SetEmulatedOSTextScaleParamsBuilder {
1845 pub fn scale(mut self, scale: f64) -> Self { self.scale = Some(scale); self }
1846 pub fn build(self) -> SetEmulatedOSTextScaleParams {
1847 SetEmulatedOSTextScaleParams {
1848 scale: self.scale,
1849 }
1850 }
1851}
1852
1853impl SetEmulatedOSTextScaleParams { pub const METHOD: &'static str = "Emulation.setEmulatedOSTextScale"; }
1854
1855impl<'a> crate::CdpCommand<'a> for SetEmulatedOSTextScaleParams {
1856 const METHOD: &'static str = "Emulation.setEmulatedOSTextScale";
1857 type Response = crate::EmptyReturns;
1858}
1859
1860#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1864#[serde(rename_all = "camelCase")]
1865pub struct SetGeolocationOverrideParams {
1866 #[serde(skip_serializing_if = "Option::is_none")]
1868 latitude: Option<f64>,
1869 #[serde(skip_serializing_if = "Option::is_none")]
1871 longitude: Option<f64>,
1872 #[serde(skip_serializing_if = "Option::is_none")]
1874 accuracy: Option<f64>,
1875 #[serde(skip_serializing_if = "Option::is_none")]
1877 altitude: Option<f64>,
1878 #[serde(skip_serializing_if = "Option::is_none", rename = "altitudeAccuracy")]
1880 altitude_accuracy: Option<f64>,
1881 #[serde(skip_serializing_if = "Option::is_none")]
1883 heading: Option<f64>,
1884 #[serde(skip_serializing_if = "Option::is_none")]
1886 speed: Option<f64>,
1887}
1888
1889impl SetGeolocationOverrideParams {
1890 pub fn builder() -> SetGeolocationOverrideParamsBuilder {
1892 SetGeolocationOverrideParamsBuilder {
1893 latitude: None,
1894 longitude: None,
1895 accuracy: None,
1896 altitude: None,
1897 altitude_accuracy: None,
1898 heading: None,
1899 speed: None,
1900 }
1901 }
1902 pub fn latitude(&self) -> Option<f64> { self.latitude }
1904 pub fn longitude(&self) -> Option<f64> { self.longitude }
1906 pub fn accuracy(&self) -> Option<f64> { self.accuracy }
1908 pub fn altitude(&self) -> Option<f64> { self.altitude }
1910 pub fn altitude_accuracy(&self) -> Option<f64> { self.altitude_accuracy }
1912 pub fn heading(&self) -> Option<f64> { self.heading }
1914 pub fn speed(&self) -> Option<f64> { self.speed }
1916}
1917
1918#[derive(Default)]
1919pub struct SetGeolocationOverrideParamsBuilder {
1920 latitude: Option<f64>,
1921 longitude: Option<f64>,
1922 accuracy: Option<f64>,
1923 altitude: Option<f64>,
1924 altitude_accuracy: Option<f64>,
1925 heading: Option<f64>,
1926 speed: Option<f64>,
1927}
1928
1929impl SetGeolocationOverrideParamsBuilder {
1930 pub fn latitude(mut self, latitude: f64) -> Self { self.latitude = Some(latitude); self }
1932 pub fn longitude(mut self, longitude: f64) -> Self { self.longitude = Some(longitude); self }
1934 pub fn accuracy(mut self, accuracy: f64) -> Self { self.accuracy = Some(accuracy); self }
1936 pub fn altitude(mut self, altitude: f64) -> Self { self.altitude = Some(altitude); self }
1938 pub fn altitude_accuracy(mut self, altitude_accuracy: f64) -> Self { self.altitude_accuracy = Some(altitude_accuracy); self }
1940 pub fn heading(mut self, heading: f64) -> Self { self.heading = Some(heading); self }
1942 pub fn speed(mut self, speed: f64) -> Self { self.speed = Some(speed); self }
1944 pub fn build(self) -> SetGeolocationOverrideParams {
1945 SetGeolocationOverrideParams {
1946 latitude: self.latitude,
1947 longitude: self.longitude,
1948 accuracy: self.accuracy,
1949 altitude: self.altitude,
1950 altitude_accuracy: self.altitude_accuracy,
1951 heading: self.heading,
1952 speed: self.speed,
1953 }
1954 }
1955}
1956
1957impl SetGeolocationOverrideParams { pub const METHOD: &'static str = "Emulation.setGeolocationOverride"; }
1958
1959impl<'a> crate::CdpCommand<'a> for SetGeolocationOverrideParams {
1960 const METHOD: &'static str = "Emulation.setGeolocationOverride";
1961 type Response = crate::EmptyReturns;
1962}
1963
1964
1965#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1966#[serde(rename_all = "camelCase")]
1967pub struct GetOverriddenSensorInformationParams {
1968 #[serde(rename = "type")]
1969 type_: SensorType,
1970}
1971
1972impl GetOverriddenSensorInformationParams {
1973 pub fn builder(type_: impl Into<SensorType>) -> GetOverriddenSensorInformationParamsBuilder {
1976 GetOverriddenSensorInformationParamsBuilder {
1977 type_: type_.into(),
1978 }
1979 }
1980 pub fn type_(&self) -> &SensorType { &self.type_ }
1981}
1982
1983
1984pub struct GetOverriddenSensorInformationParamsBuilder {
1985 type_: SensorType,
1986}
1987
1988impl GetOverriddenSensorInformationParamsBuilder {
1989 pub fn build(self) -> GetOverriddenSensorInformationParams {
1990 GetOverriddenSensorInformationParams {
1991 type_: self.type_,
1992 }
1993 }
1994}
1995
1996
1997#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1998#[serde(rename_all = "camelCase")]
1999pub struct GetOverriddenSensorInformationReturns {
2000 #[serde(rename = "requestedSamplingFrequency")]
2001 requested_sampling_frequency: f64,
2002}
2003
2004impl GetOverriddenSensorInformationReturns {
2005 pub fn builder(requested_sampling_frequency: f64) -> GetOverriddenSensorInformationReturnsBuilder {
2008 GetOverriddenSensorInformationReturnsBuilder {
2009 requested_sampling_frequency: requested_sampling_frequency,
2010 }
2011 }
2012 pub fn requested_sampling_frequency(&self) -> f64 { self.requested_sampling_frequency }
2013}
2014
2015
2016pub struct GetOverriddenSensorInformationReturnsBuilder {
2017 requested_sampling_frequency: f64,
2018}
2019
2020impl GetOverriddenSensorInformationReturnsBuilder {
2021 pub fn build(self) -> GetOverriddenSensorInformationReturns {
2022 GetOverriddenSensorInformationReturns {
2023 requested_sampling_frequency: self.requested_sampling_frequency,
2024 }
2025 }
2026}
2027
2028impl GetOverriddenSensorInformationParams { pub const METHOD: &'static str = "Emulation.getOverriddenSensorInformation"; }
2029
2030impl<'a> crate::CdpCommand<'a> for GetOverriddenSensorInformationParams {
2031 const METHOD: &'static str = "Emulation.getOverriddenSensorInformation";
2032 type Response = GetOverriddenSensorInformationReturns;
2033}
2034
2035#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2042#[serde(rename_all = "camelCase")]
2043pub struct SetSensorOverrideEnabledParams {
2044 enabled: bool,
2045 #[serde(rename = "type")]
2046 type_: SensorType,
2047 #[serde(skip_serializing_if = "Option::is_none")]
2048 metadata: Option<SensorMetadata>,
2049}
2050
2051impl SetSensorOverrideEnabledParams {
2052 pub fn builder(enabled: bool, type_: impl Into<SensorType>) -> SetSensorOverrideEnabledParamsBuilder {
2056 SetSensorOverrideEnabledParamsBuilder {
2057 enabled: enabled,
2058 type_: type_.into(),
2059 metadata: None,
2060 }
2061 }
2062 pub fn enabled(&self) -> bool { self.enabled }
2063 pub fn type_(&self) -> &SensorType { &self.type_ }
2064 pub fn metadata(&self) -> Option<&SensorMetadata> { self.metadata.as_ref() }
2065}
2066
2067
2068pub struct SetSensorOverrideEnabledParamsBuilder {
2069 enabled: bool,
2070 type_: SensorType,
2071 metadata: Option<SensorMetadata>,
2072}
2073
2074impl SetSensorOverrideEnabledParamsBuilder {
2075 pub fn metadata(mut self, metadata: SensorMetadata) -> Self { self.metadata = Some(metadata); self }
2076 pub fn build(self) -> SetSensorOverrideEnabledParams {
2077 SetSensorOverrideEnabledParams {
2078 enabled: self.enabled,
2079 type_: self.type_,
2080 metadata: self.metadata,
2081 }
2082 }
2083}
2084
2085impl SetSensorOverrideEnabledParams { pub const METHOD: &'static str = "Emulation.setSensorOverrideEnabled"; }
2086
2087impl<'a> crate::CdpCommand<'a> for SetSensorOverrideEnabledParams {
2088 const METHOD: &'static str = "Emulation.setSensorOverrideEnabled";
2089 type Response = crate::EmptyReturns;
2090}
2091
2092#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2096#[serde(rename_all = "camelCase")]
2097pub struct SetSensorOverrideReadingsParams {
2098 #[serde(rename = "type")]
2099 type_: SensorType,
2100 reading: SensorReading,
2101}
2102
2103impl SetSensorOverrideReadingsParams {
2104 pub fn builder(type_: impl Into<SensorType>, reading: SensorReading) -> SetSensorOverrideReadingsParamsBuilder {
2108 SetSensorOverrideReadingsParamsBuilder {
2109 type_: type_.into(),
2110 reading: reading,
2111 }
2112 }
2113 pub fn type_(&self) -> &SensorType { &self.type_ }
2114 pub fn reading(&self) -> &SensorReading { &self.reading }
2115}
2116
2117
2118pub struct SetSensorOverrideReadingsParamsBuilder {
2119 type_: SensorType,
2120 reading: SensorReading,
2121}
2122
2123impl SetSensorOverrideReadingsParamsBuilder {
2124 pub fn build(self) -> SetSensorOverrideReadingsParams {
2125 SetSensorOverrideReadingsParams {
2126 type_: self.type_,
2127 reading: self.reading,
2128 }
2129 }
2130}
2131
2132impl SetSensorOverrideReadingsParams { pub const METHOD: &'static str = "Emulation.setSensorOverrideReadings"; }
2133
2134impl<'a> crate::CdpCommand<'a> for SetSensorOverrideReadingsParams {
2135 const METHOD: &'static str = "Emulation.setSensorOverrideReadings";
2136 type Response = crate::EmptyReturns;
2137}
2138
2139#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2145#[serde(rename_all = "camelCase")]
2146pub struct SetPressureSourceOverrideEnabledParams {
2147 enabled: bool,
2148 source: PressureSource,
2149 #[serde(skip_serializing_if = "Option::is_none")]
2150 metadata: Option<PressureMetadata>,
2151}
2152
2153impl SetPressureSourceOverrideEnabledParams {
2154 pub fn builder(enabled: bool, source: impl Into<PressureSource>) -> SetPressureSourceOverrideEnabledParamsBuilder {
2158 SetPressureSourceOverrideEnabledParamsBuilder {
2159 enabled: enabled,
2160 source: source.into(),
2161 metadata: None,
2162 }
2163 }
2164 pub fn enabled(&self) -> bool { self.enabled }
2165 pub fn source(&self) -> &PressureSource { &self.source }
2166 pub fn metadata(&self) -> Option<&PressureMetadata> { self.metadata.as_ref() }
2167}
2168
2169
2170pub struct SetPressureSourceOverrideEnabledParamsBuilder {
2171 enabled: bool,
2172 source: PressureSource,
2173 metadata: Option<PressureMetadata>,
2174}
2175
2176impl SetPressureSourceOverrideEnabledParamsBuilder {
2177 pub fn metadata(mut self, metadata: PressureMetadata) -> Self { self.metadata = Some(metadata); self }
2178 pub fn build(self) -> SetPressureSourceOverrideEnabledParams {
2179 SetPressureSourceOverrideEnabledParams {
2180 enabled: self.enabled,
2181 source: self.source,
2182 metadata: self.metadata,
2183 }
2184 }
2185}
2186
2187impl SetPressureSourceOverrideEnabledParams { pub const METHOD: &'static str = "Emulation.setPressureSourceOverrideEnabled"; }
2188
2189impl<'a> crate::CdpCommand<'a> for SetPressureSourceOverrideEnabledParams {
2190 const METHOD: &'static str = "Emulation.setPressureSourceOverrideEnabled";
2191 type Response = crate::EmptyReturns;
2192}
2193
2194#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2200#[serde(rename_all = "camelCase")]
2201pub struct SetPressureStateOverrideParams {
2202 source: PressureSource,
2203 state: PressureState,
2204}
2205
2206impl SetPressureStateOverrideParams {
2207 pub fn builder(source: impl Into<PressureSource>, state: impl Into<PressureState>) -> SetPressureStateOverrideParamsBuilder {
2211 SetPressureStateOverrideParamsBuilder {
2212 source: source.into(),
2213 state: state.into(),
2214 }
2215 }
2216 pub fn source(&self) -> &PressureSource { &self.source }
2217 pub fn state(&self) -> &PressureState { &self.state }
2218}
2219
2220
2221pub struct SetPressureStateOverrideParamsBuilder {
2222 source: PressureSource,
2223 state: PressureState,
2224}
2225
2226impl SetPressureStateOverrideParamsBuilder {
2227 pub fn build(self) -> SetPressureStateOverrideParams {
2228 SetPressureStateOverrideParams {
2229 source: self.source,
2230 state: self.state,
2231 }
2232 }
2233}
2234
2235impl SetPressureStateOverrideParams { pub const METHOD: &'static str = "Emulation.setPressureStateOverride"; }
2236
2237impl<'a> crate::CdpCommand<'a> for SetPressureStateOverrideParams {
2238 const METHOD: &'static str = "Emulation.setPressureStateOverride";
2239 type Response = crate::EmptyReturns;
2240}
2241
2242#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2247#[serde(rename_all = "camelCase")]
2248pub struct SetPressureDataOverrideParams {
2249 source: PressureSource,
2250 state: PressureState,
2251 #[serde(skip_serializing_if = "Option::is_none", rename = "ownContributionEstimate")]
2252 own_contribution_estimate: Option<f64>,
2253}
2254
2255impl SetPressureDataOverrideParams {
2256 pub fn builder(source: impl Into<PressureSource>, state: impl Into<PressureState>) -> SetPressureDataOverrideParamsBuilder {
2260 SetPressureDataOverrideParamsBuilder {
2261 source: source.into(),
2262 state: state.into(),
2263 own_contribution_estimate: None,
2264 }
2265 }
2266 pub fn source(&self) -> &PressureSource { &self.source }
2267 pub fn state(&self) -> &PressureState { &self.state }
2268 pub fn own_contribution_estimate(&self) -> Option<f64> { self.own_contribution_estimate }
2269}
2270
2271
2272pub struct SetPressureDataOverrideParamsBuilder {
2273 source: PressureSource,
2274 state: PressureState,
2275 own_contribution_estimate: Option<f64>,
2276}
2277
2278impl SetPressureDataOverrideParamsBuilder {
2279 pub fn own_contribution_estimate(mut self, own_contribution_estimate: f64) -> Self { self.own_contribution_estimate = Some(own_contribution_estimate); self }
2280 pub fn build(self) -> SetPressureDataOverrideParams {
2281 SetPressureDataOverrideParams {
2282 source: self.source,
2283 state: self.state,
2284 own_contribution_estimate: self.own_contribution_estimate,
2285 }
2286 }
2287}
2288
2289impl SetPressureDataOverrideParams { pub const METHOD: &'static str = "Emulation.setPressureDataOverride"; }
2290
2291impl<'a> crate::CdpCommand<'a> for SetPressureDataOverrideParams {
2292 const METHOD: &'static str = "Emulation.setPressureDataOverride";
2293 type Response = crate::EmptyReturns;
2294}
2295
2296#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2299#[serde(rename_all = "camelCase")]
2300pub struct SetIdleOverrideParams {
2301 #[serde(rename = "isUserActive")]
2303 is_user_active: bool,
2304 #[serde(rename = "isScreenUnlocked")]
2306 is_screen_unlocked: bool,
2307}
2308
2309impl SetIdleOverrideParams {
2310 pub fn builder(is_user_active: bool, is_screen_unlocked: bool) -> SetIdleOverrideParamsBuilder {
2314 SetIdleOverrideParamsBuilder {
2315 is_user_active: is_user_active,
2316 is_screen_unlocked: is_screen_unlocked,
2317 }
2318 }
2319 pub fn is_user_active(&self) -> bool { self.is_user_active }
2321 pub fn is_screen_unlocked(&self) -> bool { self.is_screen_unlocked }
2323}
2324
2325
2326pub struct SetIdleOverrideParamsBuilder {
2327 is_user_active: bool,
2328 is_screen_unlocked: bool,
2329}
2330
2331impl SetIdleOverrideParamsBuilder {
2332 pub fn build(self) -> SetIdleOverrideParams {
2333 SetIdleOverrideParams {
2334 is_user_active: self.is_user_active,
2335 is_screen_unlocked: self.is_screen_unlocked,
2336 }
2337 }
2338}
2339
2340impl SetIdleOverrideParams { pub const METHOD: &'static str = "Emulation.setIdleOverride"; }
2341
2342impl<'a> crate::CdpCommand<'a> for SetIdleOverrideParams {
2343 const METHOD: &'static str = "Emulation.setIdleOverride";
2344 type Response = crate::EmptyReturns;
2345}
2346
2347#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2348pub struct ClearIdleOverrideParams {}
2349
2350impl ClearIdleOverrideParams { pub const METHOD: &'static str = "Emulation.clearIdleOverride"; }
2351
2352impl<'a> crate::CdpCommand<'a> for ClearIdleOverrideParams {
2353 const METHOD: &'static str = "Emulation.clearIdleOverride";
2354 type Response = crate::EmptyReturns;
2355}
2356
2357#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2360#[serde(rename_all = "camelCase")]
2361pub struct SetNavigatorOverridesParams<'a> {
2362 platform: Cow<'a, str>,
2364}
2365
2366impl<'a> SetNavigatorOverridesParams<'a> {
2367 pub fn builder(platform: impl Into<Cow<'a, str>>) -> SetNavigatorOverridesParamsBuilder<'a> {
2370 SetNavigatorOverridesParamsBuilder {
2371 platform: platform.into(),
2372 }
2373 }
2374 pub fn platform(&self) -> &str { self.platform.as_ref() }
2376}
2377
2378
2379pub struct SetNavigatorOverridesParamsBuilder<'a> {
2380 platform: Cow<'a, str>,
2381}
2382
2383impl<'a> SetNavigatorOverridesParamsBuilder<'a> {
2384 pub fn build(self) -> SetNavigatorOverridesParams<'a> {
2385 SetNavigatorOverridesParams {
2386 platform: self.platform,
2387 }
2388 }
2389}
2390
2391impl<'a> SetNavigatorOverridesParams<'a> { pub const METHOD: &'static str = "Emulation.setNavigatorOverrides"; }
2392
2393impl<'a> crate::CdpCommand<'a> for SetNavigatorOverridesParams<'a> {
2394 const METHOD: &'static str = "Emulation.setNavigatorOverrides";
2395 type Response = crate::EmptyReturns;
2396}
2397
2398#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2401#[serde(rename_all = "camelCase")]
2402pub struct SetPageScaleFactorParams {
2403 #[serde(rename = "pageScaleFactor")]
2405 page_scale_factor: f64,
2406}
2407
2408impl SetPageScaleFactorParams {
2409 pub fn builder(page_scale_factor: f64) -> SetPageScaleFactorParamsBuilder {
2412 SetPageScaleFactorParamsBuilder {
2413 page_scale_factor: page_scale_factor,
2414 }
2415 }
2416 pub fn page_scale_factor(&self) -> f64 { self.page_scale_factor }
2418}
2419
2420
2421pub struct SetPageScaleFactorParamsBuilder {
2422 page_scale_factor: f64,
2423}
2424
2425impl SetPageScaleFactorParamsBuilder {
2426 pub fn build(self) -> SetPageScaleFactorParams {
2427 SetPageScaleFactorParams {
2428 page_scale_factor: self.page_scale_factor,
2429 }
2430 }
2431}
2432
2433impl SetPageScaleFactorParams { pub const METHOD: &'static str = "Emulation.setPageScaleFactor"; }
2434
2435impl<'a> crate::CdpCommand<'a> for SetPageScaleFactorParams {
2436 const METHOD: &'static str = "Emulation.setPageScaleFactor";
2437 type Response = crate::EmptyReturns;
2438}
2439
2440#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2443#[serde(rename_all = "camelCase")]
2444pub struct SetScriptExecutionDisabledParams {
2445 value: bool,
2447}
2448
2449impl SetScriptExecutionDisabledParams {
2450 pub fn builder(value: bool) -> SetScriptExecutionDisabledParamsBuilder {
2453 SetScriptExecutionDisabledParamsBuilder {
2454 value: value,
2455 }
2456 }
2457 pub fn value(&self) -> bool { self.value }
2459}
2460
2461
2462pub struct SetScriptExecutionDisabledParamsBuilder {
2463 value: bool,
2464}
2465
2466impl SetScriptExecutionDisabledParamsBuilder {
2467 pub fn build(self) -> SetScriptExecutionDisabledParams {
2468 SetScriptExecutionDisabledParams {
2469 value: self.value,
2470 }
2471 }
2472}
2473
2474impl SetScriptExecutionDisabledParams { pub const METHOD: &'static str = "Emulation.setScriptExecutionDisabled"; }
2475
2476impl<'a> crate::CdpCommand<'a> for SetScriptExecutionDisabledParams {
2477 const METHOD: &'static str = "Emulation.setScriptExecutionDisabled";
2478 type Response = crate::EmptyReturns;
2479}
2480
2481#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2484#[serde(rename_all = "camelCase")]
2485pub struct SetTouchEmulationEnabledParams {
2486 enabled: bool,
2488 #[serde(skip_serializing_if = "Option::is_none", rename = "maxTouchPoints")]
2490 max_touch_points: Option<i64>,
2491}
2492
2493impl SetTouchEmulationEnabledParams {
2494 pub fn builder(enabled: bool) -> SetTouchEmulationEnabledParamsBuilder {
2497 SetTouchEmulationEnabledParamsBuilder {
2498 enabled: enabled,
2499 max_touch_points: None,
2500 }
2501 }
2502 pub fn enabled(&self) -> bool { self.enabled }
2504 pub fn max_touch_points(&self) -> Option<i64> { self.max_touch_points }
2506}
2507
2508
2509pub struct SetTouchEmulationEnabledParamsBuilder {
2510 enabled: bool,
2511 max_touch_points: Option<i64>,
2512}
2513
2514impl SetTouchEmulationEnabledParamsBuilder {
2515 pub fn max_touch_points(mut self, max_touch_points: i64) -> Self { self.max_touch_points = Some(max_touch_points); self }
2517 pub fn build(self) -> SetTouchEmulationEnabledParams {
2518 SetTouchEmulationEnabledParams {
2519 enabled: self.enabled,
2520 max_touch_points: self.max_touch_points,
2521 }
2522 }
2523}
2524
2525impl SetTouchEmulationEnabledParams { pub const METHOD: &'static str = "Emulation.setTouchEmulationEnabled"; }
2526
2527impl<'a> crate::CdpCommand<'a> for SetTouchEmulationEnabledParams {
2528 const METHOD: &'static str = "Emulation.setTouchEmulationEnabled";
2529 type Response = crate::EmptyReturns;
2530}
2531
2532#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2536#[serde(rename_all = "camelCase")]
2537pub struct SetVirtualTimePolicyParams {
2538 policy: VirtualTimePolicy,
2539 #[serde(skip_serializing_if = "Option::is_none")]
2542 budget: Option<f64>,
2543 #[serde(skip_serializing_if = "Option::is_none", rename = "maxVirtualTimeTaskStarvationCount")]
2546 max_virtual_time_task_starvation_count: Option<u64>,
2547 #[serde(skip_serializing_if = "Option::is_none", rename = "initialVirtualTime")]
2549 initial_virtual_time: Option<crate::network::TimeSinceEpoch>,
2550}
2551
2552impl SetVirtualTimePolicyParams {
2553 pub fn builder(policy: impl Into<VirtualTimePolicy>) -> SetVirtualTimePolicyParamsBuilder {
2556 SetVirtualTimePolicyParamsBuilder {
2557 policy: policy.into(),
2558 budget: None,
2559 max_virtual_time_task_starvation_count: None,
2560 initial_virtual_time: None,
2561 }
2562 }
2563 pub fn policy(&self) -> &VirtualTimePolicy { &self.policy }
2564 pub fn budget(&self) -> Option<f64> { self.budget }
2567 pub fn max_virtual_time_task_starvation_count(&self) -> Option<u64> { self.max_virtual_time_task_starvation_count }
2570 pub fn initial_virtual_time(&self) -> Option<&crate::network::TimeSinceEpoch> { self.initial_virtual_time.as_ref() }
2572}
2573
2574
2575pub struct SetVirtualTimePolicyParamsBuilder {
2576 policy: VirtualTimePolicy,
2577 budget: Option<f64>,
2578 max_virtual_time_task_starvation_count: Option<u64>,
2579 initial_virtual_time: Option<crate::network::TimeSinceEpoch>,
2580}
2581
2582impl SetVirtualTimePolicyParamsBuilder {
2583 pub fn budget(mut self, budget: f64) -> Self { self.budget = Some(budget); self }
2586 pub fn max_virtual_time_task_starvation_count(mut self, max_virtual_time_task_starvation_count: u64) -> Self { self.max_virtual_time_task_starvation_count = Some(max_virtual_time_task_starvation_count); self }
2589 pub fn initial_virtual_time(mut self, initial_virtual_time: crate::network::TimeSinceEpoch) -> Self { self.initial_virtual_time = Some(initial_virtual_time); self }
2591 pub fn build(self) -> SetVirtualTimePolicyParams {
2592 SetVirtualTimePolicyParams {
2593 policy: self.policy,
2594 budget: self.budget,
2595 max_virtual_time_task_starvation_count: self.max_virtual_time_task_starvation_count,
2596 initial_virtual_time: self.initial_virtual_time,
2597 }
2598 }
2599}
2600
2601#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2605#[serde(rename_all = "camelCase")]
2606pub struct SetVirtualTimePolicyReturns {
2607 #[serde(rename = "virtualTimeTicksBase")]
2609 virtual_time_ticks_base: f64,
2610}
2611
2612impl SetVirtualTimePolicyReturns {
2613 pub fn builder(virtual_time_ticks_base: f64) -> SetVirtualTimePolicyReturnsBuilder {
2616 SetVirtualTimePolicyReturnsBuilder {
2617 virtual_time_ticks_base: virtual_time_ticks_base,
2618 }
2619 }
2620 pub fn virtual_time_ticks_base(&self) -> f64 { self.virtual_time_ticks_base }
2622}
2623
2624
2625pub struct SetVirtualTimePolicyReturnsBuilder {
2626 virtual_time_ticks_base: f64,
2627}
2628
2629impl SetVirtualTimePolicyReturnsBuilder {
2630 pub fn build(self) -> SetVirtualTimePolicyReturns {
2631 SetVirtualTimePolicyReturns {
2632 virtual_time_ticks_base: self.virtual_time_ticks_base,
2633 }
2634 }
2635}
2636
2637impl SetVirtualTimePolicyParams { pub const METHOD: &'static str = "Emulation.setVirtualTimePolicy"; }
2638
2639impl<'a> crate::CdpCommand<'a> for SetVirtualTimePolicyParams {
2640 const METHOD: &'static str = "Emulation.setVirtualTimePolicy";
2641 type Response = SetVirtualTimePolicyReturns;
2642}
2643
2644#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2647#[serde(rename_all = "camelCase")]
2648pub struct SetLocaleOverrideParams<'a> {
2649 #[serde(skip_serializing_if = "Option::is_none")]
2652 locale: Option<Cow<'a, str>>,
2653}
2654
2655impl<'a> SetLocaleOverrideParams<'a> {
2656 pub fn builder() -> SetLocaleOverrideParamsBuilder<'a> {
2658 SetLocaleOverrideParamsBuilder {
2659 locale: None,
2660 }
2661 }
2662 pub fn locale(&self) -> Option<&str> { self.locale.as_deref() }
2665}
2666
2667#[derive(Default)]
2668pub struct SetLocaleOverrideParamsBuilder<'a> {
2669 locale: Option<Cow<'a, str>>,
2670}
2671
2672impl<'a> SetLocaleOverrideParamsBuilder<'a> {
2673 pub fn locale(mut self, locale: impl Into<Cow<'a, str>>) -> Self { self.locale = Some(locale.into()); self }
2676 pub fn build(self) -> SetLocaleOverrideParams<'a> {
2677 SetLocaleOverrideParams {
2678 locale: self.locale,
2679 }
2680 }
2681}
2682
2683impl<'a> SetLocaleOverrideParams<'a> { pub const METHOD: &'static str = "Emulation.setLocaleOverride"; }
2684
2685impl<'a> crate::CdpCommand<'a> for SetLocaleOverrideParams<'a> {
2686 const METHOD: &'static str = "Emulation.setLocaleOverride";
2687 type Response = crate::EmptyReturns;
2688}
2689
2690#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2693#[serde(rename_all = "camelCase")]
2694pub struct SetTimezoneOverrideParams<'a> {
2695 #[serde(rename = "timezoneId")]
2699 timezone_id: Cow<'a, str>,
2700}
2701
2702impl<'a> SetTimezoneOverrideParams<'a> {
2703 pub fn builder(timezone_id: impl Into<Cow<'a, str>>) -> SetTimezoneOverrideParamsBuilder<'a> {
2706 SetTimezoneOverrideParamsBuilder {
2707 timezone_id: timezone_id.into(),
2708 }
2709 }
2710 pub fn timezone_id(&self) -> &str { self.timezone_id.as_ref() }
2714}
2715
2716
2717pub struct SetTimezoneOverrideParamsBuilder<'a> {
2718 timezone_id: Cow<'a, str>,
2719}
2720
2721impl<'a> SetTimezoneOverrideParamsBuilder<'a> {
2722 pub fn build(self) -> SetTimezoneOverrideParams<'a> {
2723 SetTimezoneOverrideParams {
2724 timezone_id: self.timezone_id,
2725 }
2726 }
2727}
2728
2729impl<'a> SetTimezoneOverrideParams<'a> { pub const METHOD: &'static str = "Emulation.setTimezoneOverride"; }
2730
2731impl<'a> crate::CdpCommand<'a> for SetTimezoneOverrideParams<'a> {
2732 const METHOD: &'static str = "Emulation.setTimezoneOverride";
2733 type Response = crate::EmptyReturns;
2734}
2735
2736#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2741#[serde(rename_all = "camelCase")]
2742pub struct SetVisibleSizeParams {
2743 width: u64,
2745 height: i64,
2747}
2748
2749impl SetVisibleSizeParams {
2750 pub fn builder(width: u64, height: i64) -> SetVisibleSizeParamsBuilder {
2754 SetVisibleSizeParamsBuilder {
2755 width: width,
2756 height: height,
2757 }
2758 }
2759 pub fn width(&self) -> u64 { self.width }
2761 pub fn height(&self) -> i64 { self.height }
2763}
2764
2765
2766pub struct SetVisibleSizeParamsBuilder {
2767 width: u64,
2768 height: i64,
2769}
2770
2771impl SetVisibleSizeParamsBuilder {
2772 pub fn build(self) -> SetVisibleSizeParams {
2773 SetVisibleSizeParams {
2774 width: self.width,
2775 height: self.height,
2776 }
2777 }
2778}
2779
2780impl SetVisibleSizeParams { pub const METHOD: &'static str = "Emulation.setVisibleSize"; }
2781
2782impl<'a> crate::CdpCommand<'a> for SetVisibleSizeParams {
2783 const METHOD: &'static str = "Emulation.setVisibleSize";
2784 type Response = crate::EmptyReturns;
2785}
2786
2787
2788#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2789#[serde(rename_all = "camelCase")]
2790pub struct SetDisabledImageTypesParams {
2791 #[serde(rename = "imageTypes")]
2793 image_types: Vec<DisabledImageType>,
2794}
2795
2796impl SetDisabledImageTypesParams {
2797 pub fn builder(image_types: Vec<DisabledImageType>) -> SetDisabledImageTypesParamsBuilder {
2800 SetDisabledImageTypesParamsBuilder {
2801 image_types: image_types,
2802 }
2803 }
2804 pub fn image_types(&self) -> &[DisabledImageType] { &self.image_types }
2806}
2807
2808
2809pub struct SetDisabledImageTypesParamsBuilder {
2810 image_types: Vec<DisabledImageType>,
2811}
2812
2813impl SetDisabledImageTypesParamsBuilder {
2814 pub fn build(self) -> SetDisabledImageTypesParams {
2815 SetDisabledImageTypesParams {
2816 image_types: self.image_types,
2817 }
2818 }
2819}
2820
2821impl SetDisabledImageTypesParams { pub const METHOD: &'static str = "Emulation.setDisabledImageTypes"; }
2822
2823impl<'a> crate::CdpCommand<'a> for SetDisabledImageTypesParams {
2824 const METHOD: &'static str = "Emulation.setDisabledImageTypes";
2825 type Response = crate::EmptyReturns;
2826}
2827
2828#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2831#[serde(rename_all = "camelCase")]
2832pub struct SetDataSaverOverrideParams {
2833 #[serde(skip_serializing_if = "Option::is_none", rename = "dataSaverEnabled")]
2835 data_saver_enabled: Option<bool>,
2836}
2837
2838impl SetDataSaverOverrideParams {
2839 pub fn builder() -> SetDataSaverOverrideParamsBuilder {
2841 SetDataSaverOverrideParamsBuilder {
2842 data_saver_enabled: None,
2843 }
2844 }
2845 pub fn data_saver_enabled(&self) -> Option<bool> { self.data_saver_enabled }
2847}
2848
2849#[derive(Default)]
2850pub struct SetDataSaverOverrideParamsBuilder {
2851 data_saver_enabled: Option<bool>,
2852}
2853
2854impl SetDataSaverOverrideParamsBuilder {
2855 pub fn data_saver_enabled(mut self, data_saver_enabled: bool) -> Self { self.data_saver_enabled = Some(data_saver_enabled); self }
2857 pub fn build(self) -> SetDataSaverOverrideParams {
2858 SetDataSaverOverrideParams {
2859 data_saver_enabled: self.data_saver_enabled,
2860 }
2861 }
2862}
2863
2864impl SetDataSaverOverrideParams { pub const METHOD: &'static str = "Emulation.setDataSaverOverride"; }
2865
2866impl<'a> crate::CdpCommand<'a> for SetDataSaverOverrideParams {
2867 const METHOD: &'static str = "Emulation.setDataSaverOverride";
2868 type Response = crate::EmptyReturns;
2869}
2870
2871
2872#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2873#[serde(rename_all = "camelCase")]
2874pub struct SetHardwareConcurrencyOverrideParams {
2875 #[serde(rename = "hardwareConcurrency")]
2877 hardware_concurrency: i64,
2878}
2879
2880impl SetHardwareConcurrencyOverrideParams {
2881 pub fn builder(hardware_concurrency: i64) -> SetHardwareConcurrencyOverrideParamsBuilder {
2884 SetHardwareConcurrencyOverrideParamsBuilder {
2885 hardware_concurrency: hardware_concurrency,
2886 }
2887 }
2888 pub fn hardware_concurrency(&self) -> i64 { self.hardware_concurrency }
2890}
2891
2892
2893pub struct SetHardwareConcurrencyOverrideParamsBuilder {
2894 hardware_concurrency: i64,
2895}
2896
2897impl SetHardwareConcurrencyOverrideParamsBuilder {
2898 pub fn build(self) -> SetHardwareConcurrencyOverrideParams {
2899 SetHardwareConcurrencyOverrideParams {
2900 hardware_concurrency: self.hardware_concurrency,
2901 }
2902 }
2903}
2904
2905impl SetHardwareConcurrencyOverrideParams { pub const METHOD: &'static str = "Emulation.setHardwareConcurrencyOverride"; }
2906
2907impl<'a> crate::CdpCommand<'a> for SetHardwareConcurrencyOverrideParams {
2908 const METHOD: &'static str = "Emulation.setHardwareConcurrencyOverride";
2909 type Response = crate::EmptyReturns;
2910}
2911
2912#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2916#[serde(rename_all = "camelCase")]
2917pub struct SetUserAgentOverrideParams<'a> {
2918 #[serde(rename = "userAgent")]
2920 user_agent: Cow<'a, str>,
2921 #[serde(skip_serializing_if = "Option::is_none", rename = "acceptLanguage")]
2923 accept_language: Option<Cow<'a, str>>,
2924 #[serde(skip_serializing_if = "Option::is_none")]
2926 platform: Option<Cow<'a, str>>,
2927 #[serde(skip_serializing_if = "Option::is_none", rename = "userAgentMetadata")]
2929 user_agent_metadata: Option<UserAgentMetadata<'a>>,
2930}
2931
2932impl<'a> SetUserAgentOverrideParams<'a> {
2933 pub fn builder(user_agent: impl Into<Cow<'a, str>>) -> SetUserAgentOverrideParamsBuilder<'a> {
2936 SetUserAgentOverrideParamsBuilder {
2937 user_agent: user_agent.into(),
2938 accept_language: None,
2939 platform: None,
2940 user_agent_metadata: None,
2941 }
2942 }
2943 pub fn user_agent(&self) -> &str { self.user_agent.as_ref() }
2945 pub fn accept_language(&self) -> Option<&str> { self.accept_language.as_deref() }
2947 pub fn platform(&self) -> Option<&str> { self.platform.as_deref() }
2949 pub fn user_agent_metadata(&self) -> Option<&UserAgentMetadata<'a>> { self.user_agent_metadata.as_ref() }
2951}
2952
2953
2954pub struct SetUserAgentOverrideParamsBuilder<'a> {
2955 user_agent: Cow<'a, str>,
2956 accept_language: Option<Cow<'a, str>>,
2957 platform: Option<Cow<'a, str>>,
2958 user_agent_metadata: Option<UserAgentMetadata<'a>>,
2959}
2960
2961impl<'a> SetUserAgentOverrideParamsBuilder<'a> {
2962 pub fn accept_language(mut self, accept_language: impl Into<Cow<'a, str>>) -> Self { self.accept_language = Some(accept_language.into()); self }
2964 pub fn platform(mut self, platform: impl Into<Cow<'a, str>>) -> Self { self.platform = Some(platform.into()); self }
2966 pub fn user_agent_metadata(mut self, user_agent_metadata: UserAgentMetadata<'a>) -> Self { self.user_agent_metadata = Some(user_agent_metadata); self }
2968 pub fn build(self) -> SetUserAgentOverrideParams<'a> {
2969 SetUserAgentOverrideParams {
2970 user_agent: self.user_agent,
2971 accept_language: self.accept_language,
2972 platform: self.platform,
2973 user_agent_metadata: self.user_agent_metadata,
2974 }
2975 }
2976}
2977
2978impl<'a> SetUserAgentOverrideParams<'a> { pub const METHOD: &'static str = "Emulation.setUserAgentOverride"; }
2979
2980impl<'a> crate::CdpCommand<'a> for SetUserAgentOverrideParams<'a> {
2981 const METHOD: &'static str = "Emulation.setUserAgentOverride";
2982 type Response = crate::EmptyReturns;
2983}
2984
2985#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2988#[serde(rename_all = "camelCase")]
2989pub struct SetAutomationOverrideParams {
2990 enabled: bool,
2992}
2993
2994impl SetAutomationOverrideParams {
2995 pub fn builder(enabled: bool) -> SetAutomationOverrideParamsBuilder {
2998 SetAutomationOverrideParamsBuilder {
2999 enabled: enabled,
3000 }
3001 }
3002 pub fn enabled(&self) -> bool { self.enabled }
3004}
3005
3006
3007pub struct SetAutomationOverrideParamsBuilder {
3008 enabled: bool,
3009}
3010
3011impl SetAutomationOverrideParamsBuilder {
3012 pub fn build(self) -> SetAutomationOverrideParams {
3013 SetAutomationOverrideParams {
3014 enabled: self.enabled,
3015 }
3016 }
3017}
3018
3019impl SetAutomationOverrideParams { pub const METHOD: &'static str = "Emulation.setAutomationOverride"; }
3020
3021impl<'a> crate::CdpCommand<'a> for SetAutomationOverrideParams {
3022 const METHOD: &'static str = "Emulation.setAutomationOverride";
3023 type Response = crate::EmptyReturns;
3024}
3025
3026#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3030#[serde(rename_all = "camelCase")]
3031pub struct SetSmallViewportHeightDifferenceOverrideParams {
3032 difference: i64,
3035}
3036
3037impl SetSmallViewportHeightDifferenceOverrideParams {
3038 pub fn builder(difference: i64) -> SetSmallViewportHeightDifferenceOverrideParamsBuilder {
3041 SetSmallViewportHeightDifferenceOverrideParamsBuilder {
3042 difference: difference,
3043 }
3044 }
3045 pub fn difference(&self) -> i64 { self.difference }
3048}
3049
3050
3051pub struct SetSmallViewportHeightDifferenceOverrideParamsBuilder {
3052 difference: i64,
3053}
3054
3055impl SetSmallViewportHeightDifferenceOverrideParamsBuilder {
3056 pub fn build(self) -> SetSmallViewportHeightDifferenceOverrideParams {
3057 SetSmallViewportHeightDifferenceOverrideParams {
3058 difference: self.difference,
3059 }
3060 }
3061}
3062
3063impl SetSmallViewportHeightDifferenceOverrideParams { pub const METHOD: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride"; }
3064
3065impl<'a> crate::CdpCommand<'a> for SetSmallViewportHeightDifferenceOverrideParams {
3066 const METHOD: &'static str = "Emulation.setSmallViewportHeightDifferenceOverride";
3067 type Response = crate::EmptyReturns;
3068}
3069
3070#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3074#[serde(rename_all = "camelCase")]
3075pub struct GetScreenInfosReturns<'a> {
3076 #[serde(rename = "screenInfos")]
3077 screen_infos: Vec<ScreenInfo<'a>>,
3078}
3079
3080impl<'a> GetScreenInfosReturns<'a> {
3081 pub fn builder(screen_infos: Vec<ScreenInfo<'a>>) -> GetScreenInfosReturnsBuilder<'a> {
3084 GetScreenInfosReturnsBuilder {
3085 screen_infos: screen_infos,
3086 }
3087 }
3088 pub fn screen_infos(&self) -> &[ScreenInfo<'a>] { &self.screen_infos }
3089}
3090
3091
3092pub struct GetScreenInfosReturnsBuilder<'a> {
3093 screen_infos: Vec<ScreenInfo<'a>>,
3094}
3095
3096impl<'a> GetScreenInfosReturnsBuilder<'a> {
3097 pub fn build(self) -> GetScreenInfosReturns<'a> {
3098 GetScreenInfosReturns {
3099 screen_infos: self.screen_infos,
3100 }
3101 }
3102}
3103
3104#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3105pub struct GetScreenInfosParams {}
3106
3107impl GetScreenInfosParams { pub const METHOD: &'static str = "Emulation.getScreenInfos"; }
3108
3109impl<'a> crate::CdpCommand<'a> for GetScreenInfosParams {
3110 const METHOD: &'static str = "Emulation.getScreenInfos";
3111 type Response = GetScreenInfosReturns<'a>;
3112}
3113
3114#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3117#[serde(rename_all = "camelCase")]
3118pub struct AddScreenParams<'a> {
3119 left: i64,
3121 top: i64,
3123 width: u64,
3125 height: i64,
3127 #[serde(skip_serializing_if = "Option::is_none", rename = "workAreaInsets")]
3129 work_area_insets: Option<WorkAreaInsets>,
3130 #[serde(skip_serializing_if = "Option::is_none", rename = "devicePixelRatio")]
3132 device_pixel_ratio: Option<f64>,
3133 #[serde(skip_serializing_if = "Option::is_none")]
3135 rotation: Option<i64>,
3136 #[serde(skip_serializing_if = "Option::is_none", rename = "colorDepth")]
3138 color_depth: Option<i64>,
3139 #[serde(skip_serializing_if = "Option::is_none")]
3141 label: Option<Cow<'a, str>>,
3142 #[serde(skip_serializing_if = "Option::is_none", rename = "isInternal")]
3144 is_internal: Option<bool>,
3145}
3146
3147impl<'a> AddScreenParams<'a> {
3148 pub fn builder(left: i64, top: i64, width: u64, height: i64) -> AddScreenParamsBuilder<'a> {
3154 AddScreenParamsBuilder {
3155 left: left,
3156 top: top,
3157 width: width,
3158 height: height,
3159 work_area_insets: None,
3160 device_pixel_ratio: None,
3161 rotation: None,
3162 color_depth: None,
3163 label: None,
3164 is_internal: None,
3165 }
3166 }
3167 pub fn left(&self) -> i64 { self.left }
3169 pub fn top(&self) -> i64 { self.top }
3171 pub fn width(&self) -> u64 { self.width }
3173 pub fn height(&self) -> i64 { self.height }
3175 pub fn work_area_insets(&self) -> Option<&WorkAreaInsets> { self.work_area_insets.as_ref() }
3177 pub fn device_pixel_ratio(&self) -> Option<f64> { self.device_pixel_ratio }
3179 pub fn rotation(&self) -> Option<i64> { self.rotation }
3181 pub fn color_depth(&self) -> Option<i64> { self.color_depth }
3183 pub fn label(&self) -> Option<&str> { self.label.as_deref() }
3185 pub fn is_internal(&self) -> Option<bool> { self.is_internal }
3187}
3188
3189
3190pub struct AddScreenParamsBuilder<'a> {
3191 left: i64,
3192 top: i64,
3193 width: u64,
3194 height: i64,
3195 work_area_insets: Option<WorkAreaInsets>,
3196 device_pixel_ratio: Option<f64>,
3197 rotation: Option<i64>,
3198 color_depth: Option<i64>,
3199 label: Option<Cow<'a, str>>,
3200 is_internal: Option<bool>,
3201}
3202
3203impl<'a> AddScreenParamsBuilder<'a> {
3204 pub fn work_area_insets(mut self, work_area_insets: WorkAreaInsets) -> Self { self.work_area_insets = Some(work_area_insets); self }
3206 pub fn device_pixel_ratio(mut self, device_pixel_ratio: f64) -> Self { self.device_pixel_ratio = Some(device_pixel_ratio); self }
3208 pub fn rotation(mut self, rotation: i64) -> Self { self.rotation = Some(rotation); self }
3210 pub fn color_depth(mut self, color_depth: i64) -> Self { self.color_depth = Some(color_depth); self }
3212 pub fn label(mut self, label: impl Into<Cow<'a, str>>) -> Self { self.label = Some(label.into()); self }
3214 pub fn is_internal(mut self, is_internal: bool) -> Self { self.is_internal = Some(is_internal); self }
3216 pub fn build(self) -> AddScreenParams<'a> {
3217 AddScreenParams {
3218 left: self.left,
3219 top: self.top,
3220 width: self.width,
3221 height: self.height,
3222 work_area_insets: self.work_area_insets,
3223 device_pixel_ratio: self.device_pixel_ratio,
3224 rotation: self.rotation,
3225 color_depth: self.color_depth,
3226 label: self.label,
3227 is_internal: self.is_internal,
3228 }
3229 }
3230}
3231
3232#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3235#[serde(rename_all = "camelCase")]
3236pub struct AddScreenReturns<'a> {
3237 #[serde(rename = "screenInfo")]
3238 screen_info: ScreenInfo<'a>,
3239}
3240
3241impl<'a> AddScreenReturns<'a> {
3242 pub fn builder(screen_info: ScreenInfo<'a>) -> AddScreenReturnsBuilder<'a> {
3245 AddScreenReturnsBuilder {
3246 screen_info: screen_info,
3247 }
3248 }
3249 pub fn screen_info(&self) -> &ScreenInfo<'a> { &self.screen_info }
3250}
3251
3252
3253pub struct AddScreenReturnsBuilder<'a> {
3254 screen_info: ScreenInfo<'a>,
3255}
3256
3257impl<'a> AddScreenReturnsBuilder<'a> {
3258 pub fn build(self) -> AddScreenReturns<'a> {
3259 AddScreenReturns {
3260 screen_info: self.screen_info,
3261 }
3262 }
3263}
3264
3265impl<'a> AddScreenParams<'a> { pub const METHOD: &'static str = "Emulation.addScreen"; }
3266
3267impl<'a> crate::CdpCommand<'a> for AddScreenParams<'a> {
3268 const METHOD: &'static str = "Emulation.addScreen";
3269 type Response = AddScreenReturns<'a>;
3270}
3271
3272#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3275#[serde(rename_all = "camelCase")]
3276pub struct UpdateScreenParams<'a> {
3277 #[serde(rename = "screenId")]
3279 screen_id: ScreenId<'a>,
3280 #[serde(skip_serializing_if = "Option::is_none")]
3282 left: Option<i64>,
3283 #[serde(skip_serializing_if = "Option::is_none")]
3285 top: Option<i64>,
3286 #[serde(skip_serializing_if = "Option::is_none")]
3288 width: Option<u64>,
3289 #[serde(skip_serializing_if = "Option::is_none")]
3291 height: Option<i64>,
3292 #[serde(skip_serializing_if = "Option::is_none", rename = "workAreaInsets")]
3294 work_area_insets: Option<WorkAreaInsets>,
3295 #[serde(skip_serializing_if = "Option::is_none", rename = "devicePixelRatio")]
3297 device_pixel_ratio: Option<f64>,
3298 #[serde(skip_serializing_if = "Option::is_none")]
3300 rotation: Option<i64>,
3301 #[serde(skip_serializing_if = "Option::is_none", rename = "colorDepth")]
3303 color_depth: Option<i64>,
3304 #[serde(skip_serializing_if = "Option::is_none")]
3306 label: Option<Cow<'a, str>>,
3307 #[serde(skip_serializing_if = "Option::is_none", rename = "isInternal")]
3309 is_internal: Option<bool>,
3310}
3311
3312impl<'a> UpdateScreenParams<'a> {
3313 pub fn builder(screen_id: impl Into<ScreenId<'a>>) -> UpdateScreenParamsBuilder<'a> {
3316 UpdateScreenParamsBuilder {
3317 screen_id: screen_id.into(),
3318 left: None,
3319 top: None,
3320 width: None,
3321 height: None,
3322 work_area_insets: None,
3323 device_pixel_ratio: None,
3324 rotation: None,
3325 color_depth: None,
3326 label: None,
3327 is_internal: None,
3328 }
3329 }
3330 pub fn screen_id(&self) -> &ScreenId<'a> { &self.screen_id }
3332 pub fn left(&self) -> Option<i64> { self.left }
3334 pub fn top(&self) -> Option<i64> { self.top }
3336 pub fn width(&self) -> Option<u64> { self.width }
3338 pub fn height(&self) -> Option<i64> { self.height }
3340 pub fn work_area_insets(&self) -> Option<&WorkAreaInsets> { self.work_area_insets.as_ref() }
3342 pub fn device_pixel_ratio(&self) -> Option<f64> { self.device_pixel_ratio }
3344 pub fn rotation(&self) -> Option<i64> { self.rotation }
3346 pub fn color_depth(&self) -> Option<i64> { self.color_depth }
3348 pub fn label(&self) -> Option<&str> { self.label.as_deref() }
3350 pub fn is_internal(&self) -> Option<bool> { self.is_internal }
3352}
3353
3354
3355pub struct UpdateScreenParamsBuilder<'a> {
3356 screen_id: ScreenId<'a>,
3357 left: Option<i64>,
3358 top: Option<i64>,
3359 width: Option<u64>,
3360 height: Option<i64>,
3361 work_area_insets: Option<WorkAreaInsets>,
3362 device_pixel_ratio: Option<f64>,
3363 rotation: Option<i64>,
3364 color_depth: Option<i64>,
3365 label: Option<Cow<'a, str>>,
3366 is_internal: Option<bool>,
3367}
3368
3369impl<'a> UpdateScreenParamsBuilder<'a> {
3370 pub fn left(mut self, left: i64) -> Self { self.left = Some(left); self }
3372 pub fn top(mut self, top: i64) -> Self { self.top = Some(top); self }
3374 pub fn width(mut self, width: u64) -> Self { self.width = Some(width); self }
3376 pub fn height(mut self, height: i64) -> Self { self.height = Some(height); self }
3378 pub fn work_area_insets(mut self, work_area_insets: WorkAreaInsets) -> Self { self.work_area_insets = Some(work_area_insets); self }
3380 pub fn device_pixel_ratio(mut self, device_pixel_ratio: f64) -> Self { self.device_pixel_ratio = Some(device_pixel_ratio); self }
3382 pub fn rotation(mut self, rotation: i64) -> Self { self.rotation = Some(rotation); self }
3384 pub fn color_depth(mut self, color_depth: i64) -> Self { self.color_depth = Some(color_depth); self }
3386 pub fn label(mut self, label: impl Into<Cow<'a, str>>) -> Self { self.label = Some(label.into()); self }
3388 pub fn is_internal(mut self, is_internal: bool) -> Self { self.is_internal = Some(is_internal); self }
3390 pub fn build(self) -> UpdateScreenParams<'a> {
3391 UpdateScreenParams {
3392 screen_id: self.screen_id,
3393 left: self.left,
3394 top: self.top,
3395 width: self.width,
3396 height: self.height,
3397 work_area_insets: self.work_area_insets,
3398 device_pixel_ratio: self.device_pixel_ratio,
3399 rotation: self.rotation,
3400 color_depth: self.color_depth,
3401 label: self.label,
3402 is_internal: self.is_internal,
3403 }
3404 }
3405}
3406
3407#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3410#[serde(rename_all = "camelCase")]
3411pub struct UpdateScreenReturns<'a> {
3412 #[serde(rename = "screenInfo")]
3413 screen_info: ScreenInfo<'a>,
3414}
3415
3416impl<'a> UpdateScreenReturns<'a> {
3417 pub fn builder(screen_info: ScreenInfo<'a>) -> UpdateScreenReturnsBuilder<'a> {
3420 UpdateScreenReturnsBuilder {
3421 screen_info: screen_info,
3422 }
3423 }
3424 pub fn screen_info(&self) -> &ScreenInfo<'a> { &self.screen_info }
3425}
3426
3427
3428pub struct UpdateScreenReturnsBuilder<'a> {
3429 screen_info: ScreenInfo<'a>,
3430}
3431
3432impl<'a> UpdateScreenReturnsBuilder<'a> {
3433 pub fn build(self) -> UpdateScreenReturns<'a> {
3434 UpdateScreenReturns {
3435 screen_info: self.screen_info,
3436 }
3437 }
3438}
3439
3440impl<'a> UpdateScreenParams<'a> { pub const METHOD: &'static str = "Emulation.updateScreen"; }
3441
3442impl<'a> crate::CdpCommand<'a> for UpdateScreenParams<'a> {
3443 const METHOD: &'static str = "Emulation.updateScreen";
3444 type Response = UpdateScreenReturns<'a>;
3445}
3446
3447#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3450#[serde(rename_all = "camelCase")]
3451pub struct RemoveScreenParams<'a> {
3452 #[serde(rename = "screenId")]
3453 screen_id: ScreenId<'a>,
3454}
3455
3456impl<'a> RemoveScreenParams<'a> {
3457 pub fn builder(screen_id: impl Into<ScreenId<'a>>) -> RemoveScreenParamsBuilder<'a> {
3460 RemoveScreenParamsBuilder {
3461 screen_id: screen_id.into(),
3462 }
3463 }
3464 pub fn screen_id(&self) -> &ScreenId<'a> { &self.screen_id }
3465}
3466
3467
3468pub struct RemoveScreenParamsBuilder<'a> {
3469 screen_id: ScreenId<'a>,
3470}
3471
3472impl<'a> RemoveScreenParamsBuilder<'a> {
3473 pub fn build(self) -> RemoveScreenParams<'a> {
3474 RemoveScreenParams {
3475 screen_id: self.screen_id,
3476 }
3477 }
3478}
3479
3480impl<'a> RemoveScreenParams<'a> { pub const METHOD: &'static str = "Emulation.removeScreen"; }
3481
3482impl<'a> crate::CdpCommand<'a> for RemoveScreenParams<'a> {
3483 const METHOD: &'static str = "Emulation.removeScreen";
3484 type Response = crate::EmptyReturns;
3485}
3486
3487#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3493#[serde(rename_all = "camelCase")]
3494pub struct SetPrimaryScreenParams<'a> {
3495 #[serde(rename = "screenId")]
3496 screen_id: ScreenId<'a>,
3497}
3498
3499impl<'a> SetPrimaryScreenParams<'a> {
3500 pub fn builder(screen_id: impl Into<ScreenId<'a>>) -> SetPrimaryScreenParamsBuilder<'a> {
3503 SetPrimaryScreenParamsBuilder {
3504 screen_id: screen_id.into(),
3505 }
3506 }
3507 pub fn screen_id(&self) -> &ScreenId<'a> { &self.screen_id }
3508}
3509
3510
3511pub struct SetPrimaryScreenParamsBuilder<'a> {
3512 screen_id: ScreenId<'a>,
3513}
3514
3515impl<'a> SetPrimaryScreenParamsBuilder<'a> {
3516 pub fn build(self) -> SetPrimaryScreenParams<'a> {
3517 SetPrimaryScreenParams {
3518 screen_id: self.screen_id,
3519 }
3520 }
3521}
3522
3523impl<'a> SetPrimaryScreenParams<'a> { pub const METHOD: &'static str = "Emulation.setPrimaryScreen"; }
3524
3525impl<'a> crate::CdpCommand<'a> for SetPrimaryScreenParams<'a> {
3526 const METHOD: &'static str = "Emulation.setPrimaryScreen";
3527 type Response = crate::EmptyReturns;
3528}