@maxim_mazurok/gapi.client.admin-directory_v1 0.0.20231127 → 0.0.20231219
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 +8515 -12540
- package/package.json +6 -6
- package/readme.md +248 -149
- package/tests.ts +0 -1822
- package/tsconfig.json +0 -18
- package/tslint.json +0 -6
package/readme.md
CHANGED
|
@@ -25,11 +25,14 @@ gapi.load('client', () => {
|
|
|
25
25
|
Then load api client wrapper:
|
|
26
26
|
|
|
27
27
|
```typescript
|
|
28
|
-
gapi.client.load(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
gapi.client.load(
|
|
29
|
+
'https://admin.googleapis.com/$discovery/rest?version=directory_v1',
|
|
30
|
+
() => {
|
|
31
|
+
// now we can use:
|
|
32
|
+
// gapi.client.admin
|
|
33
|
+
// gapi.client.directory
|
|
34
|
+
}
|
|
35
|
+
);
|
|
33
36
|
```
|
|
34
37
|
|
|
35
38
|
```typescript
|
|
@@ -47,498 +50,594 @@ Don't forget to authenticate your client before sending any request to resources
|
|
|
47
50
|
// declare client_id registered in Google Developers Console
|
|
48
51
|
var client_id = '',
|
|
49
52
|
scope = [
|
|
50
|
-
|
|
51
|
-
|
|
53
|
+
// See, add, edit, and permanently delete the printers that your organization can use with Chrome
|
|
54
|
+
'https://www.googleapis.com/auth/admin.chrome.printers',
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
// See the printers that your organization can use with Chrome
|
|
57
|
+
'https://www.googleapis.com/auth/admin.chrome.printers.readonly',
|
|
55
58
|
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
// View and manage customer related information
|
|
60
|
+
'https://www.googleapis.com/auth/admin.directory.customer',
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
// View customer related information
|
|
63
|
+
'https://www.googleapis.com/auth/admin.directory.customer.readonly',
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
// View and manage your Chrome OS devices' metadata
|
|
66
|
+
'https://www.googleapis.com/auth/admin.directory.device.chromeos',
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
// View your Chrome OS devices' metadata
|
|
69
|
+
'https://www.googleapis.com/auth/admin.directory.device.chromeos.readonly',
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
// View and manage your mobile devices' metadata
|
|
72
|
+
'https://www.googleapis.com/auth/admin.directory.device.mobile',
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
// Manage your mobile devices by performing administrative tasks
|
|
75
|
+
'https://www.googleapis.com/auth/admin.directory.device.mobile.action',
|
|
73
76
|
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
// View your mobile devices' metadata
|
|
78
|
+
'https://www.googleapis.com/auth/admin.directory.device.mobile.readonly',
|
|
76
79
|
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
// View and manage the provisioning of domains for your customers
|
|
81
|
+
'https://www.googleapis.com/auth/admin.directory.domain',
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
// View domains related to your customers
|
|
84
|
+
'https://www.googleapis.com/auth/admin.directory.domain.readonly',
|
|
82
85
|
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
// View and manage the provisioning of groups on your domain
|
|
87
|
+
'https://www.googleapis.com/auth/admin.directory.group',
|
|
85
88
|
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
// View and manage group subscriptions on your domain
|
|
90
|
+
'https://www.googleapis.com/auth/admin.directory.group.member',
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
// View group subscriptions on your domain
|
|
93
|
+
'https://www.googleapis.com/auth/admin.directory.group.member.readonly',
|
|
91
94
|
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
// View groups on your domain
|
|
96
|
+
'https://www.googleapis.com/auth/admin.directory.group.readonly',
|
|
94
97
|
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
// View and manage organization units on your domain
|
|
99
|
+
'https://www.googleapis.com/auth/admin.directory.orgunit',
|
|
97
100
|
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
// View organization units on your domain
|
|
102
|
+
'https://www.googleapis.com/auth/admin.directory.orgunit.readonly',
|
|
100
103
|
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
// View and manage the provisioning of calendar resources on your domain
|
|
105
|
+
'https://www.googleapis.com/auth/admin.directory.resource.calendar',
|
|
103
106
|
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
// View calendar resources on your domain
|
|
108
|
+
'https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly',
|
|
106
109
|
|
|
107
|
-
|
|
108
|
-
|
|
110
|
+
// Manage delegated admin roles for your domain
|
|
111
|
+
'https://www.googleapis.com/auth/admin.directory.rolemanagement',
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
// View delegated admin roles for your domain
|
|
114
|
+
'https://www.googleapis.com/auth/admin.directory.rolemanagement.readonly',
|
|
112
115
|
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
// View and manage the provisioning of users on your domain
|
|
117
|
+
'https://www.googleapis.com/auth/admin.directory.user',
|
|
115
118
|
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
// View and manage user aliases on your domain
|
|
120
|
+
'https://www.googleapis.com/auth/admin.directory.user.alias',
|
|
118
121
|
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
// View user aliases on your domain
|
|
123
|
+
'https://www.googleapis.com/auth/admin.directory.user.alias.readonly',
|
|
121
124
|
|
|
122
|
-
|
|
123
|
-
|
|
125
|
+
// See info about users on your domain
|
|
126
|
+
'https://www.googleapis.com/auth/admin.directory.user.readonly',
|
|
124
127
|
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
// Manage data access permissions for users on your domain
|
|
129
|
+
'https://www.googleapis.com/auth/admin.directory.user.security',
|
|
127
130
|
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
// View and manage the provisioning of user schemas on your domain
|
|
132
|
+
'https://www.googleapis.com/auth/admin.directory.userschema',
|
|
130
133
|
|
|
131
|
-
|
|
132
|
-
|
|
134
|
+
// View user schemas on your domain
|
|
135
|
+
'https://www.googleapis.com/auth/admin.directory.userschema.readonly',
|
|
133
136
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
138
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
139
|
+
],
|
|
140
|
+
immediate = true;
|
|
138
141
|
// ...
|
|
139
142
|
|
|
140
143
|
gapi.auth.authorize(
|
|
141
|
-
{
|
|
144
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
142
145
|
authResult => {
|
|
143
146
|
if (authResult && !authResult.error) {
|
|
144
|
-
|
|
147
|
+
/* handle successful authorization */
|
|
145
148
|
} else {
|
|
146
|
-
|
|
149
|
+
/* handle authorization error */
|
|
147
150
|
}
|
|
148
|
-
}
|
|
151
|
+
}
|
|
152
|
+
);
|
|
149
153
|
```
|
|
150
154
|
|
|
151
155
|
After that you can use Admin SDK API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
152
156
|
|
|
153
157
|
```typescript
|
|
154
|
-
|
|
155
158
|
/*
|
|
156
159
|
Deletes an ASP issued by a user.
|
|
157
160
|
*/
|
|
158
|
-
await gapi.client.directory.asps.delete({
|
|
161
|
+
await gapi.client.directory.asps.delete({codeId: 1, userKey: 'userKey'});
|
|
159
162
|
|
|
160
163
|
/*
|
|
161
164
|
Gets information about an ASP issued by a user.
|
|
162
165
|
*/
|
|
163
|
-
await gapi.client.directory.asps.get({
|
|
166
|
+
await gapi.client.directory.asps.get({codeId: 1, userKey: 'userKey'});
|
|
164
167
|
|
|
165
168
|
/*
|
|
166
169
|
Lists the ASPs issued by a user.
|
|
167
170
|
*/
|
|
168
|
-
await gapi.client.directory.asps.list({
|
|
171
|
+
await gapi.client.directory.asps.list({userKey: 'userKey'});
|
|
169
172
|
|
|
170
173
|
/*
|
|
171
174
|
Stops watching resources through this channel.
|
|
172
175
|
*/
|
|
173
|
-
await gapi.client.admin.channels.stop({
|
|
176
|
+
await gapi.client.admin.channels.stop({});
|
|
174
177
|
|
|
175
178
|
/*
|
|
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).
|
|
179
|
+
DEPRECATED: Use BatchChangeChromeOsDeviceStatus instead. 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
180
|
*/
|
|
178
|
-
await gapi.client.directory.chromeosdevices.action({
|
|
181
|
+
await gapi.client.directory.chromeosdevices.action({
|
|
182
|
+
customerId: 'customerId',
|
|
183
|
+
resourceId: 'resourceId',
|
|
184
|
+
});
|
|
179
185
|
|
|
180
186
|
/*
|
|
181
187
|
Retrieves a Chrome OS device's properties.
|
|
182
188
|
*/
|
|
183
|
-
await gapi.client.directory.chromeosdevices.get({
|
|
189
|
+
await gapi.client.directory.chromeosdevices.get({
|
|
190
|
+
customerId: 'customerId',
|
|
191
|
+
deviceId: 'deviceId',
|
|
192
|
+
});
|
|
184
193
|
|
|
185
194
|
/*
|
|
186
195
|
Retrieves a paginated list of Chrome OS devices within an account.
|
|
187
196
|
*/
|
|
188
|
-
await gapi.client.directory.chromeosdevices.list({
|
|
197
|
+
await gapi.client.directory.chromeosdevices.list({customerId: 'customerId'});
|
|
189
198
|
|
|
190
199
|
/*
|
|
191
200
|
Moves or inserts multiple Chrome OS devices to an organizational unit. You can move up to 50 devices at once.
|
|
192
201
|
*/
|
|
193
|
-
await gapi.client.directory.chromeosdevices.moveDevicesToOu({
|
|
202
|
+
await gapi.client.directory.chromeosdevices.moveDevicesToOu({
|
|
203
|
+
customerId: 'customerId',
|
|
204
|
+
orgUnitPath: 'orgUnitPath',
|
|
205
|
+
});
|
|
194
206
|
|
|
195
207
|
/*
|
|
196
208
|
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
209
|
*/
|
|
198
|
-
await gapi.client.directory.chromeosdevices.patch({
|
|
210
|
+
await gapi.client.directory.chromeosdevices.patch({
|
|
211
|
+
customerId: 'customerId',
|
|
212
|
+
deviceId: 'deviceId',
|
|
213
|
+
});
|
|
199
214
|
|
|
200
215
|
/*
|
|
201
216
|
Updates a device's updatable properties, such as `annotatedUser`, `annotatedLocation`, `notes`, `orgUnitPath`, or `annotatedAssetId`.
|
|
202
217
|
*/
|
|
203
|
-
await gapi.client.directory.chromeosdevices.update({
|
|
218
|
+
await gapi.client.directory.chromeosdevices.update({
|
|
219
|
+
customerId: 'customerId',
|
|
220
|
+
deviceId: 'deviceId',
|
|
221
|
+
});
|
|
204
222
|
|
|
205
223
|
/*
|
|
206
224
|
Retrieves a customer.
|
|
207
225
|
*/
|
|
208
|
-
await gapi.client.directory.customers.get({
|
|
226
|
+
await gapi.client.directory.customers.get({customerKey: 'customerKey'});
|
|
209
227
|
|
|
210
228
|
/*
|
|
211
229
|
Patches a customer.
|
|
212
230
|
*/
|
|
213
|
-
await gapi.client.directory.customers.patch({
|
|
231
|
+
await gapi.client.directory.customers.patch({customerKey: 'customerKey'});
|
|
214
232
|
|
|
215
233
|
/*
|
|
216
234
|
Updates a customer.
|
|
217
235
|
*/
|
|
218
|
-
await gapi.client.directory.customers.update({
|
|
236
|
+
await gapi.client.directory.customers.update({customerKey: 'customerKey'});
|
|
219
237
|
|
|
220
238
|
/*
|
|
221
239
|
Deletes a domain Alias of the customer.
|
|
222
240
|
*/
|
|
223
|
-
await gapi.client.directory.domainAliases.delete({
|
|
241
|
+
await gapi.client.directory.domainAliases.delete({
|
|
242
|
+
customer: 'customer',
|
|
243
|
+
domainAliasName: 'domainAliasName',
|
|
244
|
+
});
|
|
224
245
|
|
|
225
246
|
/*
|
|
226
247
|
Retrieves a domain alias of the customer.
|
|
227
248
|
*/
|
|
228
|
-
await gapi.client.directory.domainAliases.get({
|
|
249
|
+
await gapi.client.directory.domainAliases.get({
|
|
250
|
+
customer: 'customer',
|
|
251
|
+
domainAliasName: 'domainAliasName',
|
|
252
|
+
});
|
|
229
253
|
|
|
230
254
|
/*
|
|
231
255
|
Inserts a domain alias of the customer.
|
|
232
256
|
*/
|
|
233
|
-
await gapi.client.directory.domainAliases.insert({
|
|
257
|
+
await gapi.client.directory.domainAliases.insert({customer: 'customer'});
|
|
234
258
|
|
|
235
259
|
/*
|
|
236
260
|
Lists the domain aliases of the customer.
|
|
237
261
|
*/
|
|
238
|
-
await gapi.client.directory.domainAliases.list({
|
|
262
|
+
await gapi.client.directory.domainAliases.list({customer: 'customer'});
|
|
239
263
|
|
|
240
264
|
/*
|
|
241
265
|
Deletes a domain of the customer.
|
|
242
266
|
*/
|
|
243
|
-
await gapi.client.directory.domains.delete({
|
|
267
|
+
await gapi.client.directory.domains.delete({
|
|
268
|
+
customer: 'customer',
|
|
269
|
+
domainName: 'domainName',
|
|
270
|
+
});
|
|
244
271
|
|
|
245
272
|
/*
|
|
246
273
|
Retrieves a domain of the customer.
|
|
247
274
|
*/
|
|
248
|
-
await gapi.client.directory.domains.get({
|
|
275
|
+
await gapi.client.directory.domains.get({
|
|
276
|
+
customer: 'customer',
|
|
277
|
+
domainName: 'domainName',
|
|
278
|
+
});
|
|
249
279
|
|
|
250
280
|
/*
|
|
251
281
|
Inserts a domain of the customer.
|
|
252
282
|
*/
|
|
253
|
-
await gapi.client.directory.domains.insert({
|
|
283
|
+
await gapi.client.directory.domains.insert({customer: 'customer'});
|
|
254
284
|
|
|
255
285
|
/*
|
|
256
286
|
Lists the domains of the customer.
|
|
257
287
|
*/
|
|
258
|
-
await gapi.client.directory.domains.list({
|
|
288
|
+
await gapi.client.directory.domains.list({customer: 'customer'});
|
|
259
289
|
|
|
260
290
|
/*
|
|
261
291
|
Deletes a group.
|
|
262
292
|
*/
|
|
263
|
-
await gapi.client.directory.groups.delete({
|
|
293
|
+
await gapi.client.directory.groups.delete({groupKey: 'groupKey'});
|
|
264
294
|
|
|
265
295
|
/*
|
|
266
296
|
Retrieves a group's properties.
|
|
267
297
|
*/
|
|
268
|
-
await gapi.client.directory.groups.get({
|
|
298
|
+
await gapi.client.directory.groups.get({groupKey: 'groupKey'});
|
|
269
299
|
|
|
270
300
|
/*
|
|
271
301
|
Creates a group.
|
|
272
302
|
*/
|
|
273
|
-
await gapi.client.directory.groups.insert({
|
|
303
|
+
await gapi.client.directory.groups.insert({});
|
|
274
304
|
|
|
275
305
|
/*
|
|
276
306
|
Retrieves all groups of a domain or of a user given a userKey (paginated).
|
|
277
307
|
*/
|
|
278
|
-
await gapi.client.directory.groups.list({
|
|
308
|
+
await gapi.client.directory.groups.list({});
|
|
279
309
|
|
|
280
310
|
/*
|
|
281
311
|
Updates a group's properties. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
|
|
282
312
|
*/
|
|
283
|
-
await gapi.client.directory.groups.patch({
|
|
313
|
+
await gapi.client.directory.groups.patch({groupKey: 'groupKey'});
|
|
284
314
|
|
|
285
315
|
/*
|
|
286
316
|
Updates a group's properties.
|
|
287
317
|
*/
|
|
288
|
-
await gapi.client.directory.groups.update({
|
|
318
|
+
await gapi.client.directory.groups.update({groupKey: 'groupKey'});
|
|
289
319
|
|
|
290
320
|
/*
|
|
291
321
|
Removes a member from a group.
|
|
292
322
|
*/
|
|
293
|
-
await gapi.client.directory.members.delete({
|
|
323
|
+
await gapi.client.directory.members.delete({
|
|
324
|
+
groupKey: 'groupKey',
|
|
325
|
+
memberKey: 'memberKey',
|
|
326
|
+
});
|
|
294
327
|
|
|
295
328
|
/*
|
|
296
329
|
Retrieves a group member's properties.
|
|
297
330
|
*/
|
|
298
|
-
await gapi.client.directory.members.get({
|
|
331
|
+
await gapi.client.directory.members.get({
|
|
332
|
+
groupKey: 'groupKey',
|
|
333
|
+
memberKey: 'memberKey',
|
|
334
|
+
});
|
|
299
335
|
|
|
300
336
|
/*
|
|
301
337
|
Checks whether the given user is a member of the group. Membership can be direct or nested, but if nested, the `memberKey` and `groupKey` must be entities in the same domain or an `Invalid input` error is returned. To check for nested memberships that include entities outside of the group's domain, use the [`checkTransitiveMembership()`](https://cloud.google.com/identity/docs/reference/rest/v1/groups.memberships/checkTransitiveMembership) method in the Cloud Identity Groups API.
|
|
302
338
|
*/
|
|
303
|
-
await gapi.client.directory.members.hasMember({
|
|
339
|
+
await gapi.client.directory.members.hasMember({
|
|
340
|
+
groupKey: 'groupKey',
|
|
341
|
+
memberKey: 'memberKey',
|
|
342
|
+
});
|
|
304
343
|
|
|
305
344
|
/*
|
|
306
345
|
Adds a user to the specified group.
|
|
307
346
|
*/
|
|
308
|
-
await gapi.client.directory.members.insert({
|
|
347
|
+
await gapi.client.directory.members.insert({groupKey: 'groupKey'});
|
|
309
348
|
|
|
310
349
|
/*
|
|
311
350
|
Retrieves a paginated list of all members in a group. This method times out after 60 minutes. For more information, see [Troubleshoot error codes](https://developers.google.com/admin-sdk/directory/v1/guides/troubleshoot-error-codes).
|
|
312
351
|
*/
|
|
313
|
-
await gapi.client.directory.members.list({
|
|
352
|
+
await gapi.client.directory.members.list({groupKey: 'groupKey'});
|
|
314
353
|
|
|
315
354
|
/*
|
|
316
355
|
Updates the membership properties of a user in the specified group. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).
|
|
317
356
|
*/
|
|
318
|
-
await gapi.client.directory.members.patch({
|
|
357
|
+
await gapi.client.directory.members.patch({
|
|
358
|
+
groupKey: 'groupKey',
|
|
359
|
+
memberKey: 'memberKey',
|
|
360
|
+
});
|
|
319
361
|
|
|
320
362
|
/*
|
|
321
363
|
Updates the membership of a user in the specified group.
|
|
322
364
|
*/
|
|
323
|
-
await gapi.client.directory.members.update({
|
|
365
|
+
await gapi.client.directory.members.update({
|
|
366
|
+
groupKey: 'groupKey',
|
|
367
|
+
memberKey: 'memberKey',
|
|
368
|
+
});
|
|
324
369
|
|
|
325
370
|
/*
|
|
326
371
|
Takes an action that affects a mobile device. For example, remotely wiping a device.
|
|
327
372
|
*/
|
|
328
|
-
await gapi.client.directory.mobiledevices.action({
|
|
373
|
+
await gapi.client.directory.mobiledevices.action({
|
|
374
|
+
customerId: 'customerId',
|
|
375
|
+
resourceId: 'resourceId',
|
|
376
|
+
});
|
|
329
377
|
|
|
330
378
|
/*
|
|
331
379
|
Removes a mobile device.
|
|
332
380
|
*/
|
|
333
|
-
await gapi.client.directory.mobiledevices.delete({
|
|
381
|
+
await gapi.client.directory.mobiledevices.delete({
|
|
382
|
+
customerId: 'customerId',
|
|
383
|
+
resourceId: 'resourceId',
|
|
384
|
+
});
|
|
334
385
|
|
|
335
386
|
/*
|
|
336
387
|
Retrieves a mobile device's properties.
|
|
337
388
|
*/
|
|
338
|
-
await gapi.client.directory.mobiledevices.get({
|
|
389
|
+
await gapi.client.directory.mobiledevices.get({
|
|
390
|
+
customerId: 'customerId',
|
|
391
|
+
resourceId: 'resourceId',
|
|
392
|
+
});
|
|
339
393
|
|
|
340
394
|
/*
|
|
341
395
|
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. This method times out after 60 minutes. For more information, see [Troubleshoot error codes](https://developers.google.com/admin-sdk/directory/v1/guides/troubleshoot-error-codes).
|
|
342
396
|
*/
|
|
343
|
-
await gapi.client.directory.mobiledevices.list({
|
|
397
|
+
await gapi.client.directory.mobiledevices.list({customerId: 'customerId'});
|
|
344
398
|
|
|
345
399
|
/*
|
|
346
400
|
Removes an organizational unit.
|
|
347
401
|
*/
|
|
348
|
-
await gapi.client.directory.orgunits.delete({
|
|
402
|
+
await gapi.client.directory.orgunits.delete({
|
|
403
|
+
customerId: 'customerId',
|
|
404
|
+
orgUnitPath: 'orgUnitPath',
|
|
405
|
+
});
|
|
349
406
|
|
|
350
407
|
/*
|
|
351
408
|
Retrieves an organizational unit.
|
|
352
409
|
*/
|
|
353
|
-
await gapi.client.directory.orgunits.get({
|
|
410
|
+
await gapi.client.directory.orgunits.get({
|
|
411
|
+
customerId: 'customerId',
|
|
412
|
+
orgUnitPath: 'orgUnitPath',
|
|
413
|
+
});
|
|
354
414
|
|
|
355
415
|
/*
|
|
356
416
|
Adds an organizational unit.
|
|
357
417
|
*/
|
|
358
|
-
await gapi.client.directory.orgunits.insert({
|
|
418
|
+
await gapi.client.directory.orgunits.insert({customerId: 'customerId'});
|
|
359
419
|
|
|
360
420
|
/*
|
|
361
421
|
Retrieves a list of all organizational units for an account.
|
|
362
422
|
*/
|
|
363
|
-
await gapi.client.directory.orgunits.list({
|
|
423
|
+
await gapi.client.directory.orgunits.list({customerId: 'customerId'});
|
|
364
424
|
|
|
365
425
|
/*
|
|
366
426
|
Updates an organizational unit. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch)
|
|
367
427
|
*/
|
|
368
|
-
await gapi.client.directory.orgunits.patch({
|
|
428
|
+
await gapi.client.directory.orgunits.patch({
|
|
429
|
+
customerId: 'customerId',
|
|
430
|
+
orgUnitPath: 'orgUnitPath',
|
|
431
|
+
});
|
|
369
432
|
|
|
370
433
|
/*
|
|
371
434
|
Updates an organizational unit.
|
|
372
435
|
*/
|
|
373
|
-
await gapi.client.directory.orgunits.update({
|
|
436
|
+
await gapi.client.directory.orgunits.update({
|
|
437
|
+
customerId: 'customerId',
|
|
438
|
+
orgUnitPath: 'orgUnitPath',
|
|
439
|
+
});
|
|
374
440
|
|
|
375
441
|
/*
|
|
376
442
|
Retrieves a paginated list of all privileges for a customer.
|
|
377
443
|
*/
|
|
378
|
-
await gapi.client.directory.privileges.list({
|
|
444
|
+
await gapi.client.directory.privileges.list({customer: 'customer'});
|
|
379
445
|
|
|
380
446
|
/*
|
|
381
447
|
Deletes a role assignment.
|
|
382
448
|
*/
|
|
383
|
-
await gapi.client.directory.roleAssignments.delete({
|
|
449
|
+
await gapi.client.directory.roleAssignments.delete({
|
|
450
|
+
customer: 'customer',
|
|
451
|
+
roleAssignmentId: 'roleAssignmentId',
|
|
452
|
+
});
|
|
384
453
|
|
|
385
454
|
/*
|
|
386
455
|
Retrieves a role assignment.
|
|
387
456
|
*/
|
|
388
|
-
await gapi.client.directory.roleAssignments.get({
|
|
457
|
+
await gapi.client.directory.roleAssignments.get({
|
|
458
|
+
customer: 'customer',
|
|
459
|
+
roleAssignmentId: 'roleAssignmentId',
|
|
460
|
+
});
|
|
389
461
|
|
|
390
462
|
/*
|
|
391
463
|
Creates a role assignment.
|
|
392
464
|
*/
|
|
393
|
-
await gapi.client.directory.roleAssignments.insert({
|
|
465
|
+
await gapi.client.directory.roleAssignments.insert({customer: 'customer'});
|
|
394
466
|
|
|
395
467
|
/*
|
|
396
468
|
Retrieves a paginated list of all roleAssignments.
|
|
397
469
|
*/
|
|
398
|
-
await gapi.client.directory.roleAssignments.list({
|
|
470
|
+
await gapi.client.directory.roleAssignments.list({customer: 'customer'});
|
|
399
471
|
|
|
400
472
|
/*
|
|
401
473
|
Deletes a role.
|
|
402
474
|
*/
|
|
403
|
-
await gapi.client.directory.roles.delete({
|
|
475
|
+
await gapi.client.directory.roles.delete({
|
|
476
|
+
customer: 'customer',
|
|
477
|
+
roleId: 'roleId',
|
|
478
|
+
});
|
|
404
479
|
|
|
405
480
|
/*
|
|
406
481
|
Retrieves a role.
|
|
407
482
|
*/
|
|
408
|
-
await gapi.client.directory.roles.get({
|
|
483
|
+
await gapi.client.directory.roles.get({customer: 'customer', roleId: 'roleId'});
|
|
409
484
|
|
|
410
485
|
/*
|
|
411
486
|
Creates a role.
|
|
412
487
|
*/
|
|
413
|
-
await gapi.client.directory.roles.insert({
|
|
488
|
+
await gapi.client.directory.roles.insert({customer: 'customer'});
|
|
414
489
|
|
|
415
490
|
/*
|
|
416
491
|
Retrieves a paginated list of all the roles in a domain.
|
|
417
492
|
*/
|
|
418
|
-
await gapi.client.directory.roles.list({
|
|
493
|
+
await gapi.client.directory.roles.list({customer: 'customer'});
|
|
419
494
|
|
|
420
495
|
/*
|
|
421
496
|
Patches a role.
|
|
422
497
|
*/
|
|
423
|
-
await gapi.client.directory.roles.patch({
|
|
498
|
+
await gapi.client.directory.roles.patch({
|
|
499
|
+
customer: 'customer',
|
|
500
|
+
roleId: 'roleId',
|
|
501
|
+
});
|
|
424
502
|
|
|
425
503
|
/*
|
|
426
504
|
Updates a role.
|
|
427
505
|
*/
|
|
428
|
-
await gapi.client.directory.roles.update({
|
|
506
|
+
await gapi.client.directory.roles.update({
|
|
507
|
+
customer: 'customer',
|
|
508
|
+
roleId: 'roleId',
|
|
509
|
+
});
|
|
429
510
|
|
|
430
511
|
/*
|
|
431
512
|
Deletes a schema.
|
|
432
513
|
*/
|
|
433
|
-
await gapi.client.directory.schemas.delete({
|
|
514
|
+
await gapi.client.directory.schemas.delete({
|
|
515
|
+
customerId: 'customerId',
|
|
516
|
+
schemaKey: 'schemaKey',
|
|
517
|
+
});
|
|
434
518
|
|
|
435
519
|
/*
|
|
436
520
|
Retrieves a schema.
|
|
437
521
|
*/
|
|
438
|
-
await gapi.client.directory.schemas.get({
|
|
522
|
+
await gapi.client.directory.schemas.get({
|
|
523
|
+
customerId: 'customerId',
|
|
524
|
+
schemaKey: 'schemaKey',
|
|
525
|
+
});
|
|
439
526
|
|
|
440
527
|
/*
|
|
441
528
|
Creates a schema.
|
|
442
529
|
*/
|
|
443
|
-
await gapi.client.directory.schemas.insert({
|
|
530
|
+
await gapi.client.directory.schemas.insert({customerId: 'customerId'});
|
|
444
531
|
|
|
445
532
|
/*
|
|
446
533
|
Retrieves all schemas for a customer.
|
|
447
534
|
*/
|
|
448
|
-
await gapi.client.directory.schemas.list({
|
|
535
|
+
await gapi.client.directory.schemas.list({customerId: 'customerId'});
|
|
449
536
|
|
|
450
537
|
/*
|
|
451
538
|
Patches a schema.
|
|
452
539
|
*/
|
|
453
|
-
await gapi.client.directory.schemas.patch({
|
|
540
|
+
await gapi.client.directory.schemas.patch({
|
|
541
|
+
customerId: 'customerId',
|
|
542
|
+
schemaKey: 'schemaKey',
|
|
543
|
+
});
|
|
454
544
|
|
|
455
545
|
/*
|
|
456
546
|
Updates a schema.
|
|
457
547
|
*/
|
|
458
|
-
await gapi.client.directory.schemas.update({
|
|
548
|
+
await gapi.client.directory.schemas.update({
|
|
549
|
+
customerId: 'customerId',
|
|
550
|
+
schemaKey: 'schemaKey',
|
|
551
|
+
});
|
|
459
552
|
|
|
460
553
|
/*
|
|
461
554
|
Deletes all access tokens issued by a user for an application.
|
|
462
555
|
*/
|
|
463
|
-
await gapi.client.directory.tokens.delete({
|
|
556
|
+
await gapi.client.directory.tokens.delete({
|
|
557
|
+
clientId: 'clientId',
|
|
558
|
+
userKey: 'userKey',
|
|
559
|
+
});
|
|
464
560
|
|
|
465
561
|
/*
|
|
466
562
|
Gets information about an access token issued by a user.
|
|
467
563
|
*/
|
|
468
|
-
await gapi.client.directory.tokens.get({
|
|
564
|
+
await gapi.client.directory.tokens.get({
|
|
565
|
+
clientId: 'clientId',
|
|
566
|
+
userKey: 'userKey',
|
|
567
|
+
});
|
|
469
568
|
|
|
470
569
|
/*
|
|
471
570
|
Returns the set of tokens specified user has issued to 3rd party applications.
|
|
472
571
|
*/
|
|
473
|
-
await gapi.client.directory.tokens.list({
|
|
572
|
+
await gapi.client.directory.tokens.list({userKey: 'userKey'});
|
|
474
573
|
|
|
475
574
|
/*
|
|
476
575
|
Turns off 2-Step Verification for user.
|
|
477
576
|
*/
|
|
478
|
-
await gapi.client.directory.twoStepVerification.turnOff({
|
|
577
|
+
await gapi.client.directory.twoStepVerification.turnOff({userKey: 'userKey'});
|
|
479
578
|
|
|
480
579
|
/*
|
|
481
580
|
Deletes a user.
|
|
482
581
|
*/
|
|
483
|
-
await gapi.client.directory.users.delete({
|
|
582
|
+
await gapi.client.directory.users.delete({userKey: 'userKey'});
|
|
484
583
|
|
|
485
584
|
/*
|
|
486
585
|
Retrieves a user.
|
|
487
586
|
*/
|
|
488
|
-
await gapi.client.directory.users.get({
|
|
587
|
+
await gapi.client.directory.users.get({userKey: 'userKey'});
|
|
489
588
|
|
|
490
589
|
/*
|
|
491
590
|
Creates a user. Mutate calls immediately following user creation might sometimes fail as the user isn't fully created due to propagation delay in our backends. Check the error details for the "User creation is not complete" message to see if this is the case. Retrying the calls after some time can help in this case.
|
|
492
591
|
*/
|
|
493
|
-
await gapi.client.directory.users.insert({
|
|
592
|
+
await gapi.client.directory.users.insert({});
|
|
494
593
|
|
|
495
594
|
/*
|
|
496
595
|
Retrieves a paginated list of either deleted users or all users in a domain.
|
|
497
596
|
*/
|
|
498
|
-
await gapi.client.directory.users.list({
|
|
597
|
+
await gapi.client.directory.users.list({});
|
|
499
598
|
|
|
500
599
|
/*
|
|
501
600
|
Makes a user a super administrator.
|
|
502
601
|
*/
|
|
503
|
-
await gapi.client.directory.users.makeAdmin({
|
|
602
|
+
await gapi.client.directory.users.makeAdmin({userKey: 'userKey'});
|
|
504
603
|
|
|
505
604
|
/*
|
|
506
605
|
Updates a user using patch semantics. The update method should be used instead, because it also supports patch semantics and has better performance. If you're mapping an external identity to a Google identity, use the [`update`](https://developers.google.com/admin-sdk/directory/v1/reference/users/update) method instead of the `patch` method. This method is unable to clear fields that contain repeated objects (`addresses`, `phones`, etc). Use the update method instead.
|
|
507
606
|
*/
|
|
508
|
-
await gapi.client.directory.users.patch({
|
|
607
|
+
await gapi.client.directory.users.patch({userKey: 'userKey'});
|
|
509
608
|
|
|
510
609
|
/*
|
|
511
610
|
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
611
|
*/
|
|
513
|
-
await gapi.client.directory.users.signOut({
|
|
612
|
+
await gapi.client.directory.users.signOut({userKey: 'userKey'});
|
|
514
613
|
|
|
515
614
|
/*
|
|
516
615
|
Undeletes a deleted user.
|
|
517
616
|
*/
|
|
518
|
-
await gapi.client.directory.users.undelete({
|
|
617
|
+
await gapi.client.directory.users.undelete({userKey: 'userKey'});
|
|
519
618
|
|
|
520
619
|
/*
|
|
521
620
|
Updates a user. This method supports patch semantics, meaning that 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. For repeating fields that contain arrays, individual items in the array can't be patched piecemeal; they must be supplied in the request body with the desired values for all items. See the [user accounts guide](https://developers.google.com/admin-sdk/directory/v1/guides/manage-users#update_user) for more information.
|
|
522
621
|
*/
|
|
523
|
-
await gapi.client.directory.users.update({
|
|
622
|
+
await gapi.client.directory.users.update({userKey: 'userKey'});
|
|
524
623
|
|
|
525
624
|
/*
|
|
526
625
|
Watches for changes in users list.
|
|
527
626
|
*/
|
|
528
|
-
await gapi.client.directory.users.watch({
|
|
627
|
+
await gapi.client.directory.users.watch({});
|
|
529
628
|
|
|
530
629
|
/*
|
|
531
630
|
Generates new backup verification codes for the user.
|
|
532
631
|
*/
|
|
533
|
-
await gapi.client.directory.verificationCodes.generate({
|
|
632
|
+
await gapi.client.directory.verificationCodes.generate({userKey: 'userKey'});
|
|
534
633
|
|
|
535
634
|
/*
|
|
536
635
|
Invalidates the current backup verification codes for the user.
|
|
537
636
|
*/
|
|
538
|
-
await gapi.client.directory.verificationCodes.invalidate({
|
|
637
|
+
await gapi.client.directory.verificationCodes.invalidate({userKey: 'userKey'});
|
|
539
638
|
|
|
540
639
|
/*
|
|
541
640
|
Returns the current set of valid backup verification codes for the specified user.
|
|
542
641
|
*/
|
|
543
|
-
await gapi.client.directory.verificationCodes.list({
|
|
642
|
+
await gapi.client.directory.verificationCodes.list({userKey: 'userKey'});
|
|
544
643
|
```
|