@maxim_mazurok/gapi.client.admin-directory_v1 0.0.20220809

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/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.admin-directory_v1",
3
+ "version": "0.0.20220809",
4
+ "description": "TypeScript typings for Admin SDK API directory_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,544 @@
1
+ # TypeScript typings for Admin SDK API directory_v1
2
+
3
+ Admin SDK lets administrators of enterprise domains to view and manage resources like user, groups etc. It also provides audit and usage reports of domain.
4
+ For detailed description please check [documentation](https://developers.google.com/admin-sdk/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Admin SDK API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.admin-directory_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://admin.googleapis.com/$discovery/rest?version=directory_v1', () => {
29
+ // now we can use:
30
+ // gapi.client.admin
31
+ // gapi.client.directory
32
+ });
33
+ ```
34
+
35
+ ```typescript
36
+ // Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
37
+ gapi.client.load('admin', 'directory_v1', () => {
38
+ // now we can use:
39
+ // gapi.client.admin
40
+ // gapi.client.directory
41
+ });
42
+ ```
43
+
44
+ Don't forget to authenticate your client before sending any request to resources:
45
+
46
+ ```typescript
47
+ // declare client_id registered in Google Developers Console
48
+ var client_id = '',
49
+ scope = [
50
+ // See, add, edit, and permanently delete the printers that your organization can use with Chrome
51
+ 'https://www.googleapis.com/auth/admin.chrome.printers',
52
+
53
+ // See the printers that your organization can use with Chrome
54
+ 'https://www.googleapis.com/auth/admin.chrome.printers.readonly',
55
+
56
+ // View and manage customer related information
57
+ 'https://www.googleapis.com/auth/admin.directory.customer',
58
+
59
+ // View customer related information
60
+ 'https://www.googleapis.com/auth/admin.directory.customer.readonly',
61
+
62
+ // View and manage your Chrome OS devices' metadata
63
+ 'https://www.googleapis.com/auth/admin.directory.device.chromeos',
64
+
65
+ // View your Chrome OS devices' metadata
66
+ 'https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly',
67
+
68
+ // View and manage your mobile devices' metadata
69
+ 'https://www.googleapis.com/auth/admin.directory.device.mobile',
70
+
71
+ // Manage your mobile devices by performing administrative tasks
72
+ 'https://www.googleapis.com/auth/admin.directory.device.mobile.action',
73
+
74
+ // View your mobile devices' metadata
75
+ 'https://www.googleapis.com/auth/admin.directory.device.mobile.readonly',
76
+
77
+ // View and manage the provisioning of domains for your customers
78
+ 'https://www.googleapis.com/auth/admin.directory.domain',
79
+
80
+ // View domains related to your customers
81
+ 'https://www.googleapis.com/auth/admin.directory.domain.readonly',
82
+
83
+ // View and manage the provisioning of groups on your domain
84
+ 'https://www.googleapis.com/auth/admin.directory.group',
85
+
86
+ // View and manage group subscriptions on your domain
87
+ 'https://www.googleapis.com/auth/admin.directory.group.member',
88
+
89
+ // View group subscriptions on your domain
90
+ 'https://www.googleapis.com/auth/admin.directory.group.member.readonly',
91
+
92
+ // View groups on your domain
93
+ 'https://www.googleapis.com/auth/admin.directory.group.readonly',
94
+
95
+ // View and manage organization units on your domain
96
+ 'https://www.googleapis.com/auth/admin.directory.orgunit',
97
+
98
+ // View organization units on your domain
99
+ 'https://www.googleapis.com/auth/admin.directory.orgunit.readonly',
100
+
101
+ // View and manage the provisioning of calendar resources on your domain
102
+ 'https://www.googleapis.com/auth/admin.directory.resource.calendar',
103
+
104
+ // View calendar resources on your domain
105
+ 'https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly',
106
+
107
+ // Manage delegated admin roles for your domain
108
+ 'https://www.googleapis.com/auth/admin.directory.rolemanagement',
109
+
110
+ // View delegated admin roles for your domain
111
+ 'https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly',
112
+
113
+ // View and manage the provisioning of users on your domain
114
+ 'https://www.googleapis.com/auth/admin.directory.user',
115
+
116
+ // View and manage user aliases on your domain
117
+ 'https://www.googleapis.com/auth/admin.directory.user.alias',
118
+
119
+ // View user aliases on your domain
120
+ 'https://www.googleapis.com/auth/admin.directory.user.alias.readonly',
121
+
122
+ // See info about users on your domain
123
+ 'https://www.googleapis.com/auth/admin.directory.user.readonly',
124
+
125
+ // Manage data access permissions for users on your domain
126
+ 'https://www.googleapis.com/auth/admin.directory.user.security',
127
+
128
+ // View and manage the provisioning of user schemas on your domain
129
+ 'https://www.googleapis.com/auth/admin.directory.userschema',
130
+
131
+ // View user schemas on your domain
132
+ 'https://www.googleapis.com/auth/admin.directory.userschema.readonly',
133
+
134
+ // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
135
+ 'https://www.googleapis.com/auth/cloud-platform',
136
+ ],
137
+ immediate = true;
138
+ // ...
139
+
140
+ gapi.auth.authorize(
141
+ { client_id: client_id, scope: scope, immediate: immediate },
142
+ authResult => {
143
+ if (authResult && !authResult.error) {
144
+ /* handle successful authorization */
145
+ } else {
146
+ /* handle authorization error */
147
+ }
148
+ });
149
+ ```
150
+
151
+ After that you can use Admin SDK API resources: <!-- TODO: make this work for multiple namespaces -->
152
+
153
+ ```typescript
154
+
155
+ /*
156
+ Deletes an ASP issued by a user.
157
+ */
158
+ await gapi.client.directory.asps.delete({ codeId: 1, userKey: "userKey", });
159
+
160
+ /*
161
+ Gets information about an ASP issued by a user.
162
+ */
163
+ await gapi.client.directory.asps.get({ codeId: 1, userKey: "userKey", });
164
+
165
+ /*
166
+ Lists the ASPs issued by a user.
167
+ */
168
+ await gapi.client.directory.asps.list({ userKey: "userKey", });
169
+
170
+ /*
171
+ Stops watching resources through this channel.
172
+ */
173
+ await gapi.client.admin.channels.stop({ });
174
+
175
+ /*
176
+ Takes an action that affects a Chrome OS Device. This includes deprovisioning, disabling, and re-enabling devices. *Warning:* * Deprovisioning a device will stop device policy syncing and remove device-level printers. After a device is deprovisioned, it must be wiped before it can be re-enrolled. * Lost or stolen devices should use the disable action. * Re-enabling a disabled device will consume a device license. If you do not have sufficient licenses available when completing the re-enable action, you will receive an error. For more information about deprovisioning and disabling devices, visit the [help center](https://support.google.com/chrome/a/answer/3523633).
177
+ */
178
+ await gapi.client.directory.chromeosdevices.action({ customerId: "customerId", resourceId: "resourceId", });
179
+
180
+ /*
181
+ Retrieves a Chrome OS device's properties.
182
+ */
183
+ await gapi.client.directory.chromeosdevices.get({ customerId: "customerId", deviceId: "deviceId", });
184
+
185
+ /*
186
+ Retrieves a paginated list of Chrome OS devices within an account.
187
+ */
188
+ await gapi.client.directory.chromeosdevices.list({ customerId: "customerId", });
189
+
190
+ /*
191
+ Moves or inserts multiple Chrome OS devices to an organizational unit. You can move up to 50 devices at once.
192
+ */
193
+ await gapi.client.directory.chromeosdevices.moveDevicesToOu({ customerId: "customerId", orgUnitPath: "orgUnitPath", });
194
+
195
+ /*
196
+ Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
197
+ */
198
+ await gapi.client.directory.chromeosdevices.patch({ customerId: "customerId", deviceId: "deviceId", });
199
+
200
+ /*
201
+ Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.
202
+ */
203
+ await gapi.client.directory.chromeosdevices.update({ customerId: "customerId", deviceId: "deviceId", });
204
+
205
+ /*
206
+ Retrieves a customer.
207
+ */
208
+ await gapi.client.directory.customers.get({ customerKey: "customerKey", });
209
+
210
+ /*
211
+ Patches a customer.
212
+ */
213
+ await gapi.client.directory.customers.patch({ customerKey: "customerKey", });
214
+
215
+ /*
216
+ Updates a customer.
217
+ */
218
+ await gapi.client.directory.customers.update({ customerKey: "customerKey", });
219
+
220
+ /*
221
+ Deletes a domain Alias of the customer.
222
+ */
223
+ await gapi.client.directory.domainAliases.delete({ customer: "customer", domainAliasName: "domainAliasName", });
224
+
225
+ /*
226
+ Retrieves a domain alias of the customer.
227
+ */
228
+ await gapi.client.directory.domainAliases.get({ customer: "customer", domainAliasName: "domainAliasName", });
229
+
230
+ /*
231
+ Inserts a domain alias of the customer.
232
+ */
233
+ await gapi.client.directory.domainAliases.insert({ customer: "customer", });
234
+
235
+ /*
236
+ Lists the domain aliases of the customer.
237
+ */
238
+ await gapi.client.directory.domainAliases.list({ customer: "customer", });
239
+
240
+ /*
241
+ Deletes a domain of the customer.
242
+ */
243
+ await gapi.client.directory.domains.delete({ customer: "customer", domainName: "domainName", });
244
+
245
+ /*
246
+ Retrieves a domain of the customer.
247
+ */
248
+ await gapi.client.directory.domains.get({ customer: "customer", domainName: "domainName", });
249
+
250
+ /*
251
+ Inserts a domain of the customer.
252
+ */
253
+ await gapi.client.directory.domains.insert({ customer: "customer", });
254
+
255
+ /*
256
+ Lists the domains of the customer.
257
+ */
258
+ await gapi.client.directory.domains.list({ customer: "customer", });
259
+
260
+ /*
261
+ Deletes a group.
262
+ */
263
+ await gapi.client.directory.groups.delete({ groupKey: "groupKey", });
264
+
265
+ /*
266
+ Retrieves a group's properties.
267
+ */
268
+ await gapi.client.directory.groups.get({ groupKey: "groupKey", });
269
+
270
+ /*
271
+ Creates a group.
272
+ */
273
+ await gapi.client.directory.groups.insert({ });
274
+
275
+ /*
276
+ Retrieves all groups of a domain or of a user given a userKey (paginated).
277
+ */
278
+ await gapi.client.directory.groups.list({ });
279
+
280
+ /*
281
+ Updates a group's properties. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
282
+ */
283
+ await gapi.client.directory.groups.patch({ groupKey: "groupKey", });
284
+
285
+ /*
286
+ Updates a group's properties.
287
+ */
288
+ await gapi.client.directory.groups.update({ groupKey: "groupKey", });
289
+
290
+ /*
291
+ Removes a member from a group.
292
+ */
293
+ await gapi.client.directory.members.delete({ groupKey: "groupKey", memberKey: "memberKey", });
294
+
295
+ /*
296
+ Retrieves a group member's properties.
297
+ */
298
+ await gapi.client.directory.members.get({ groupKey: "groupKey", memberKey: "memberKey", });
299
+
300
+ /*
301
+ Checks whether the given user is a member of the group. Membership can be direct or nested.
302
+ */
303
+ await gapi.client.directory.members.hasMember({ groupKey: "groupKey", memberKey: "memberKey", });
304
+
305
+ /*
306
+ Adds a user to the specified group.
307
+ */
308
+ await gapi.client.directory.members.insert({ groupKey: "groupKey", });
309
+
310
+ /*
311
+ Retrieves a paginated list of all members in a group.
312
+ */
313
+ await gapi.client.directory.members.list({ groupKey: "groupKey", });
314
+
315
+ /*
316
+ Updates the membership properties of a user in the specified group. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
317
+ */
318
+ await gapi.client.directory.members.patch({ groupKey: "groupKey", memberKey: "memberKey", });
319
+
320
+ /*
321
+ Updates the membership of a user in the specified group.
322
+ */
323
+ await gapi.client.directory.members.update({ groupKey: "groupKey", memberKey: "memberKey", });
324
+
325
+ /*
326
+ Takes an action that affects a mobile device. For example, remotely wiping a device.
327
+ */
328
+ await gapi.client.directory.mobiledevices.action({ customerId: "customerId", resourceId: "resourceId", });
329
+
330
+ /*
331
+ Removes a mobile device.
332
+ */
333
+ await gapi.client.directory.mobiledevices.delete({ customerId: "customerId", resourceId: "resourceId", });
334
+
335
+ /*
336
+ Retrieves a mobile device's properties.
337
+ */
338
+ await gapi.client.directory.mobiledevices.get({ customerId: "customerId", resourceId: "resourceId", });
339
+
340
+ /*
341
+ Retrieves a paginated list of all user-owned mobile devices for an account. To retrieve a list that includes company-owned devices, use the Cloud Identity [Devices API](https://cloud.google.com/identity/docs/concepts/overview-devices) instead.
342
+ */
343
+ await gapi.client.directory.mobiledevices.list({ customerId: "customerId", });
344
+
345
+ /*
346
+ Removes an organizational unit.
347
+ */
348
+ await gapi.client.directory.orgunits.delete({ customerId: "customerId", orgUnitPath: "orgUnitPath", });
349
+
350
+ /*
351
+ Retrieves an organizational unit.
352
+ */
353
+ await gapi.client.directory.orgunits.get({ customerId: "customerId", orgUnitPath: "orgUnitPath", });
354
+
355
+ /*
356
+ Adds an organizational unit.
357
+ */
358
+ await gapi.client.directory.orgunits.insert({ customerId: "customerId", });
359
+
360
+ /*
361
+ Retrieves a list of all organizational units for an account.
362
+ */
363
+ await gapi.client.directory.orgunits.list({ customerId: "customerId", });
364
+
365
+ /*
366
+ Updates an organizational unit. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch)
367
+ */
368
+ await gapi.client.directory.orgunits.patch({ customerId: "customerId", orgUnitPath: "orgUnitPath", });
369
+
370
+ /*
371
+ Updates an organizational unit.
372
+ */
373
+ await gapi.client.directory.orgunits.update({ customerId: "customerId", orgUnitPath: "orgUnitPath", });
374
+
375
+ /*
376
+ Retrieves a paginated list of all privileges for a customer.
377
+ */
378
+ await gapi.client.directory.privileges.list({ customer: "customer", });
379
+
380
+ /*
381
+ Deletes a role assignment.
382
+ */
383
+ await gapi.client.directory.roleAssignments.delete({ customer: "customer", roleAssignmentId: "roleAssignmentId", });
384
+
385
+ /*
386
+ Retrieves a role assignment.
387
+ */
388
+ await gapi.client.directory.roleAssignments.get({ customer: "customer", roleAssignmentId: "roleAssignmentId", });
389
+
390
+ /*
391
+ Creates a role assignment.
392
+ */
393
+ await gapi.client.directory.roleAssignments.insert({ customer: "customer", });
394
+
395
+ /*
396
+ Retrieves a paginated list of all roleAssignments.
397
+ */
398
+ await gapi.client.directory.roleAssignments.list({ customer: "customer", });
399
+
400
+ /*
401
+ Deletes a role.
402
+ */
403
+ await gapi.client.directory.roles.delete({ customer: "customer", roleId: "roleId", });
404
+
405
+ /*
406
+ Retrieves a role.
407
+ */
408
+ await gapi.client.directory.roles.get({ customer: "customer", roleId: "roleId", });
409
+
410
+ /*
411
+ Creates a role.
412
+ */
413
+ await gapi.client.directory.roles.insert({ customer: "customer", });
414
+
415
+ /*
416
+ Retrieves a paginated list of all the roles in a domain.
417
+ */
418
+ await gapi.client.directory.roles.list({ customer: "customer", });
419
+
420
+ /*
421
+ Patches a role.
422
+ */
423
+ await gapi.client.directory.roles.patch({ customer: "customer", roleId: "roleId", });
424
+
425
+ /*
426
+ Updates a role.
427
+ */
428
+ await gapi.client.directory.roles.update({ customer: "customer", roleId: "roleId", });
429
+
430
+ /*
431
+ Deletes a schema.
432
+ */
433
+ await gapi.client.directory.schemas.delete({ customerId: "customerId", schemaKey: "schemaKey", });
434
+
435
+ /*
436
+ Retrieves a schema.
437
+ */
438
+ await gapi.client.directory.schemas.get({ customerId: "customerId", schemaKey: "schemaKey", });
439
+
440
+ /*
441
+ Creates a schema.
442
+ */
443
+ await gapi.client.directory.schemas.insert({ customerId: "customerId", });
444
+
445
+ /*
446
+ Retrieves all schemas for a customer.
447
+ */
448
+ await gapi.client.directory.schemas.list({ customerId: "customerId", });
449
+
450
+ /*
451
+ Patches a schema.
452
+ */
453
+ await gapi.client.directory.schemas.patch({ customerId: "customerId", schemaKey: "schemaKey", });
454
+
455
+ /*
456
+ Updates a schema.
457
+ */
458
+ await gapi.client.directory.schemas.update({ customerId: "customerId", schemaKey: "schemaKey", });
459
+
460
+ /*
461
+ Deletes all access tokens issued by a user for an application.
462
+ */
463
+ await gapi.client.directory.tokens.delete({ clientId: "clientId", userKey: "userKey", });
464
+
465
+ /*
466
+ Gets information about an access token issued by a user.
467
+ */
468
+ await gapi.client.directory.tokens.get({ clientId: "clientId", userKey: "userKey", });
469
+
470
+ /*
471
+ Returns the set of tokens specified user has issued to 3rd party applications.
472
+ */
473
+ await gapi.client.directory.tokens.list({ userKey: "userKey", });
474
+
475
+ /*
476
+ Turns off 2-Step Verification for user.
477
+ */
478
+ await gapi.client.directory.twoStepVerification.turnOff({ userKey: "userKey", });
479
+
480
+ /*
481
+ Deletes a user.
482
+ */
483
+ await gapi.client.directory.users.delete({ userKey: "userKey", });
484
+
485
+ /*
486
+ Retrieves a user.
487
+ */
488
+ await gapi.client.directory.users.get({ userKey: "userKey", });
489
+
490
+ /*
491
+ Creates a user.
492
+ */
493
+ await gapi.client.directory.users.insert({ });
494
+
495
+ /*
496
+ Retrieves a paginated list of either deleted users or all users in a domain.
497
+ */
498
+ await gapi.client.directory.users.list({ });
499
+
500
+ /*
501
+ Makes a user a super administrator.
502
+ */
503
+ await gapi.client.directory.users.makeAdmin({ userKey: "userKey", });
504
+
505
+ /*
506
+ Updates a user using patch semantics. The update method should be used instead, since it also supports patch semantics and has better performance. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.
507
+ */
508
+ await gapi.client.directory.users.patch({ userKey: "userKey", });
509
+
510
+ /*
511
+ Signs a user out of all web and device sessions and reset their sign-in cookies. User will have to sign in by authenticating again.
512
+ */
513
+ await gapi.client.directory.users.signOut({ userKey: "userKey", });
514
+
515
+ /*
516
+ Undeletes a deleted user.
517
+ */
518
+ await gapi.client.directory.users.undelete({ userKey: "userKey", });
519
+
520
+ /*
521
+ Updates a user. This method supports patch semantics, meaning you only need to include the fields you wish to update. Fields that are not present in the request will be preserved, and fields set to `null` will be cleared.
522
+ */
523
+ await gapi.client.directory.users.update({ userKey: "userKey", });
524
+
525
+ /*
526
+ Watches for changes in users list.
527
+ */
528
+ await gapi.client.directory.users.watch({ });
529
+
530
+ /*
531
+ Generates new backup verification codes for the user.
532
+ */
533
+ await gapi.client.directory.verificationCodes.generate({ userKey: "userKey", });
534
+
535
+ /*
536
+ Invalidates the current backup verification codes for the user.
537
+ */
538
+ await gapi.client.directory.verificationCodes.invalidate({ userKey: "userKey", });
539
+
540
+ /*
541
+ Returns the current set of valid backup verification codes for the specified user.
542
+ */
543
+ await gapi.client.directory.verificationCodes.list({ userKey: "userKey", });
544
+ ```