3.0.20220805 • Published 2 years ago

@maxim_mazurok/gapi.client.calendar v3.0.20220805

Weekly downloads
584
License
MIT
Repository
github
Last release
2 years ago

TypeScript typings for Calendar API v3

Manipulates events and other calendar data. For detailed description please check documentation.

Installing

Install typings for Calendar API:

npm install @types/gapi.client.calendar@v3 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load('calendar', 'v3', () => {
  // now we can use gapi.client.calendar
  // ...
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [ 
      // See, edit, share, and permanently delete all the calendars you can access using Google Calendar
      'https://www.googleapis.com/auth/calendar',

      // View and edit events on all your calendars
      'https://www.googleapis.com/auth/calendar.events',

      // View events on all your calendars
      'https://www.googleapis.com/auth/calendar.events.readonly',

      // See and download any calendar you can access using your Google Calendar
      'https://www.googleapis.com/auth/calendar.readonly',

      // View your Calendar settings
      'https://www.googleapis.com/auth/calendar.settings.readonly',
    ],
    immediate = true;
// ...

gapi.auth.authorize(
  { client_id: client_id, scope: scope, immediate: immediate },
  authResult => {
    if (authResult && !authResult.error) {
        /* handle successful authorization */
    } else {
        /* handle authorization error */
    }
});

After that you can use Calendar API resources:

/*
Deletes an access control rule.
*/
await gapi.client.calendar.acl.delete({ calendarId: "calendarId", ruleId: "ruleId",  });

/*
Returns an access control rule.
*/
await gapi.client.calendar.acl.get({ calendarId: "calendarId", ruleId: "ruleId",  });

/*
Creates an access control rule.
*/
await gapi.client.calendar.acl.insert({ calendarId: "calendarId",  });

/*
Returns the rules in the access control list for the calendar.
*/
await gapi.client.calendar.acl.list({ calendarId: "calendarId",  });

/*
Updates an access control rule. This method supports patch semantics.
*/
await gapi.client.calendar.acl.patch({ calendarId: "calendarId", ruleId: "ruleId",  });

/*
Updates an access control rule.
*/
await gapi.client.calendar.acl.update({ calendarId: "calendarId", ruleId: "ruleId",  });

/*
Watch for changes to ACL resources.
*/
await gapi.client.calendar.acl.watch({ calendarId: "calendarId",  });

/*
Removes a calendar from the user's calendar list.
*/
await gapi.client.calendar.calendarList.delete({ calendarId: "calendarId",  });

/*
Returns a calendar from the user's calendar list.
*/
await gapi.client.calendar.calendarList.get({ calendarId: "calendarId",  });

/*
Inserts an existing calendar into the user's calendar list.
*/
await gapi.client.calendar.calendarList.insert({  });

/*
Returns the calendars on the user's calendar list.
*/
await gapi.client.calendar.calendarList.list({  });

/*
Updates an existing calendar on the user's calendar list. This method supports patch semantics.
*/
await gapi.client.calendar.calendarList.patch({ calendarId: "calendarId",  });

/*
Updates an existing calendar on the user's calendar list.
*/
await gapi.client.calendar.calendarList.update({ calendarId: "calendarId",  });

/*
Watch for changes to CalendarList resources.
*/
await gapi.client.calendar.calendarList.watch({  });

/*
Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.
*/
await gapi.client.calendar.calendars.clear({ calendarId: "calendarId",  });

/*
Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.
*/
await gapi.client.calendar.calendars.delete({ calendarId: "calendarId",  });

/*
Returns metadata for a calendar.
*/
await gapi.client.calendar.calendars.get({ calendarId: "calendarId",  });

/*
Creates a secondary calendar.
*/
await gapi.client.calendar.calendars.insert({  });

/*
Updates metadata for a calendar. This method supports patch semantics.
*/
await gapi.client.calendar.calendars.patch({ calendarId: "calendarId",  });

/*
Updates metadata for a calendar.
*/
await gapi.client.calendar.calendars.update({ calendarId: "calendarId",  });

/*
Stop watching resources through this channel
*/
await gapi.client.calendar.channels.stop({  });

/*
Returns the color definitions for calendars and events.
*/
await gapi.client.calendar.colors.get({  });

/*
Deletes an event.
*/
await gapi.client.calendar.events.delete({ calendarId: "calendarId", eventId: "eventId",  });

/*
Returns an event based on its Google Calendar ID. To retrieve an event using its iCalendar ID, call the events.list method using the iCalUID parameter.
*/
await gapi.client.calendar.events.get({ calendarId: "calendarId", eventId: "eventId",  });

/*
Imports an event. This operation is used to add a private copy of an existing event to a calendar.
*/
await gapi.client.calendar.events.import({ calendarId: "calendarId",  });

/*
Creates an event.
*/
await gapi.client.calendar.events.insert({ calendarId: "calendarId",  });

/*
Returns instances of the specified recurring event.
*/
await gapi.client.calendar.events.instances({ calendarId: "calendarId", eventId: "eventId",  });

/*
Returns events on the specified calendar.
*/
await gapi.client.calendar.events.list({ calendarId: "calendarId",  });

/*
Moves an event to another calendar, i.e. changes an event's organizer.
*/
await gapi.client.calendar.events.move({ calendarId: "calendarId", destination: "destination", eventId: "eventId",  });

/*
Updates an event. This method supports patch semantics.
*/
await gapi.client.calendar.events.patch({ calendarId: "calendarId", eventId: "eventId",  });

/*
Creates an event based on a simple text string.
*/
await gapi.client.calendar.events.quickAdd({ calendarId: "calendarId", text: "text",  });

/*
Updates an event.
*/
await gapi.client.calendar.events.update({ calendarId: "calendarId", eventId: "eventId",  });

/*
Watch for changes to Events resources.
*/
await gapi.client.calendar.events.watch({ calendarId: "calendarId",  });

/*
Returns free/busy information for a set of calendars.
*/
await gapi.client.calendar.freebusy.query({  });

/*
Returns a single user setting.
*/
await gapi.client.calendar.settings.get({ setting: "setting",  });

/*
Returns all user settings for the authenticated user.
*/
await gapi.client.calendar.settings.list({  });

/*
Watch for changes to Settings resources.
*/
await gapi.client.calendar.settings.watch({  });
3.0.20220610

2 years ago

3.0.20220715

2 years ago

3.0.20220722

2 years ago

3.0.20220617

2 years ago

3.0.20220624

2 years ago

3.0.20220805

2 years ago

3.0.20220708

2 years ago

3.0.20220701

2 years ago

3.0.20220603

2 years ago

3.0.20220505

2 years ago

3.0.20220513

2 years ago

3.0.20220527

2 years ago

3.0.20220520

2 years ago

3.0.20220429

2 years ago

3.0.20220318

2 years ago

3.0.20220323

2 years ago

3.0.20220408

2 years ago

3.0.20220415

2 years ago

3.0.20220401

2 years ago

3.0.20220422

2 years ago

3.0.20220304

2 years ago

3.0.20211229

2 years ago

3.0.20220211

2 years ago

3.0.20220217

2 years ago

3.0.20220203

2 years ago

3.0.20220114

2 years ago

3.0.20220107

2 years ago

3.0.20211105

3 years ago

3.0.20211210

2 years ago

3.0.20211026

3 years ago

3.0.20211022

3 years ago

3.0.20211007

3 years ago

3.0.20211014

3 years ago

3.0.20210929

3 years ago

3.0.20210927

3 years ago

3.0.20210924

3 years ago

3.0.20210921

3 years ago

3.0.20210919

3 years ago

3.0.20210915

3 years ago

3.0.20210913

3 years ago

3.0.20210910

3 years ago

3.0.20210906

3 years ago

3.0.20210907

3 years ago

3.0.20210903

3 years ago

3.0.20210825

3 years ago

3.0.20210820

3 years ago

3.0.20210823

3 years ago

3.0.20210818

3 years ago

3.0.20210811

3 years ago

3.0.20210813

3 years ago

3.0.20210816

3 years ago

3.0.20210807

3 years ago

3.0.20210718

3 years ago

3.0.20210717

3 years ago

3.0.20210714

3 years ago

3.0.20210713

3 years ago

3.0.20210710

3 years ago

3.0.20210708

3 years ago

3.0.20210706

3 years ago

3.0.20210704

3 years ago

3.0.20210703

3 years ago

3.0.20210701

3 years ago

3.0.20210627

3 years ago

3.0.20210629

3 years ago

3.0.20210628

3 years ago

3.0.20210626

3 years ago

3.0.20210622

3 years ago

3.0.20210621

3 years ago

3.0.20210617

3 years ago

3.0.20210614

3 years ago

3.0.20210615

3 years ago

3.0.20210610

3 years ago

3.0.20210609

3 years ago

3.0.20210608

3 years ago

3.0.20210606

3 years ago

3.0.20210605

3 years ago

3.0.20210603

3 years ago

3.0.20210602

3 years ago

3.0.20210601

3 years ago

3.0.20210529

3 years ago

3.0.20210527

3 years ago

3.0.20210526

3 years ago

3.0.20210522

3 years ago

3.0.20210520

3 years ago

3.0.20210518

3 years ago

3.0.20210516

3 years ago

3.0.20210515

3 years ago

3.0.20210513

3 years ago

3.0.20210512

3 years ago

3.0.20210511

3 years ago

3.0.20210510

3 years ago

3.0.20210507

3 years ago

3.0.20210506

3 years ago

3.0.20210501

3 years ago

3.0.20210429

3 years ago

3.0.20210424

3 years ago

3.0.20210417

3 years ago

3.0.20210415

3 years ago

3.0.20210412

3 years ago

3.0.20210410

3 years ago

3.0.20210408

3 years ago

3.0.20210406

3 years ago

3.0.20210405

3 years ago

3.0.20210329

3 years ago

3.0.20210327

3 years ago

3.0.20210324

3 years ago

3.0.20210322

3 years ago

3.0.20210320

3 years ago

3.0.20210318

3 years ago

3.0.20210317

3 years ago

3.0.20210316

3 years ago

3.0.20210307

3 years ago

3.0.20210301

3 years ago

3.0.20210222

3 years ago

3.0.20210215

3 years ago

3.0.20210211

3 years ago

3.0.20210202

3 years ago

3.0.20210128

3 years ago

3.0.20210125

3 years ago

3.0.20210120

3 years ago

3.0.20210107

3 years ago

3.0.20201227

3 years ago

3.0.20201210

3 years ago

3.0.20201203

3 years ago

3.0.20201201

3 years ago

3.0.20201127

3 years ago

3.0.20201126

3 years ago

3.0.20201124

3 years ago

3.0.20201118

3 years ago

3.0.20201117

4 years ago

3.0.20201114

4 years ago

3.0.20201112

4 years ago

3.0.20201111

4 years ago

3.0.20201109

4 years ago

3.0.20201107

4 years ago

3.0.20201104

4 years ago

3.0.20201103

4 years ago

3.0.20201102

4 years ago

3.0.20201101

4 years ago

3.0.20201030

4 years ago