mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #25987 from bmandalapu/master
gapi.calendar: Adding gapi calendar event delete functionality in gapi.calendar wrapper
This commit is contained in:
@@ -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);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Vendored
+12
@@ -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?: {
|
||||
|
||||
Reference in New Issue
Block a user