From 2cdd2ae154ec4464c7a8100ea8f77d5c796ed934 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 12 Jul 2024 16:34:48 -0700 Subject: [PATCH] add import_term --- uw_mazevo/api.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/uw_mazevo/api.py b/uw_mazevo/api.py index f785359..6da9f5e 100644 --- a/uw_mazevo/api.py +++ b/uw_mazevo/api.py @@ -1,4 +1,4 @@ -from uw_mazevo import get_resource, post_resource +from uw_mazevo import DAO, get_resource, post_resource from uw_mazevo.models import Booking, Building, Room, Status @@ -41,6 +41,20 @@ def get_statuses(self): return statuses +class PublicCourses(object): + URL = "/api/publiccourses/{}" + + def import_term(self, courses): + """ + Import a Term + """ + url = self.URL.format("importterm") + body = courses + body["apiKey"] = DAO.get_service_setting("API_KEY") + + post_resource(url, body) + + class PublicEvent(object): URL = "/api/PublicEvent/{}"