feat: make reservation api wrapper

This commit is contained in:
Jef Roosens 2023-05-11 15:49:05 +02:00
parent 0aa021259a
commit c799d3d226
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
7 changed files with 76 additions and 21 deletions

View file

@ -9,3 +9,4 @@ edition = "2021"
affluences-api = { path = "../affluences-api" }
tokio = { version = "1.28.1", features = ["full"] }
chrono = "*"
uuid = "*"

View file

@ -1,17 +1,18 @@
use affluences_api::AffluencesClient;
use chrono::NaiveDate;
use uuid::{uuid, Uuid};
#[tokio::main]
async fn main() {
let site = "ghent-university";
// let uuid = "026b8caa-d310-464f-b714-4c21a2cf98ea";
let site = "faculty-library-sciences";
let id: Uuid = uuid!("4737e57a-ee05-4f7b-901a-7bb541eeb297");
let mut client = AffluencesClient::new();
let res = client.site_data(site).await.unwrap();
// let res = client
// .available(uuid, NaiveDate::from_ymd_opt(2023, 5, 11).unwrap(), 1)
// .await
// .unwrap();
// let res = client.site_data(site).await.unwrap();
let res = client
.available(id, NaiveDate::from_ymd_opt(2023, 5, 11).unwrap(), 1)
.await
.unwrap();
println!("{:?}", res);
}