added some endpoints

This commit is contained in:
vextrixes committed 2026-10-28 22:37:05 +01:00
1 parent fedbf019b4
commit 2adf27dbed
18 files changed
+254 -9

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
use std::marker::PhantomData;
use crate::{Endpoint, Subjects};
pub const SUBJECTS_ENDPOINT: Endpoint<(), Subjects> = Endpoint::Get {
url: "/api/3/subjects",
auth: true,
_types: PhantomData,
};
+5
View File
@@ -0,0 +1,5 @@
mod endpoints;
mod subject_types;
pub use endpoints::*;
pub use subject_types::*;
+23
View File
@@ -0,0 +1,23 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Subjects {
pub subjects: Vec<Subject>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct Subject {
pub subject_id: String,
pub subject_name: String,
pub subject_abbrev: String,
pub teacher_id: String,
pub teacher_name: String,
pub teacher_abbrev: String,
pub teacher_email: Option<String>,
pub teacher_web: Option<String>,
pub teacher_school_phone: Option<String>,
pub teacher_home_phone: Option<String>,
pub teacher_mobile_phone: Option<String>,
}