3.0.20220805 • Published 3 years ago

@maxim_mazurok/gapi.client.calendar v3.0.20220805

Weekly downloads
584
License
MIT
Repository
github
Last release
3 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

3 years ago

3.0.20220715

3 years ago

3.0.20220722

3 years ago

3.0.20220617

3 years ago

3.0.20220624

3 years ago

3.0.20220805

3 years ago

3.0.20220708

3 years ago

3.0.20220701

3 years ago

3.0.20220603

3 years ago

3.0.20220505

3 years ago

3.0.20220513

3 years ago

3.0.20220527

3 years ago

3.0.20220520

3 years ago

3.0.20220429

3 years ago

3.0.20220318

3 years ago

3.0.20220323

3 years ago

3.0.20220408

3 years ago

3.0.20220415

3 years ago

3.0.20220401

3 years ago

3.0.20220422

3 years ago

3.0.20220304

3 years ago

3.0.20211229

4 years ago

3.0.20220211

3 years ago

3.0.20220217

3 years ago

3.0.20220203

3 years ago

3.0.20220114

3 years ago

3.0.20220107

4 years ago

3.0.20211105

4 years ago

3.0.20211210

4 years ago

3.0.20211026

4 years ago

3.0.20211022

4 years ago

3.0.20211007

4 years ago

3.0.20211014

4 years ago

3.0.20210929

4 years ago

3.0.20210927

4 years ago

3.0.20210924

4 years ago

3.0.20210921

4 years ago

3.0.20210919

4 years ago

3.0.20210915

4 years ago

3.0.20210913

4 years ago

3.0.20210910

4 years ago

3.0.20210906

4 years ago

3.0.20210907

4 years ago

3.0.20210903

4 years ago

3.0.20210825

4 years ago

3.0.20210820

4 years ago

3.0.20210823

4 years ago

3.0.20210818

4 years ago

3.0.20210811

4 years ago

3.0.20210813

4 years ago

3.0.20210816

4 years ago

3.0.20210807

4 years ago

3.0.20210718

4 years ago

3.0.20210717

4 years ago

3.0.20210714

4 years ago

3.0.20210713

4 years ago

3.0.20210710

4 years ago

3.0.20210708

4 years ago

3.0.20210706

4 years ago

3.0.20210704

4 years ago

3.0.20210703

4 years ago

3.0.20210701

4 years ago

3.0.20210627

4 years ago

3.0.20210629

4 years ago

3.0.20210628

4 years ago

3.0.20210626

4 years ago

3.0.20210622

4 years ago

3.0.20210621

4 years ago

3.0.20210617

4 years ago

3.0.20210614

4 years ago

3.0.20210615

4 years ago

3.0.20210610

4 years ago

3.0.20210609

4 years ago

3.0.20210608

4 years ago

3.0.20210606

4 years ago

3.0.20210605

4 years ago

3.0.20210603

4 years ago

3.0.20210602

4 years ago

3.0.20210601

4 years ago

3.0.20210529

4 years ago

3.0.20210527

4 years ago

3.0.20210526

4 years ago

3.0.20210522

4 years ago

3.0.20210520

4 years ago

3.0.20210518

4 years ago

3.0.20210516

4 years ago

3.0.20210515

4 years ago

3.0.20210513

4 years ago

3.0.20210512

4 years ago

3.0.20210511

4 years ago

3.0.20210510

4 years ago

3.0.20210507

4 years ago

3.0.20210506

4 years ago

3.0.20210501

4 years ago

3.0.20210429

4 years ago

3.0.20210424

4 years ago

3.0.20210417

4 years ago

3.0.20210415

4 years ago

3.0.20210412

4 years ago

3.0.20210410

4 years ago

3.0.20210408

4 years ago

3.0.20210406

4 years ago

3.0.20210405

4 years ago

3.0.20210329

4 years ago

3.0.20210327

4 years ago

3.0.20210324

4 years ago

3.0.20210322

4 years ago

3.0.20210320

4 years ago

3.0.20210318

4 years ago

3.0.20210317

4 years ago

3.0.20210316

4 years ago

3.0.20210307

4 years ago

3.0.20210301

4 years ago

3.0.20210222

4 years ago

3.0.20210215

4 years ago

3.0.20210211

4 years ago

3.0.20210202

4 years ago

3.0.20210128

4 years ago

3.0.20210125

4 years ago

3.0.20210120

4 years ago

3.0.20210107

4 years ago

3.0.20201227

5 years ago

3.0.20201210

5 years ago

3.0.20201203

5 years ago

3.0.20201201

5 years ago

3.0.20201127

5 years ago

3.0.20201126

5 years ago

3.0.20201124

5 years ago

3.0.20201118

5 years ago

3.0.20201117

5 years ago

3.0.20201114

5 years ago

3.0.20201112

5 years ago

3.0.20201111

5 years ago

3.0.20201109

5 years ago

3.0.20201107

5 years ago

3.0.20201104

5 years ago

3.0.20201103

5 years ago

3.0.20201102

5 years ago

3.0.20201101

5 years ago

3.0.20201030

5 years ago