From f57f6e2402c327d2b71f94291f6540638fb92482 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 2 Apr 2022 19:02:02 -0400 Subject: [PATCH] Add method for deleting calendar event --- octoprint_reservations/google_calendar.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/octoprint_reservations/google_calendar.py b/octoprint_reservations/google_calendar.py index a4c434f..3b1b3d3 100644 --- a/octoprint_reservations/google_calendar.py +++ b/octoprint_reservations/google_calendar.py @@ -79,3 +79,10 @@ class CalendarService: else: raise + + def delete_event(self, calendar_id: str, id: str): + event_id = self.encode_event_id(id) + try: + self.service.events().delete(calendar_id, event_id) + except HttpError as error: + print("Got error when deleting event: ", error)