1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use ::ApiRequest;
use v2_api::models::rocket::*;
#[derive(Builder, Debug, Default)]
#[builder(default)]
pub struct AllRocketsRequest {}
impl ApiRequest for AllRocketsRequest {
type Output = Vec<Rocket>;
fn endpoint(&self) -> String {
"v2/rockets".to_owned()
}
}
#[derive(Builder, Debug, Default)]
#[builder(setter(into))]
#[builder(default)]
pub struct RocketRequest<'a> {
rocket_id: &'a str
}
impl<'a> ApiRequest for RocketRequest<'a> {
type Output = Rocket;
fn endpoint(&self) -> String {
"v2/rockets/".to_owned() + self.rocket_id
}
}