@maxim_mazurok/gapi.client.licensing-v1 0.0.20220808

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,414 @@
1
+ /* Type definitions for non-npm package Enterprise License Manager API v1 0.0 */
2
+ // Project: https://developers.google.com/admin-sdk/licensing/
3
+ // Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
4
+ // Nick Amoscato <https://github.com/namoscato>
5
+ // Declan Vong <https://github.com/declanvong>
6
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
7
+ // TypeScript Version: 2.8
8
+
9
+ // IMPORTANT
10
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
11
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
12
+ // Generated from: https://licensing.googleapis.com/$discovery/rest?version=v1
13
+ // Revision: 20220808
14
+
15
+ /// <reference types="gapi.client" />
16
+
17
+ declare namespace gapi.client {
18
+ /** Load Enterprise License Manager API v1 */
19
+ function load(urlOrObject: "https://licensing.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
20
+ /** @deprecated Please load APIs with discovery documents. */
21
+ function load(name: "licensing", version: "v1"): Promise<void>;
22
+ /** @deprecated Please load APIs with discovery documents. */
23
+ function load(name: "licensing", version: "v1", callback: () => any): void;
24
+
25
+ namespace licensing {
26
+ // tslint:disable-next-line:no-empty-interface
27
+ interface Empty {
28
+ }
29
+ interface LicenseAssignment {
30
+ /** ETag of the resource. */
31
+ etags?: string;
32
+ /** Identifies the resource as a LicenseAssignment, which is `licensing#licenseAssignment`. */
33
+ kind?: string;
34
+ /** A product's unique identifier. For more information about products in this version of the API, see Product and SKU IDs. */
35
+ productId?: string;
36
+ /** Display Name of the product. */
37
+ productName?: string;
38
+ /** Link to this page. */
39
+ selfLink?: string;
40
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
41
+ skuId?: string;
42
+ /** Display Name of the sku of the product. */
43
+ skuName?: string;
44
+ /**
45
+ * The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use a
46
+ * `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
47
+ */
48
+ userId?: string;
49
+ }
50
+ interface LicenseAssignmentInsert {
51
+ /** Email id of the user */
52
+ userId?: string;
53
+ }
54
+ interface LicenseAssignmentList {
55
+ /** ETag of the resource. */
56
+ etag?: string;
57
+ /** The LicenseAssignments in this page of results. */
58
+ items?: LicenseAssignment[];
59
+ /** Identifies the resource as a collection of LicenseAssignments. */
60
+ kind?: string;
61
+ /**
62
+ * The token that you must submit in a subsequent request to retrieve additional license results matching your query parameters. The `maxResults` query string is related to the
63
+ * `nextPageToken` since `maxResults` determines how many entries are returned on each next page.
64
+ */
65
+ nextPageToken?: string;
66
+ }
67
+ interface LicenseAssignmentsResource {
68
+ /** Revoke a license. */
69
+ delete(request?: {
70
+ /** V1 error format. */
71
+ "$.xgafv"?: string;
72
+ /** OAuth access token. */
73
+ access_token?: string;
74
+ /** Data format for response. */
75
+ alt?: string;
76
+ /** JSONP */
77
+ callback?: string;
78
+ /** Selector specifying which fields to include in a partial response. */
79
+ fields?: string;
80
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
81
+ key?: string;
82
+ /** OAuth 2.0 token for the current user. */
83
+ oauth_token?: string;
84
+ /** Returns response with indentations and line breaks. */
85
+ prettyPrint?: boolean;
86
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
87
+ productId: string;
88
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
89
+ quotaUser?: string;
90
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
91
+ skuId: string;
92
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
93
+ upload_protocol?: string;
94
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
95
+ uploadType?: string;
96
+ /**
97
+ * The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use
98
+ * a `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
99
+ */
100
+ userId: string;
101
+ }): Request<{}>;
102
+ /** Get a specific user's license by product SKU. */
103
+ get(request?: {
104
+ /** V1 error format. */
105
+ "$.xgafv"?: string;
106
+ /** OAuth access token. */
107
+ access_token?: string;
108
+ /** Data format for response. */
109
+ alt?: string;
110
+ /** JSONP */
111
+ callback?: string;
112
+ /** Selector specifying which fields to include in a partial response. */
113
+ fields?: string;
114
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
115
+ key?: string;
116
+ /** OAuth 2.0 token for the current user. */
117
+ oauth_token?: string;
118
+ /** Returns response with indentations and line breaks. */
119
+ prettyPrint?: boolean;
120
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
121
+ productId: string;
122
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
123
+ quotaUser?: string;
124
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
125
+ skuId: string;
126
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
127
+ upload_protocol?: string;
128
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
129
+ uploadType?: string;
130
+ /**
131
+ * The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use
132
+ * a `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
133
+ */
134
+ userId: string;
135
+ }): Request<LicenseAssignment>;
136
+ /** Assign a license. */
137
+ insert(request: {
138
+ /** V1 error format. */
139
+ "$.xgafv"?: string;
140
+ /** OAuth access token. */
141
+ access_token?: string;
142
+ /** Data format for response. */
143
+ alt?: string;
144
+ /** JSONP */
145
+ callback?: string;
146
+ /** Selector specifying which fields to include in a partial response. */
147
+ fields?: string;
148
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
149
+ key?: string;
150
+ /** OAuth 2.0 token for the current user. */
151
+ oauth_token?: string;
152
+ /** Returns response with indentations and line breaks. */
153
+ prettyPrint?: boolean;
154
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
155
+ productId: string;
156
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
157
+ quotaUser?: string;
158
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
159
+ skuId: string;
160
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
161
+ upload_protocol?: string;
162
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
163
+ uploadType?: string;
164
+ /** Request body */
165
+ resource: LicenseAssignmentInsert;
166
+ }): Request<LicenseAssignment>;
167
+ insert(request: {
168
+ /** V1 error format. */
169
+ "$.xgafv"?: string;
170
+ /** OAuth access token. */
171
+ access_token?: string;
172
+ /** Data format for response. */
173
+ alt?: string;
174
+ /** JSONP */
175
+ callback?: string;
176
+ /** Selector specifying which fields to include in a partial response. */
177
+ fields?: string;
178
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
179
+ key?: string;
180
+ /** OAuth 2.0 token for the current user. */
181
+ oauth_token?: string;
182
+ /** Returns response with indentations and line breaks. */
183
+ prettyPrint?: boolean;
184
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
185
+ productId: string;
186
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
187
+ quotaUser?: string;
188
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
189
+ skuId: string;
190
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
191
+ upload_protocol?: string;
192
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
193
+ uploadType?: string;
194
+ },
195
+ body: LicenseAssignmentInsert): Request<LicenseAssignment>;
196
+ /** List all users assigned licenses for a specific product SKU. */
197
+ listForProduct(request?: {
198
+ /** V1 error format. */
199
+ "$.xgafv"?: string;
200
+ /** OAuth access token. */
201
+ access_token?: string;
202
+ /** Data format for response. */
203
+ alt?: string;
204
+ /** JSONP */
205
+ callback?: string;
206
+ /** The customer's unique ID as defined in the Admin console, such as `C00000000`. If the customer is suspended, the server returns an error. */
207
+ customerId: string;
208
+ /** Selector specifying which fields to include in a partial response. */
209
+ fields?: string;
210
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
211
+ key?: string;
212
+ /** The `maxResults` query string determines how many entries are returned on each page of a large response. This is an optional parameter. The value must be a positive number. */
213
+ maxResults?: number;
214
+ /** OAuth 2.0 token for the current user. */
215
+ oauth_token?: string;
216
+ /**
217
+ * Token to fetch the next page of data. The `maxResults` query string is related to the `pageToken` since `maxResults` determines how many entries are returned on each page. This
218
+ * is an optional query string. If not specified, the server returns the first page.
219
+ */
220
+ pageToken?: string;
221
+ /** Returns response with indentations and line breaks. */
222
+ prettyPrint?: boolean;
223
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
224
+ productId: string;
225
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
226
+ quotaUser?: string;
227
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
228
+ upload_protocol?: string;
229
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
230
+ uploadType?: string;
231
+ }): Request<LicenseAssignmentList>;
232
+ /** List all users assigned licenses for a specific product SKU. */
233
+ listForProductAndSku(request?: {
234
+ /** V1 error format. */
235
+ "$.xgafv"?: string;
236
+ /** OAuth access token. */
237
+ access_token?: string;
238
+ /** Data format for response. */
239
+ alt?: string;
240
+ /** JSONP */
241
+ callback?: string;
242
+ /** The customer's unique ID as defined in the Admin console, such as `C00000000`. If the customer is suspended, the server returns an error. */
243
+ customerId: string;
244
+ /** Selector specifying which fields to include in a partial response. */
245
+ fields?: string;
246
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
247
+ key?: string;
248
+ /** The `maxResults` query string determines how many entries are returned on each page of a large response. This is an optional parameter. The value must be a positive number. */
249
+ maxResults?: number;
250
+ /** OAuth 2.0 token for the current user. */
251
+ oauth_token?: string;
252
+ /**
253
+ * Token to fetch the next page of data. The `maxResults` query string is related to the `pageToken` since `maxResults` determines how many entries are returned on each page. This
254
+ * is an optional query string. If not specified, the server returns the first page.
255
+ */
256
+ pageToken?: string;
257
+ /** Returns response with indentations and line breaks. */
258
+ prettyPrint?: boolean;
259
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
260
+ productId: string;
261
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
262
+ quotaUser?: string;
263
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
264
+ skuId: string;
265
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
266
+ upload_protocol?: string;
267
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
268
+ uploadType?: string;
269
+ }): Request<LicenseAssignmentList>;
270
+ /** Reassign a user's product SKU with a different SKU in the same product. This method supports patch semantics. */
271
+ patch(request: {
272
+ /** V1 error format. */
273
+ "$.xgafv"?: string;
274
+ /** OAuth access token. */
275
+ access_token?: string;
276
+ /** Data format for response. */
277
+ alt?: string;
278
+ /** JSONP */
279
+ callback?: string;
280
+ /** Selector specifying which fields to include in a partial response. */
281
+ fields?: string;
282
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
283
+ key?: string;
284
+ /** OAuth 2.0 token for the current user. */
285
+ oauth_token?: string;
286
+ /** Returns response with indentations and line breaks. */
287
+ prettyPrint?: boolean;
288
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
289
+ productId: string;
290
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
291
+ quotaUser?: string;
292
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
293
+ skuId: string;
294
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
295
+ upload_protocol?: string;
296
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
297
+ uploadType?: string;
298
+ /**
299
+ * The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use
300
+ * a `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
301
+ */
302
+ userId: string;
303
+ /** Request body */
304
+ resource: LicenseAssignment;
305
+ }): Request<LicenseAssignment>;
306
+ patch(request: {
307
+ /** V1 error format. */
308
+ "$.xgafv"?: string;
309
+ /** OAuth access token. */
310
+ access_token?: string;
311
+ /** Data format for response. */
312
+ alt?: string;
313
+ /** JSONP */
314
+ callback?: string;
315
+ /** Selector specifying which fields to include in a partial response. */
316
+ fields?: string;
317
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
318
+ key?: string;
319
+ /** OAuth 2.0 token for the current user. */
320
+ oauth_token?: string;
321
+ /** Returns response with indentations and line breaks. */
322
+ prettyPrint?: boolean;
323
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
324
+ productId: string;
325
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
326
+ quotaUser?: string;
327
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
328
+ skuId: string;
329
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
330
+ upload_protocol?: string;
331
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
332
+ uploadType?: string;
333
+ /**
334
+ * The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use
335
+ * a `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
336
+ */
337
+ userId: string;
338
+ },
339
+ body: LicenseAssignment): Request<LicenseAssignment>;
340
+ /** Reassign a user's product SKU with a different SKU in the same product. */
341
+ update(request: {
342
+ /** V1 error format. */
343
+ "$.xgafv"?: string;
344
+ /** OAuth access token. */
345
+ access_token?: string;
346
+ /** Data format for response. */
347
+ alt?: string;
348
+ /** JSONP */
349
+ callback?: string;
350
+ /** Selector specifying which fields to include in a partial response. */
351
+ fields?: string;
352
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
353
+ key?: string;
354
+ /** OAuth 2.0 token for the current user. */
355
+ oauth_token?: string;
356
+ /** Returns response with indentations and line breaks. */
357
+ prettyPrint?: boolean;
358
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
359
+ productId: string;
360
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
361
+ quotaUser?: string;
362
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
363
+ skuId: string;
364
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
365
+ upload_protocol?: string;
366
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
367
+ uploadType?: string;
368
+ /**
369
+ * The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use
370
+ * a `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
371
+ */
372
+ userId: string;
373
+ /** Request body */
374
+ resource: LicenseAssignment;
375
+ }): Request<LicenseAssignment>;
376
+ update(request: {
377
+ /** V1 error format. */
378
+ "$.xgafv"?: string;
379
+ /** OAuth access token. */
380
+ access_token?: string;
381
+ /** Data format for response. */
382
+ alt?: string;
383
+ /** JSONP */
384
+ callback?: string;
385
+ /** Selector specifying which fields to include in a partial response. */
386
+ fields?: string;
387
+ /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
388
+ key?: string;
389
+ /** OAuth 2.0 token for the current user. */
390
+ oauth_token?: string;
391
+ /** Returns response with indentations and line breaks. */
392
+ prettyPrint?: boolean;
393
+ /** A product's unique identifier. For more information about products in this version of the API, see Products and SKUs. */
394
+ productId: string;
395
+ /** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
396
+ quotaUser?: string;
397
+ /** A product SKU's unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. */
398
+ skuId: string;
399
+ /** Upload protocol for media (e.g. "raw", "multipart"). */
400
+ upload_protocol?: string;
401
+ /** Legacy upload protocol for media (e.g. "media", "multipart"). */
402
+ uploadType?: string;
403
+ /**
404
+ * The user's current primary email address. If the user's email address changes, use the new email address in your API requests. Since a `userId` is subject to change, do not use
405
+ * a `userId` value as a key for persistent data. This key could break if the current user's email address changes. If the `userId` is suspended, the license status changes.
406
+ */
407
+ userId: string;
408
+ },
409
+ body: LicenseAssignment): Request<LicenseAssignment>;
410
+ }
411
+
412
+ const licenseAssignments: LicenseAssignmentsResource;
413
+ }
414
+ }
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.licensing-v1",
3
+ "version": "0.0.20220808",
4
+ "description": "TypeScript typings for Enterprise License Manager API v1",
5
+ "license": "MIT",
6
+ "author": {
7
+ "email": "maxim@mazurok.com",
8
+ "name": "Maxim Mazurok",
9
+ "url": "https://maxim.mazurok.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
14
+ },
15
+ "types": "index.d.ts",
16
+ "dependencies": {
17
+ "@types/gapi.client": "*",
18
+ "@types/gapi.client.discovery": "*"
19
+ }
20
+ }
package/readme.md ADDED
@@ -0,0 +1,103 @@
1
+ # TypeScript typings for Enterprise License Manager API v1
2
+
3
+ The Google Enterprise License Manager API lets you manage Google Workspace and related licenses for all users of a customer that you manage.
4
+ For detailed description please check [documentation](https://developers.google.com/admin-sdk/licensing/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Enterprise License Manager API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.licensing-v1 --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ You need to initialize Google API client in your code:
17
+
18
+ ```typescript
19
+ gapi.load('client', () => {
20
+ // now we can use gapi.client
21
+ // ...
22
+ });
23
+ ```
24
+
25
+ Then load api client wrapper:
26
+
27
+ ```typescript
28
+ gapi.client.load('https://licensing.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.licensing
31
+ });
32
+ ```
33
+
34
+ ```typescript
35
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
36
+ gapi.client.load('licensing', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.licensing
39
+ });
40
+ ```
41
+
42
+ Don't forget to authenticate your client before sending any request to resources:
43
+
44
+ ```typescript
45
+ // declare client_id registered in Google Developers Console
46
+ var client_id = '',
47
+ scope = [
48
+ // View and manage G Suite licenses for your domain
49
+ 'https://www.googleapis.com/auth/apps.licensing',
50
+ ],
51
+ immediate = true;
52
+ // ...
53
+
54
+ gapi.auth.authorize(
55
+ { client_id: client_id, scope: scope, immediate: immediate },
56
+ authResult => {
57
+ if (authResult && !authResult.error) {
58
+ /* handle successful authorization */
59
+ } else {
60
+ /* handle authorization error */
61
+ }
62
+ });
63
+ ```
64
+
65
+ After that you can use Enterprise License Manager API resources: <!-- TODO: make this work for multiple namespaces -->
66
+
67
+ ```typescript
68
+
69
+ /*
70
+ Revoke a license.
71
+ */
72
+ await gapi.client.licensing.licenseAssignments.delete({ productId: "productId", skuId: "skuId", userId: "userId", });
73
+
74
+ /*
75
+ Get a specific user's license by product SKU.
76
+ */
77
+ await gapi.client.licensing.licenseAssignments.get({ productId: "productId", skuId: "skuId", userId: "userId", });
78
+
79
+ /*
80
+ Assign a license.
81
+ */
82
+ await gapi.client.licensing.licenseAssignments.insert({ productId: "productId", skuId: "skuId", });
83
+
84
+ /*
85
+ List all users assigned licenses for a specific product SKU.
86
+ */
87
+ await gapi.client.licensing.licenseAssignments.listForProduct({ customerId: "customerId", productId: "productId", });
88
+
89
+ /*
90
+ List all users assigned licenses for a specific product SKU.
91
+ */
92
+ await gapi.client.licensing.licenseAssignments.listForProductAndSku({ customerId: "customerId", productId: "productId", skuId: "skuId", });
93
+
94
+ /*
95
+ Reassign a user's product SKU with a different SKU in the same product. This method supports patch semantics.
96
+ */
97
+ await gapi.client.licensing.licenseAssignments.patch({ productId: "productId", skuId: "skuId", userId: "userId", });
98
+
99
+ /*
100
+ Reassign a user's product SKU with a different SKU in the same product.
101
+ */
102
+ await gapi.client.licensing.licenseAssignments.update({ productId: "productId", skuId: "skuId", userId: "userId", });
103
+ ```
package/tests.ts ADDED
@@ -0,0 +1,97 @@
1
+ /* This is stub file for gapi.client.licensing-v1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20220808
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://licensing.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.licensing */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** View and manage G Suite licenses for your domain */
19
+ 'https://www.googleapis.com/auth/apps.licensing',
20
+ ];
21
+ const immediate = false;
22
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
23
+ if (authResult && !authResult.error) {
24
+ /** handle successful authorization */
25
+ run();
26
+ } else {
27
+ /** handle authorization error */
28
+ }
29
+ });
30
+
31
+ async function run() {
32
+ /** Revoke a license. */
33
+ await gapi.client.licensing.licenseAssignments.delete({
34
+ productId: "Test string",
35
+ skuId: "Test string",
36
+ userId: "Test string",
37
+ });
38
+ /** Get a specific user's license by product SKU. */
39
+ await gapi.client.licensing.licenseAssignments.get({
40
+ productId: "Test string",
41
+ skuId: "Test string",
42
+ userId: "Test string",
43
+ });
44
+ /** Assign a license. */
45
+ await gapi.client.licensing.licenseAssignments.insert({
46
+ productId: "Test string",
47
+ skuId: "Test string",
48
+ }, {
49
+ userId: "Test string",
50
+ });
51
+ /** List all users assigned licenses for a specific product SKU. */
52
+ await gapi.client.licensing.licenseAssignments.listForProduct({
53
+ customerId: "Test string",
54
+ maxResults: 42,
55
+ pageToken: "Test string",
56
+ productId: "Test string",
57
+ });
58
+ /** List all users assigned licenses for a specific product SKU. */
59
+ await gapi.client.licensing.licenseAssignments.listForProductAndSku({
60
+ customerId: "Test string",
61
+ maxResults: 42,
62
+ pageToken: "Test string",
63
+ productId: "Test string",
64
+ skuId: "Test string",
65
+ });
66
+ /** Reassign a user's product SKU with a different SKU in the same product. This method supports patch semantics. */
67
+ await gapi.client.licensing.licenseAssignments.patch({
68
+ productId: "Test string",
69
+ skuId: "Test string",
70
+ userId: "Test string",
71
+ }, {
72
+ etags: "Test string",
73
+ kind: "Test string",
74
+ productId: "Test string",
75
+ productName: "Test string",
76
+ selfLink: "Test string",
77
+ skuId: "Test string",
78
+ skuName: "Test string",
79
+ userId: "Test string",
80
+ });
81
+ /** Reassign a user's product SKU with a different SKU in the same product. */
82
+ await gapi.client.licensing.licenseAssignments.update({
83
+ productId: "Test string",
84
+ skuId: "Test string",
85
+ userId: "Test string",
86
+ }, {
87
+ etags: "Test string",
88
+ kind: "Test string",
89
+ productId: "Test string",
90
+ productName: "Test string",
91
+ selfLink: "Test string",
92
+ skuId: "Test string",
93
+ skuName: "Test string",
94
+ userId: "Test string",
95
+ });
96
+ }
97
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "lib": ["es6", "dom"],
5
+ "noImplicitAny": true,
6
+ "noImplicitThis": true,
7
+ "strictNullChecks": true,
8
+ "baseUrl": "../",
9
+ "typeRoots": [
10
+ "../"
11
+ ],
12
+ "types": [],
13
+ "noEmit": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "strictFunctionTypes": true
16
+ },
17
+ "files": ["index.d.ts", "tests.ts"]
18
+ }
package/tslint.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "dtslint/dtslint.json",
3
+ "rules": {
4
+ "no-redundant-jsdoc": false
5
+ }
6
+ }