0.0.20240511 • Published 9 days ago

@maxim_mazurok/gapi.client.licensing-v1 v0.0.20240511

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

TypeScript typings for Enterprise License Manager API v1

The Google Enterprise License Manager API lets you manage Google Workspace and related licenses for all users of a customer that you manage. For detailed description please check documentation.

Installing

Install typings for Enterprise License Manager API:

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

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 = [
    // View and manage G Suite licenses for your domain
    'https://www.googleapis.com/auth/apps.licensing',
  ],
  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 Enterprise License Manager API resources:

/*
Revoke a license.
*/
await gapi.client.licensing.licenseAssignments.delete({
  productId: 'productId',
  skuId: 'skuId',
  userId: 'userId',
});

/*
Get a specific user's license by product SKU.
*/
await gapi.client.licensing.licenseAssignments.get({
  productId: 'productId',
  skuId: 'skuId',
  userId: 'userId',
});

/*
Assign a license.
*/
await gapi.client.licensing.licenseAssignments.insert({
  productId: 'productId',
  skuId: 'skuId',
});

/*
List all users assigned licenses for a specific product SKU.
*/
await gapi.client.licensing.licenseAssignments.listForProduct({
  customerId: 'customerId',
  productId: 'productId',
});

/*
List all users assigned licenses for a specific product SKU.
*/
await gapi.client.licensing.licenseAssignments.listForProductAndSku({
  customerId: 'customerId',
  productId: 'productId',
  skuId: 'skuId',
});

/*
Reassign a user's product SKU with a different SKU in the same product. This method supports patch semantics.
*/
await gapi.client.licensing.licenseAssignments.patch({
  productId: 'productId',
  skuId: 'skuId',
  userId: 'userId',
});

/*
Reassign a user's product SKU with a different SKU in the same product.
*/
await gapi.client.licensing.licenseAssignments.update({
  productId: 'productId',
  skuId: 'skuId',
  userId: 'userId',
});
0.0.20240511

9 days ago

0.0.20240504

16 days ago

0.0.20240425

22 days ago

0.0.20240422

27 days ago

0.0.20240420

30 days ago

0.0.20240410

1 month ago

0.0.20240406

1 month ago

0.0.20240331

2 months ago

0.0.20240329

2 months ago

0.0.20240324

2 months ago

0.0.20240317

2 months ago

0.0.20240315

2 months ago

0.0.20240311

2 months ago

0.0.20240308

2 months ago

0.0.20240301

3 months ago

0.0.20240226

3 months ago

0.0.20240220

3 months ago

0.0.20240219

3 months ago

0.0.20240217

3 months ago

0.0.20240210

3 months ago

0.0.20240203

4 months ago

0.0.20240129

4 months ago

0.0.20240120

4 months ago

0.0.20240116

4 months ago

0.0.20240113

4 months ago

0.0.20240106

4 months ago

0.0.20240101

5 months ago

0.0.20231218

5 months ago

0.0.20231216

5 months ago

0.0.20231204

6 months ago

0.0.20231202

6 months ago

0.0.20230818

9 months ago

0.0.20231106

7 months ago

0.0.20231107

6 months ago

0.0.20230930

8 months ago

0.0.20230812

9 months ago

0.0.20231114

6 months ago

0.0.20230807

10 months ago

0.0.20230805

10 months ago

0.0.20230923

8 months ago

0.0.20231104

7 months ago

0.0.20230717

10 months ago

0.0.20231007

8 months ago

0.0.20231009

7 months ago

0.0.20230710

11 months ago

0.0.20230715

10 months ago

0.0.20231013

7 months ago

0.0.20230828

9 months ago

0.0.20230701

11 months ago

0.0.20231118

6 months ago

0.0.20230824

9 months ago

0.0.20230703

11 months ago

0.0.20231120

6 months ago

0.0.20231028

7 months ago

0.0.20230731

10 months ago

0.0.20231030

7 months ago

0.0.20230729

10 months ago

0.0.20230721

10 months ago

0.0.20230724

10 months ago

0.0.20231021

7 months ago

0.0.20231023

7 months ago

0.0.20230918

8 months ago

0.0.20230916

8 months ago

0.0.20230911

8 months ago

0.0.20230904

9 months ago

0.0.20230909

8 months ago

0.0.20230902

9 months ago

0.0.20230626

11 months ago

0.0.20230624

11 months ago

0.0.20230619

11 months ago

0.0.20230617

11 months ago

0.0.20230607

12 months ago

0.0.20230522

12 months ago

0.0.20230605

12 months ago

0.0.20230529

12 months ago

0.0.20230603

12 months ago

0.0.20230527

12 months ago

0.0.20230520

1 year ago

0.0.20230508

1 year ago

0.0.20230501

1 year ago

0.0.20230429

1 year ago

0.0.20230415

1 year ago

0.0.20230417

1 year ago

0.0.20230421

1 year ago

0.0.20230403

1 year ago

0.0.20230327

1 year ago

0.0.20230401

1 year ago

0.0.20230325

1 year ago

0.0.20230408

1 year ago

0.0.20230410

1 year ago

0.0.20230426

1 year ago

0.0.20230225

1 year ago

0.0.20230309

1 year ago

0.0.20230306

1 year ago

0.0.20230218

1 year ago

0.0.20230220

1 year ago

0.0.20230213

1 year ago

0.0.20230211

1 year ago

0.0.20221114

2 years ago

0.0.20221112

2 years ago

0.0.20221210

1 year ago

0.0.20230121

1 year ago

0.0.20230102

1 year ago

0.0.20230103

1 year ago

0.0.20221107

2 years ago

0.0.20221128

1 year ago

0.0.20221105

2 years ago

0.0.20221203

1 year ago

0.0.20221121

1 year ago

0.0.20221119

2 years ago

0.0.20221217

1 year ago

0.0.20221031

2 years ago

0.0.20221017

2 years ago

0.0.20221015

2 years ago

0.0.20221003

2 years ago

0.0.20221024

2 years ago

0.0.20221022

2 years ago

0.0.20221010

2 years ago

0.0.20221008

2 years ago

0.0.20221029

2 years ago

0.0.20220905

2 years ago

0.0.20220917

2 years ago

0.0.20220829

2 years ago

0.0.20220919

2 years ago

0.0.20220820

2 years ago

0.0.20220910

2 years ago

0.0.20220822

2 years ago

0.0.20220924

2 years ago

0.0.20220903

2 years ago

0.0.20220827

2 years ago

0.0.20220810

2 years ago

0.0.20220808

2 years ago