0.0.20250609 • Published 10 months ago

@maxim_mazurok/gapi.client.workspaceevents-v1 v0.0.20250609

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

TypeScript typings for Google Workspace Events API v1

The Google Workspace Events API lets you subscribe to events and manage change notifications across Google Workspace applications. For detailed description please check documentation.

Installing

Install typings for Google Workspace Events API:

npm install @types/gapi.client.workspaceevents-v1 --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(
  'https://workspaceevents.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.workspaceevents
  },
);
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('workspaceevents', 'v1', () => {
  // now we can use:
  // gapi.client.workspaceevents
});

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 = [
    // Private Service: https://www.googleapis.com/auth/chat.bot
    'https://www.googleapis.com/auth/chat.bot',

    // See, add, update, and remove members from conversations and spaces in Google Chat
    'https://www.googleapis.com/auth/chat.memberships',

    // View members in Google Chat conversations.
    'https://www.googleapis.com/auth/chat.memberships.readonly',

    // See, compose, send, update, and delete messages as well as their message content; add, see, and delete reactions to messages.
    'https://www.googleapis.com/auth/chat.messages',

    // See, add, and delete reactions as well as their reaction content to messages in Google Chat
    'https://www.googleapis.com/auth/chat.messages.reactions',

    // View reactions as well as their reaction content to messages in Google Chat
    'https://www.googleapis.com/auth/chat.messages.reactions.readonly',

    // See messages as well as their reactions and message content in Google Chat
    'https://www.googleapis.com/auth/chat.messages.readonly',

    // Create conversations and spaces and see or update metadata (including history settings and access settings) in Google Chat
    'https://www.googleapis.com/auth/chat.spaces',

    // View chat and spaces in Google Chat
    'https://www.googleapis.com/auth/chat.spaces.readonly',

    // See, edit, create, and delete all of your Google Drive files
    'https://www.googleapis.com/auth/drive',

    // See, edit, create, and delete only the specific Google Drive files you use with this app
    'https://www.googleapis.com/auth/drive.file',

    // View and manage metadata of files in your Google Drive
    'https://www.googleapis.com/auth/drive.metadata',

    // See information about your Google Drive files
    'https://www.googleapis.com/auth/drive.metadata.readonly',

    // See and download all your Google Drive files
    'https://www.googleapis.com/auth/drive.readonly',

    // Create, edit, and see information about your Google Meet conferences created by the app.
    'https://www.googleapis.com/auth/meetings.space.created',

    // Read information about any of your Google Meet conferences
    'https://www.googleapis.com/auth/meetings.space.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 Google Workspace Events API resources:

/*
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
*/
await gapi.client.workspaceevents.operations.get({name: 'name'});

/*
Creates a Google Workspace subscription. To learn how to use this method, see [Create a Google Workspace subscription](https://developers.google.com/workspace/events/guides/create-subscription). 
*/
await gapi.client.workspaceevents.subscriptions.create({});

/*
Deletes a Google Workspace subscription. To learn how to use this method, see [Delete a Google Workspace subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
*/
await gapi.client.workspaceevents.subscriptions.delete({name: 'name'});

/*
Gets details about a Google Workspace subscription. To learn how to use this method, see [Get details about a Google Workspace subscription](https://developers.google.com/workspace/events/guides/get-subscription).
*/
await gapi.client.workspaceevents.subscriptions.get({name: 'name'});

/*
Lists Google Workspace subscriptions. To learn how to use this method, see [List Google Workspace subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
*/
await gapi.client.workspaceevents.subscriptions.list({});

/*
Updates or renews a Google Workspace subscription. To learn how to use this method, see [Update or renew a Google Workspace subscription](https://developers.google.com/workspace/events/guides/update-subscription).
*/
await gapi.client.workspaceevents.subscriptions.patch({name: 'name'});

/*
Reactivates a suspended Google Workspace subscription. This method resets your subscription's `State` field to `ACTIVE`. Before you use this method, you must fix the error that suspended the subscription. This method will ignore or reject any subscription that isn't currently in a suspended state. To learn how to use this method, see [Reactivate a Google Workspace subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
*/
await gapi.client.workspaceevents.subscriptions.reactivate({name: 'name'});
0.0.20250408

1 year ago

0.0.20250527

11 months ago

0.0.20250406

1 year ago

0.0.20250128

1 year ago

0.0.20250525

11 months ago

0.0.20250401

1 year ago

0.0.20250520

11 months ago

0.0.20250415

1 year ago

0.0.20250412

1 year ago

0.0.20250420

12 months ago

0.0.20241201

1 year ago

0.0.20250429

12 months ago

0.0.20250309

1 year ago

0.0.20250427

12 months ago

0.0.20250304

1 year ago

0.0.20250422

12 months ago

0.0.20241210

1 year ago

0.0.20250318

1 year ago

0.0.20250316

1 year ago

0.0.20250311

1 year ago

0.0.20241203

1 year ago

0.0.20241208

1 year ago

0.0.20250609

10 months ago

0.0.20241103

1 year ago

0.0.20250209

1 year ago

0.0.20250603

11 months ago

0.0.20250601

11 months ago

0.0.20250325

1 year ago

0.0.20250204

1 year ago

0.0.20250323

1 year ago

0.0.20250211

1 year ago

0.0.20250330

1 year ago

0.0.20241217

1 year ago

0.0.20241215

1 year ago

0.0.20241110

1 year ago

0.0.20241112

1 year ago

0.0.20250218

1 year ago

0.0.20250216

1 year ago

0.0.20241105

1 year ago

0.0.20241124

1 year ago

0.0.20250506

12 months ago

0.0.20250504

12 months ago

0.0.20250107

1 year ago

0.0.20250225

1 year ago

0.0.20250105

1 year ago

0.0.20250223

1 year ago

0.0.20250111

1 year ago

0.0.20250110

1 year ago

0.0.20241117

1 year ago

0.0.20241119

1 year ago

0.0.20250518

11 months ago

0.0.20250119

1 year ago

0.0.20250513

11 months ago

0.0.20250511

11 months ago

0.0.20250114

1 year ago

0.0.20241126

1 year ago

0.0.20241029

1 year ago

0.0.20241027

1 year ago

0.0.20241022

1 year ago

0.0.20241020

1 year ago

0.0.20241015

2 years ago

0.0.20240929

2 years ago

0.0.20240924

2 years ago

0.0.20241001

2 years ago

0.0.20241013

2 years ago

0.0.20241008

2 years ago

0.0.20241006

2 years ago

0.0.20240922

2 years ago

0.0.20240908

2 years ago

0.0.20240917

2 years ago

0.0.20240911

2 years ago

0.0.20240903

2 years ago

0.0.20240827

2 years ago

0.0.20240901

2 years ago

0.0.20240804

2 years ago

0.0.20240728

2 years ago

0.0.20240806

2 years ago

0.0.20240723

2 years ago

0.0.20240602

2 years ago

0.0.20240526

2 years ago

0.0.20240604

2 years ago

0.0.20240528

2 years ago

0.0.20240521

2 years ago

0.0.20240721

2 years ago

0.0.20240618

2 years ago

0.0.20240818

2 years ago

0.0.20240811

2 years ago

0.0.20240813

2 years ago

0.0.20240616

2 years ago

0.0.20240730

2 years ago

0.0.20240611

2 years ago

0.0.20240630

2 years ago

0.0.20240709

2 years ago

0.0.20240707

2 years ago

0.0.20240702

2 years ago

0.0.20240625

2 years ago

0.0.20240825

2 years ago

0.0.20240820

2 years ago

0.0.20240623

2 years ago

0.0.20240716

2 years ago

0.0.20240519

2 years ago

0.0.20240713

2 years ago

0.0.20240514

2 years ago

0.0.20240512

2 years ago

0.0.20240507

2 years ago

0.0.20240505

2 years ago

0.0.20240430

2 years ago

0.0.20240428

2 years ago

0.0.20240423

2 years ago

0.0.20240421

2 years ago

0.0.20240414

2 years ago

0.0.20240402

2 years ago

0.0.20240331

2 years ago

0.0.20240326

2 years ago

0.0.20240324

2 years ago

0.0.20240319

2 years ago

0.0.20240317

2 years ago

0.0.20240312

2 years ago

0.0.20240310

2 years ago

0.0.20240305

2 years ago

0.0.20240218

2 years ago

0.0.20240213

2 years ago

0.0.20240215

2 years ago

0.0.20240211

2 years ago

0.0.20240206

2 years ago

0.0.20240204

2 years ago

0.0.20240130

2 years ago

0.0.20240125

2 years ago

0.0.20240123

2 years ago