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 crate::api::endpoint::Endpoint;
use http::Method;
use std::borrow::Cow;
#[derive(Default, Debug, Builder, Clone)]
#[builder(default, setter(into, strip_option))]
pub struct Guest<'a> {
#[doc = "`name` of the guest. The name is case-insensitive."]
name: Cow<'a, str>,
}
impl<'a> Guest<'a> {
pub fn builder() -> GuestBuilder<'a> {
GuestBuilder::default()
}
}
impl Endpoint for Guest<'_> {
fn method(&self) -> Method {
Method::GET
}
fn endpoint(&self) -> Cow<'static, str> {
format!("/guests/{}", self.name).into()
}
}