1use std::fmt::Debug;
4
5use reqwest::Method;
6use serde::Deserialize;
7
8use crate::ucare::{rest::Client, Result};
9
10pub struct Service<'a> {
12 client: &'a Client,
13}
14
15pub fn new_svc(client: &Client) -> Service {
17 Service { client }
18}
19
20impl Service<'_> {
21 pub fn info(&self) -> Result<Info> {
23 self.client
24 .call::<String, String, Info>(Method::GET, format!("/project/"), None, None)
25 }
26}
27
28#[derive(Debug, Deserialize)]
30pub struct Info {
31 pub name: String,
33 pub pub_key: String,
35 pub collaborators: Option<Vec<Collaborator>>,
37}
38
39#[derive(Debug, Deserialize)]
41pub struct Collaborator {
42 pub email: String,
44 pub name: String,
46}