use std::fmt::Debug;
use reqwest::Method;
use serde::Deserialize;
use crate::ucare::{rest::Client, Result};
pub struct Service<'a> {
client: &'a Client,
}
pub fn new_svc(client: &Client) -> Service {
Service { client }
}
impl Service<'_> {
pub fn info(&self) -> Result<Info> {
self.client
.call::<String, String, Info>(Method::GET, format!("/project/"), None, None)
}
}
#[derive(Debug, Deserialize)]
pub struct Info {
pub name: String,
pub pub_key: String,
pub collaborators: Option<Vec<Collaborator>>,
}
#[derive(Debug, Deserialize)]
pub struct Collaborator {
pub email: String,
pub name: String,
}