Skip to main content

browser_protocol/deviceorientation/
mod.rs

1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3use std::borrow::Cow;
4
5#[derive(Debug, Clone, Serialize, Deserialize, Default)]
6pub struct ClearDeviceOrientationOverrideParams {}
7
8impl ClearDeviceOrientationOverrideParams { pub const METHOD: &'static str = "DeviceOrientation.clearDeviceOrientationOverride"; }
9
10impl<'a> crate::CdpCommand<'a> for ClearDeviceOrientationOverrideParams {
11    const METHOD: &'static str = "DeviceOrientation.clearDeviceOrientationOverride";
12    type Response = crate::EmptyReturns;
13}
14
15/// Overrides the Device Orientation.
16
17#[derive(Debug, Clone, Serialize, Deserialize, Default)]
18#[serde(rename_all = "camelCase")]
19pub struct SetDeviceOrientationOverrideParams {
20    /// Mock alpha
21    alpha: f64,
22    /// Mock beta
23    beta: f64,
24    /// Mock gamma
25    gamma: f64,
26}
27
28impl SetDeviceOrientationOverrideParams {
29    /// Creates a builder for this type with the required parameters:
30    /// * `alpha`: Mock alpha
31    /// * `beta`: Mock beta
32    /// * `gamma`: Mock gamma
33    pub fn builder(alpha: f64, beta: f64, gamma: f64) -> SetDeviceOrientationOverrideParamsBuilder {
34        SetDeviceOrientationOverrideParamsBuilder {
35            alpha: alpha,
36            beta: beta,
37            gamma: gamma,
38        }
39    }
40    /// Mock alpha
41    pub fn alpha(&self) -> f64 { self.alpha }
42    /// Mock beta
43    pub fn beta(&self) -> f64 { self.beta }
44    /// Mock gamma
45    pub fn gamma(&self) -> f64 { self.gamma }
46}
47
48
49pub struct SetDeviceOrientationOverrideParamsBuilder {
50    alpha: f64,
51    beta: f64,
52    gamma: f64,
53}
54
55impl SetDeviceOrientationOverrideParamsBuilder {
56    pub fn build(self) -> SetDeviceOrientationOverrideParams {
57        SetDeviceOrientationOverrideParams {
58            alpha: self.alpha,
59            beta: self.beta,
60            gamma: self.gamma,
61        }
62    }
63}
64
65impl SetDeviceOrientationOverrideParams { pub const METHOD: &'static str = "DeviceOrientation.setDeviceOrientationOverride"; }
66
67impl<'a> crate::CdpCommand<'a> for SetDeviceOrientationOverrideParams {
68    const METHOD: &'static str = "DeviceOrientation.setDeviceOrientationOverride";
69    type Response = crate::EmptyReturns;
70}