0.0.20240506 • Published 15 days ago

@maxim_mazurok/gapi.client.alertcenter-v1beta1 v0.0.20240506

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

TypeScript typings for Google Workspace Alert Center API v1beta1

Manages alerts on issues affecting your domain. Note: The current version of this API (v1beta1) is available to all Google Workspace customers. For detailed description please check documentation.

Installing

Install typings for Google Workspace Alert Center API:

npm install @types/gapi.client.alertcenter-v1beta1 --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://alertcenter.googleapis.com/$discovery/rest?version=v1beta1',
  () => {
    // now we can use:
    // gapi.client.alertcenter
  }
);
// 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('alertcenter', 'v1beta1', () => {
  // now we can use:
  // gapi.client.alertcenter
});

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 and delete your domain's G Suite alerts, and send alert feedback
    'https://www.googleapis.com/auth/apps.alerts',
  ],
  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 Alert Center API resources:

/*
Performs batch delete operation on alerts.
*/
await gapi.client.alertcenter.alerts.batchDelete({});

/*
Performs batch undelete operation on alerts.
*/
await gapi.client.alertcenter.alerts.batchUndelete({});

/*
Marks the specified alert for deletion. An alert that has been marked for deletion is removed from Alert Center after 30 days. Marking an alert for deletion has no effect on an alert which has already been marked for deletion. Attempting to mark a nonexistent alert for deletion results in a `NOT_FOUND` error.
*/
await gapi.client.alertcenter.alerts.delete({alertId: 'alertId'});

/*
Gets the specified alert. Attempting to get a nonexistent alert returns `NOT_FOUND` error.
*/
await gapi.client.alertcenter.alerts.get({alertId: 'alertId'});

/*
Returns the metadata of an alert. Attempting to get metadata for a non-existent alert returns `NOT_FOUND` error.
*/
await gapi.client.alertcenter.alerts.getMetadata({alertId: 'alertId'});

/*
Lists the alerts.
*/
await gapi.client.alertcenter.alerts.list({});

/*
Restores, or "undeletes", an alert that was marked for deletion within the past 30 days. Attempting to undelete an alert which was marked for deletion over 30 days ago (which has been removed from the Alert Center database) or a nonexistent alert returns a `NOT_FOUND` error. Attempting to undelete an alert which has not been marked for deletion has no effect.
*/
await gapi.client.alertcenter.alerts.undelete({alertId: 'alertId'});

/*
Returns customer-level settings.
*/
await gapi.client.alertcenter.getSettings({});

/*
Updates the customer-level settings.
*/
await gapi.client.alertcenter.updateSettings({});
0.0.20240506

15 days ago

0.0.20240429

22 days ago

0.0.20240422

29 days ago

0.0.20240415

1 month ago

0.0.20240408

1 month ago

0.0.20240401

2 months ago

0.0.20240325

2 months ago

0.0.20240318

2 months ago

0.0.20240311

2 months ago

0.0.20240304

3 months ago

0.0.20240226

3 months ago

0.0.20240219

3 months ago

0.0.20240212

3 months ago

0.0.20240205

4 months ago

0.0.20240129

4 months ago

0.0.20240115

4 months ago

0.0.20240108

4 months ago

0.0.20240101

5 months ago

0.0.20231218

5 months ago

0.0.20231211

5 months ago

0.0.20231204

6 months ago

0.0.20231106

7 months ago

0.0.20230731

10 months ago

0.0.20230814

9 months ago

0.0.20231113

6 months ago

0.0.20231030

7 months ago

0.0.20230807

10 months ago

0.0.20230925

8 months ago

0.0.20230724

10 months ago

0.0.20231023

7 months ago

0.0.20230918

8 months ago

0.0.20230717

10 months ago

0.0.20231127

6 months ago

0.0.20231009

7 months ago

0.0.20230710

11 months ago

0.0.20230911

8 months ago

0.0.20231016

7 months ago

0.0.20230904

9 months ago

0.0.20230828

9 months ago

0.0.20230821

9 months ago

0.0.20230703

11 months ago

0.0.20231120

6 months ago

0.0.20231002

8 months ago

0.0.20230626

11 months ago

0.0.20230619

11 months ago

0.0.20230612

11 months ago

0.0.20230515

1 year ago

0.0.20230522

12 months ago

0.0.20230501

1 year ago

0.0.20230605

12 months ago

0.0.20230528

12 months ago

0.0.20230530

12 months ago

0.0.20230315

1 year ago

0.0.20230313

1 year ago

0.0.20230417

1 year ago

0.0.20230320

1 year ago

0.0.20230403

1 year ago

0.0.20230227

1 year ago

0.0.20230327

1 year ago

0.0.20230424

1 year ago

0.0.20230306

1 year ago

0.0.20230410

1 year ago

0.0.20230216

1 year ago

0.0.20230214

1 year ago

0.0.20230220

1 year ago

0.0.20230206

1 year ago

0.0.20230130

1 year ago

0.0.20221114

2 years ago

0.0.20230116

1 year ago

0.0.20221212

1 year ago

0.0.20221210

1 year ago

0.0.20230102

1 year ago

0.0.20221107

2 years ago

0.0.20230123

1 year ago

0.0.20221205

1 year ago

0.0.20221128

1 year ago

0.0.20221121

1 year ago

0.0.20230110

1 year ago

0.0.20221219

1 year ago

0.0.20221031

2 years ago

0.0.20221017

2 years ago

0.0.20221004

2 years ago

0.0.20221024

2 years ago

0.0.20221010

2 years ago

0.0.20220926

2 years ago

0.0.20220919

2 years ago

0.0.20220822

2 years ago

0.0.20220912

2 years ago

0.0.20220904

2 years ago

0.0.20220808

2 years ago