hubcaps_ex/
activity.rs

1//! Activity interface
2use crate::notifications::Notifications;
3use crate::stars::Stars;
4use crate::watching::Watching;
5use crate::Github;
6
7pub struct Activity {
8    github: Github,
9}
10
11impl Activity {
12    #[doc(hidden)]
13    pub fn new(github: Github) -> Self {
14        Self { github }
15    }
16
17    /// Return a reference to notifications operations
18    pub fn notifications(&self) -> Notifications {
19        Notifications::new(self.github.clone())
20    }
21
22    /// return a reference to starring operations
23    pub fn stars(&self) -> Stars {
24        Stars::new(self.github.clone())
25    }
26
27    /// Return a reference to watching operations
28    /// https://developer.github.com/v3/activity/watching
29    pub fn watching(&self) -> Watching {
30        Watching::new(self.github.clone())
31    }
32}