rustenium_cdp_definitions/browser_protocol/device_orientation/
commands.rs1use serde::{Deserialize, Serialize};
2#[doc = "Clears the overridden Device Orientation.\n[clearDeviceOrientationOverride](https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation/#method-clearDeviceOrientationOverride)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct ClearDeviceOrientationOverrideParams {}
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6pub enum ClearDeviceOrientationOverrideMethod {
7 #[serde(rename = "DeviceOrientation.clearDeviceOrientationOverride")]
8 ClearDeviceOrientationOverride,
9}
10#[doc = "Clears the overridden Device Orientation.\n[clearDeviceOrientationOverride](https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation/#method-clearDeviceOrientationOverride)"]
11#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12pub struct ClearDeviceOrientationOverride {
13 pub method: ClearDeviceOrientationOverrideMethod,
14 pub params: ClearDeviceOrientationOverrideParams,
15}
16impl ClearDeviceOrientationOverride {
17 pub const IDENTIFIER: &'static str = "DeviceOrientation.clearDeviceOrientationOverride";
18 pub fn identifier(&self) -> &'static str {
19 Self::IDENTIFIER
20 }
21}
22impl crate::CommandResult for ClearDeviceOrientationOverride {
23 type Result = super::results::ClearDeviceOrientationOverrideResult;
24}
25#[doc = "Overrides the Device Orientation.\n[setDeviceOrientationOverride](https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation/#method-setDeviceOrientationOverride)"]
26#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
27pub struct SetDeviceOrientationOverrideParams {
28 #[doc = "Mock alpha"]
29 #[serde(rename = "alpha")]
30 pub alpha: f64,
31 #[doc = "Mock beta"]
32 #[serde(rename = "beta")]
33 pub beta: f64,
34 #[doc = "Mock gamma"]
35 #[serde(rename = "gamma")]
36 pub gamma: f64,
37}
38impl SetDeviceOrientationOverrideParams {
39 pub fn new(alpha: impl Into<f64>, beta: impl Into<f64>, gamma: impl Into<f64>) -> Self {
40 Self {
41 alpha: alpha.into(),
42 beta: beta.into(),
43 gamma: gamma.into(),
44 }
45 }
46}
47#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
48pub enum SetDeviceOrientationOverrideMethod {
49 #[serde(rename = "DeviceOrientation.setDeviceOrientationOverride")]
50 SetDeviceOrientationOverride,
51}
52#[doc = "Overrides the Device Orientation.\n[setDeviceOrientationOverride](https://chromedevtools.github.io/devtools-protocol/tot/DeviceOrientation/#method-setDeviceOrientationOverride)"]
53#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
54pub struct SetDeviceOrientationOverride {
55 pub method: SetDeviceOrientationOverrideMethod,
56 pub params: SetDeviceOrientationOverrideParams,
57}
58impl SetDeviceOrientationOverride {
59 pub const IDENTIFIER: &'static str = "DeviceOrientation.setDeviceOrientationOverride";
60 pub fn identifier(&self) -> &'static str {
61 Self::IDENTIFIER
62 }
63}
64impl crate::CommandResult for SetDeviceOrientationOverride {
65 type Result = super::results::SetDeviceOrientationOverrideResult;
66}
67group_enum ! (DeviceOrientationCommands { ClearDeviceOrientationOverride (ClearDeviceOrientationOverride) , SetDeviceOrientationOverride (SetDeviceOrientationOverride) } + identifiable);