droneconf/src/model.rs

27 lines
429 B
Rust
Raw Normal View History

2022-03-26 23:53:27 +01:00
use reqwest::Client;
2022-01-30 22:18:09 +01:00
use serde::{Deserialize, Serialize};
#[derive(Deserialize)]
pub struct Request {
pub repo: Repository,
}
#[derive(Deserialize)]
pub struct Repository {
pub config_path: String,
2022-01-30 22:18:09 +01:00
}
#[derive(Serialize)]
pub struct Response {
pub data: String,
}
#[derive(Clone)]
2022-03-26 23:53:27 +01:00
pub struct APIConfig(pub Client);
2022-01-30 22:18:09 +01:00
impl Request {
pub fn config(&self) -> String {
self.repo.config_path.clone()
}
2022-01-30 22:18:09 +01:00
}