Merge pull request #25987 from bmandalapu/master

gapi.calendar: Adding gapi calendar event delete functionality in gapi.calendar wrapper
This commit is contained in:
Benjamin Lichtman
2018-05-31 10:18:03 -07:00
committed by GitHub
2 changed files with 32 additions and 0 deletions
@@ -149,4 +149,24 @@
request.execute(function(event) {
appendPre('Event created: ' + event.htmlLink);
});
function deleteEvent(calendarEventId: any) {
var request = gapi.client.calendar.events.delete({
calendarId: 'primary',
eventId: calendarEventId,
sendNotifications: true
});
request.then(
(response) => {
appendPre('Successfully deleted event ' + calendarEventId);
},
(error) => {
appendPre('Unable to delete event from your calendar' + calendarEventId);
}
);
}
}
+12
View File
@@ -271,6 +271,9 @@ declare namespace gapi.client.calendar {
static insert(parameters: EventsInsertParameters): HttpRequest<Event>;
static update(parameters: EventsUpdateParameters): HttpRequest<Event>;
static get(parameters: EventsGetParameters): HttpRequest<Event>;
// delete the existing event from calendar
static delete(parameters: EventsDeleteParameters): HttpRequest<Event>;
}
interface EventsGetParameters {
@@ -306,6 +309,15 @@ declare namespace gapi.client.calendar {
resource: EventInput;
}
// calendarId: 'primary' or the calendar from which the event to be deleted
// eventId: the event that need to be deleted from calendar (Event.id from the list/insert response)
interface EventsDeleteParameters {
calendarId: string;
eventId: string;
sendNotifications?: boolean;
}
interface EventInput {
// Required Properties
attachments?: {