added some endpoints
This commit is contained in:
18 files changed
+254
-9
No files matched your search
@@ -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,
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
mod endpoints;
|
||||
mod subject_types;
|
||||
|
||||
pub use endpoints::*;
|
||||
pub use subject_types::*;
|
||||
@@ -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>,
|
||||
}
|
||||
Reference in new issue
Block a user