mirror of
https://github.com/b4tman/sync_ics2gcal
synced 2024-11-01 03:06:54 +00:00
create/delete calendar
This commit is contained in:
parent
26e35c1b68
commit
c282cb61e8
@ -214,6 +214,33 @@ class GoogleCalendar():
|
|||||||
i += 1
|
i += 1
|
||||||
batch.execute()
|
batch.execute()
|
||||||
|
|
||||||
|
def create(self, summary, timeZone=None):
|
||||||
|
"""create calendar
|
||||||
|
|
||||||
|
Arguments:
|
||||||
|
summary -- new calendar summary
|
||||||
|
|
||||||
|
Keyword Arguments:
|
||||||
|
timeZone -- new calendar timezone as string (optional)
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
calendar Resource
|
||||||
|
"""
|
||||||
|
|
||||||
|
calendar = {'summary': summary}
|
||||||
|
if timeZone is not None:
|
||||||
|
calendar['timeZone'] = timeZone
|
||||||
|
|
||||||
|
created_calendar = self.service.calendars().insert(body=calendar).execute()
|
||||||
|
self.calendarId = created_calendar['id']
|
||||||
|
return created_calendar
|
||||||
|
|
||||||
|
def delete(self):
|
||||||
|
"""delete calendar
|
||||||
|
"""
|
||||||
|
|
||||||
|
self.service.calendars().delete(calendarId=self.calendarId).execute()
|
||||||
|
|
||||||
def make_public(self):
|
def make_public(self):
|
||||||
"""make calendar puplic
|
"""make calendar puplic
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user