obscuravpn_api/cmd/
exit.rs

1use serde::{Deserialize, Serialize};
2
3use crate::types::OneExit;
4
5use super::Cmd;
6
7const EXITS_PATH: &str = "exits";
8
9#[derive(Debug, Serialize, Deserialize, Clone)]
10pub struct ListExits {}
11
12impl Cmd for ListExits {
13    type Output = Vec<OneExit>;
14    const METHOD: http::Method = http::Method::GET;
15    const PATH: &'static str = EXITS_PATH;
16}
17
18#[test]
19fn test_json() {
20    let output_json = r#"
21    [
22      {
23        "id": "NYC-001",
24        "country_code": "US",
25        "city_name": "New York"
26      }
27    ]
28    "#;
29    crate::cmd::check_cmd_json::<ListExits>(None, Some(output_json));
30}