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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use crate::client::Client;
use crate::prelude::*;

#[derive(Serialize, Deserialize, Default, Debug)]
pub struct Repository {
    endpoint: String,
    client: Client,
}

impl Repository {
    pub fn new(client: Client) -> Repository {
        let endpoint = format!("{}/{}", &client.api_url, "repos");
        Repository { endpoint, client }
    }

    pub fn with_project(self, _project: Project) -> Self {
        self
    }

    pub async fn get(self, _repository: &str) -> Result<Self> {
        Ok(self)
    }

    pub fn comments(self) -> Comment {
        Comment::new(self.client)
    }

    pub fn webhooks(self) -> WebHook {
        WebHook::new(self.client)
    }

    pub fn pull_requests(self) -> PullRequest {
        PullRequest::new(self.client)
    }

    pub async fn create(self, _repository: &str) -> Result<()> {
        Ok(())
    }

    pub async fn delete(self, _repository: &str) -> Result<()> {
        Ok(())
    }
}

#[cfg(test)]
mod tests {}