linode_api/endpoints/v4/linode_instances/
linode_view.rs

1use serde::{Deserialize, Serialize};
2
3use crate::objects::v4::linode_instances::Linode;
4
5//
6wrapping_macro::wrapping! {
7    #[derive(Deserialize, Serialize, Debug, Clone)]
8    pub struct ResponseBody(pub Linode);
9}
10
11#[cfg(test)]
12mod tests {
13    use super::*;
14
15    use crate::objects::v4::linode_instances::LinodeStatus;
16
17    #[test]
18    fn test_de_response_body() {
19        match serde_json::from_str::<ResponseBody>(include_str!(
20            "../../../../tests/response_body_files/linode_instances/linode_view.json"
21        )) {
22            Ok(json) => {
23                assert_eq!(json.status, LinodeStatus::Running);
24            }
25            x => panic!("{x:?}"),
26        }
27    }
28}