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
//! # Profile
//!
//! Endpoints available for the current user's profile.
use http::Method;

use super::endpoint::Endpoint;

/// Retrieves the user resourcce for the currently authenticated user.
#[derive(Default, Debug, Builder, Clone)]
#[builder(default, setter(into, strip_option))]
pub struct Profile {}

impl Profile {
    /// Create a builder for this endpoint.
    pub fn builder() -> ProfileBuilder {
        ProfileBuilder::default()
    }
}

impl Endpoint for Profile {
    fn method(&self) -> http::Method {
        Method::GET
    }

    fn endpoint(&self) -> std::borrow::Cow<'static, str> {
        "/profile".into()
    }

    fn requires_authentication(&self) -> bool {
        true
    }
}