mirror of
				https://github.com/b4tman/sync_ics2gcal
				synced 2025-11-04 04:38:26 +00:00 
			
		
		
		
	create/delete calendar
This commit is contained in:
		@@ -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
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user