1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use serde::Serialize;

use crate::element::AxisType;

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Axis3D {
    #[serde(skip_serializing_if = "Option::is_none")]
    type_: Option<AxisType>,
}

impl Axis3D {
    pub fn new() -> Self {
        Self { type_: None }
    }

    pub fn type_<A: Into<AxisType>>(mut self, type_: A) -> Self {
        self.type_ = Some(type_.into());
        self
    }
}