1.0.20220808 • Published 2 years ago

@maxim_mazurok/gapi.client.alertcenter v1.0.20220808

Weekly downloads
89
License
MIT
Repository
github
Last release
2 years 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('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.v1beta1.getSettings({  });

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

2 years ago

1.0.20220621

2 years ago

1.0.20220620

2 years ago

1.0.20220704

2 years ago

1.0.20220627

2 years ago

1.0.20220718

2 years ago

1.0.20220711

2 years ago

1.0.20220801

2 years ago

1.0.20220725

2 years ago

1.0.20220808

2 years ago

1.0.20220509

2 years ago

1.0.20220502

2 years ago

1.0.20220516

2 years ago

1.0.20220523

2 years ago

1.0.20220606

2 years ago

1.0.20220530

2 years ago

1.0.20220418

2 years ago

1.0.20220402

2 years ago

1.0.20220321

2 years ago

1.0.20220409

2 years ago

1.0.20220404

2 years ago

1.0.20220331

2 years ago

1.0.20220307

2 years ago

1.0.20220314

2 years ago

1.0.20220105

2 years ago

1.0.20220221

2 years ago

1.0.20220116

2 years ago

1.0.20220111

2 years ago

1.0.20220127

2 years ago

1.0.20220131

2 years ago

1.0.20211109

3 years ago

1.0.20211130

2 years ago

1.0.20211214

2 years ago

1.0.20211213

2 years ago

1.0.20211029

3 years ago

1.0.20211019

3 years ago

1.0.20211006

3 years ago

1.0.20211012

3 years ago

1.0.20210930

3 years ago

1.0.20210928

3 years ago

1.0.20210921

3 years ago

1.0.20210920

3 years ago

1.0.20210907

3 years ago

1.0.20210830

3 years ago

1.0.20210817

3 years ago

1.0.20210816

3 years ago

1.0.20210810

3 years ago

1.0.20210803

3 years ago

1.0.20210727

3 years ago

1.0.20210720

3 years ago

1.0.20210713

3 years ago

1.0.20210709

3 years ago

1.0.20210701

3 years ago

1.0.20210622

3 years ago

1.0.20210619

3 years ago

1.0.20210601

3 years ago

1.0.20210525

3 years ago

1.0.20210519

3 years ago

1.0.20210512

3 years ago

1.0.20210504

3 years ago

1.0.20210427

3 years ago

1.0.20210420

3 years ago

1.0.20210413

3 years ago

1.0.20210406

3 years ago

1.0.20210330

3 years ago

1.0.20210323

3 years ago

1.0.20210316

3 years ago

1.0.20210309

3 years ago

1.0.20210303

3 years ago

1.0.20210216

3 years ago

1.0.20210209

3 years ago

1.0.20210202

3 years ago

1.0.20210130

3 years ago

1.0.20210125

3 years ago

1.0.20210123

3 years ago

1.0.20210118

3 years ago

1.0.20210116

3 years ago

1.0.20210111

3 years ago

1.0.20210109

3 years ago

1.0.20201231

3 years ago

1.0.20201212

3 years ago

1.0.20201202

3 years ago

1.0.20201130

3 years ago

1.0.20201123

3 years ago

1.0.20201121

3 years ago

1.0.20201116

4 years ago

1.0.20201113

4 years ago

1.0.20201109

4 years ago