Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: generated/googleapis/lib/admin/directory_v1.dart

Issue 559053002: Generate 0.1.0 version of googleapis/googleapis_beta (Closed) Base URL: git@github.com:dart-lang/googleapis.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 library googleapis.admin.directory_v1;
2
3 import "dart:core" as core;
4 import "dart:collection" as collection;
5 import "dart:async" as async;
6 import "dart:convert" as convert;
7
8 import "package:crypto/crypto.dart" as crypto;
9 import 'package:http/http.dart' as http;
10 import '../src/common_internal.dart' as common_internal;
11 import '../common/common.dart' as common;
12
13 export '../common/common.dart' show ApiRequestError;
14 export '../common/common.dart' show DetailedApiRequestError;
15
16 /**
17 * The Admin SDK Directory API lets you view and manage enterprise resources
18 * such as users and groups, administrative notifications, security features,
19 * and more.
20 */
21 class AdminApi {
22 /** View and manage your Chrome OS devices' metadata */
23 static const AdminDirectoryDeviceChromeosScope = "https://www.googleapis.com/a uth/admin.directory.device.chromeos";
24
25 /** View your Chrome OS devices' metadata */
26 static const AdminDirectoryDeviceChromeosReadonlyScope = "https://www.googleap is.com/auth/admin.directory.device.chromeos.readonly";
27
28 /** View and manage your mobile devices' metadata */
29 static const AdminDirectoryDeviceMobileScope = "https://www.googleapis.com/aut h/admin.directory.device.mobile";
30
31 /** Manage your mobile devices by performing administrative tasks */
32 static const AdminDirectoryDeviceMobileActionScope = "https://www.googleapis.c om/auth/admin.directory.device.mobile.action";
33
34 /** View your mobile devices' metadata */
35 static const AdminDirectoryDeviceMobileReadonlyScope = "https://www.googleapis .com/auth/admin.directory.device.mobile.readonly";
36
37 /** View and manage the provisioning of groups on your domain */
38 static const AdminDirectoryGroupScope = "https://www.googleapis.com/auth/admin .directory.group";
39
40 /** View and manage group subscriptions on your domain */
41 static const AdminDirectoryGroupMemberScope = "https://www.googleapis.com/auth /admin.directory.group.member";
42
43 /** View group subscriptions on your domain */
44 static const AdminDirectoryGroupMemberReadonlyScope = "https://www.googleapis. com/auth/admin.directory.group.member.readonly";
45
46 /** View groups on your domain */
47 static const AdminDirectoryGroupReadonlyScope = "https://www.googleapis.com/au th/admin.directory.group.readonly";
48
49 /** View and manage notifications received on your domain */
50 static const AdminDirectoryNotificationsScope = "https://www.googleapis.com/au th/admin.directory.notifications";
51
52 /** View and manage organization units on your domain */
53 static const AdminDirectoryOrgunitScope = "https://www.googleapis.com/auth/adm in.directory.orgunit";
54
55 /** View organization units on your domain */
56 static const AdminDirectoryOrgunitReadonlyScope = "https://www.googleapis.com/ auth/admin.directory.orgunit.readonly";
57
58 /** View and manage the provisioning of users on your domain */
59 static const AdminDirectoryUserScope = "https://www.googleapis.com/auth/admin. directory.user";
60
61 /** View and manage user aliases on your domain */
62 static const AdminDirectoryUserAliasScope = "https://www.googleapis.com/auth/a dmin.directory.user.alias";
63
64 /** View user aliases on your domain */
65 static const AdminDirectoryUserAliasReadonlyScope = "https://www.googleapis.co m/auth/admin.directory.user.alias.readonly";
66
67 /** View users on your domain */
68 static const AdminDirectoryUserReadonlyScope = "https://www.googleapis.com/aut h/admin.directory.user.readonly";
69
70 /** Manage data access permissions for users on your domain */
71 static const AdminDirectoryUserSecurityScope = "https://www.googleapis.com/aut h/admin.directory.user.security";
72
73
74 final common_internal.ApiRequester _requester;
75
76 AspsResourceApi get asps => new AspsResourceApi(_requester);
77 ChannelsResourceApi get channels => new ChannelsResourceApi(_requester);
78 ChromeosdevicesResourceApi get chromeosdevices => new ChromeosdevicesResourceA pi(_requester);
79 GroupsResourceApi get groups => new GroupsResourceApi(_requester);
80 MembersResourceApi get members => new MembersResourceApi(_requester);
81 MobiledevicesResourceApi get mobiledevices => new MobiledevicesResourceApi(_re quester);
82 NotificationsResourceApi get notifications => new NotificationsResourceApi(_re quester);
83 OrgunitsResourceApi get orgunits => new OrgunitsResourceApi(_requester);
84 TokensResourceApi get tokens => new TokensResourceApi(_requester);
85 UsersResourceApi get users => new UsersResourceApi(_requester);
86 VerificationCodesResourceApi get verificationCodes => new VerificationCodesRes ourceApi(_requester);
87
88 AdminApi(http.Client client) :
89 _requester = new common_internal.ApiRequester(client, "https://www.googlea pis.com/", "/admin/directory/v1/");
90 }
91
92
93 /** Not documented yet. */
94 class AspsResourceApi {
95 final common_internal.ApiRequester _requester;
96
97 AspsResourceApi(common_internal.ApiRequester client) :
98 _requester = client;
99
100 /**
101 * Delete an ASP issued by a user.
102 *
103 * Request parameters:
104 *
105 * [userKey] - Identifies the user in the API request. The value can be the
106 * user's primary email address, alias email address, or unique user ID.
107 *
108 * [codeId] - The unique ID of the ASP to be deleted.
109 *
110 * Completes with a [common.ApiRequestError] if the API endpoint returned an
111 * error.
112 *
113 * If the used [http.Client] completes with an error when making a REST call,
114 * this method will complete with the same error.
115 */
116 async.Future delete(core.String userKey, core.int codeId) {
117 var _url = null;
118 var _queryParams = new core.Map();
119 var _uploadMedia = null;
120 var _uploadOptions = null;
121 var _downloadOptions = common.DownloadOptions.Metadata;
122 var _body = null;
123
124 if (userKey == null) {
125 throw new core.ArgumentError("Parameter userKey is required.");
126 }
127 if (codeId == null) {
128 throw new core.ArgumentError("Parameter codeId is required.");
129 }
130
131 _downloadOptions = null;
132
133 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/asps /' + common_internal.Escaper.ecapeVariable('$codeId');
134
135 var _response = _requester.request(_url,
136 "DELETE",
137 body: _body,
138 queryParams: _queryParams,
139 uploadOptions: _uploadOptions,
140 uploadMedia: _uploadMedia,
141 downloadOptions: _downloadOptions);
142 return _response.then((data) => null);
143 }
144
145 /**
146 * Get information about an ASP issued by a user.
147 *
148 * Request parameters:
149 *
150 * [userKey] - Identifies the user in the API request. The value can be the
151 * user's primary email address, alias email address, or unique user ID.
152 *
153 * [codeId] - The unique ID of the ASP.
154 *
155 * Completes with a [Asp].
156 *
157 * Completes with a [common.ApiRequestError] if the API endpoint returned an
158 * error.
159 *
160 * If the used [http.Client] completes with an error when making a REST call,
161 * this method will complete with the same error.
162 */
163 async.Future<Asp> get(core.String userKey, core.int codeId) {
164 var _url = null;
165 var _queryParams = new core.Map();
166 var _uploadMedia = null;
167 var _uploadOptions = null;
168 var _downloadOptions = common.DownloadOptions.Metadata;
169 var _body = null;
170
171 if (userKey == null) {
172 throw new core.ArgumentError("Parameter userKey is required.");
173 }
174 if (codeId == null) {
175 throw new core.ArgumentError("Parameter codeId is required.");
176 }
177
178
179 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/asps /' + common_internal.Escaper.ecapeVariable('$codeId');
180
181 var _response = _requester.request(_url,
182 "GET",
183 body: _body,
184 queryParams: _queryParams,
185 uploadOptions: _uploadOptions,
186 uploadMedia: _uploadMedia,
187 downloadOptions: _downloadOptions);
188 return _response.then((data) => new Asp.fromJson(data));
189 }
190
191 /**
192 * List the ASPs issued by a user.
193 *
194 * Request parameters:
195 *
196 * [userKey] - Identifies the user in the API request. The value can be the
197 * user's primary email address, alias email address, or unique user ID.
198 *
199 * Completes with a [Asps].
200 *
201 * Completes with a [common.ApiRequestError] if the API endpoint returned an
202 * error.
203 *
204 * If the used [http.Client] completes with an error when making a REST call,
205 * this method will complete with the same error.
206 */
207 async.Future<Asps> list(core.String userKey) {
208 var _url = null;
209 var _queryParams = new core.Map();
210 var _uploadMedia = null;
211 var _uploadOptions = null;
212 var _downloadOptions = common.DownloadOptions.Metadata;
213 var _body = null;
214
215 if (userKey == null) {
216 throw new core.ArgumentError("Parameter userKey is required.");
217 }
218
219
220 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/asps ';
221
222 var _response = _requester.request(_url,
223 "GET",
224 body: _body,
225 queryParams: _queryParams,
226 uploadOptions: _uploadOptions,
227 uploadMedia: _uploadMedia,
228 downloadOptions: _downloadOptions);
229 return _response.then((data) => new Asps.fromJson(data));
230 }
231
232 }
233
234
235 /** Not documented yet. */
236 class ChannelsResourceApi {
237 final common_internal.ApiRequester _requester;
238
239 ChannelsResourceApi(common_internal.ApiRequester client) :
240 _requester = client;
241
242 /**
243 * Stop watching resources through this channel
244 *
245 * [request] - The metadata request object.
246 *
247 * Request parameters:
248 *
249 * Completes with a [common.ApiRequestError] if the API endpoint returned an
250 * error.
251 *
252 * If the used [http.Client] completes with an error when making a REST call,
253 * this method will complete with the same error.
254 */
255 async.Future stop(Channel request) {
256 var _url = null;
257 var _queryParams = new core.Map();
258 var _uploadMedia = null;
259 var _uploadOptions = null;
260 var _downloadOptions = common.DownloadOptions.Metadata;
261 var _body = null;
262
263 if (request != null) {
264 _body = convert.JSON.encode((request).toJson());
265 }
266
267 _downloadOptions = null;
268
269 _url = '/admin/directory_v1/channels/stop';
270
271 var _response = _requester.request(_url,
272 "POST",
273 body: _body,
274 queryParams: _queryParams,
275 uploadOptions: _uploadOptions,
276 uploadMedia: _uploadMedia,
277 downloadOptions: _downloadOptions);
278 return _response.then((data) => null);
279 }
280
281 }
282
283
284 /** Not documented yet. */
285 class ChromeosdevicesResourceApi {
286 final common_internal.ApiRequester _requester;
287
288 ChromeosdevicesResourceApi(common_internal.ApiRequester client) :
289 _requester = client;
290
291 /**
292 * Retrieve Chrome OS Device
293 *
294 * Request parameters:
295 *
296 * [customerId] - Immutable id of the Google Apps account
297 *
298 * [deviceId] - Immutable id of Chrome OS Device
299 *
300 * [projection] - Restrict information returned to a set of selected fields.
301 * Possible string values are:
302 * - "BASIC" : Includes only the basic metadata fields (e.g., deviceId,
303 * serialNumber, status, and user)
304 * - "FULL" : Includes all metadata fields
305 *
306 * Completes with a [ChromeOsDevice].
307 *
308 * Completes with a [common.ApiRequestError] if the API endpoint returned an
309 * error.
310 *
311 * If the used [http.Client] completes with an error when making a REST call,
312 * this method will complete with the same error.
313 */
314 async.Future<ChromeOsDevice> get(core.String customerId, core.String deviceId, {core.String projection}) {
315 var _url = null;
316 var _queryParams = new core.Map();
317 var _uploadMedia = null;
318 var _uploadOptions = null;
319 var _downloadOptions = common.DownloadOptions.Metadata;
320 var _body = null;
321
322 if (customerId == null) {
323 throw new core.ArgumentError("Parameter customerId is required.");
324 }
325 if (deviceId == null) {
326 throw new core.ArgumentError("Parameter deviceId is required.");
327 }
328 if (projection != null) {
329 _queryParams["projection"] = [projection];
330 }
331
332
333 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/chromeos/' + common_internal.Escaper.ecapeVariable('$deviceId');
334
335 var _response = _requester.request(_url,
336 "GET",
337 body: _body,
338 queryParams: _queryParams,
339 uploadOptions: _uploadOptions,
340 uploadMedia: _uploadMedia,
341 downloadOptions: _downloadOptions);
342 return _response.then((data) => new ChromeOsDevice.fromJson(data));
343 }
344
345 /**
346 * Retrieve all Chrome OS Devices of a customer (paginated)
347 *
348 * Request parameters:
349 *
350 * [customerId] - Immutable id of the Google Apps account
351 *
352 * [maxResults] - Maximum number of results to return. Default is 100
353 *
354 * [orderBy] - Column to use for sorting results
355 * Possible string values are:
356 * - "annotatedLocation" : Chromebook location as annotated by the
357 * administrator.
358 * - "annotatedUser" : Chromebook user as annotated by administrator.
359 * - "lastSync" : Chromebook last sync.
360 * - "notes" : Chromebook notes as annotated by the administrator.
361 * - "serialNumber" : Chromebook Serial Number.
362 * - "status" : Chromebook status.
363 * - "supportEndDate" : Chromebook support end date.
364 *
365 * [pageToken] - Token to specify next page in the list
366 *
367 * [projection] - Restrict information returned to a set of selected fields.
368 * Possible string values are:
369 * - "BASIC" : Includes only the basic metadata fields (e.g., deviceId,
370 * serialNumber, status, and user)
371 * - "FULL" : Includes all metadata fields
372 *
373 * [query] - Search string in the format given at
374 * http://support.google.com/chromeos/a/bin/answer.py?hl=en&answer=1698333
375 *
376 * [sortOrder] - Whether to return results in ascending or descending order.
377 * Only of use when orderBy is also used
378 * Possible string values are:
379 * - "ASCENDING" : Ascending order.
380 * - "DESCENDING" : Descending order.
381 *
382 * Completes with a [ChromeOsDevices].
383 *
384 * Completes with a [common.ApiRequestError] if the API endpoint returned an
385 * error.
386 *
387 * If the used [http.Client] completes with an error when making a REST call,
388 * this method will complete with the same error.
389 */
390 async.Future<ChromeOsDevices> list(core.String customerId, {core.int maxResult s, core.String orderBy, core.String pageToken, core.String projection, core.Stri ng query, core.String sortOrder}) {
391 var _url = null;
392 var _queryParams = new core.Map();
393 var _uploadMedia = null;
394 var _uploadOptions = null;
395 var _downloadOptions = common.DownloadOptions.Metadata;
396 var _body = null;
397
398 if (customerId == null) {
399 throw new core.ArgumentError("Parameter customerId is required.");
400 }
401 if (maxResults != null) {
402 _queryParams["maxResults"] = ["${maxResults}"];
403 }
404 if (orderBy != null) {
405 _queryParams["orderBy"] = [orderBy];
406 }
407 if (pageToken != null) {
408 _queryParams["pageToken"] = [pageToken];
409 }
410 if (projection != null) {
411 _queryParams["projection"] = [projection];
412 }
413 if (query != null) {
414 _queryParams["query"] = [query];
415 }
416 if (sortOrder != null) {
417 _queryParams["sortOrder"] = [sortOrder];
418 }
419
420
421 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/chromeos';
422
423 var _response = _requester.request(_url,
424 "GET",
425 body: _body,
426 queryParams: _queryParams,
427 uploadOptions: _uploadOptions,
428 uploadMedia: _uploadMedia,
429 downloadOptions: _downloadOptions);
430 return _response.then((data) => new ChromeOsDevices.fromJson(data));
431 }
432
433 /**
434 * Update Chrome OS Device. This method supports patch semantics.
435 *
436 * [request] - The metadata request object.
437 *
438 * Request parameters:
439 *
440 * [customerId] - Immutable id of the Google Apps account
441 *
442 * [deviceId] - Immutable id of Chrome OS Device
443 *
444 * [projection] - Restrict information returned to a set of selected fields.
445 * Possible string values are:
446 * - "BASIC" : Includes only the basic metadata fields (e.g., deviceId,
447 * serialNumber, status, and user)
448 * - "FULL" : Includes all metadata fields
449 *
450 * Completes with a [ChromeOsDevice].
451 *
452 * Completes with a [common.ApiRequestError] if the API endpoint returned an
453 * error.
454 *
455 * If the used [http.Client] completes with an error when making a REST call,
456 * this method will complete with the same error.
457 */
458 async.Future<ChromeOsDevice> patch(ChromeOsDevice request, core.String custome rId, core.String deviceId, {core.String projection}) {
459 var _url = null;
460 var _queryParams = new core.Map();
461 var _uploadMedia = null;
462 var _uploadOptions = null;
463 var _downloadOptions = common.DownloadOptions.Metadata;
464 var _body = null;
465
466 if (request != null) {
467 _body = convert.JSON.encode((request).toJson());
468 }
469 if (customerId == null) {
470 throw new core.ArgumentError("Parameter customerId is required.");
471 }
472 if (deviceId == null) {
473 throw new core.ArgumentError("Parameter deviceId is required.");
474 }
475 if (projection != null) {
476 _queryParams["projection"] = [projection];
477 }
478
479
480 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/chromeos/' + common_internal.Escaper.ecapeVariable('$deviceId');
481
482 var _response = _requester.request(_url,
483 "PATCH",
484 body: _body,
485 queryParams: _queryParams,
486 uploadOptions: _uploadOptions,
487 uploadMedia: _uploadMedia,
488 downloadOptions: _downloadOptions);
489 return _response.then((data) => new ChromeOsDevice.fromJson(data));
490 }
491
492 /**
493 * Update Chrome OS Device
494 *
495 * [request] - The metadata request object.
496 *
497 * Request parameters:
498 *
499 * [customerId] - Immutable id of the Google Apps account
500 *
501 * [deviceId] - Immutable id of Chrome OS Device
502 *
503 * [projection] - Restrict information returned to a set of selected fields.
504 * Possible string values are:
505 * - "BASIC" : Includes only the basic metadata fields (e.g., deviceId,
506 * serialNumber, status, and user)
507 * - "FULL" : Includes all metadata fields
508 *
509 * Completes with a [ChromeOsDevice].
510 *
511 * Completes with a [common.ApiRequestError] if the API endpoint returned an
512 * error.
513 *
514 * If the used [http.Client] completes with an error when making a REST call,
515 * this method will complete with the same error.
516 */
517 async.Future<ChromeOsDevice> update(ChromeOsDevice request, core.String custom erId, core.String deviceId, {core.String projection}) {
518 var _url = null;
519 var _queryParams = new core.Map();
520 var _uploadMedia = null;
521 var _uploadOptions = null;
522 var _downloadOptions = common.DownloadOptions.Metadata;
523 var _body = null;
524
525 if (request != null) {
526 _body = convert.JSON.encode((request).toJson());
527 }
528 if (customerId == null) {
529 throw new core.ArgumentError("Parameter customerId is required.");
530 }
531 if (deviceId == null) {
532 throw new core.ArgumentError("Parameter deviceId is required.");
533 }
534 if (projection != null) {
535 _queryParams["projection"] = [projection];
536 }
537
538
539 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/chromeos/' + common_internal.Escaper.ecapeVariable('$deviceId');
540
541 var _response = _requester.request(_url,
542 "PUT",
543 body: _body,
544 queryParams: _queryParams,
545 uploadOptions: _uploadOptions,
546 uploadMedia: _uploadMedia,
547 downloadOptions: _downloadOptions);
548 return _response.then((data) => new ChromeOsDevice.fromJson(data));
549 }
550
551 }
552
553
554 /** Not documented yet. */
555 class GroupsResourceApi {
556 final common_internal.ApiRequester _requester;
557
558 GroupsAliasesResourceApi get aliases => new GroupsAliasesResourceApi(_requeste r);
559
560 GroupsResourceApi(common_internal.ApiRequester client) :
561 _requester = client;
562
563 /**
564 * Delete Group
565 *
566 * Request parameters:
567 *
568 * [groupKey] - Email or immutable Id of the group
569 *
570 * Completes with a [common.ApiRequestError] if the API endpoint returned an
571 * error.
572 *
573 * If the used [http.Client] completes with an error when making a REST call,
574 * this method will complete with the same error.
575 */
576 async.Future delete(core.String groupKey) {
577 var _url = null;
578 var _queryParams = new core.Map();
579 var _uploadMedia = null;
580 var _uploadOptions = null;
581 var _downloadOptions = common.DownloadOptions.Metadata;
582 var _body = null;
583
584 if (groupKey == null) {
585 throw new core.ArgumentError("Parameter groupKey is required.");
586 }
587
588 _downloadOptions = null;
589
590 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey');
591
592 var _response = _requester.request(_url,
593 "DELETE",
594 body: _body,
595 queryParams: _queryParams,
596 uploadOptions: _uploadOptions,
597 uploadMedia: _uploadMedia,
598 downloadOptions: _downloadOptions);
599 return _response.then((data) => null);
600 }
601
602 /**
603 * Retrieve Group
604 *
605 * Request parameters:
606 *
607 * [groupKey] - Email or immutable Id of the group
608 *
609 * Completes with a [Group].
610 *
611 * Completes with a [common.ApiRequestError] if the API endpoint returned an
612 * error.
613 *
614 * If the used [http.Client] completes with an error when making a REST call,
615 * this method will complete with the same error.
616 */
617 async.Future<Group> get(core.String groupKey) {
618 var _url = null;
619 var _queryParams = new core.Map();
620 var _uploadMedia = null;
621 var _uploadOptions = null;
622 var _downloadOptions = common.DownloadOptions.Metadata;
623 var _body = null;
624
625 if (groupKey == null) {
626 throw new core.ArgumentError("Parameter groupKey is required.");
627 }
628
629
630 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey');
631
632 var _response = _requester.request(_url,
633 "GET",
634 body: _body,
635 queryParams: _queryParams,
636 uploadOptions: _uploadOptions,
637 uploadMedia: _uploadMedia,
638 downloadOptions: _downloadOptions);
639 return _response.then((data) => new Group.fromJson(data));
640 }
641
642 /**
643 * Create Group
644 *
645 * [request] - The metadata request object.
646 *
647 * Request parameters:
648 *
649 * Completes with a [Group].
650 *
651 * Completes with a [common.ApiRequestError] if the API endpoint returned an
652 * error.
653 *
654 * If the used [http.Client] completes with an error when making a REST call,
655 * this method will complete with the same error.
656 */
657 async.Future<Group> insert(Group request) {
658 var _url = null;
659 var _queryParams = new core.Map();
660 var _uploadMedia = null;
661 var _uploadOptions = null;
662 var _downloadOptions = common.DownloadOptions.Metadata;
663 var _body = null;
664
665 if (request != null) {
666 _body = convert.JSON.encode((request).toJson());
667 }
668
669
670 _url = 'groups';
671
672 var _response = _requester.request(_url,
673 "POST",
674 body: _body,
675 queryParams: _queryParams,
676 uploadOptions: _uploadOptions,
677 uploadMedia: _uploadMedia,
678 downloadOptions: _downloadOptions);
679 return _response.then((data) => new Group.fromJson(data));
680 }
681
682 /**
683 * Retrieve all groups in a domain (paginated)
684 *
685 * Request parameters:
686 *
687 * [customer] - Immutable id of the Google Apps account. In case of
688 * multi-domain, to fetch all groups for a customer, fill this field instead
689 * of domain.
690 *
691 * [domain] - Name of the domain. Fill this field to get groups from only this
692 * domain. To return all groups in a multi-domain fill customer field instead.
693 *
694 * [maxResults] - Maximum number of results to return. Default is 200
695 *
696 * [pageToken] - Token to specify next page in the list
697 *
698 * [userKey] - Email or immutable Id of the user if only those groups are to
699 * be listed, the given user is a member of. If Id, it should match with id of
700 * user object
701 *
702 * Completes with a [Groups].
703 *
704 * Completes with a [common.ApiRequestError] if the API endpoint returned an
705 * error.
706 *
707 * If the used [http.Client] completes with an error when making a REST call,
708 * this method will complete with the same error.
709 */
710 async.Future<Groups> list({core.String customer, core.String domain, core.int maxResults, core.String pageToken, core.String userKey}) {
711 var _url = null;
712 var _queryParams = new core.Map();
713 var _uploadMedia = null;
714 var _uploadOptions = null;
715 var _downloadOptions = common.DownloadOptions.Metadata;
716 var _body = null;
717
718 if (customer != null) {
719 _queryParams["customer"] = [customer];
720 }
721 if (domain != null) {
722 _queryParams["domain"] = [domain];
723 }
724 if (maxResults != null) {
725 _queryParams["maxResults"] = ["${maxResults}"];
726 }
727 if (pageToken != null) {
728 _queryParams["pageToken"] = [pageToken];
729 }
730 if (userKey != null) {
731 _queryParams["userKey"] = [userKey];
732 }
733
734
735 _url = 'groups';
736
737 var _response = _requester.request(_url,
738 "GET",
739 body: _body,
740 queryParams: _queryParams,
741 uploadOptions: _uploadOptions,
742 uploadMedia: _uploadMedia,
743 downloadOptions: _downloadOptions);
744 return _response.then((data) => new Groups.fromJson(data));
745 }
746
747 /**
748 * Update Group. This method supports patch semantics.
749 *
750 * [request] - The metadata request object.
751 *
752 * Request parameters:
753 *
754 * [groupKey] - Email or immutable Id of the group. If Id, it should match
755 * with id of group object
756 *
757 * Completes with a [Group].
758 *
759 * Completes with a [common.ApiRequestError] if the API endpoint returned an
760 * error.
761 *
762 * If the used [http.Client] completes with an error when making a REST call,
763 * this method will complete with the same error.
764 */
765 async.Future<Group> patch(Group request, core.String groupKey) {
766 var _url = null;
767 var _queryParams = new core.Map();
768 var _uploadMedia = null;
769 var _uploadOptions = null;
770 var _downloadOptions = common.DownloadOptions.Metadata;
771 var _body = null;
772
773 if (request != null) {
774 _body = convert.JSON.encode((request).toJson());
775 }
776 if (groupKey == null) {
777 throw new core.ArgumentError("Parameter groupKey is required.");
778 }
779
780
781 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey');
782
783 var _response = _requester.request(_url,
784 "PATCH",
785 body: _body,
786 queryParams: _queryParams,
787 uploadOptions: _uploadOptions,
788 uploadMedia: _uploadMedia,
789 downloadOptions: _downloadOptions);
790 return _response.then((data) => new Group.fromJson(data));
791 }
792
793 /**
794 * Update Group
795 *
796 * [request] - The metadata request object.
797 *
798 * Request parameters:
799 *
800 * [groupKey] - Email or immutable Id of the group. If Id, it should match
801 * with id of group object
802 *
803 * Completes with a [Group].
804 *
805 * Completes with a [common.ApiRequestError] if the API endpoint returned an
806 * error.
807 *
808 * If the used [http.Client] completes with an error when making a REST call,
809 * this method will complete with the same error.
810 */
811 async.Future<Group> update(Group request, core.String groupKey) {
812 var _url = null;
813 var _queryParams = new core.Map();
814 var _uploadMedia = null;
815 var _uploadOptions = null;
816 var _downloadOptions = common.DownloadOptions.Metadata;
817 var _body = null;
818
819 if (request != null) {
820 _body = convert.JSON.encode((request).toJson());
821 }
822 if (groupKey == null) {
823 throw new core.ArgumentError("Parameter groupKey is required.");
824 }
825
826
827 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey');
828
829 var _response = _requester.request(_url,
830 "PUT",
831 body: _body,
832 queryParams: _queryParams,
833 uploadOptions: _uploadOptions,
834 uploadMedia: _uploadMedia,
835 downloadOptions: _downloadOptions);
836 return _response.then((data) => new Group.fromJson(data));
837 }
838
839 }
840
841
842 /** Not documented yet. */
843 class GroupsAliasesResourceApi {
844 final common_internal.ApiRequester _requester;
845
846 GroupsAliasesResourceApi(common_internal.ApiRequester client) :
847 _requester = client;
848
849 /**
850 * Remove a alias for the group
851 *
852 * Request parameters:
853 *
854 * [groupKey] - Email or immutable Id of the group
855 *
856 * [alias] - The alias to be removed
857 *
858 * Completes with a [common.ApiRequestError] if the API endpoint returned an
859 * error.
860 *
861 * If the used [http.Client] completes with an error when making a REST call,
862 * this method will complete with the same error.
863 */
864 async.Future delete(core.String groupKey, core.String alias) {
865 var _url = null;
866 var _queryParams = new core.Map();
867 var _uploadMedia = null;
868 var _uploadOptions = null;
869 var _downloadOptions = common.DownloadOptions.Metadata;
870 var _body = null;
871
872 if (groupKey == null) {
873 throw new core.ArgumentError("Parameter groupKey is required.");
874 }
875 if (alias == null) {
876 throw new core.ArgumentError("Parameter alias is required.");
877 }
878
879 _downloadOptions = null;
880
881 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/al iases/' + common_internal.Escaper.ecapeVariable('$alias');
882
883 var _response = _requester.request(_url,
884 "DELETE",
885 body: _body,
886 queryParams: _queryParams,
887 uploadOptions: _uploadOptions,
888 uploadMedia: _uploadMedia,
889 downloadOptions: _downloadOptions);
890 return _response.then((data) => null);
891 }
892
893 /**
894 * Add a alias for the group
895 *
896 * [request] - The metadata request object.
897 *
898 * Request parameters:
899 *
900 * [groupKey] - Email or immutable Id of the group
901 *
902 * Completes with a [Alias].
903 *
904 * Completes with a [common.ApiRequestError] if the API endpoint returned an
905 * error.
906 *
907 * If the used [http.Client] completes with an error when making a REST call,
908 * this method will complete with the same error.
909 */
910 async.Future<Alias> insert(Alias request, core.String groupKey) {
911 var _url = null;
912 var _queryParams = new core.Map();
913 var _uploadMedia = null;
914 var _uploadOptions = null;
915 var _downloadOptions = common.DownloadOptions.Metadata;
916 var _body = null;
917
918 if (request != null) {
919 _body = convert.JSON.encode((request).toJson());
920 }
921 if (groupKey == null) {
922 throw new core.ArgumentError("Parameter groupKey is required.");
923 }
924
925
926 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/al iases';
927
928 var _response = _requester.request(_url,
929 "POST",
930 body: _body,
931 queryParams: _queryParams,
932 uploadOptions: _uploadOptions,
933 uploadMedia: _uploadMedia,
934 downloadOptions: _downloadOptions);
935 return _response.then((data) => new Alias.fromJson(data));
936 }
937
938 /**
939 * List all aliases for a group
940 *
941 * Request parameters:
942 *
943 * [groupKey] - Email or immutable Id of the group
944 *
945 * Completes with a [Aliases].
946 *
947 * Completes with a [common.ApiRequestError] if the API endpoint returned an
948 * error.
949 *
950 * If the used [http.Client] completes with an error when making a REST call,
951 * this method will complete with the same error.
952 */
953 async.Future<Aliases> list(core.String groupKey) {
954 var _url = null;
955 var _queryParams = new core.Map();
956 var _uploadMedia = null;
957 var _uploadOptions = null;
958 var _downloadOptions = common.DownloadOptions.Metadata;
959 var _body = null;
960
961 if (groupKey == null) {
962 throw new core.ArgumentError("Parameter groupKey is required.");
963 }
964
965
966 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/al iases';
967
968 var _response = _requester.request(_url,
969 "GET",
970 body: _body,
971 queryParams: _queryParams,
972 uploadOptions: _uploadOptions,
973 uploadMedia: _uploadMedia,
974 downloadOptions: _downloadOptions);
975 return _response.then((data) => new Aliases.fromJson(data));
976 }
977
978 }
979
980
981 /** Not documented yet. */
982 class MembersResourceApi {
983 final common_internal.ApiRequester _requester;
984
985 MembersResourceApi(common_internal.ApiRequester client) :
986 _requester = client;
987
988 /**
989 * Remove membership.
990 *
991 * Request parameters:
992 *
993 * [groupKey] - Email or immutable Id of the group
994 *
995 * [memberKey] - Email or immutable Id of the member
996 *
997 * Completes with a [common.ApiRequestError] if the API endpoint returned an
998 * error.
999 *
1000 * If the used [http.Client] completes with an error when making a REST call,
1001 * this method will complete with the same error.
1002 */
1003 async.Future delete(core.String groupKey, core.String memberKey) {
1004 var _url = null;
1005 var _queryParams = new core.Map();
1006 var _uploadMedia = null;
1007 var _uploadOptions = null;
1008 var _downloadOptions = common.DownloadOptions.Metadata;
1009 var _body = null;
1010
1011 if (groupKey == null) {
1012 throw new core.ArgumentError("Parameter groupKey is required.");
1013 }
1014 if (memberKey == null) {
1015 throw new core.ArgumentError("Parameter memberKey is required.");
1016 }
1017
1018 _downloadOptions = null;
1019
1020 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/me mbers/' + common_internal.Escaper.ecapeVariable('$memberKey');
1021
1022 var _response = _requester.request(_url,
1023 "DELETE",
1024 body: _body,
1025 queryParams: _queryParams,
1026 uploadOptions: _uploadOptions,
1027 uploadMedia: _uploadMedia,
1028 downloadOptions: _downloadOptions);
1029 return _response.then((data) => null);
1030 }
1031
1032 /**
1033 * Retrieve Group Member
1034 *
1035 * Request parameters:
1036 *
1037 * [groupKey] - Email or immutable Id of the group
1038 *
1039 * [memberKey] - Email or immutable Id of the member
1040 *
1041 * Completes with a [Member].
1042 *
1043 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1044 * error.
1045 *
1046 * If the used [http.Client] completes with an error when making a REST call,
1047 * this method will complete with the same error.
1048 */
1049 async.Future<Member> get(core.String groupKey, core.String memberKey) {
1050 var _url = null;
1051 var _queryParams = new core.Map();
1052 var _uploadMedia = null;
1053 var _uploadOptions = null;
1054 var _downloadOptions = common.DownloadOptions.Metadata;
1055 var _body = null;
1056
1057 if (groupKey == null) {
1058 throw new core.ArgumentError("Parameter groupKey is required.");
1059 }
1060 if (memberKey == null) {
1061 throw new core.ArgumentError("Parameter memberKey is required.");
1062 }
1063
1064
1065 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/me mbers/' + common_internal.Escaper.ecapeVariable('$memberKey');
1066
1067 var _response = _requester.request(_url,
1068 "GET",
1069 body: _body,
1070 queryParams: _queryParams,
1071 uploadOptions: _uploadOptions,
1072 uploadMedia: _uploadMedia,
1073 downloadOptions: _downloadOptions);
1074 return _response.then((data) => new Member.fromJson(data));
1075 }
1076
1077 /**
1078 * Add user to the specified group.
1079 *
1080 * [request] - The metadata request object.
1081 *
1082 * Request parameters:
1083 *
1084 * [groupKey] - Email or immutable Id of the group
1085 *
1086 * Completes with a [Member].
1087 *
1088 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1089 * error.
1090 *
1091 * If the used [http.Client] completes with an error when making a REST call,
1092 * this method will complete with the same error.
1093 */
1094 async.Future<Member> insert(Member request, core.String groupKey) {
1095 var _url = null;
1096 var _queryParams = new core.Map();
1097 var _uploadMedia = null;
1098 var _uploadOptions = null;
1099 var _downloadOptions = common.DownloadOptions.Metadata;
1100 var _body = null;
1101
1102 if (request != null) {
1103 _body = convert.JSON.encode((request).toJson());
1104 }
1105 if (groupKey == null) {
1106 throw new core.ArgumentError("Parameter groupKey is required.");
1107 }
1108
1109
1110 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/me mbers';
1111
1112 var _response = _requester.request(_url,
1113 "POST",
1114 body: _body,
1115 queryParams: _queryParams,
1116 uploadOptions: _uploadOptions,
1117 uploadMedia: _uploadMedia,
1118 downloadOptions: _downloadOptions);
1119 return _response.then((data) => new Member.fromJson(data));
1120 }
1121
1122 /**
1123 * Retrieve all members in a group (paginated)
1124 *
1125 * Request parameters:
1126 *
1127 * [groupKey] - Email or immutable Id of the group
1128 *
1129 * [maxResults] - Maximum number of results to return. Default is 200
1130 *
1131 * [pageToken] - Token to specify next page in the list
1132 *
1133 * [roles] - Comma separated role values to filter list results on.
1134 *
1135 * Completes with a [Members].
1136 *
1137 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1138 * error.
1139 *
1140 * If the used [http.Client] completes with an error when making a REST call,
1141 * this method will complete with the same error.
1142 */
1143 async.Future<Members> list(core.String groupKey, {core.int maxResults, core.St ring pageToken, core.String roles}) {
1144 var _url = null;
1145 var _queryParams = new core.Map();
1146 var _uploadMedia = null;
1147 var _uploadOptions = null;
1148 var _downloadOptions = common.DownloadOptions.Metadata;
1149 var _body = null;
1150
1151 if (groupKey == null) {
1152 throw new core.ArgumentError("Parameter groupKey is required.");
1153 }
1154 if (maxResults != null) {
1155 _queryParams["maxResults"] = ["${maxResults}"];
1156 }
1157 if (pageToken != null) {
1158 _queryParams["pageToken"] = [pageToken];
1159 }
1160 if (roles != null) {
1161 _queryParams["roles"] = [roles];
1162 }
1163
1164
1165 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/me mbers';
1166
1167 var _response = _requester.request(_url,
1168 "GET",
1169 body: _body,
1170 queryParams: _queryParams,
1171 uploadOptions: _uploadOptions,
1172 uploadMedia: _uploadMedia,
1173 downloadOptions: _downloadOptions);
1174 return _response.then((data) => new Members.fromJson(data));
1175 }
1176
1177 /**
1178 * Update membership of a user in the specified group. This method supports
1179 * patch semantics.
1180 *
1181 * [request] - The metadata request object.
1182 *
1183 * Request parameters:
1184 *
1185 * [groupKey] - Email or immutable Id of the group. If Id, it should match
1186 * with id of group object
1187 *
1188 * [memberKey] - Email or immutable Id of the user. If Id, it should match
1189 * with id of member object
1190 *
1191 * Completes with a [Member].
1192 *
1193 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1194 * error.
1195 *
1196 * If the used [http.Client] completes with an error when making a REST call,
1197 * this method will complete with the same error.
1198 */
1199 async.Future<Member> patch(Member request, core.String groupKey, core.String m emberKey) {
1200 var _url = null;
1201 var _queryParams = new core.Map();
1202 var _uploadMedia = null;
1203 var _uploadOptions = null;
1204 var _downloadOptions = common.DownloadOptions.Metadata;
1205 var _body = null;
1206
1207 if (request != null) {
1208 _body = convert.JSON.encode((request).toJson());
1209 }
1210 if (groupKey == null) {
1211 throw new core.ArgumentError("Parameter groupKey is required.");
1212 }
1213 if (memberKey == null) {
1214 throw new core.ArgumentError("Parameter memberKey is required.");
1215 }
1216
1217
1218 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/me mbers/' + common_internal.Escaper.ecapeVariable('$memberKey');
1219
1220 var _response = _requester.request(_url,
1221 "PATCH",
1222 body: _body,
1223 queryParams: _queryParams,
1224 uploadOptions: _uploadOptions,
1225 uploadMedia: _uploadMedia,
1226 downloadOptions: _downloadOptions);
1227 return _response.then((data) => new Member.fromJson(data));
1228 }
1229
1230 /**
1231 * Update membership of a user in the specified group.
1232 *
1233 * [request] - The metadata request object.
1234 *
1235 * Request parameters:
1236 *
1237 * [groupKey] - Email or immutable Id of the group. If Id, it should match
1238 * with id of group object
1239 *
1240 * [memberKey] - Email or immutable Id of the user. If Id, it should match
1241 * with id of member object
1242 *
1243 * Completes with a [Member].
1244 *
1245 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1246 * error.
1247 *
1248 * If the used [http.Client] completes with an error when making a REST call,
1249 * this method will complete with the same error.
1250 */
1251 async.Future<Member> update(Member request, core.String groupKey, core.String memberKey) {
1252 var _url = null;
1253 var _queryParams = new core.Map();
1254 var _uploadMedia = null;
1255 var _uploadOptions = null;
1256 var _downloadOptions = common.DownloadOptions.Metadata;
1257 var _body = null;
1258
1259 if (request != null) {
1260 _body = convert.JSON.encode((request).toJson());
1261 }
1262 if (groupKey == null) {
1263 throw new core.ArgumentError("Parameter groupKey is required.");
1264 }
1265 if (memberKey == null) {
1266 throw new core.ArgumentError("Parameter memberKey is required.");
1267 }
1268
1269
1270 _url = 'groups/' + common_internal.Escaper.ecapeVariable('$groupKey') + '/me mbers/' + common_internal.Escaper.ecapeVariable('$memberKey');
1271
1272 var _response = _requester.request(_url,
1273 "PUT",
1274 body: _body,
1275 queryParams: _queryParams,
1276 uploadOptions: _uploadOptions,
1277 uploadMedia: _uploadMedia,
1278 downloadOptions: _downloadOptions);
1279 return _response.then((data) => new Member.fromJson(data));
1280 }
1281
1282 }
1283
1284
1285 /** Not documented yet. */
1286 class MobiledevicesResourceApi {
1287 final common_internal.ApiRequester _requester;
1288
1289 MobiledevicesResourceApi(common_internal.ApiRequester client) :
1290 _requester = client;
1291
1292 /**
1293 * Take action on Mobile Device
1294 *
1295 * [request] - The metadata request object.
1296 *
1297 * Request parameters:
1298 *
1299 * [customerId] - Immutable id of the Google Apps account
1300 *
1301 * [resourceId] - Immutable id of Mobile Device
1302 *
1303 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1304 * error.
1305 *
1306 * If the used [http.Client] completes with an error when making a REST call,
1307 * this method will complete with the same error.
1308 */
1309 async.Future action(MobileDeviceAction request, core.String customerId, core.S tring resourceId) {
1310 var _url = null;
1311 var _queryParams = new core.Map();
1312 var _uploadMedia = null;
1313 var _uploadOptions = null;
1314 var _downloadOptions = common.DownloadOptions.Metadata;
1315 var _body = null;
1316
1317 if (request != null) {
1318 _body = convert.JSON.encode((request).toJson());
1319 }
1320 if (customerId == null) {
1321 throw new core.ArgumentError("Parameter customerId is required.");
1322 }
1323 if (resourceId == null) {
1324 throw new core.ArgumentError("Parameter resourceId is required.");
1325 }
1326
1327 _downloadOptions = null;
1328
1329 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/mobile/' + common_internal.Escaper.ecapeVariable('$resourceId') + '/ac tion';
1330
1331 var _response = _requester.request(_url,
1332 "POST",
1333 body: _body,
1334 queryParams: _queryParams,
1335 uploadOptions: _uploadOptions,
1336 uploadMedia: _uploadMedia,
1337 downloadOptions: _downloadOptions);
1338 return _response.then((data) => null);
1339 }
1340
1341 /**
1342 * Delete Mobile Device
1343 *
1344 * Request parameters:
1345 *
1346 * [customerId] - Immutable id of the Google Apps account
1347 *
1348 * [resourceId] - Immutable id of Mobile Device
1349 *
1350 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1351 * error.
1352 *
1353 * If the used [http.Client] completes with an error when making a REST call,
1354 * this method will complete with the same error.
1355 */
1356 async.Future delete(core.String customerId, core.String resourceId) {
1357 var _url = null;
1358 var _queryParams = new core.Map();
1359 var _uploadMedia = null;
1360 var _uploadOptions = null;
1361 var _downloadOptions = common.DownloadOptions.Metadata;
1362 var _body = null;
1363
1364 if (customerId == null) {
1365 throw new core.ArgumentError("Parameter customerId is required.");
1366 }
1367 if (resourceId == null) {
1368 throw new core.ArgumentError("Parameter resourceId is required.");
1369 }
1370
1371 _downloadOptions = null;
1372
1373 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/mobile/' + common_internal.Escaper.ecapeVariable('$resourceId');
1374
1375 var _response = _requester.request(_url,
1376 "DELETE",
1377 body: _body,
1378 queryParams: _queryParams,
1379 uploadOptions: _uploadOptions,
1380 uploadMedia: _uploadMedia,
1381 downloadOptions: _downloadOptions);
1382 return _response.then((data) => null);
1383 }
1384
1385 /**
1386 * Retrieve Mobile Device
1387 *
1388 * Request parameters:
1389 *
1390 * [customerId] - Immutable id of the Google Apps account
1391 *
1392 * [resourceId] - Immutable id of Mobile Device
1393 *
1394 * [projection] - Restrict information returned to a set of selected fields.
1395 * Possible string values are:
1396 * - "BASIC" : Includes only the basic metadata fields (e.g., deviceId, model,
1397 * status, type, and status)
1398 * - "FULL" : Includes all metadata fields
1399 *
1400 * Completes with a [MobileDevice].
1401 *
1402 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1403 * error.
1404 *
1405 * If the used [http.Client] completes with an error when making a REST call,
1406 * this method will complete with the same error.
1407 */
1408 async.Future<MobileDevice> get(core.String customerId, core.String resourceId, {core.String projection}) {
1409 var _url = null;
1410 var _queryParams = new core.Map();
1411 var _uploadMedia = null;
1412 var _uploadOptions = null;
1413 var _downloadOptions = common.DownloadOptions.Metadata;
1414 var _body = null;
1415
1416 if (customerId == null) {
1417 throw new core.ArgumentError("Parameter customerId is required.");
1418 }
1419 if (resourceId == null) {
1420 throw new core.ArgumentError("Parameter resourceId is required.");
1421 }
1422 if (projection != null) {
1423 _queryParams["projection"] = [projection];
1424 }
1425
1426
1427 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/mobile/' + common_internal.Escaper.ecapeVariable('$resourceId');
1428
1429 var _response = _requester.request(_url,
1430 "GET",
1431 body: _body,
1432 queryParams: _queryParams,
1433 uploadOptions: _uploadOptions,
1434 uploadMedia: _uploadMedia,
1435 downloadOptions: _downloadOptions);
1436 return _response.then((data) => new MobileDevice.fromJson(data));
1437 }
1438
1439 /**
1440 * Retrieve all Mobile Devices of a customer (paginated)
1441 *
1442 * Request parameters:
1443 *
1444 * [customerId] - Immutable id of the Google Apps account
1445 *
1446 * [maxResults] - Maximum number of results to return. Default is 100
1447 *
1448 * [orderBy] - Column to use for sorting results
1449 * Possible string values are:
1450 * - "deviceId" : Mobile Device serial number.
1451 * - "email" : Owner user email.
1452 * - "lastSync" : Last policy settings sync date time of the device.
1453 * - "model" : Mobile Device model.
1454 * - "name" : Owner user name.
1455 * - "os" : Mobile operating system.
1456 * - "status" : Status of the device.
1457 * - "type" : Type of the device.
1458 *
1459 * [pageToken] - Token to specify next page in the list
1460 *
1461 * [projection] - Restrict information returned to a set of selected fields.
1462 * Possible string values are:
1463 * - "BASIC" : Includes only the basic metadata fields (e.g., deviceId, model,
1464 * status, type, and status)
1465 * - "FULL" : Includes all metadata fields
1466 *
1467 * [query] - Search string in the format given at
1468 * http://support.google.com/a/bin/answer.py?hl=en&answer=1408863#search
1469 *
1470 * [sortOrder] - Whether to return results in ascending or descending order.
1471 * Only of use when orderBy is also used
1472 * Possible string values are:
1473 * - "ASCENDING" : Ascending order.
1474 * - "DESCENDING" : Descending order.
1475 *
1476 * Completes with a [MobileDevices].
1477 *
1478 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1479 * error.
1480 *
1481 * If the used [http.Client] completes with an error when making a REST call,
1482 * this method will complete with the same error.
1483 */
1484 async.Future<MobileDevices> list(core.String customerId, {core.int maxResults, core.String orderBy, core.String pageToken, core.String projection, core.String query, core.String sortOrder}) {
1485 var _url = null;
1486 var _queryParams = new core.Map();
1487 var _uploadMedia = null;
1488 var _uploadOptions = null;
1489 var _downloadOptions = common.DownloadOptions.Metadata;
1490 var _body = null;
1491
1492 if (customerId == null) {
1493 throw new core.ArgumentError("Parameter customerId is required.");
1494 }
1495 if (maxResults != null) {
1496 _queryParams["maxResults"] = ["${maxResults}"];
1497 }
1498 if (orderBy != null) {
1499 _queryParams["orderBy"] = [orderBy];
1500 }
1501 if (pageToken != null) {
1502 _queryParams["pageToken"] = [pageToken];
1503 }
1504 if (projection != null) {
1505 _queryParams["projection"] = [projection];
1506 }
1507 if (query != null) {
1508 _queryParams["query"] = [query];
1509 }
1510 if (sortOrder != null) {
1511 _queryParams["sortOrder"] = [sortOrder];
1512 }
1513
1514
1515 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/devices/mobile';
1516
1517 var _response = _requester.request(_url,
1518 "GET",
1519 body: _body,
1520 queryParams: _queryParams,
1521 uploadOptions: _uploadOptions,
1522 uploadMedia: _uploadMedia,
1523 downloadOptions: _downloadOptions);
1524 return _response.then((data) => new MobileDevices.fromJson(data));
1525 }
1526
1527 }
1528
1529
1530 /** Not documented yet. */
1531 class NotificationsResourceApi {
1532 final common_internal.ApiRequester _requester;
1533
1534 NotificationsResourceApi(common_internal.ApiRequester client) :
1535 _requester = client;
1536
1537 /**
1538 * Deletes a notification
1539 *
1540 * Request parameters:
1541 *
1542 * [customer] - The unique ID for the customer's Google account. The
1543 * customerId is also returned as part of the Users resource.
1544 *
1545 * [notificationId] - The unique ID of the notification.
1546 *
1547 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1548 * error.
1549 *
1550 * If the used [http.Client] completes with an error when making a REST call,
1551 * this method will complete with the same error.
1552 */
1553 async.Future delete(core.String customer, core.String notificationId) {
1554 var _url = null;
1555 var _queryParams = new core.Map();
1556 var _uploadMedia = null;
1557 var _uploadOptions = null;
1558 var _downloadOptions = common.DownloadOptions.Metadata;
1559 var _body = null;
1560
1561 if (customer == null) {
1562 throw new core.ArgumentError("Parameter customer is required.");
1563 }
1564 if (notificationId == null) {
1565 throw new core.ArgumentError("Parameter notificationId is required.");
1566 }
1567
1568 _downloadOptions = null;
1569
1570 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customer') + '/ notifications/' + common_internal.Escaper.ecapeVariable('$notificationId');
1571
1572 var _response = _requester.request(_url,
1573 "DELETE",
1574 body: _body,
1575 queryParams: _queryParams,
1576 uploadOptions: _uploadOptions,
1577 uploadMedia: _uploadMedia,
1578 downloadOptions: _downloadOptions);
1579 return _response.then((data) => null);
1580 }
1581
1582 /**
1583 * Retrieves a notification.
1584 *
1585 * Request parameters:
1586 *
1587 * [customer] - The unique ID for the customer's Google account. The
1588 * customerId is also returned as part of the Users resource.
1589 *
1590 * [notificationId] - The unique ID of the notification.
1591 *
1592 * Completes with a [Notification].
1593 *
1594 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1595 * error.
1596 *
1597 * If the used [http.Client] completes with an error when making a REST call,
1598 * this method will complete with the same error.
1599 */
1600 async.Future<Notification> get(core.String customer, core.String notificationI d) {
1601 var _url = null;
1602 var _queryParams = new core.Map();
1603 var _uploadMedia = null;
1604 var _uploadOptions = null;
1605 var _downloadOptions = common.DownloadOptions.Metadata;
1606 var _body = null;
1607
1608 if (customer == null) {
1609 throw new core.ArgumentError("Parameter customer is required.");
1610 }
1611 if (notificationId == null) {
1612 throw new core.ArgumentError("Parameter notificationId is required.");
1613 }
1614
1615
1616 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customer') + '/ notifications/' + common_internal.Escaper.ecapeVariable('$notificationId');
1617
1618 var _response = _requester.request(_url,
1619 "GET",
1620 body: _body,
1621 queryParams: _queryParams,
1622 uploadOptions: _uploadOptions,
1623 uploadMedia: _uploadMedia,
1624 downloadOptions: _downloadOptions);
1625 return _response.then((data) => new Notification.fromJson(data));
1626 }
1627
1628 /**
1629 * Retrieves a list of notifications.
1630 *
1631 * Request parameters:
1632 *
1633 * [customer] - The unique ID for the customer's Google account.
1634 *
1635 * [language] - The ISO 639-1 code of the language notifications are returned
1636 * in. The default is English (en).
1637 *
1638 * [maxResults] - Maximum number of notifications to return per page. The
1639 * default is 100.
1640 *
1641 * [pageToken] - The token to specify the page of results to retrieve.
1642 *
1643 * Completes with a [Notifications].
1644 *
1645 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1646 * error.
1647 *
1648 * If the used [http.Client] completes with an error when making a REST call,
1649 * this method will complete with the same error.
1650 */
1651 async.Future<Notifications> list(core.String customer, {core.String language, core.int maxResults, core.String pageToken}) {
1652 var _url = null;
1653 var _queryParams = new core.Map();
1654 var _uploadMedia = null;
1655 var _uploadOptions = null;
1656 var _downloadOptions = common.DownloadOptions.Metadata;
1657 var _body = null;
1658
1659 if (customer == null) {
1660 throw new core.ArgumentError("Parameter customer is required.");
1661 }
1662 if (language != null) {
1663 _queryParams["language"] = [language];
1664 }
1665 if (maxResults != null) {
1666 _queryParams["maxResults"] = ["${maxResults}"];
1667 }
1668 if (pageToken != null) {
1669 _queryParams["pageToken"] = [pageToken];
1670 }
1671
1672
1673 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customer') + '/ notifications';
1674
1675 var _response = _requester.request(_url,
1676 "GET",
1677 body: _body,
1678 queryParams: _queryParams,
1679 uploadOptions: _uploadOptions,
1680 uploadMedia: _uploadMedia,
1681 downloadOptions: _downloadOptions);
1682 return _response.then((data) => new Notifications.fromJson(data));
1683 }
1684
1685 /**
1686 * Updates a notification. This method supports patch semantics.
1687 *
1688 * [request] - The metadata request object.
1689 *
1690 * Request parameters:
1691 *
1692 * [customer] - The unique ID for the customer's Google account.
1693 *
1694 * [notificationId] - The unique ID of the notification.
1695 *
1696 * Completes with a [Notification].
1697 *
1698 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1699 * error.
1700 *
1701 * If the used [http.Client] completes with an error when making a REST call,
1702 * this method will complete with the same error.
1703 */
1704 async.Future<Notification> patch(Notification request, core.String customer, c ore.String notificationId) {
1705 var _url = null;
1706 var _queryParams = new core.Map();
1707 var _uploadMedia = null;
1708 var _uploadOptions = null;
1709 var _downloadOptions = common.DownloadOptions.Metadata;
1710 var _body = null;
1711
1712 if (request != null) {
1713 _body = convert.JSON.encode((request).toJson());
1714 }
1715 if (customer == null) {
1716 throw new core.ArgumentError("Parameter customer is required.");
1717 }
1718 if (notificationId == null) {
1719 throw new core.ArgumentError("Parameter notificationId is required.");
1720 }
1721
1722
1723 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customer') + '/ notifications/' + common_internal.Escaper.ecapeVariable('$notificationId');
1724
1725 var _response = _requester.request(_url,
1726 "PATCH",
1727 body: _body,
1728 queryParams: _queryParams,
1729 uploadOptions: _uploadOptions,
1730 uploadMedia: _uploadMedia,
1731 downloadOptions: _downloadOptions);
1732 return _response.then((data) => new Notification.fromJson(data));
1733 }
1734
1735 /**
1736 * Updates a notification.
1737 *
1738 * [request] - The metadata request object.
1739 *
1740 * Request parameters:
1741 *
1742 * [customer] - The unique ID for the customer's Google account.
1743 *
1744 * [notificationId] - The unique ID of the notification.
1745 *
1746 * Completes with a [Notification].
1747 *
1748 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1749 * error.
1750 *
1751 * If the used [http.Client] completes with an error when making a REST call,
1752 * this method will complete with the same error.
1753 */
1754 async.Future<Notification> update(Notification request, core.String customer, core.String notificationId) {
1755 var _url = null;
1756 var _queryParams = new core.Map();
1757 var _uploadMedia = null;
1758 var _uploadOptions = null;
1759 var _downloadOptions = common.DownloadOptions.Metadata;
1760 var _body = null;
1761
1762 if (request != null) {
1763 _body = convert.JSON.encode((request).toJson());
1764 }
1765 if (customer == null) {
1766 throw new core.ArgumentError("Parameter customer is required.");
1767 }
1768 if (notificationId == null) {
1769 throw new core.ArgumentError("Parameter notificationId is required.");
1770 }
1771
1772
1773 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customer') + '/ notifications/' + common_internal.Escaper.ecapeVariable('$notificationId');
1774
1775 var _response = _requester.request(_url,
1776 "PUT",
1777 body: _body,
1778 queryParams: _queryParams,
1779 uploadOptions: _uploadOptions,
1780 uploadMedia: _uploadMedia,
1781 downloadOptions: _downloadOptions);
1782 return _response.then((data) => new Notification.fromJson(data));
1783 }
1784
1785 }
1786
1787
1788 /** Not documented yet. */
1789 class OrgunitsResourceApi {
1790 final common_internal.ApiRequester _requester;
1791
1792 OrgunitsResourceApi(common_internal.ApiRequester client) :
1793 _requester = client;
1794
1795 /**
1796 * Remove Organization Unit
1797 *
1798 * Request parameters:
1799 *
1800 * [customerId] - Immutable id of the Google Apps account
1801 *
1802 * [orgUnitPath] - Full path of the organization unit
1803 *
1804 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1805 * error.
1806 *
1807 * If the used [http.Client] completes with an error when making a REST call,
1808 * this method will complete with the same error.
1809 */
1810 async.Future delete(core.String customerId, core.List<core.String> orgUnitPath ) {
1811 var _url = null;
1812 var _queryParams = new core.Map();
1813 var _uploadMedia = null;
1814 var _uploadOptions = null;
1815 var _downloadOptions = common.DownloadOptions.Metadata;
1816 var _body = null;
1817
1818 if (customerId == null) {
1819 throw new core.ArgumentError("Parameter customerId is required.");
1820 }
1821 if (orgUnitPath == null || orgUnitPath.isEmpty) {
1822 throw new core.ArgumentError("Parameter orgUnitPath is required.");
1823 }
1824
1825 _downloadOptions = null;
1826
1827 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/orgunits' + '/' + (orgUnitPath).map((item) => common_internal.Escaper.ecapePat hComponent(item)).join('/');
1828
1829 var _response = _requester.request(_url,
1830 "DELETE",
1831 body: _body,
1832 queryParams: _queryParams,
1833 uploadOptions: _uploadOptions,
1834 uploadMedia: _uploadMedia,
1835 downloadOptions: _downloadOptions);
1836 return _response.then((data) => null);
1837 }
1838
1839 /**
1840 * Retrieve Organization Unit
1841 *
1842 * Request parameters:
1843 *
1844 * [customerId] - Immutable id of the Google Apps account
1845 *
1846 * [orgUnitPath] - Full path of the organization unit
1847 *
1848 * Completes with a [OrgUnit].
1849 *
1850 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1851 * error.
1852 *
1853 * If the used [http.Client] completes with an error when making a REST call,
1854 * this method will complete with the same error.
1855 */
1856 async.Future<OrgUnit> get(core.String customerId, core.List<core.String> orgUn itPath) {
1857 var _url = null;
1858 var _queryParams = new core.Map();
1859 var _uploadMedia = null;
1860 var _uploadOptions = null;
1861 var _downloadOptions = common.DownloadOptions.Metadata;
1862 var _body = null;
1863
1864 if (customerId == null) {
1865 throw new core.ArgumentError("Parameter customerId is required.");
1866 }
1867 if (orgUnitPath == null || orgUnitPath.isEmpty) {
1868 throw new core.ArgumentError("Parameter orgUnitPath is required.");
1869 }
1870
1871
1872 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/orgunits' + '/' + (orgUnitPath).map((item) => common_internal.Escaper.ecapePat hComponent(item)).join('/');
1873
1874 var _response = _requester.request(_url,
1875 "GET",
1876 body: _body,
1877 queryParams: _queryParams,
1878 uploadOptions: _uploadOptions,
1879 uploadMedia: _uploadMedia,
1880 downloadOptions: _downloadOptions);
1881 return _response.then((data) => new OrgUnit.fromJson(data));
1882 }
1883
1884 /**
1885 * Add Organization Unit
1886 *
1887 * [request] - The metadata request object.
1888 *
1889 * Request parameters:
1890 *
1891 * [customerId] - Immutable id of the Google Apps account
1892 *
1893 * Completes with a [OrgUnit].
1894 *
1895 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1896 * error.
1897 *
1898 * If the used [http.Client] completes with an error when making a REST call,
1899 * this method will complete with the same error.
1900 */
1901 async.Future<OrgUnit> insert(OrgUnit request, core.String customerId) {
1902 var _url = null;
1903 var _queryParams = new core.Map();
1904 var _uploadMedia = null;
1905 var _uploadOptions = null;
1906 var _downloadOptions = common.DownloadOptions.Metadata;
1907 var _body = null;
1908
1909 if (request != null) {
1910 _body = convert.JSON.encode((request).toJson());
1911 }
1912 if (customerId == null) {
1913 throw new core.ArgumentError("Parameter customerId is required.");
1914 }
1915
1916
1917 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/orgunits';
1918
1919 var _response = _requester.request(_url,
1920 "POST",
1921 body: _body,
1922 queryParams: _queryParams,
1923 uploadOptions: _uploadOptions,
1924 uploadMedia: _uploadMedia,
1925 downloadOptions: _downloadOptions);
1926 return _response.then((data) => new OrgUnit.fromJson(data));
1927 }
1928
1929 /**
1930 * Retrieve all Organization Units
1931 *
1932 * Request parameters:
1933 *
1934 * [customerId] - Immutable id of the Google Apps account
1935 *
1936 * [orgUnitPath] - the URL-encoded organization unit
1937 *
1938 * [type] - Whether to return all sub-organizations or just immediate children
1939 * Possible string values are:
1940 * - "all" : All sub-organization units.
1941 * - "children" : Immediate children only (default).
1942 *
1943 * Completes with a [OrgUnits].
1944 *
1945 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1946 * error.
1947 *
1948 * If the used [http.Client] completes with an error when making a REST call,
1949 * this method will complete with the same error.
1950 */
1951 async.Future<OrgUnits> list(core.String customerId, {core.String orgUnitPath, core.String type}) {
1952 var _url = null;
1953 var _queryParams = new core.Map();
1954 var _uploadMedia = null;
1955 var _uploadOptions = null;
1956 var _downloadOptions = common.DownloadOptions.Metadata;
1957 var _body = null;
1958
1959 if (customerId == null) {
1960 throw new core.ArgumentError("Parameter customerId is required.");
1961 }
1962 if (orgUnitPath != null) {
1963 _queryParams["orgUnitPath"] = [orgUnitPath];
1964 }
1965 if (type != null) {
1966 _queryParams["type"] = [type];
1967 }
1968
1969
1970 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/orgunits';
1971
1972 var _response = _requester.request(_url,
1973 "GET",
1974 body: _body,
1975 queryParams: _queryParams,
1976 uploadOptions: _uploadOptions,
1977 uploadMedia: _uploadMedia,
1978 downloadOptions: _downloadOptions);
1979 return _response.then((data) => new OrgUnits.fromJson(data));
1980 }
1981
1982 /**
1983 * Update Organization Unit. This method supports patch semantics.
1984 *
1985 * [request] - The metadata request object.
1986 *
1987 * Request parameters:
1988 *
1989 * [customerId] - Immutable id of the Google Apps account
1990 *
1991 * [orgUnitPath] - Full path of the organization unit
1992 *
1993 * Completes with a [OrgUnit].
1994 *
1995 * Completes with a [common.ApiRequestError] if the API endpoint returned an
1996 * error.
1997 *
1998 * If the used [http.Client] completes with an error when making a REST call,
1999 * this method will complete with the same error.
2000 */
2001 async.Future<OrgUnit> patch(OrgUnit request, core.String customerId, core.List <core.String> orgUnitPath) {
2002 var _url = null;
2003 var _queryParams = new core.Map();
2004 var _uploadMedia = null;
2005 var _uploadOptions = null;
2006 var _downloadOptions = common.DownloadOptions.Metadata;
2007 var _body = null;
2008
2009 if (request != null) {
2010 _body = convert.JSON.encode((request).toJson());
2011 }
2012 if (customerId == null) {
2013 throw new core.ArgumentError("Parameter customerId is required.");
2014 }
2015 if (orgUnitPath == null || orgUnitPath.isEmpty) {
2016 throw new core.ArgumentError("Parameter orgUnitPath is required.");
2017 }
2018
2019
2020 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/orgunits' + '/' + (orgUnitPath).map((item) => common_internal.Escaper.ecapePat hComponent(item)).join('/');
2021
2022 var _response = _requester.request(_url,
2023 "PATCH",
2024 body: _body,
2025 queryParams: _queryParams,
2026 uploadOptions: _uploadOptions,
2027 uploadMedia: _uploadMedia,
2028 downloadOptions: _downloadOptions);
2029 return _response.then((data) => new OrgUnit.fromJson(data));
2030 }
2031
2032 /**
2033 * Update Organization Unit
2034 *
2035 * [request] - The metadata request object.
2036 *
2037 * Request parameters:
2038 *
2039 * [customerId] - Immutable id of the Google Apps account
2040 *
2041 * [orgUnitPath] - Full path of the organization unit
2042 *
2043 * Completes with a [OrgUnit].
2044 *
2045 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2046 * error.
2047 *
2048 * If the used [http.Client] completes with an error when making a REST call,
2049 * this method will complete with the same error.
2050 */
2051 async.Future<OrgUnit> update(OrgUnit request, core.String customerId, core.Lis t<core.String> orgUnitPath) {
2052 var _url = null;
2053 var _queryParams = new core.Map();
2054 var _uploadMedia = null;
2055 var _uploadOptions = null;
2056 var _downloadOptions = common.DownloadOptions.Metadata;
2057 var _body = null;
2058
2059 if (request != null) {
2060 _body = convert.JSON.encode((request).toJson());
2061 }
2062 if (customerId == null) {
2063 throw new core.ArgumentError("Parameter customerId is required.");
2064 }
2065 if (orgUnitPath == null || orgUnitPath.isEmpty) {
2066 throw new core.ArgumentError("Parameter orgUnitPath is required.");
2067 }
2068
2069
2070 _url = 'customer/' + common_internal.Escaper.ecapeVariable('$customerId') + '/orgunits' + '/' + (orgUnitPath).map((item) => common_internal.Escaper.ecapePat hComponent(item)).join('/');
2071
2072 var _response = _requester.request(_url,
2073 "PUT",
2074 body: _body,
2075 queryParams: _queryParams,
2076 uploadOptions: _uploadOptions,
2077 uploadMedia: _uploadMedia,
2078 downloadOptions: _downloadOptions);
2079 return _response.then((data) => new OrgUnit.fromJson(data));
2080 }
2081
2082 }
2083
2084
2085 /** Not documented yet. */
2086 class TokensResourceApi {
2087 final common_internal.ApiRequester _requester;
2088
2089 TokensResourceApi(common_internal.ApiRequester client) :
2090 _requester = client;
2091
2092 /**
2093 * Delete all access tokens issued by a user for an application.
2094 *
2095 * Request parameters:
2096 *
2097 * [userKey] - Identifies the user in the API request. The value can be the
2098 * user's primary email address, alias email address, or unique user ID.
2099 *
2100 * [clientId] - The Client ID of the application the token is issued to.
2101 *
2102 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2103 * error.
2104 *
2105 * If the used [http.Client] completes with an error when making a REST call,
2106 * this method will complete with the same error.
2107 */
2108 async.Future delete(core.String userKey, core.String clientId) {
2109 var _url = null;
2110 var _queryParams = new core.Map();
2111 var _uploadMedia = null;
2112 var _uploadOptions = null;
2113 var _downloadOptions = common.DownloadOptions.Metadata;
2114 var _body = null;
2115
2116 if (userKey == null) {
2117 throw new core.ArgumentError("Parameter userKey is required.");
2118 }
2119 if (clientId == null) {
2120 throw new core.ArgumentError("Parameter clientId is required.");
2121 }
2122
2123 _downloadOptions = null;
2124
2125 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/toke ns/' + common_internal.Escaper.ecapeVariable('$clientId');
2126
2127 var _response = _requester.request(_url,
2128 "DELETE",
2129 body: _body,
2130 queryParams: _queryParams,
2131 uploadOptions: _uploadOptions,
2132 uploadMedia: _uploadMedia,
2133 downloadOptions: _downloadOptions);
2134 return _response.then((data) => null);
2135 }
2136
2137 /**
2138 * Get information about an access token issued by a user.
2139 *
2140 * Request parameters:
2141 *
2142 * [userKey] - Identifies the user in the API request. The value can be the
2143 * user's primary email address, alias email address, or unique user ID.
2144 *
2145 * [clientId] - The Client ID of the application the token is issued to.
2146 *
2147 * Completes with a [Token].
2148 *
2149 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2150 * error.
2151 *
2152 * If the used [http.Client] completes with an error when making a REST call,
2153 * this method will complete with the same error.
2154 */
2155 async.Future<Token> get(core.String userKey, core.String clientId) {
2156 var _url = null;
2157 var _queryParams = new core.Map();
2158 var _uploadMedia = null;
2159 var _uploadOptions = null;
2160 var _downloadOptions = common.DownloadOptions.Metadata;
2161 var _body = null;
2162
2163 if (userKey == null) {
2164 throw new core.ArgumentError("Parameter userKey is required.");
2165 }
2166 if (clientId == null) {
2167 throw new core.ArgumentError("Parameter clientId is required.");
2168 }
2169
2170
2171 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/toke ns/' + common_internal.Escaper.ecapeVariable('$clientId');
2172
2173 var _response = _requester.request(_url,
2174 "GET",
2175 body: _body,
2176 queryParams: _queryParams,
2177 uploadOptions: _uploadOptions,
2178 uploadMedia: _uploadMedia,
2179 downloadOptions: _downloadOptions);
2180 return _response.then((data) => new Token.fromJson(data));
2181 }
2182
2183 /**
2184 * Returns the set of tokens specified user has issued to 3rd party
2185 * applications.
2186 *
2187 * Request parameters:
2188 *
2189 * [userKey] - Identifies the user in the API request. The value can be the
2190 * user's primary email address, alias email address, or unique user ID.
2191 *
2192 * Completes with a [Tokens].
2193 *
2194 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2195 * error.
2196 *
2197 * If the used [http.Client] completes with an error when making a REST call,
2198 * this method will complete with the same error.
2199 */
2200 async.Future<Tokens> list(core.String userKey) {
2201 var _url = null;
2202 var _queryParams = new core.Map();
2203 var _uploadMedia = null;
2204 var _uploadOptions = null;
2205 var _downloadOptions = common.DownloadOptions.Metadata;
2206 var _body = null;
2207
2208 if (userKey == null) {
2209 throw new core.ArgumentError("Parameter userKey is required.");
2210 }
2211
2212
2213 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/toke ns';
2214
2215 var _response = _requester.request(_url,
2216 "GET",
2217 body: _body,
2218 queryParams: _queryParams,
2219 uploadOptions: _uploadOptions,
2220 uploadMedia: _uploadMedia,
2221 downloadOptions: _downloadOptions);
2222 return _response.then((data) => new Tokens.fromJson(data));
2223 }
2224
2225 }
2226
2227
2228 /** Not documented yet. */
2229 class UsersResourceApi {
2230 final common_internal.ApiRequester _requester;
2231
2232 UsersAliasesResourceApi get aliases => new UsersAliasesResourceApi(_requester) ;
2233 UsersPhotosResourceApi get photos => new UsersPhotosResourceApi(_requester);
2234
2235 UsersResourceApi(common_internal.ApiRequester client) :
2236 _requester = client;
2237
2238 /**
2239 * Delete user
2240 *
2241 * Request parameters:
2242 *
2243 * [userKey] - Email or immutable Id of the user
2244 *
2245 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2246 * error.
2247 *
2248 * If the used [http.Client] completes with an error when making a REST call,
2249 * this method will complete with the same error.
2250 */
2251 async.Future delete(core.String userKey) {
2252 var _url = null;
2253 var _queryParams = new core.Map();
2254 var _uploadMedia = null;
2255 var _uploadOptions = null;
2256 var _downloadOptions = common.DownloadOptions.Metadata;
2257 var _body = null;
2258
2259 if (userKey == null) {
2260 throw new core.ArgumentError("Parameter userKey is required.");
2261 }
2262
2263 _downloadOptions = null;
2264
2265 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey');
2266
2267 var _response = _requester.request(_url,
2268 "DELETE",
2269 body: _body,
2270 queryParams: _queryParams,
2271 uploadOptions: _uploadOptions,
2272 uploadMedia: _uploadMedia,
2273 downloadOptions: _downloadOptions);
2274 return _response.then((data) => null);
2275 }
2276
2277 /**
2278 * retrieve user
2279 *
2280 * Request parameters:
2281 *
2282 * [userKey] - Email or immutable Id of the user
2283 *
2284 * Completes with a [User].
2285 *
2286 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2287 * error.
2288 *
2289 * If the used [http.Client] completes with an error when making a REST call,
2290 * this method will complete with the same error.
2291 */
2292 async.Future<User> get(core.String userKey) {
2293 var _url = null;
2294 var _queryParams = new core.Map();
2295 var _uploadMedia = null;
2296 var _uploadOptions = null;
2297 var _downloadOptions = common.DownloadOptions.Metadata;
2298 var _body = null;
2299
2300 if (userKey == null) {
2301 throw new core.ArgumentError("Parameter userKey is required.");
2302 }
2303
2304
2305 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey');
2306
2307 var _response = _requester.request(_url,
2308 "GET",
2309 body: _body,
2310 queryParams: _queryParams,
2311 uploadOptions: _uploadOptions,
2312 uploadMedia: _uploadMedia,
2313 downloadOptions: _downloadOptions);
2314 return _response.then((data) => new User.fromJson(data));
2315 }
2316
2317 /**
2318 * create user.
2319 *
2320 * [request] - The metadata request object.
2321 *
2322 * Request parameters:
2323 *
2324 * Completes with a [User].
2325 *
2326 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2327 * error.
2328 *
2329 * If the used [http.Client] completes with an error when making a REST call,
2330 * this method will complete with the same error.
2331 */
2332 async.Future<User> insert(User request) {
2333 var _url = null;
2334 var _queryParams = new core.Map();
2335 var _uploadMedia = null;
2336 var _uploadOptions = null;
2337 var _downloadOptions = common.DownloadOptions.Metadata;
2338 var _body = null;
2339
2340 if (request != null) {
2341 _body = convert.JSON.encode((request).toJson());
2342 }
2343
2344
2345 _url = 'users';
2346
2347 var _response = _requester.request(_url,
2348 "POST",
2349 body: _body,
2350 queryParams: _queryParams,
2351 uploadOptions: _uploadOptions,
2352 uploadMedia: _uploadMedia,
2353 downloadOptions: _downloadOptions);
2354 return _response.then((data) => new User.fromJson(data));
2355 }
2356
2357 /**
2358 * Retrieve either deleted users or all users in a domain (paginated)
2359 *
2360 * Request parameters:
2361 *
2362 * [customer] - Immutable id of the Google Apps account. In case of
2363 * multi-domain, to fetch all users for a customer, fill this field instead of
2364 * domain.
2365 *
2366 * [domain] - Name of the domain. Fill this field to get users from only this
2367 * domain. To return all users in a multi-domain fill customer field instead.
2368 *
2369 * [event] - Event on which subscription is intended (if subscribing)
2370 * Possible string values are:
2371 * - "add" : User Created Event
2372 * - "delete" : User Deleted Event
2373 * - "makeAdmin" : User Admin Status Change Event
2374 * - "undelete" : User Undeleted Event
2375 * - "update" : User Updated Event
2376 *
2377 * [maxResults] - Maximum number of results to return. Default is 100. Max
2378 * allowed is 500
2379 * Value must be between "1" and "500".
2380 *
2381 * [orderBy] - Column to use for sorting results
2382 * Possible string values are:
2383 * - "email" : Primary email of the user.
2384 * - "familyName" : User's family name.
2385 * - "givenName" : User's given name.
2386 *
2387 * [pageToken] - Token to specify next page in the list
2388 *
2389 * [query] - Query string search. Should be of the form "" where field can be
2390 * any of supported fields, operators can be one of '=' for exact match or ':'
2391 * for prefix match. For prefix match, the value should always be followed by
2392 * a *.
2393 *
2394 * [showDeleted] - If set to true retrieves the list of deleted users. Default
2395 * is false
2396 *
2397 * [sortOrder] - Whether to return results in ascending or descending order.
2398 * Possible string values are:
2399 * - "ASCENDING" : Ascending order.
2400 * - "DESCENDING" : Descending order.
2401 *
2402 * Completes with a [Users].
2403 *
2404 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2405 * error.
2406 *
2407 * If the used [http.Client] completes with an error when making a REST call,
2408 * this method will complete with the same error.
2409 */
2410 async.Future<Users> list({core.String customer, core.String domain, core.Strin g event, core.int maxResults, core.String orderBy, core.String pageToken, core.S tring query, core.String showDeleted, core.String sortOrder}) {
2411 var _url = null;
2412 var _queryParams = new core.Map();
2413 var _uploadMedia = null;
2414 var _uploadOptions = null;
2415 var _downloadOptions = common.DownloadOptions.Metadata;
2416 var _body = null;
2417
2418 if (customer != null) {
2419 _queryParams["customer"] = [customer];
2420 }
2421 if (domain != null) {
2422 _queryParams["domain"] = [domain];
2423 }
2424 if (event != null) {
2425 _queryParams["event"] = [event];
2426 }
2427 if (maxResults != null) {
2428 _queryParams["maxResults"] = ["${maxResults}"];
2429 }
2430 if (orderBy != null) {
2431 _queryParams["orderBy"] = [orderBy];
2432 }
2433 if (pageToken != null) {
2434 _queryParams["pageToken"] = [pageToken];
2435 }
2436 if (query != null) {
2437 _queryParams["query"] = [query];
2438 }
2439 if (showDeleted != null) {
2440 _queryParams["showDeleted"] = [showDeleted];
2441 }
2442 if (sortOrder != null) {
2443 _queryParams["sortOrder"] = [sortOrder];
2444 }
2445
2446
2447 _url = 'users';
2448
2449 var _response = _requester.request(_url,
2450 "GET",
2451 body: _body,
2452 queryParams: _queryParams,
2453 uploadOptions: _uploadOptions,
2454 uploadMedia: _uploadMedia,
2455 downloadOptions: _downloadOptions);
2456 return _response.then((data) => new Users.fromJson(data));
2457 }
2458
2459 /**
2460 * change admin status of a user
2461 *
2462 * [request] - The metadata request object.
2463 *
2464 * Request parameters:
2465 *
2466 * [userKey] - Email or immutable Id of the user as admin
2467 *
2468 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2469 * error.
2470 *
2471 * If the used [http.Client] completes with an error when making a REST call,
2472 * this method will complete with the same error.
2473 */
2474 async.Future makeAdmin(UserMakeAdmin request, core.String userKey) {
2475 var _url = null;
2476 var _queryParams = new core.Map();
2477 var _uploadMedia = null;
2478 var _uploadOptions = null;
2479 var _downloadOptions = common.DownloadOptions.Metadata;
2480 var _body = null;
2481
2482 if (request != null) {
2483 _body = convert.JSON.encode((request).toJson());
2484 }
2485 if (userKey == null) {
2486 throw new core.ArgumentError("Parameter userKey is required.");
2487 }
2488
2489 _downloadOptions = null;
2490
2491 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/make Admin';
2492
2493 var _response = _requester.request(_url,
2494 "POST",
2495 body: _body,
2496 queryParams: _queryParams,
2497 uploadOptions: _uploadOptions,
2498 uploadMedia: _uploadMedia,
2499 downloadOptions: _downloadOptions);
2500 return _response.then((data) => null);
2501 }
2502
2503 /**
2504 * update user. This method supports patch semantics.
2505 *
2506 * [request] - The metadata request object.
2507 *
2508 * Request parameters:
2509 *
2510 * [userKey] - Email or immutable Id of the user. If Id, it should match with
2511 * id of user object
2512 *
2513 * Completes with a [User].
2514 *
2515 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2516 * error.
2517 *
2518 * If the used [http.Client] completes with an error when making a REST call,
2519 * this method will complete with the same error.
2520 */
2521 async.Future<User> patch(User request, core.String userKey) {
2522 var _url = null;
2523 var _queryParams = new core.Map();
2524 var _uploadMedia = null;
2525 var _uploadOptions = null;
2526 var _downloadOptions = common.DownloadOptions.Metadata;
2527 var _body = null;
2528
2529 if (request != null) {
2530 _body = convert.JSON.encode((request).toJson());
2531 }
2532 if (userKey == null) {
2533 throw new core.ArgumentError("Parameter userKey is required.");
2534 }
2535
2536
2537 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey');
2538
2539 var _response = _requester.request(_url,
2540 "PATCH",
2541 body: _body,
2542 queryParams: _queryParams,
2543 uploadOptions: _uploadOptions,
2544 uploadMedia: _uploadMedia,
2545 downloadOptions: _downloadOptions);
2546 return _response.then((data) => new User.fromJson(data));
2547 }
2548
2549 /**
2550 * Undelete a deleted user
2551 *
2552 * [request] - The metadata request object.
2553 *
2554 * Request parameters:
2555 *
2556 * [userKey] - The immutable id of the user
2557 *
2558 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2559 * error.
2560 *
2561 * If the used [http.Client] completes with an error when making a REST call,
2562 * this method will complete with the same error.
2563 */
2564 async.Future undelete(UserUndelete request, core.String userKey) {
2565 var _url = null;
2566 var _queryParams = new core.Map();
2567 var _uploadMedia = null;
2568 var _uploadOptions = null;
2569 var _downloadOptions = common.DownloadOptions.Metadata;
2570 var _body = null;
2571
2572 if (request != null) {
2573 _body = convert.JSON.encode((request).toJson());
2574 }
2575 if (userKey == null) {
2576 throw new core.ArgumentError("Parameter userKey is required.");
2577 }
2578
2579 _downloadOptions = null;
2580
2581 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/unde lete';
2582
2583 var _response = _requester.request(_url,
2584 "POST",
2585 body: _body,
2586 queryParams: _queryParams,
2587 uploadOptions: _uploadOptions,
2588 uploadMedia: _uploadMedia,
2589 downloadOptions: _downloadOptions);
2590 return _response.then((data) => null);
2591 }
2592
2593 /**
2594 * update user
2595 *
2596 * [request] - The metadata request object.
2597 *
2598 * Request parameters:
2599 *
2600 * [userKey] - Email or immutable Id of the user. If Id, it should match with
2601 * id of user object
2602 *
2603 * Completes with a [User].
2604 *
2605 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2606 * error.
2607 *
2608 * If the used [http.Client] completes with an error when making a REST call,
2609 * this method will complete with the same error.
2610 */
2611 async.Future<User> update(User request, core.String userKey) {
2612 var _url = null;
2613 var _queryParams = new core.Map();
2614 var _uploadMedia = null;
2615 var _uploadOptions = null;
2616 var _downloadOptions = common.DownloadOptions.Metadata;
2617 var _body = null;
2618
2619 if (request != null) {
2620 _body = convert.JSON.encode((request).toJson());
2621 }
2622 if (userKey == null) {
2623 throw new core.ArgumentError("Parameter userKey is required.");
2624 }
2625
2626
2627 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey');
2628
2629 var _response = _requester.request(_url,
2630 "PUT",
2631 body: _body,
2632 queryParams: _queryParams,
2633 uploadOptions: _uploadOptions,
2634 uploadMedia: _uploadMedia,
2635 downloadOptions: _downloadOptions);
2636 return _response.then((data) => new User.fromJson(data));
2637 }
2638
2639 /**
2640 * Watch for changes in users list
2641 *
2642 * [request] - The metadata request object.
2643 *
2644 * Request parameters:
2645 *
2646 * [customer] - Immutable id of the Google Apps account. In case of
2647 * multi-domain, to fetch all users for a customer, fill this field instead of
2648 * domain.
2649 *
2650 * [domain] - Name of the domain. Fill this field to get users from only this
2651 * domain. To return all users in a multi-domain fill customer field instead.
2652 *
2653 * [event] - Event on which subscription is intended (if subscribing)
2654 * Possible string values are:
2655 * - "add" : User Created Event
2656 * - "delete" : User Deleted Event
2657 * - "makeAdmin" : User Admin Status Change Event
2658 * - "undelete" : User Undeleted Event
2659 * - "update" : User Updated Event
2660 *
2661 * [maxResults] - Maximum number of results to return. Default is 100. Max
2662 * allowed is 500
2663 * Value must be between "1" and "500".
2664 *
2665 * [orderBy] - Column to use for sorting results
2666 * Possible string values are:
2667 * - "email" : Primary email of the user.
2668 * - "familyName" : User's family name.
2669 * - "givenName" : User's given name.
2670 *
2671 * [pageToken] - Token to specify next page in the list
2672 *
2673 * [query] - Query string search. Should be of the form "" where field can be
2674 * any of supported fields, operators can be one of '=' for exact match or ':'
2675 * for prefix match. For prefix match, the value should always be followed by
2676 * a *.
2677 *
2678 * [showDeleted] - If set to true retrieves the list of deleted users. Default
2679 * is false
2680 *
2681 * [sortOrder] - Whether to return results in ascending or descending order.
2682 * Possible string values are:
2683 * - "ASCENDING" : Ascending order.
2684 * - "DESCENDING" : Descending order.
2685 *
2686 * Completes with a [Channel].
2687 *
2688 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2689 * error.
2690 *
2691 * If the used [http.Client] completes with an error when making a REST call,
2692 * this method will complete with the same error.
2693 */
2694 async.Future<Channel> watch(Channel request, {core.String customer, core.Strin g domain, core.String event, core.int maxResults, core.String orderBy, core.Stri ng pageToken, core.String query, core.String showDeleted, core.String sortOrder} ) {
2695 var _url = null;
2696 var _queryParams = new core.Map();
2697 var _uploadMedia = null;
2698 var _uploadOptions = null;
2699 var _downloadOptions = common.DownloadOptions.Metadata;
2700 var _body = null;
2701
2702 if (request != null) {
2703 _body = convert.JSON.encode((request).toJson());
2704 }
2705 if (customer != null) {
2706 _queryParams["customer"] = [customer];
2707 }
2708 if (domain != null) {
2709 _queryParams["domain"] = [domain];
2710 }
2711 if (event != null) {
2712 _queryParams["event"] = [event];
2713 }
2714 if (maxResults != null) {
2715 _queryParams["maxResults"] = ["${maxResults}"];
2716 }
2717 if (orderBy != null) {
2718 _queryParams["orderBy"] = [orderBy];
2719 }
2720 if (pageToken != null) {
2721 _queryParams["pageToken"] = [pageToken];
2722 }
2723 if (query != null) {
2724 _queryParams["query"] = [query];
2725 }
2726 if (showDeleted != null) {
2727 _queryParams["showDeleted"] = [showDeleted];
2728 }
2729 if (sortOrder != null) {
2730 _queryParams["sortOrder"] = [sortOrder];
2731 }
2732
2733
2734 _url = 'users/watch';
2735
2736 var _response = _requester.request(_url,
2737 "POST",
2738 body: _body,
2739 queryParams: _queryParams,
2740 uploadOptions: _uploadOptions,
2741 uploadMedia: _uploadMedia,
2742 downloadOptions: _downloadOptions);
2743 return _response.then((data) => new Channel.fromJson(data));
2744 }
2745
2746 }
2747
2748
2749 /** Not documented yet. */
2750 class UsersAliasesResourceApi {
2751 final common_internal.ApiRequester _requester;
2752
2753 UsersAliasesResourceApi(common_internal.ApiRequester client) :
2754 _requester = client;
2755
2756 /**
2757 * Remove a alias for the user
2758 *
2759 * Request parameters:
2760 *
2761 * [userKey] - Email or immutable Id of the user
2762 *
2763 * [alias] - The alias to be removed
2764 *
2765 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2766 * error.
2767 *
2768 * If the used [http.Client] completes with an error when making a REST call,
2769 * this method will complete with the same error.
2770 */
2771 async.Future delete(core.String userKey, core.String alias) {
2772 var _url = null;
2773 var _queryParams = new core.Map();
2774 var _uploadMedia = null;
2775 var _uploadOptions = null;
2776 var _downloadOptions = common.DownloadOptions.Metadata;
2777 var _body = null;
2778
2779 if (userKey == null) {
2780 throw new core.ArgumentError("Parameter userKey is required.");
2781 }
2782 if (alias == null) {
2783 throw new core.ArgumentError("Parameter alias is required.");
2784 }
2785
2786 _downloadOptions = null;
2787
2788 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/alia ses/' + common_internal.Escaper.ecapeVariable('$alias');
2789
2790 var _response = _requester.request(_url,
2791 "DELETE",
2792 body: _body,
2793 queryParams: _queryParams,
2794 uploadOptions: _uploadOptions,
2795 uploadMedia: _uploadMedia,
2796 downloadOptions: _downloadOptions);
2797 return _response.then((data) => null);
2798 }
2799
2800 /**
2801 * Add a alias for the user
2802 *
2803 * [request] - The metadata request object.
2804 *
2805 * Request parameters:
2806 *
2807 * [userKey] - Email or immutable Id of the user
2808 *
2809 * Completes with a [Alias].
2810 *
2811 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2812 * error.
2813 *
2814 * If the used [http.Client] completes with an error when making a REST call,
2815 * this method will complete with the same error.
2816 */
2817 async.Future<Alias> insert(Alias request, core.String userKey) {
2818 var _url = null;
2819 var _queryParams = new core.Map();
2820 var _uploadMedia = null;
2821 var _uploadOptions = null;
2822 var _downloadOptions = common.DownloadOptions.Metadata;
2823 var _body = null;
2824
2825 if (request != null) {
2826 _body = convert.JSON.encode((request).toJson());
2827 }
2828 if (userKey == null) {
2829 throw new core.ArgumentError("Parameter userKey is required.");
2830 }
2831
2832
2833 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/alia ses';
2834
2835 var _response = _requester.request(_url,
2836 "POST",
2837 body: _body,
2838 queryParams: _queryParams,
2839 uploadOptions: _uploadOptions,
2840 uploadMedia: _uploadMedia,
2841 downloadOptions: _downloadOptions);
2842 return _response.then((data) => new Alias.fromJson(data));
2843 }
2844
2845 /**
2846 * List all aliases for a user
2847 *
2848 * Request parameters:
2849 *
2850 * [userKey] - Email or immutable Id of the user
2851 *
2852 * [event] - Event on which subscription is intended (if subscribing)
2853 * Possible string values are:
2854 * - "add" : Alias Created Event
2855 * - "delete" : Alias Deleted Event
2856 *
2857 * Completes with a [Aliases].
2858 *
2859 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2860 * error.
2861 *
2862 * If the used [http.Client] completes with an error when making a REST call,
2863 * this method will complete with the same error.
2864 */
2865 async.Future<Aliases> list(core.String userKey, {core.String event}) {
2866 var _url = null;
2867 var _queryParams = new core.Map();
2868 var _uploadMedia = null;
2869 var _uploadOptions = null;
2870 var _downloadOptions = common.DownloadOptions.Metadata;
2871 var _body = null;
2872
2873 if (userKey == null) {
2874 throw new core.ArgumentError("Parameter userKey is required.");
2875 }
2876 if (event != null) {
2877 _queryParams["event"] = [event];
2878 }
2879
2880
2881 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/alia ses';
2882
2883 var _response = _requester.request(_url,
2884 "GET",
2885 body: _body,
2886 queryParams: _queryParams,
2887 uploadOptions: _uploadOptions,
2888 uploadMedia: _uploadMedia,
2889 downloadOptions: _downloadOptions);
2890 return _response.then((data) => new Aliases.fromJson(data));
2891 }
2892
2893 /**
2894 * Watch for changes in user aliases list
2895 *
2896 * [request] - The metadata request object.
2897 *
2898 * Request parameters:
2899 *
2900 * [userKey] - Email or immutable Id of the user
2901 *
2902 * [event] - Event on which subscription is intended (if subscribing)
2903 * Possible string values are:
2904 * - "add" : Alias Created Event
2905 * - "delete" : Alias Deleted Event
2906 *
2907 * Completes with a [Channel].
2908 *
2909 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2910 * error.
2911 *
2912 * If the used [http.Client] completes with an error when making a REST call,
2913 * this method will complete with the same error.
2914 */
2915 async.Future<Channel> watch(Channel request, core.String userKey, {core.String event}) {
2916 var _url = null;
2917 var _queryParams = new core.Map();
2918 var _uploadMedia = null;
2919 var _uploadOptions = null;
2920 var _downloadOptions = common.DownloadOptions.Metadata;
2921 var _body = null;
2922
2923 if (request != null) {
2924 _body = convert.JSON.encode((request).toJson());
2925 }
2926 if (userKey == null) {
2927 throw new core.ArgumentError("Parameter userKey is required.");
2928 }
2929 if (event != null) {
2930 _queryParams["event"] = [event];
2931 }
2932
2933
2934 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/alia ses/watch';
2935
2936 var _response = _requester.request(_url,
2937 "POST",
2938 body: _body,
2939 queryParams: _queryParams,
2940 uploadOptions: _uploadOptions,
2941 uploadMedia: _uploadMedia,
2942 downloadOptions: _downloadOptions);
2943 return _response.then((data) => new Channel.fromJson(data));
2944 }
2945
2946 }
2947
2948
2949 /** Not documented yet. */
2950 class UsersPhotosResourceApi {
2951 final common_internal.ApiRequester _requester;
2952
2953 UsersPhotosResourceApi(common_internal.ApiRequester client) :
2954 _requester = client;
2955
2956 /**
2957 * Remove photos for the user
2958 *
2959 * Request parameters:
2960 *
2961 * [userKey] - Email or immutable Id of the user
2962 *
2963 * Completes with a [common.ApiRequestError] if the API endpoint returned an
2964 * error.
2965 *
2966 * If the used [http.Client] completes with an error when making a REST call,
2967 * this method will complete with the same error.
2968 */
2969 async.Future delete(core.String userKey) {
2970 var _url = null;
2971 var _queryParams = new core.Map();
2972 var _uploadMedia = null;
2973 var _uploadOptions = null;
2974 var _downloadOptions = common.DownloadOptions.Metadata;
2975 var _body = null;
2976
2977 if (userKey == null) {
2978 throw new core.ArgumentError("Parameter userKey is required.");
2979 }
2980
2981 _downloadOptions = null;
2982
2983 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/phot os/thumbnail';
2984
2985 var _response = _requester.request(_url,
2986 "DELETE",
2987 body: _body,
2988 queryParams: _queryParams,
2989 uploadOptions: _uploadOptions,
2990 uploadMedia: _uploadMedia,
2991 downloadOptions: _downloadOptions);
2992 return _response.then((data) => null);
2993 }
2994
2995 /**
2996 * Retrieve photo of a user
2997 *
2998 * Request parameters:
2999 *
3000 * [userKey] - Email or immutable Id of the user
3001 *
3002 * Completes with a [UserPhoto].
3003 *
3004 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3005 * error.
3006 *
3007 * If the used [http.Client] completes with an error when making a REST call,
3008 * this method will complete with the same error.
3009 */
3010 async.Future<UserPhoto> get(core.String userKey) {
3011 var _url = null;
3012 var _queryParams = new core.Map();
3013 var _uploadMedia = null;
3014 var _uploadOptions = null;
3015 var _downloadOptions = common.DownloadOptions.Metadata;
3016 var _body = null;
3017
3018 if (userKey == null) {
3019 throw new core.ArgumentError("Parameter userKey is required.");
3020 }
3021
3022
3023 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/phot os/thumbnail';
3024
3025 var _response = _requester.request(_url,
3026 "GET",
3027 body: _body,
3028 queryParams: _queryParams,
3029 uploadOptions: _uploadOptions,
3030 uploadMedia: _uploadMedia,
3031 downloadOptions: _downloadOptions);
3032 return _response.then((data) => new UserPhoto.fromJson(data));
3033 }
3034
3035 /**
3036 * Add a photo for the user. This method supports patch semantics.
3037 *
3038 * [request] - The metadata request object.
3039 *
3040 * Request parameters:
3041 *
3042 * [userKey] - Email or immutable Id of the user
3043 *
3044 * Completes with a [UserPhoto].
3045 *
3046 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3047 * error.
3048 *
3049 * If the used [http.Client] completes with an error when making a REST call,
3050 * this method will complete with the same error.
3051 */
3052 async.Future<UserPhoto> patch(UserPhoto request, core.String userKey) {
3053 var _url = null;
3054 var _queryParams = new core.Map();
3055 var _uploadMedia = null;
3056 var _uploadOptions = null;
3057 var _downloadOptions = common.DownloadOptions.Metadata;
3058 var _body = null;
3059
3060 if (request != null) {
3061 _body = convert.JSON.encode((request).toJson());
3062 }
3063 if (userKey == null) {
3064 throw new core.ArgumentError("Parameter userKey is required.");
3065 }
3066
3067
3068 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/phot os/thumbnail';
3069
3070 var _response = _requester.request(_url,
3071 "PATCH",
3072 body: _body,
3073 queryParams: _queryParams,
3074 uploadOptions: _uploadOptions,
3075 uploadMedia: _uploadMedia,
3076 downloadOptions: _downloadOptions);
3077 return _response.then((data) => new UserPhoto.fromJson(data));
3078 }
3079
3080 /**
3081 * Add a photo for the user
3082 *
3083 * [request] - The metadata request object.
3084 *
3085 * Request parameters:
3086 *
3087 * [userKey] - Email or immutable Id of the user
3088 *
3089 * Completes with a [UserPhoto].
3090 *
3091 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3092 * error.
3093 *
3094 * If the used [http.Client] completes with an error when making a REST call,
3095 * this method will complete with the same error.
3096 */
3097 async.Future<UserPhoto> update(UserPhoto request, core.String userKey) {
3098 var _url = null;
3099 var _queryParams = new core.Map();
3100 var _uploadMedia = null;
3101 var _uploadOptions = null;
3102 var _downloadOptions = common.DownloadOptions.Metadata;
3103 var _body = null;
3104
3105 if (request != null) {
3106 _body = convert.JSON.encode((request).toJson());
3107 }
3108 if (userKey == null) {
3109 throw new core.ArgumentError("Parameter userKey is required.");
3110 }
3111
3112
3113 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/phot os/thumbnail';
3114
3115 var _response = _requester.request(_url,
3116 "PUT",
3117 body: _body,
3118 queryParams: _queryParams,
3119 uploadOptions: _uploadOptions,
3120 uploadMedia: _uploadMedia,
3121 downloadOptions: _downloadOptions);
3122 return _response.then((data) => new UserPhoto.fromJson(data));
3123 }
3124
3125 }
3126
3127
3128 /** Not documented yet. */
3129 class VerificationCodesResourceApi {
3130 final common_internal.ApiRequester _requester;
3131
3132 VerificationCodesResourceApi(common_internal.ApiRequester client) :
3133 _requester = client;
3134
3135 /**
3136 * Generate new backup verification codes for the user.
3137 *
3138 * Request parameters:
3139 *
3140 * [userKey] - Email or immutable Id of the user
3141 *
3142 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3143 * error.
3144 *
3145 * If the used [http.Client] completes with an error when making a REST call,
3146 * this method will complete with the same error.
3147 */
3148 async.Future generate(core.String userKey) {
3149 var _url = null;
3150 var _queryParams = new core.Map();
3151 var _uploadMedia = null;
3152 var _uploadOptions = null;
3153 var _downloadOptions = common.DownloadOptions.Metadata;
3154 var _body = null;
3155
3156 if (userKey == null) {
3157 throw new core.ArgumentError("Parameter userKey is required.");
3158 }
3159
3160 _downloadOptions = null;
3161
3162 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/veri ficationCodes/generate';
3163
3164 var _response = _requester.request(_url,
3165 "POST",
3166 body: _body,
3167 queryParams: _queryParams,
3168 uploadOptions: _uploadOptions,
3169 uploadMedia: _uploadMedia,
3170 downloadOptions: _downloadOptions);
3171 return _response.then((data) => null);
3172 }
3173
3174 /**
3175 * Invalidate the current backup verification codes for the user.
3176 *
3177 * Request parameters:
3178 *
3179 * [userKey] - Email or immutable Id of the user
3180 *
3181 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3182 * error.
3183 *
3184 * If the used [http.Client] completes with an error when making a REST call,
3185 * this method will complete with the same error.
3186 */
3187 async.Future invalidate(core.String userKey) {
3188 var _url = null;
3189 var _queryParams = new core.Map();
3190 var _uploadMedia = null;
3191 var _uploadOptions = null;
3192 var _downloadOptions = common.DownloadOptions.Metadata;
3193 var _body = null;
3194
3195 if (userKey == null) {
3196 throw new core.ArgumentError("Parameter userKey is required.");
3197 }
3198
3199 _downloadOptions = null;
3200
3201 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/veri ficationCodes/invalidate';
3202
3203 var _response = _requester.request(_url,
3204 "POST",
3205 body: _body,
3206 queryParams: _queryParams,
3207 uploadOptions: _uploadOptions,
3208 uploadMedia: _uploadMedia,
3209 downloadOptions: _downloadOptions);
3210 return _response.then((data) => null);
3211 }
3212
3213 /**
3214 * Returns the current set of valid backup verification codes for the
3215 * specified user.
3216 *
3217 * Request parameters:
3218 *
3219 * [userKey] - Identifies the user in the API request. The value can be the
3220 * user's primary email address, alias email address, or unique user ID.
3221 *
3222 * Completes with a [VerificationCodes].
3223 *
3224 * Completes with a [common.ApiRequestError] if the API endpoint returned an
3225 * error.
3226 *
3227 * If the used [http.Client] completes with an error when making a REST call,
3228 * this method will complete with the same error.
3229 */
3230 async.Future<VerificationCodes> list(core.String userKey) {
3231 var _url = null;
3232 var _queryParams = new core.Map();
3233 var _uploadMedia = null;
3234 var _uploadOptions = null;
3235 var _downloadOptions = common.DownloadOptions.Metadata;
3236 var _body = null;
3237
3238 if (userKey == null) {
3239 throw new core.ArgumentError("Parameter userKey is required.");
3240 }
3241
3242
3243 _url = 'users/' + common_internal.Escaper.ecapeVariable('$userKey') + '/veri ficationCodes';
3244
3245 var _response = _requester.request(_url,
3246 "GET",
3247 body: _body,
3248 queryParams: _queryParams,
3249 uploadOptions: _uploadOptions,
3250 uploadMedia: _uploadMedia,
3251 downloadOptions: _downloadOptions);
3252 return _response.then((data) => new VerificationCodes.fromJson(data));
3253 }
3254
3255 }
3256
3257
3258
3259 /** JSON template for Alias object in Directory API. */
3260 class Alias {
3261 /** A alias email */
3262 core.String alias;
3263
3264 /** ETag of the resource. */
3265 core.String etag;
3266
3267 /** Unique id of the group (Read-only) Unique id of the user (Read-only) */
3268 core.String id;
3269
3270 /** Kind of resource this is. */
3271 core.String kind;
3272
3273 /** Group's primary email (Read-only) User's primary email (Read-only) */
3274 core.String primaryEmail;
3275
3276
3277 Alias();
3278
3279 Alias.fromJson(core.Map _json) {
3280 if (_json.containsKey("alias")) {
3281 alias = _json["alias"];
3282 }
3283 if (_json.containsKey("etag")) {
3284 etag = _json["etag"];
3285 }
3286 if (_json.containsKey("id")) {
3287 id = _json["id"];
3288 }
3289 if (_json.containsKey("kind")) {
3290 kind = _json["kind"];
3291 }
3292 if (_json.containsKey("primaryEmail")) {
3293 primaryEmail = _json["primaryEmail"];
3294 }
3295 }
3296
3297 core.Map toJson() {
3298 var _json = new core.Map();
3299 if (alias != null) {
3300 _json["alias"] = alias;
3301 }
3302 if (etag != null) {
3303 _json["etag"] = etag;
3304 }
3305 if (id != null) {
3306 _json["id"] = id;
3307 }
3308 if (kind != null) {
3309 _json["kind"] = kind;
3310 }
3311 if (primaryEmail != null) {
3312 _json["primaryEmail"] = primaryEmail;
3313 }
3314 return _json;
3315 }
3316 }
3317
3318
3319 /** JSON response template to list aliases in Directory API. */
3320 class Aliases {
3321 /** List of alias objects. */
3322 core.List<Alias> aliases;
3323
3324 /** ETag of the resource. */
3325 core.String etag;
3326
3327 /** Kind of resource this is. */
3328 core.String kind;
3329
3330
3331 Aliases();
3332
3333 Aliases.fromJson(core.Map _json) {
3334 if (_json.containsKey("aliases")) {
3335 aliases = _json["aliases"].map((value) => new Alias.fromJson(value)).toLis t();
3336 }
3337 if (_json.containsKey("etag")) {
3338 etag = _json["etag"];
3339 }
3340 if (_json.containsKey("kind")) {
3341 kind = _json["kind"];
3342 }
3343 }
3344
3345 core.Map toJson() {
3346 var _json = new core.Map();
3347 if (aliases != null) {
3348 _json["aliases"] = aliases.map((value) => (value).toJson()).toList();
3349 }
3350 if (etag != null) {
3351 _json["etag"] = etag;
3352 }
3353 if (kind != null) {
3354 _json["kind"] = kind;
3355 }
3356 return _json;
3357 }
3358 }
3359
3360
3361 /** The template that returns individual ASP (Access Code) data. */
3362 class Asp {
3363 /** The unique ID of the ASP. */
3364 core.int codeId;
3365
3366 /** The time when the ASP was created. Expressed in Unix time format. */
3367 core.String creationTime;
3368
3369 /** ETag of the ASP. */
3370 core.String etag;
3371
3372 /** The type of the API resource. This is always admin#directory#asp. */
3373 core.String kind;
3374
3375 /** The time when the ASP was last used. Expressed in Unix time format. */
3376 core.String lastTimeUsed;
3377
3378 /**
3379 * The name of the application that the user, represented by their userId,
3380 * entered when the ASP was created.
3381 */
3382 core.String name;
3383
3384 /** The unique ID of the user who issued the ASP. */
3385 core.String userKey;
3386
3387
3388 Asp();
3389
3390 Asp.fromJson(core.Map _json) {
3391 if (_json.containsKey("codeId")) {
3392 codeId = _json["codeId"];
3393 }
3394 if (_json.containsKey("creationTime")) {
3395 creationTime = _json["creationTime"];
3396 }
3397 if (_json.containsKey("etag")) {
3398 etag = _json["etag"];
3399 }
3400 if (_json.containsKey("kind")) {
3401 kind = _json["kind"];
3402 }
3403 if (_json.containsKey("lastTimeUsed")) {
3404 lastTimeUsed = _json["lastTimeUsed"];
3405 }
3406 if (_json.containsKey("name")) {
3407 name = _json["name"];
3408 }
3409 if (_json.containsKey("userKey")) {
3410 userKey = _json["userKey"];
3411 }
3412 }
3413
3414 core.Map toJson() {
3415 var _json = new core.Map();
3416 if (codeId != null) {
3417 _json["codeId"] = codeId;
3418 }
3419 if (creationTime != null) {
3420 _json["creationTime"] = creationTime;
3421 }
3422 if (etag != null) {
3423 _json["etag"] = etag;
3424 }
3425 if (kind != null) {
3426 _json["kind"] = kind;
3427 }
3428 if (lastTimeUsed != null) {
3429 _json["lastTimeUsed"] = lastTimeUsed;
3430 }
3431 if (name != null) {
3432 _json["name"] = name;
3433 }
3434 if (userKey != null) {
3435 _json["userKey"] = userKey;
3436 }
3437 return _json;
3438 }
3439 }
3440
3441
3442 /** Not documented yet. */
3443 class Asps {
3444 /** ETag of the resource. */
3445 core.String etag;
3446
3447 /** A list of ASP resources. */
3448 core.List<Asp> items;
3449
3450 /** The type of the API resource. This is always admin#directory#aspList. */
3451 core.String kind;
3452
3453
3454 Asps();
3455
3456 Asps.fromJson(core.Map _json) {
3457 if (_json.containsKey("etag")) {
3458 etag = _json["etag"];
3459 }
3460 if (_json.containsKey("items")) {
3461 items = _json["items"].map((value) => new Asp.fromJson(value)).toList();
3462 }
3463 if (_json.containsKey("kind")) {
3464 kind = _json["kind"];
3465 }
3466 }
3467
3468 core.Map toJson() {
3469 var _json = new core.Map();
3470 if (etag != null) {
3471 _json["etag"] = etag;
3472 }
3473 if (items != null) {
3474 _json["items"] = items.map((value) => (value).toJson()).toList();
3475 }
3476 if (kind != null) {
3477 _json["kind"] = kind;
3478 }
3479 return _json;
3480 }
3481 }
3482
3483
3484 /** An notification channel used to watch for resource changes. */
3485 class Channel {
3486 /** The address where notifications are delivered for this channel. */
3487 core.String address;
3488
3489 /**
3490 * Date and time of notification channel expiration, expressed as a Unix
3491 * timestamp, in milliseconds. Optional.
3492 */
3493 core.String expiration;
3494
3495 /** A UUID or similar unique string that identifies this channel. */
3496 core.String id;
3497
3498 /**
3499 * Identifies this as a notification channel used to watch for changes to a
3500 * resource. Value: the fixed string "api#channel".
3501 */
3502 core.String kind;
3503
3504 /** Additional parameters controlling delivery channel behavior. Optional. */
3505 core.Map<core.String, core.String> params;
3506
3507 /** A Boolean value to indicate whether payload is wanted. Optional. */
3508 core.bool payload;
3509
3510 /**
3511 * An opaque ID that identifies the resource being watched on this channel.
3512 * Stable across different API versions.
3513 */
3514 core.String resourceId;
3515
3516 /** A version-specific identifier for the watched resource. */
3517 core.String resourceUri;
3518
3519 /**
3520 * An arbitrary string delivered to the target address with each notification
3521 * delivered over this channel. Optional.
3522 */
3523 core.String token;
3524
3525 /** The type of delivery mechanism used for this channel. */
3526 core.String type;
3527
3528
3529 Channel();
3530
3531 Channel.fromJson(core.Map _json) {
3532 if (_json.containsKey("address")) {
3533 address = _json["address"];
3534 }
3535 if (_json.containsKey("expiration")) {
3536 expiration = _json["expiration"];
3537 }
3538 if (_json.containsKey("id")) {
3539 id = _json["id"];
3540 }
3541 if (_json.containsKey("kind")) {
3542 kind = _json["kind"];
3543 }
3544 if (_json.containsKey("params")) {
3545 params = _json["params"];
3546 }
3547 if (_json.containsKey("payload")) {
3548 payload = _json["payload"];
3549 }
3550 if (_json.containsKey("resourceId")) {
3551 resourceId = _json["resourceId"];
3552 }
3553 if (_json.containsKey("resourceUri")) {
3554 resourceUri = _json["resourceUri"];
3555 }
3556 if (_json.containsKey("token")) {
3557 token = _json["token"];
3558 }
3559 if (_json.containsKey("type")) {
3560 type = _json["type"];
3561 }
3562 }
3563
3564 core.Map toJson() {
3565 var _json = new core.Map();
3566 if (address != null) {
3567 _json["address"] = address;
3568 }
3569 if (expiration != null) {
3570 _json["expiration"] = expiration;
3571 }
3572 if (id != null) {
3573 _json["id"] = id;
3574 }
3575 if (kind != null) {
3576 _json["kind"] = kind;
3577 }
3578 if (params != null) {
3579 _json["params"] = params;
3580 }
3581 if (payload != null) {
3582 _json["payload"] = payload;
3583 }
3584 if (resourceId != null) {
3585 _json["resourceId"] = resourceId;
3586 }
3587 if (resourceUri != null) {
3588 _json["resourceUri"] = resourceUri;
3589 }
3590 if (token != null) {
3591 _json["token"] = token;
3592 }
3593 if (type != null) {
3594 _json["type"] = type;
3595 }
3596 return _json;
3597 }
3598 }
3599
3600
3601 /** Not documented yet. */
3602 class ChromeOsDeviceRecentUsers {
3603 /** Email address of the user. Present only if the user type is managed */
3604 core.String email;
3605
3606 /** The type of the user */
3607 core.String type;
3608
3609
3610 ChromeOsDeviceRecentUsers();
3611
3612 ChromeOsDeviceRecentUsers.fromJson(core.Map _json) {
3613 if (_json.containsKey("email")) {
3614 email = _json["email"];
3615 }
3616 if (_json.containsKey("type")) {
3617 type = _json["type"];
3618 }
3619 }
3620
3621 core.Map toJson() {
3622 var _json = new core.Map();
3623 if (email != null) {
3624 _json["email"] = email;
3625 }
3626 if (type != null) {
3627 _json["type"] = type;
3628 }
3629 return _json;
3630 }
3631 }
3632
3633
3634 /** JSON template for Chrome Os Device resource in Directory API. */
3635 class ChromeOsDevice {
3636 /** Address or location of the device as noted by the administrator */
3637 core.String annotatedLocation;
3638
3639 /** User of the device */
3640 core.String annotatedUser;
3641
3642 /** Chromebook boot mode (Read-only) */
3643 core.String bootMode;
3644
3645 /** Unique identifier of Chrome OS Device (Read-only) */
3646 core.String deviceId;
3647
3648 /** ETag of the resource. */
3649 core.String etag;
3650
3651 /** Chromebook Mac Address on ethernet network interface (Read-only) */
3652 core.String ethernetMacAddress;
3653
3654 /** Chromebook firmware version (Read-only) */
3655 core.String firmwareVersion;
3656
3657 /** Kind of resource this is. */
3658 core.String kind;
3659
3660 /** Date and time the device was last enrolled (Read-only) */
3661 core.DateTime lastEnrollmentTime;
3662
3663 /**
3664 * Date and time the device was last synchronized with the policy settings in
3665 * the Google Apps administrator control panel (Read-only)
3666 */
3667 core.DateTime lastSync;
3668
3669 /** Chromebook Mac Address on wifi network interface (Read-only) */
3670 core.String macAddress;
3671
3672 /**
3673 * Mobile Equipment identifier for the 3G mobile card in the Chromebook
3674 * (Read-only)
3675 */
3676 core.String meid;
3677
3678 /** Chromebook Model (Read-only) */
3679 core.String model;
3680
3681 /** Notes added by the administrator */
3682 core.String notes;
3683
3684 /** Chromebook order number (Read-only) */
3685 core.String orderNumber;
3686
3687 /** OrgUnit of the device */
3688 core.String orgUnitPath;
3689
3690 /** Chromebook Os Version (Read-only) */
3691 core.String osVersion;
3692
3693 /** Chromebook platform version (Read-only) */
3694 core.String platformVersion;
3695
3696 /**
3697 * List of recent device users, in descending order by last login time
3698 * (Read-only)
3699 */
3700 core.List<ChromeOsDeviceRecentUsers> recentUsers;
3701
3702 /** Chromebook serial number (Read-only) */
3703 core.String serialNumber;
3704
3705 /** status of the device (Read-only) */
3706 core.String status;
3707
3708 /** Final date the device will be supported (Read-only) */
3709 core.DateTime supportEndDate;
3710
3711 /** Will Chromebook auto renew after support end date (Read-only) */
3712 core.bool willAutoRenew;
3713
3714
3715 ChromeOsDevice();
3716
3717 ChromeOsDevice.fromJson(core.Map _json) {
3718 if (_json.containsKey("annotatedLocation")) {
3719 annotatedLocation = _json["annotatedLocation"];
3720 }
3721 if (_json.containsKey("annotatedUser")) {
3722 annotatedUser = _json["annotatedUser"];
3723 }
3724 if (_json.containsKey("bootMode")) {
3725 bootMode = _json["bootMode"];
3726 }
3727 if (_json.containsKey("deviceId")) {
3728 deviceId = _json["deviceId"];
3729 }
3730 if (_json.containsKey("etag")) {
3731 etag = _json["etag"];
3732 }
3733 if (_json.containsKey("ethernetMacAddress")) {
3734 ethernetMacAddress = _json["ethernetMacAddress"];
3735 }
3736 if (_json.containsKey("firmwareVersion")) {
3737 firmwareVersion = _json["firmwareVersion"];
3738 }
3739 if (_json.containsKey("kind")) {
3740 kind = _json["kind"];
3741 }
3742 if (_json.containsKey("lastEnrollmentTime")) {
3743 lastEnrollmentTime = core.DateTime.parse(_json["lastEnrollmentTime"]);
3744 }
3745 if (_json.containsKey("lastSync")) {
3746 lastSync = core.DateTime.parse(_json["lastSync"]);
3747 }
3748 if (_json.containsKey("macAddress")) {
3749 macAddress = _json["macAddress"];
3750 }
3751 if (_json.containsKey("meid")) {
3752 meid = _json["meid"];
3753 }
3754 if (_json.containsKey("model")) {
3755 model = _json["model"];
3756 }
3757 if (_json.containsKey("notes")) {
3758 notes = _json["notes"];
3759 }
3760 if (_json.containsKey("orderNumber")) {
3761 orderNumber = _json["orderNumber"];
3762 }
3763 if (_json.containsKey("orgUnitPath")) {
3764 orgUnitPath = _json["orgUnitPath"];
3765 }
3766 if (_json.containsKey("osVersion")) {
3767 osVersion = _json["osVersion"];
3768 }
3769 if (_json.containsKey("platformVersion")) {
3770 platformVersion = _json["platformVersion"];
3771 }
3772 if (_json.containsKey("recentUsers")) {
3773 recentUsers = _json["recentUsers"].map((value) => new ChromeOsDeviceRecent Users.fromJson(value)).toList();
3774 }
3775 if (_json.containsKey("serialNumber")) {
3776 serialNumber = _json["serialNumber"];
3777 }
3778 if (_json.containsKey("status")) {
3779 status = _json["status"];
3780 }
3781 if (_json.containsKey("supportEndDate")) {
3782 supportEndDate = core.DateTime.parse(_json["supportEndDate"]);
3783 }
3784 if (_json.containsKey("willAutoRenew")) {
3785 willAutoRenew = _json["willAutoRenew"];
3786 }
3787 }
3788
3789 core.Map toJson() {
3790 var _json = new core.Map();
3791 if (annotatedLocation != null) {
3792 _json["annotatedLocation"] = annotatedLocation;
3793 }
3794 if (annotatedUser != null) {
3795 _json["annotatedUser"] = annotatedUser;
3796 }
3797 if (bootMode != null) {
3798 _json["bootMode"] = bootMode;
3799 }
3800 if (deviceId != null) {
3801 _json["deviceId"] = deviceId;
3802 }
3803 if (etag != null) {
3804 _json["etag"] = etag;
3805 }
3806 if (ethernetMacAddress != null) {
3807 _json["ethernetMacAddress"] = ethernetMacAddress;
3808 }
3809 if (firmwareVersion != null) {
3810 _json["firmwareVersion"] = firmwareVersion;
3811 }
3812 if (kind != null) {
3813 _json["kind"] = kind;
3814 }
3815 if (lastEnrollmentTime != null) {
3816 _json["lastEnrollmentTime"] = (lastEnrollmentTime).toIso8601String();
3817 }
3818 if (lastSync != null) {
3819 _json["lastSync"] = (lastSync).toIso8601String();
3820 }
3821 if (macAddress != null) {
3822 _json["macAddress"] = macAddress;
3823 }
3824 if (meid != null) {
3825 _json["meid"] = meid;
3826 }
3827 if (model != null) {
3828 _json["model"] = model;
3829 }
3830 if (notes != null) {
3831 _json["notes"] = notes;
3832 }
3833 if (orderNumber != null) {
3834 _json["orderNumber"] = orderNumber;
3835 }
3836 if (orgUnitPath != null) {
3837 _json["orgUnitPath"] = orgUnitPath;
3838 }
3839 if (osVersion != null) {
3840 _json["osVersion"] = osVersion;
3841 }
3842 if (platformVersion != null) {
3843 _json["platformVersion"] = platformVersion;
3844 }
3845 if (recentUsers != null) {
3846 _json["recentUsers"] = recentUsers.map((value) => (value).toJson()).toList ();
3847 }
3848 if (serialNumber != null) {
3849 _json["serialNumber"] = serialNumber;
3850 }
3851 if (status != null) {
3852 _json["status"] = status;
3853 }
3854 if (supportEndDate != null) {
3855 _json["supportEndDate"] = (supportEndDate).toIso8601String();
3856 }
3857 if (willAutoRenew != null) {
3858 _json["willAutoRenew"] = willAutoRenew;
3859 }
3860 return _json;
3861 }
3862 }
3863
3864
3865 /**
3866 * JSON response template for List Chrome OS Devices operation in Directory API.
3867 */
3868 class ChromeOsDevices {
3869 /** List of Chrome OS Device objects. */
3870 core.List<ChromeOsDevice> chromeosdevices;
3871
3872 /** ETag of the resource. */
3873 core.String etag;
3874
3875 /** Kind of resource this is. */
3876 core.String kind;
3877
3878 /** Token used to access next page of this result. */
3879 core.String nextPageToken;
3880
3881
3882 ChromeOsDevices();
3883
3884 ChromeOsDevices.fromJson(core.Map _json) {
3885 if (_json.containsKey("chromeosdevices")) {
3886 chromeosdevices = _json["chromeosdevices"].map((value) => new ChromeOsDevi ce.fromJson(value)).toList();
3887 }
3888 if (_json.containsKey("etag")) {
3889 etag = _json["etag"];
3890 }
3891 if (_json.containsKey("kind")) {
3892 kind = _json["kind"];
3893 }
3894 if (_json.containsKey("nextPageToken")) {
3895 nextPageToken = _json["nextPageToken"];
3896 }
3897 }
3898
3899 core.Map toJson() {
3900 var _json = new core.Map();
3901 if (chromeosdevices != null) {
3902 _json["chromeosdevices"] = chromeosdevices.map((value) => (value).toJson() ).toList();
3903 }
3904 if (etag != null) {
3905 _json["etag"] = etag;
3906 }
3907 if (kind != null) {
3908 _json["kind"] = kind;
3909 }
3910 if (nextPageToken != null) {
3911 _json["nextPageToken"] = nextPageToken;
3912 }
3913 return _json;
3914 }
3915 }
3916
3917
3918 /** JSON template for Group resource in Directory API. */
3919 class Group {
3920 /** Is the group created by admin (Read-only) * */
3921 core.bool adminCreated;
3922
3923 /** List of aliases (Read-only) */
3924 core.List<core.String> aliases;
3925
3926 /** Description of the group */
3927 core.String description;
3928
3929 /** Group direct members count */
3930 core.String directMembersCount;
3931
3932 /** Email of Group */
3933 core.String email;
3934
3935 /** ETag of the resource. */
3936 core.String etag;
3937
3938 /** Unique identifier of Group (Read-only) */
3939 core.String id;
3940
3941 /** Kind of resource this is. */
3942 core.String kind;
3943
3944 /** Group name */
3945 core.String name;
3946
3947 /** List of non editable aliases (Read-only) */
3948 core.List<core.String> nonEditableAliases;
3949
3950
3951 Group();
3952
3953 Group.fromJson(core.Map _json) {
3954 if (_json.containsKey("adminCreated")) {
3955 adminCreated = _json["adminCreated"];
3956 }
3957 if (_json.containsKey("aliases")) {
3958 aliases = _json["aliases"];
3959 }
3960 if (_json.containsKey("description")) {
3961 description = _json["description"];
3962 }
3963 if (_json.containsKey("directMembersCount")) {
3964 directMembersCount = _json["directMembersCount"];
3965 }
3966 if (_json.containsKey("email")) {
3967 email = _json["email"];
3968 }
3969 if (_json.containsKey("etag")) {
3970 etag = _json["etag"];
3971 }
3972 if (_json.containsKey("id")) {
3973 id = _json["id"];
3974 }
3975 if (_json.containsKey("kind")) {
3976 kind = _json["kind"];
3977 }
3978 if (_json.containsKey("name")) {
3979 name = _json["name"];
3980 }
3981 if (_json.containsKey("nonEditableAliases")) {
3982 nonEditableAliases = _json["nonEditableAliases"];
3983 }
3984 }
3985
3986 core.Map toJson() {
3987 var _json = new core.Map();
3988 if (adminCreated != null) {
3989 _json["adminCreated"] = adminCreated;
3990 }
3991 if (aliases != null) {
3992 _json["aliases"] = aliases;
3993 }
3994 if (description != null) {
3995 _json["description"] = description;
3996 }
3997 if (directMembersCount != null) {
3998 _json["directMembersCount"] = directMembersCount;
3999 }
4000 if (email != null) {
4001 _json["email"] = email;
4002 }
4003 if (etag != null) {
4004 _json["etag"] = etag;
4005 }
4006 if (id != null) {
4007 _json["id"] = id;
4008 }
4009 if (kind != null) {
4010 _json["kind"] = kind;
4011 }
4012 if (name != null) {
4013 _json["name"] = name;
4014 }
4015 if (nonEditableAliases != null) {
4016 _json["nonEditableAliases"] = nonEditableAliases;
4017 }
4018 return _json;
4019 }
4020 }
4021
4022
4023 /** JSON response template for List Groups operation in Directory API. */
4024 class Groups {
4025 /** ETag of the resource. */
4026 core.String etag;
4027
4028 /** List of group objects. */
4029 core.List<Group> groups;
4030
4031 /** Kind of resource this is. */
4032 core.String kind;
4033
4034 /** Token used to access next page of this result. */
4035 core.String nextPageToken;
4036
4037
4038 Groups();
4039
4040 Groups.fromJson(core.Map _json) {
4041 if (_json.containsKey("etag")) {
4042 etag = _json["etag"];
4043 }
4044 if (_json.containsKey("groups")) {
4045 groups = _json["groups"].map((value) => new Group.fromJson(value)).toList( );
4046 }
4047 if (_json.containsKey("kind")) {
4048 kind = _json["kind"];
4049 }
4050 if (_json.containsKey("nextPageToken")) {
4051 nextPageToken = _json["nextPageToken"];
4052 }
4053 }
4054
4055 core.Map toJson() {
4056 var _json = new core.Map();
4057 if (etag != null) {
4058 _json["etag"] = etag;
4059 }
4060 if (groups != null) {
4061 _json["groups"] = groups.map((value) => (value).toJson()).toList();
4062 }
4063 if (kind != null) {
4064 _json["kind"] = kind;
4065 }
4066 if (nextPageToken != null) {
4067 _json["nextPageToken"] = nextPageToken;
4068 }
4069 return _json;
4070 }
4071 }
4072
4073
4074 /** JSON template for Member resource in Directory API. */
4075 class Member {
4076 /** Email of member (Read-only) */
4077 core.String email;
4078
4079 /** ETag of the resource. */
4080 core.String etag;
4081
4082 /**
4083 * Unique identifier of customer member (Read-only) Unique identifier of group
4084 * (Read-only) Unique identifier of member (Read-only)
4085 */
4086 core.String id;
4087
4088 /** Kind of resource this is. */
4089 core.String kind;
4090
4091 /** Role of member */
4092 core.String role;
4093
4094 /** Type of member (Immutable) */
4095 core.String type;
4096
4097
4098 Member();
4099
4100 Member.fromJson(core.Map _json) {
4101 if (_json.containsKey("email")) {
4102 email = _json["email"];
4103 }
4104 if (_json.containsKey("etag")) {
4105 etag = _json["etag"];
4106 }
4107 if (_json.containsKey("id")) {
4108 id = _json["id"];
4109 }
4110 if (_json.containsKey("kind")) {
4111 kind = _json["kind"];
4112 }
4113 if (_json.containsKey("role")) {
4114 role = _json["role"];
4115 }
4116 if (_json.containsKey("type")) {
4117 type = _json["type"];
4118 }
4119 }
4120
4121 core.Map toJson() {
4122 var _json = new core.Map();
4123 if (email != null) {
4124 _json["email"] = email;
4125 }
4126 if (etag != null) {
4127 _json["etag"] = etag;
4128 }
4129 if (id != null) {
4130 _json["id"] = id;
4131 }
4132 if (kind != null) {
4133 _json["kind"] = kind;
4134 }
4135 if (role != null) {
4136 _json["role"] = role;
4137 }
4138 if (type != null) {
4139 _json["type"] = type;
4140 }
4141 return _json;
4142 }
4143 }
4144
4145
4146 /** JSON response template for List Members operation in Directory API. */
4147 class Members {
4148 /** ETag of the resource. */
4149 core.String etag;
4150
4151 /** Kind of resource this is. */
4152 core.String kind;
4153
4154 /** List of member objects. */
4155 core.List<Member> members;
4156
4157 /** Token used to access next page of this result. */
4158 core.String nextPageToken;
4159
4160
4161 Members();
4162
4163 Members.fromJson(core.Map _json) {
4164 if (_json.containsKey("etag")) {
4165 etag = _json["etag"];
4166 }
4167 if (_json.containsKey("kind")) {
4168 kind = _json["kind"];
4169 }
4170 if (_json.containsKey("members")) {
4171 members = _json["members"].map((value) => new Member.fromJson(value)).toLi st();
4172 }
4173 if (_json.containsKey("nextPageToken")) {
4174 nextPageToken = _json["nextPageToken"];
4175 }
4176 }
4177
4178 core.Map toJson() {
4179 var _json = new core.Map();
4180 if (etag != null) {
4181 _json["etag"] = etag;
4182 }
4183 if (kind != null) {
4184 _json["kind"] = kind;
4185 }
4186 if (members != null) {
4187 _json["members"] = members.map((value) => (value).toJson()).toList();
4188 }
4189 if (nextPageToken != null) {
4190 _json["nextPageToken"] = nextPageToken;
4191 }
4192 return _json;
4193 }
4194 }
4195
4196
4197 /** Not documented yet. */
4198 class MobileDeviceApplications {
4199 /** Display name of application */
4200 core.String displayName;
4201
4202 /** Package name of application */
4203 core.String packageName;
4204
4205 /** List of Permissions for application */
4206 core.List<core.String> permission;
4207
4208 /** Version code of application */
4209 core.int versionCode;
4210
4211 /** Version name of application */
4212 core.String versionName;
4213
4214
4215 MobileDeviceApplications();
4216
4217 MobileDeviceApplications.fromJson(core.Map _json) {
4218 if (_json.containsKey("displayName")) {
4219 displayName = _json["displayName"];
4220 }
4221 if (_json.containsKey("packageName")) {
4222 packageName = _json["packageName"];
4223 }
4224 if (_json.containsKey("permission")) {
4225 permission = _json["permission"];
4226 }
4227 if (_json.containsKey("versionCode")) {
4228 versionCode = _json["versionCode"];
4229 }
4230 if (_json.containsKey("versionName")) {
4231 versionName = _json["versionName"];
4232 }
4233 }
4234
4235 core.Map toJson() {
4236 var _json = new core.Map();
4237 if (displayName != null) {
4238 _json["displayName"] = displayName;
4239 }
4240 if (packageName != null) {
4241 _json["packageName"] = packageName;
4242 }
4243 if (permission != null) {
4244 _json["permission"] = permission;
4245 }
4246 if (versionCode != null) {
4247 _json["versionCode"] = versionCode;
4248 }
4249 if (versionName != null) {
4250 _json["versionName"] = versionName;
4251 }
4252 return _json;
4253 }
4254 }
4255
4256
4257 /** JSON template for Mobile Device resource in Directory API. */
4258 class MobileDevice {
4259 /** List of applications installed on Mobile Device */
4260 core.List<MobileDeviceApplications> applications;
4261
4262 /** Mobile Device Baseband version (Read-only) */
4263 core.String basebandVersion;
4264
4265 /** Mobile Device Build number (Read-only) */
4266 core.String buildNumber;
4267
4268 /** The default locale used on the Mobile Device (Read-only) */
4269 core.String defaultLanguage;
4270
4271 /** Mobile Device compromised status (Read-only) */
4272 core.String deviceCompromisedStatus;
4273
4274 /** Mobile Device serial number (Read-only) */
4275 core.String deviceId;
4276
4277 /** List of owner user's email addresses (Read-only) */
4278 core.List<core.String> email;
4279
4280 /** ETag of the resource. */
4281 core.String etag;
4282
4283 /**
4284 * Date and time the device was first synchronized with the policy settings in
4285 * the Google Apps administrator control panel (Read-only)
4286 */
4287 core.DateTime firstSync;
4288
4289 /** Mobile Device Hardware Id (Read-only) */
4290 core.String hardwareId;
4291
4292 /** Mobile Device IMEI number (Read-only) */
4293 core.String imei;
4294
4295 /** Mobile Device Kernel version (Read-only) */
4296 core.String kernelVersion;
4297
4298 /** Kind of resource this is. */
4299 core.String kind;
4300
4301 /**
4302 * Date and time the device was last synchronized with the policy settings in
4303 * the Google Apps administrator control panel (Read-only)
4304 */
4305 core.DateTime lastSync;
4306
4307 /**
4308 * Boolean indicating if this account is on owner/primary profile or not
4309 * (Read-only)
4310 */
4311 core.bool managedAccountIsOnOwnerProfile;
4312
4313 /** Mobile Device MEID number (Read-only) */
4314 core.String meid;
4315
4316 /** Name of the model of the device */
4317 core.String model;
4318
4319 /** List of owner user's names (Read-only) */
4320 core.List<core.String> name;
4321
4322 /** Mobile Device mobile or network operator (if available) (Read-only) */
4323 core.String networkOperator;
4324
4325 /** Name of the mobile operating system */
4326 core.String os;
4327
4328 /** Unique identifier of Mobile Device (Read-only) */
4329 core.String resourceId;
4330
4331 /** Mobile Device SSN or Serial Number (Read-only) */
4332 core.String serialNumber;
4333
4334 /** Status of the device (Read-only) */
4335 core.String status;
4336
4337 /** The type of device (Read-only) */
4338 core.String type;
4339
4340 /** Mobile Device user agent */
4341 core.String userAgent;
4342
4343 /** Mobile Device WiFi MAC address (Read-only) */
4344 core.String wifiMacAddress;
4345
4346
4347 MobileDevice();
4348
4349 MobileDevice.fromJson(core.Map _json) {
4350 if (_json.containsKey("applications")) {
4351 applications = _json["applications"].map((value) => new MobileDeviceApplic ations.fromJson(value)).toList();
4352 }
4353 if (_json.containsKey("basebandVersion")) {
4354 basebandVersion = _json["basebandVersion"];
4355 }
4356 if (_json.containsKey("buildNumber")) {
4357 buildNumber = _json["buildNumber"];
4358 }
4359 if (_json.containsKey("defaultLanguage")) {
4360 defaultLanguage = _json["defaultLanguage"];
4361 }
4362 if (_json.containsKey("deviceCompromisedStatus")) {
4363 deviceCompromisedStatus = _json["deviceCompromisedStatus"];
4364 }
4365 if (_json.containsKey("deviceId")) {
4366 deviceId = _json["deviceId"];
4367 }
4368 if (_json.containsKey("email")) {
4369 email = _json["email"];
4370 }
4371 if (_json.containsKey("etag")) {
4372 etag = _json["etag"];
4373 }
4374 if (_json.containsKey("firstSync")) {
4375 firstSync = core.DateTime.parse(_json["firstSync"]);
4376 }
4377 if (_json.containsKey("hardwareId")) {
4378 hardwareId = _json["hardwareId"];
4379 }
4380 if (_json.containsKey("imei")) {
4381 imei = _json["imei"];
4382 }
4383 if (_json.containsKey("kernelVersion")) {
4384 kernelVersion = _json["kernelVersion"];
4385 }
4386 if (_json.containsKey("kind")) {
4387 kind = _json["kind"];
4388 }
4389 if (_json.containsKey("lastSync")) {
4390 lastSync = core.DateTime.parse(_json["lastSync"]);
4391 }
4392 if (_json.containsKey("managedAccountIsOnOwnerProfile")) {
4393 managedAccountIsOnOwnerProfile = _json["managedAccountIsOnOwnerProfile"];
4394 }
4395 if (_json.containsKey("meid")) {
4396 meid = _json["meid"];
4397 }
4398 if (_json.containsKey("model")) {
4399 model = _json["model"];
4400 }
4401 if (_json.containsKey("name")) {
4402 name = _json["name"];
4403 }
4404 if (_json.containsKey("networkOperator")) {
4405 networkOperator = _json["networkOperator"];
4406 }
4407 if (_json.containsKey("os")) {
4408 os = _json["os"];
4409 }
4410 if (_json.containsKey("resourceId")) {
4411 resourceId = _json["resourceId"];
4412 }
4413 if (_json.containsKey("serialNumber")) {
4414 serialNumber = _json["serialNumber"];
4415 }
4416 if (_json.containsKey("status")) {
4417 status = _json["status"];
4418 }
4419 if (_json.containsKey("type")) {
4420 type = _json["type"];
4421 }
4422 if (_json.containsKey("userAgent")) {
4423 userAgent = _json["userAgent"];
4424 }
4425 if (_json.containsKey("wifiMacAddress")) {
4426 wifiMacAddress = _json["wifiMacAddress"];
4427 }
4428 }
4429
4430 core.Map toJson() {
4431 var _json = new core.Map();
4432 if (applications != null) {
4433 _json["applications"] = applications.map((value) => (value).toJson()).toLi st();
4434 }
4435 if (basebandVersion != null) {
4436 _json["basebandVersion"] = basebandVersion;
4437 }
4438 if (buildNumber != null) {
4439 _json["buildNumber"] = buildNumber;
4440 }
4441 if (defaultLanguage != null) {
4442 _json["defaultLanguage"] = defaultLanguage;
4443 }
4444 if (deviceCompromisedStatus != null) {
4445 _json["deviceCompromisedStatus"] = deviceCompromisedStatus;
4446 }
4447 if (deviceId != null) {
4448 _json["deviceId"] = deviceId;
4449 }
4450 if (email != null) {
4451 _json["email"] = email;
4452 }
4453 if (etag != null) {
4454 _json["etag"] = etag;
4455 }
4456 if (firstSync != null) {
4457 _json["firstSync"] = (firstSync).toIso8601String();
4458 }
4459 if (hardwareId != null) {
4460 _json["hardwareId"] = hardwareId;
4461 }
4462 if (imei != null) {
4463 _json["imei"] = imei;
4464 }
4465 if (kernelVersion != null) {
4466 _json["kernelVersion"] = kernelVersion;
4467 }
4468 if (kind != null) {
4469 _json["kind"] = kind;
4470 }
4471 if (lastSync != null) {
4472 _json["lastSync"] = (lastSync).toIso8601String();
4473 }
4474 if (managedAccountIsOnOwnerProfile != null) {
4475 _json["managedAccountIsOnOwnerProfile"] = managedAccountIsOnOwnerProfile;
4476 }
4477 if (meid != null) {
4478 _json["meid"] = meid;
4479 }
4480 if (model != null) {
4481 _json["model"] = model;
4482 }
4483 if (name != null) {
4484 _json["name"] = name;
4485 }
4486 if (networkOperator != null) {
4487 _json["networkOperator"] = networkOperator;
4488 }
4489 if (os != null) {
4490 _json["os"] = os;
4491 }
4492 if (resourceId != null) {
4493 _json["resourceId"] = resourceId;
4494 }
4495 if (serialNumber != null) {
4496 _json["serialNumber"] = serialNumber;
4497 }
4498 if (status != null) {
4499 _json["status"] = status;
4500 }
4501 if (type != null) {
4502 _json["type"] = type;
4503 }
4504 if (userAgent != null) {
4505 _json["userAgent"] = userAgent;
4506 }
4507 if (wifiMacAddress != null) {
4508 _json["wifiMacAddress"] = wifiMacAddress;
4509 }
4510 return _json;
4511 }
4512 }
4513
4514
4515 /**
4516 * JSON request template for firing commands on Mobile Device in Directory
4517 * Devices API.
4518 */
4519 class MobileDeviceAction {
4520 /** Action to be taken on the Mobile Device */
4521 core.String action;
4522
4523
4524 MobileDeviceAction();
4525
4526 MobileDeviceAction.fromJson(core.Map _json) {
4527 if (_json.containsKey("action")) {
4528 action = _json["action"];
4529 }
4530 }
4531
4532 core.Map toJson() {
4533 var _json = new core.Map();
4534 if (action != null) {
4535 _json["action"] = action;
4536 }
4537 return _json;
4538 }
4539 }
4540
4541
4542 /**
4543 * JSON response template for List Mobile Devices operation in Directory API.
4544 */
4545 class MobileDevices {
4546 /** ETag of the resource. */
4547 core.String etag;
4548
4549 /** Kind of resource this is. */
4550 core.String kind;
4551
4552 /** List of Mobile Device objects. */
4553 core.List<MobileDevice> mobiledevices;
4554
4555 /** Token used to access next page of this result. */
4556 core.String nextPageToken;
4557
4558
4559 MobileDevices();
4560
4561 MobileDevices.fromJson(core.Map _json) {
4562 if (_json.containsKey("etag")) {
4563 etag = _json["etag"];
4564 }
4565 if (_json.containsKey("kind")) {
4566 kind = _json["kind"];
4567 }
4568 if (_json.containsKey("mobiledevices")) {
4569 mobiledevices = _json["mobiledevices"].map((value) => new MobileDevice.fro mJson(value)).toList();
4570 }
4571 if (_json.containsKey("nextPageToken")) {
4572 nextPageToken = _json["nextPageToken"];
4573 }
4574 }
4575
4576 core.Map toJson() {
4577 var _json = new core.Map();
4578 if (etag != null) {
4579 _json["etag"] = etag;
4580 }
4581 if (kind != null) {
4582 _json["kind"] = kind;
4583 }
4584 if (mobiledevices != null) {
4585 _json["mobiledevices"] = mobiledevices.map((value) => (value).toJson()).to List();
4586 }
4587 if (nextPageToken != null) {
4588 _json["nextPageToken"] = nextPageToken;
4589 }
4590 return _json;
4591 }
4592 }
4593
4594
4595 /** Template for a notification resource. */
4596 class Notification {
4597 /** Body of the notification (Read-only) */
4598 core.String body;
4599
4600 /** ETag of the resource. */
4601 core.String etag;
4602
4603 /** Address from which the notification is received (Read-only) */
4604 core.String fromAddress;
4605
4606 /** Boolean indicating whether the notification is unread or not. */
4607 core.bool isUnread;
4608
4609 /** The type of the resource. */
4610 core.String kind;
4611
4612 /** Not documented yet. */
4613 core.String notificationId;
4614
4615 /** Time at which notification was sent (Read-only) */
4616 core.DateTime sendTime;
4617
4618 /** Subject of the notification (Read-only) */
4619 core.String subject;
4620
4621
4622 Notification();
4623
4624 Notification.fromJson(core.Map _json) {
4625 if (_json.containsKey("body")) {
4626 body = _json["body"];
4627 }
4628 if (_json.containsKey("etag")) {
4629 etag = _json["etag"];
4630 }
4631 if (_json.containsKey("fromAddress")) {
4632 fromAddress = _json["fromAddress"];
4633 }
4634 if (_json.containsKey("isUnread")) {
4635 isUnread = _json["isUnread"];
4636 }
4637 if (_json.containsKey("kind")) {
4638 kind = _json["kind"];
4639 }
4640 if (_json.containsKey("notificationId")) {
4641 notificationId = _json["notificationId"];
4642 }
4643 if (_json.containsKey("sendTime")) {
4644 sendTime = core.DateTime.parse(_json["sendTime"]);
4645 }
4646 if (_json.containsKey("subject")) {
4647 subject = _json["subject"];
4648 }
4649 }
4650
4651 core.Map toJson() {
4652 var _json = new core.Map();
4653 if (body != null) {
4654 _json["body"] = body;
4655 }
4656 if (etag != null) {
4657 _json["etag"] = etag;
4658 }
4659 if (fromAddress != null) {
4660 _json["fromAddress"] = fromAddress;
4661 }
4662 if (isUnread != null) {
4663 _json["isUnread"] = isUnread;
4664 }
4665 if (kind != null) {
4666 _json["kind"] = kind;
4667 }
4668 if (notificationId != null) {
4669 _json["notificationId"] = notificationId;
4670 }
4671 if (sendTime != null) {
4672 _json["sendTime"] = (sendTime).toIso8601String();
4673 }
4674 if (subject != null) {
4675 _json["subject"] = subject;
4676 }
4677 return _json;
4678 }
4679 }
4680
4681
4682 /** Template for notifications list response. */
4683 class Notifications {
4684 /** ETag of the resource. */
4685 core.String etag;
4686
4687 /** List of notifications in this page. */
4688 core.List<Notification> items;
4689
4690 /** The type of the resource. */
4691 core.String kind;
4692
4693 /** Token for fetching the next page of notifications. */
4694 core.String nextPageToken;
4695
4696 /** Number of unread notification for the domain. */
4697 core.int unreadNotificationsCount;
4698
4699
4700 Notifications();
4701
4702 Notifications.fromJson(core.Map _json) {
4703 if (_json.containsKey("etag")) {
4704 etag = _json["etag"];
4705 }
4706 if (_json.containsKey("items")) {
4707 items = _json["items"].map((value) => new Notification.fromJson(value)).to List();
4708 }
4709 if (_json.containsKey("kind")) {
4710 kind = _json["kind"];
4711 }
4712 if (_json.containsKey("nextPageToken")) {
4713 nextPageToken = _json["nextPageToken"];
4714 }
4715 if (_json.containsKey("unreadNotificationsCount")) {
4716 unreadNotificationsCount = _json["unreadNotificationsCount"];
4717 }
4718 }
4719
4720 core.Map toJson() {
4721 var _json = new core.Map();
4722 if (etag != null) {
4723 _json["etag"] = etag;
4724 }
4725 if (items != null) {
4726 _json["items"] = items.map((value) => (value).toJson()).toList();
4727 }
4728 if (kind != null) {
4729 _json["kind"] = kind;
4730 }
4731 if (nextPageToken != null) {
4732 _json["nextPageToken"] = nextPageToken;
4733 }
4734 if (unreadNotificationsCount != null) {
4735 _json["unreadNotificationsCount"] = unreadNotificationsCount;
4736 }
4737 return _json;
4738 }
4739 }
4740
4741
4742 /** JSON template for Org Unit resource in Directory API. */
4743 class OrgUnit {
4744 /** Should block inheritance */
4745 core.bool blockInheritance;
4746
4747 /** Description of OrgUnit */
4748 core.String description;
4749
4750 /** ETag of the resource. */
4751 core.String etag;
4752
4753 /** Kind of resource this is. */
4754 core.String kind;
4755
4756 /** Name of OrgUnit */
4757 core.String name;
4758
4759 /** Path of OrgUnit */
4760 core.String orgUnitPath;
4761
4762 /** Path of parent OrgUnit */
4763 core.String parentOrgUnitPath;
4764
4765
4766 OrgUnit();
4767
4768 OrgUnit.fromJson(core.Map _json) {
4769 if (_json.containsKey("blockInheritance")) {
4770 blockInheritance = _json["blockInheritance"];
4771 }
4772 if (_json.containsKey("description")) {
4773 description = _json["description"];
4774 }
4775 if (_json.containsKey("etag")) {
4776 etag = _json["etag"];
4777 }
4778 if (_json.containsKey("kind")) {
4779 kind = _json["kind"];
4780 }
4781 if (_json.containsKey("name")) {
4782 name = _json["name"];
4783 }
4784 if (_json.containsKey("orgUnitPath")) {
4785 orgUnitPath = _json["orgUnitPath"];
4786 }
4787 if (_json.containsKey("parentOrgUnitPath")) {
4788 parentOrgUnitPath = _json["parentOrgUnitPath"];
4789 }
4790 }
4791
4792 core.Map toJson() {
4793 var _json = new core.Map();
4794 if (blockInheritance != null) {
4795 _json["blockInheritance"] = blockInheritance;
4796 }
4797 if (description != null) {
4798 _json["description"] = description;
4799 }
4800 if (etag != null) {
4801 _json["etag"] = etag;
4802 }
4803 if (kind != null) {
4804 _json["kind"] = kind;
4805 }
4806 if (name != null) {
4807 _json["name"] = name;
4808 }
4809 if (orgUnitPath != null) {
4810 _json["orgUnitPath"] = orgUnitPath;
4811 }
4812 if (parentOrgUnitPath != null) {
4813 _json["parentOrgUnitPath"] = parentOrgUnitPath;
4814 }
4815 return _json;
4816 }
4817 }
4818
4819
4820 /**
4821 * JSON response template for List Organization Units operation in Directory
4822 * API.
4823 */
4824 class OrgUnits {
4825 /** ETag of the resource. */
4826 core.String etag;
4827
4828 /** Kind of resource this is. */
4829 core.String kind;
4830
4831 /** List of user objects. */
4832 core.List<OrgUnit> organizationUnits;
4833
4834
4835 OrgUnits();
4836
4837 OrgUnits.fromJson(core.Map _json) {
4838 if (_json.containsKey("etag")) {
4839 etag = _json["etag"];
4840 }
4841 if (_json.containsKey("kind")) {
4842 kind = _json["kind"];
4843 }
4844 if (_json.containsKey("organizationUnits")) {
4845 organizationUnits = _json["organizationUnits"].map((value) => new OrgUnit. fromJson(value)).toList();
4846 }
4847 }
4848
4849 core.Map toJson() {
4850 var _json = new core.Map();
4851 if (etag != null) {
4852 _json["etag"] = etag;
4853 }
4854 if (kind != null) {
4855 _json["kind"] = kind;
4856 }
4857 if (organizationUnits != null) {
4858 _json["organizationUnits"] = organizationUnits.map((value) => (value).toJs on()).toList();
4859 }
4860 return _json;
4861 }
4862 }
4863
4864
4865 /** JSON template for token resource in Directory API. */
4866 class Token {
4867 /**
4868 * Whether the application is registered with Google. The value is true if the
4869 * application has an anonymous Client ID.
4870 */
4871 core.bool anonymous;
4872
4873 /** The Client ID of the application the token is issued to. */
4874 core.String clientId;
4875
4876 /** The displayable name of the application the token is issued to. */
4877 core.String displayText;
4878
4879 /** ETag of the resource. */
4880 core.String etag;
4881
4882 /** The type of the API resource. This is always admin#directory#token. */
4883 core.String kind;
4884
4885 /**
4886 * Whether the token is issued to an installed application. The value is true
4887 * if the application is installed to a desktop or mobile device.
4888 */
4889 core.bool nativeApp;
4890
4891 /** A list of authorization scopes the application is granted. */
4892 core.List<core.String> scopes;
4893
4894 /** The unique ID of the user that issued the token. */
4895 core.String userKey;
4896
4897
4898 Token();
4899
4900 Token.fromJson(core.Map _json) {
4901 if (_json.containsKey("anonymous")) {
4902 anonymous = _json["anonymous"];
4903 }
4904 if (_json.containsKey("clientId")) {
4905 clientId = _json["clientId"];
4906 }
4907 if (_json.containsKey("displayText")) {
4908 displayText = _json["displayText"];
4909 }
4910 if (_json.containsKey("etag")) {
4911 etag = _json["etag"];
4912 }
4913 if (_json.containsKey("kind")) {
4914 kind = _json["kind"];
4915 }
4916 if (_json.containsKey("nativeApp")) {
4917 nativeApp = _json["nativeApp"];
4918 }
4919 if (_json.containsKey("scopes")) {
4920 scopes = _json["scopes"];
4921 }
4922 if (_json.containsKey("userKey")) {
4923 userKey = _json["userKey"];
4924 }
4925 }
4926
4927 core.Map toJson() {
4928 var _json = new core.Map();
4929 if (anonymous != null) {
4930 _json["anonymous"] = anonymous;
4931 }
4932 if (clientId != null) {
4933 _json["clientId"] = clientId;
4934 }
4935 if (displayText != null) {
4936 _json["displayText"] = displayText;
4937 }
4938 if (etag != null) {
4939 _json["etag"] = etag;
4940 }
4941 if (kind != null) {
4942 _json["kind"] = kind;
4943 }
4944 if (nativeApp != null) {
4945 _json["nativeApp"] = nativeApp;
4946 }
4947 if (scopes != null) {
4948 _json["scopes"] = scopes;
4949 }
4950 if (userKey != null) {
4951 _json["userKey"] = userKey;
4952 }
4953 return _json;
4954 }
4955 }
4956
4957
4958 /** JSON response template for List tokens operation in Directory API. */
4959 class Tokens {
4960 /** ETag of the resource. */
4961 core.String etag;
4962
4963 /** A list of Token resources. */
4964 core.List<Token> items;
4965
4966 /**
4967 * The type of the API resource. This is always admin#directory#tokenList.
4968 */
4969 core.String kind;
4970
4971
4972 Tokens();
4973
4974 Tokens.fromJson(core.Map _json) {
4975 if (_json.containsKey("etag")) {
4976 etag = _json["etag"];
4977 }
4978 if (_json.containsKey("items")) {
4979 items = _json["items"].map((value) => new Token.fromJson(value)).toList();
4980 }
4981 if (_json.containsKey("kind")) {
4982 kind = _json["kind"];
4983 }
4984 }
4985
4986 core.Map toJson() {
4987 var _json = new core.Map();
4988 if (etag != null) {
4989 _json["etag"] = etag;
4990 }
4991 if (items != null) {
4992 _json["items"] = items.map((value) => (value).toJson()).toList();
4993 }
4994 if (kind != null) {
4995 _json["kind"] = kind;
4996 }
4997 return _json;
4998 }
4999 }
5000
5001
5002 /** JSON template for User object in Apps Directory API. */
5003 class User {
5004 /**
5005 * Not documented yet.
5006 *
5007 * The values for Object must be JSON objects. It can consist of `num`,
5008 * `String`, `bool` and `null` as well as `Map` and `List` values.
5009 */
5010 core.Object addresses;
5011
5012 /** Indicates if user has agreed to terms (Read-only) */
5013 core.bool agreedToTerms;
5014
5015 /** List of aliases (Read-only) */
5016 core.List<core.String> aliases;
5017
5018 /** Boolean indicating if the user should change password in next login */
5019 core.bool changePasswordAtNextLogin;
5020
5021 /** User's Google account creation time. (Read-only) */
5022 core.DateTime creationTime;
5023
5024 /** CustomerId of User (Read-only) */
5025 core.String customerId;
5026
5027 /** Not documented yet. */
5028 core.DateTime deletionTime;
5029
5030 /**
5031 * Not documented yet.
5032 *
5033 * The values for Object must be JSON objects. It can consist of `num`,
5034 * `String`, `bool` and `null` as well as `Map` and `List` values.
5035 */
5036 core.Object emails;
5037
5038 /** ETag of the resource. */
5039 core.String etag;
5040
5041 /**
5042 * Not documented yet.
5043 *
5044 * The values for Object must be JSON objects. It can consist of `num`,
5045 * `String`, `bool` and `null` as well as `Map` and `List` values.
5046 */
5047 core.Object externalIds;
5048
5049 /** Hash function name for password. Supported are MD5, SHA-1 and crypt */
5050 core.String hashFunction;
5051
5052 /** Unique identifier of User (Read-only) */
5053 core.String id;
5054
5055 /**
5056 * Not documented yet.
5057 *
5058 * The values for Object must be JSON objects. It can consist of `num`,
5059 * `String`, `bool` and `null` as well as `Map` and `List` values.
5060 */
5061 core.Object ims;
5062
5063 /** Boolean indicating if user is included in Global Address List */
5064 core.bool includeInGlobalAddressList;
5065
5066 /** Boolean indicating if ip is whitelisted */
5067 core.bool ipWhitelisted;
5068
5069 /** Boolean indicating if the user is admin (Read-only) */
5070 core.bool isAdmin;
5071
5072 /** Boolean indicating if the user is delegated admin (Read-only) */
5073 core.bool isDelegatedAdmin;
5074
5075 /** Is mailbox setup (Read-only) */
5076 core.bool isMailboxSetup;
5077
5078 /** Kind of resource this is. */
5079 core.String kind;
5080
5081 /** User's last login time. (Read-only) */
5082 core.DateTime lastLoginTime;
5083
5084 /** User's name */
5085 UserName name;
5086
5087 /** List of non editable aliases (Read-only) */
5088 core.List<core.String> nonEditableAliases;
5089
5090 /** OrgUnit of User */
5091 core.String orgUnitPath;
5092
5093 /**
5094 * Not documented yet.
5095 *
5096 * The values for Object must be JSON objects. It can consist of `num`,
5097 * `String`, `bool` and `null` as well as `Map` and `List` values.
5098 */
5099 core.Object organizations;
5100
5101 /** User's password */
5102 core.String password;
5103
5104 /**
5105 * Not documented yet.
5106 *
5107 * The values for Object must be JSON objects. It can consist of `num`,
5108 * `String`, `bool` and `null` as well as `Map` and `List` values.
5109 */
5110 core.Object phones;
5111
5112 /** username of User */
5113 core.String primaryEmail;
5114
5115 /**
5116 * Not documented yet.
5117 *
5118 * The values for Object must be JSON objects. It can consist of `num`,
5119 * `String`, `bool` and `null` as well as `Map` and `List` values.
5120 */
5121 core.Object relations;
5122
5123 /** Indicates if user is suspended */
5124 core.bool suspended;
5125
5126 /** Suspension reason if user is suspended (Read-only) */
5127 core.String suspensionReason;
5128
5129 /** Photo Url of the user (Read-only) */
5130 core.String thumbnailPhotoUrl;
5131
5132
5133 User();
5134
5135 User.fromJson(core.Map _json) {
5136 if (_json.containsKey("addresses")) {
5137 addresses = _json["addresses"];
5138 }
5139 if (_json.containsKey("agreedToTerms")) {
5140 agreedToTerms = _json["agreedToTerms"];
5141 }
5142 if (_json.containsKey("aliases")) {
5143 aliases = _json["aliases"];
5144 }
5145 if (_json.containsKey("changePasswordAtNextLogin")) {
5146 changePasswordAtNextLogin = _json["changePasswordAtNextLogin"];
5147 }
5148 if (_json.containsKey("creationTime")) {
5149 creationTime = core.DateTime.parse(_json["creationTime"]);
5150 }
5151 if (_json.containsKey("customerId")) {
5152 customerId = _json["customerId"];
5153 }
5154 if (_json.containsKey("deletionTime")) {
5155 deletionTime = core.DateTime.parse(_json["deletionTime"]);
5156 }
5157 if (_json.containsKey("emails")) {
5158 emails = _json["emails"];
5159 }
5160 if (_json.containsKey("etag")) {
5161 etag = _json["etag"];
5162 }
5163 if (_json.containsKey("externalIds")) {
5164 externalIds = _json["externalIds"];
5165 }
5166 if (_json.containsKey("hashFunction")) {
5167 hashFunction = _json["hashFunction"];
5168 }
5169 if (_json.containsKey("id")) {
5170 id = _json["id"];
5171 }
5172 if (_json.containsKey("ims")) {
5173 ims = _json["ims"];
5174 }
5175 if (_json.containsKey("includeInGlobalAddressList")) {
5176 includeInGlobalAddressList = _json["includeInGlobalAddressList"];
5177 }
5178 if (_json.containsKey("ipWhitelisted")) {
5179 ipWhitelisted = _json["ipWhitelisted"];
5180 }
5181 if (_json.containsKey("isAdmin")) {
5182 isAdmin = _json["isAdmin"];
5183 }
5184 if (_json.containsKey("isDelegatedAdmin")) {
5185 isDelegatedAdmin = _json["isDelegatedAdmin"];
5186 }
5187 if (_json.containsKey("isMailboxSetup")) {
5188 isMailboxSetup = _json["isMailboxSetup"];
5189 }
5190 if (_json.containsKey("kind")) {
5191 kind = _json["kind"];
5192 }
5193 if (_json.containsKey("lastLoginTime")) {
5194 lastLoginTime = core.DateTime.parse(_json["lastLoginTime"]);
5195 }
5196 if (_json.containsKey("name")) {
5197 name = new UserName.fromJson(_json["name"]);
5198 }
5199 if (_json.containsKey("nonEditableAliases")) {
5200 nonEditableAliases = _json["nonEditableAliases"];
5201 }
5202 if (_json.containsKey("orgUnitPath")) {
5203 orgUnitPath = _json["orgUnitPath"];
5204 }
5205 if (_json.containsKey("organizations")) {
5206 organizations = _json["organizations"];
5207 }
5208 if (_json.containsKey("password")) {
5209 password = _json["password"];
5210 }
5211 if (_json.containsKey("phones")) {
5212 phones = _json["phones"];
5213 }
5214 if (_json.containsKey("primaryEmail")) {
5215 primaryEmail = _json["primaryEmail"];
5216 }
5217 if (_json.containsKey("relations")) {
5218 relations = _json["relations"];
5219 }
5220 if (_json.containsKey("suspended")) {
5221 suspended = _json["suspended"];
5222 }
5223 if (_json.containsKey("suspensionReason")) {
5224 suspensionReason = _json["suspensionReason"];
5225 }
5226 if (_json.containsKey("thumbnailPhotoUrl")) {
5227 thumbnailPhotoUrl = _json["thumbnailPhotoUrl"];
5228 }
5229 }
5230
5231 core.Map toJson() {
5232 var _json = new core.Map();
5233 if (addresses != null) {
5234 _json["addresses"] = addresses;
5235 }
5236 if (agreedToTerms != null) {
5237 _json["agreedToTerms"] = agreedToTerms;
5238 }
5239 if (aliases != null) {
5240 _json["aliases"] = aliases;
5241 }
5242 if (changePasswordAtNextLogin != null) {
5243 _json["changePasswordAtNextLogin"] = changePasswordAtNextLogin;
5244 }
5245 if (creationTime != null) {
5246 _json["creationTime"] = (creationTime).toIso8601String();
5247 }
5248 if (customerId != null) {
5249 _json["customerId"] = customerId;
5250 }
5251 if (deletionTime != null) {
5252 _json["deletionTime"] = (deletionTime).toIso8601String();
5253 }
5254 if (emails != null) {
5255 _json["emails"] = emails;
5256 }
5257 if (etag != null) {
5258 _json["etag"] = etag;
5259 }
5260 if (externalIds != null) {
5261 _json["externalIds"] = externalIds;
5262 }
5263 if (hashFunction != null) {
5264 _json["hashFunction"] = hashFunction;
5265 }
5266 if (id != null) {
5267 _json["id"] = id;
5268 }
5269 if (ims != null) {
5270 _json["ims"] = ims;
5271 }
5272 if (includeInGlobalAddressList != null) {
5273 _json["includeInGlobalAddressList"] = includeInGlobalAddressList;
5274 }
5275 if (ipWhitelisted != null) {
5276 _json["ipWhitelisted"] = ipWhitelisted;
5277 }
5278 if (isAdmin != null) {
5279 _json["isAdmin"] = isAdmin;
5280 }
5281 if (isDelegatedAdmin != null) {
5282 _json["isDelegatedAdmin"] = isDelegatedAdmin;
5283 }
5284 if (isMailboxSetup != null) {
5285 _json["isMailboxSetup"] = isMailboxSetup;
5286 }
5287 if (kind != null) {
5288 _json["kind"] = kind;
5289 }
5290 if (lastLoginTime != null) {
5291 _json["lastLoginTime"] = (lastLoginTime).toIso8601String();
5292 }
5293 if (name != null) {
5294 _json["name"] = (name).toJson();
5295 }
5296 if (nonEditableAliases != null) {
5297 _json["nonEditableAliases"] = nonEditableAliases;
5298 }
5299 if (orgUnitPath != null) {
5300 _json["orgUnitPath"] = orgUnitPath;
5301 }
5302 if (organizations != null) {
5303 _json["organizations"] = organizations;
5304 }
5305 if (password != null) {
5306 _json["password"] = password;
5307 }
5308 if (phones != null) {
5309 _json["phones"] = phones;
5310 }
5311 if (primaryEmail != null) {
5312 _json["primaryEmail"] = primaryEmail;
5313 }
5314 if (relations != null) {
5315 _json["relations"] = relations;
5316 }
5317 if (suspended != null) {
5318 _json["suspended"] = suspended;
5319 }
5320 if (suspensionReason != null) {
5321 _json["suspensionReason"] = suspensionReason;
5322 }
5323 if (thumbnailPhotoUrl != null) {
5324 _json["thumbnailPhotoUrl"] = thumbnailPhotoUrl;
5325 }
5326 return _json;
5327 }
5328 }
5329
5330
5331 /** JSON template for address. */
5332 class UserAddress {
5333 /** Country. */
5334 core.String country;
5335
5336 /** Country code. */
5337 core.String countryCode;
5338
5339 /** Custom type. */
5340 core.String customType;
5341
5342 /** Extended Address. */
5343 core.String extendedAddress;
5344
5345 /** Formatted address (read-only field) */
5346 core.String formatted;
5347
5348 /** Locality. */
5349 core.String locality;
5350
5351 /** Other parts of address. */
5352 core.String poBox;
5353
5354 /** Postal code. */
5355 core.String postalCode;
5356
5357 /**
5358 * If this is user's primary address. Only one entry could be marked as
5359 * primary.
5360 */
5361 core.bool primary;
5362
5363 /** Region. */
5364 core.String region;
5365
5366 /**
5367 * User supplied address was structured. Structured addresses are NOT
5368 * supported at this time. You might be able to write structured addresses,
5369 * but any values will eventually be clobbered.
5370 */
5371 core.bool sourceIsStructured;
5372
5373 /** Street. */
5374 core.String streetAddress;
5375
5376 /**
5377 * Each entry can have a type which indicates standard values of that entry.
5378 * For example address could be of home, work etc. In addition to the standard
5379 * type, an entry can have a custom type and can take any value. Such type
5380 * should have the CUSTOM value as type and also have a customType value.
5381 */
5382 core.String type;
5383
5384
5385 UserAddress();
5386
5387 UserAddress.fromJson(core.Map _json) {
5388 if (_json.containsKey("country")) {
5389 country = _json["country"];
5390 }
5391 if (_json.containsKey("countryCode")) {
5392 countryCode = _json["countryCode"];
5393 }
5394 if (_json.containsKey("customType")) {
5395 customType = _json["customType"];
5396 }
5397 if (_json.containsKey("extendedAddress")) {
5398 extendedAddress = _json["extendedAddress"];
5399 }
5400 if (_json.containsKey("formatted")) {
5401 formatted = _json["formatted"];
5402 }
5403 if (_json.containsKey("locality")) {
5404 locality = _json["locality"];
5405 }
5406 if (_json.containsKey("poBox")) {
5407 poBox = _json["poBox"];
5408 }
5409 if (_json.containsKey("postalCode")) {
5410 postalCode = _json["postalCode"];
5411 }
5412 if (_json.containsKey("primary")) {
5413 primary = _json["primary"];
5414 }
5415 if (_json.containsKey("region")) {
5416 region = _json["region"];
5417 }
5418 if (_json.containsKey("sourceIsStructured")) {
5419 sourceIsStructured = _json["sourceIsStructured"];
5420 }
5421 if (_json.containsKey("streetAddress")) {
5422 streetAddress = _json["streetAddress"];
5423 }
5424 if (_json.containsKey("type")) {
5425 type = _json["type"];
5426 }
5427 }
5428
5429 core.Map toJson() {
5430 var _json = new core.Map();
5431 if (country != null) {
5432 _json["country"] = country;
5433 }
5434 if (countryCode != null) {
5435 _json["countryCode"] = countryCode;
5436 }
5437 if (customType != null) {
5438 _json["customType"] = customType;
5439 }
5440 if (extendedAddress != null) {
5441 _json["extendedAddress"] = extendedAddress;
5442 }
5443 if (formatted != null) {
5444 _json["formatted"] = formatted;
5445 }
5446 if (locality != null) {
5447 _json["locality"] = locality;
5448 }
5449 if (poBox != null) {
5450 _json["poBox"] = poBox;
5451 }
5452 if (postalCode != null) {
5453 _json["postalCode"] = postalCode;
5454 }
5455 if (primary != null) {
5456 _json["primary"] = primary;
5457 }
5458 if (region != null) {
5459 _json["region"] = region;
5460 }
5461 if (sourceIsStructured != null) {
5462 _json["sourceIsStructured"] = sourceIsStructured;
5463 }
5464 if (streetAddress != null) {
5465 _json["streetAddress"] = streetAddress;
5466 }
5467 if (type != null) {
5468 _json["type"] = type;
5469 }
5470 return _json;
5471 }
5472 }
5473
5474
5475 /** JSON template for an email. */
5476 class UserEmail {
5477 /** Email id of the user. */
5478 core.String address;
5479
5480 /** Custom Type. */
5481 core.String customType;
5482
5483 /**
5484 * If this is user's primary email. Only one entry could be marked as primary.
5485 */
5486 core.bool primary;
5487
5488 /**
5489 * Each entry can have a type which indicates standard types of that entry.
5490 * For example email could be of home, work etc. In addition to the standard
5491 * type, an entry can have a custom type and can take any value Such types
5492 * should have the CUSTOM value as type and also have a customType value.
5493 */
5494 core.String type;
5495
5496
5497 UserEmail();
5498
5499 UserEmail.fromJson(core.Map _json) {
5500 if (_json.containsKey("address")) {
5501 address = _json["address"];
5502 }
5503 if (_json.containsKey("customType")) {
5504 customType = _json["customType"];
5505 }
5506 if (_json.containsKey("primary")) {
5507 primary = _json["primary"];
5508 }
5509 if (_json.containsKey("type")) {
5510 type = _json["type"];
5511 }
5512 }
5513
5514 core.Map toJson() {
5515 var _json = new core.Map();
5516 if (address != null) {
5517 _json["address"] = address;
5518 }
5519 if (customType != null) {
5520 _json["customType"] = customType;
5521 }
5522 if (primary != null) {
5523 _json["primary"] = primary;
5524 }
5525 if (type != null) {
5526 _json["type"] = type;
5527 }
5528 return _json;
5529 }
5530 }
5531
5532
5533 /** JSON template for an externalId entry. */
5534 class UserExternalId {
5535 /** Custom type. */
5536 core.String customType;
5537
5538 /** The type of the Id. */
5539 core.String type;
5540
5541 /** The value of the id. */
5542 core.String value;
5543
5544
5545 UserExternalId();
5546
5547 UserExternalId.fromJson(core.Map _json) {
5548 if (_json.containsKey("customType")) {
5549 customType = _json["customType"];
5550 }
5551 if (_json.containsKey("type")) {
5552 type = _json["type"];
5553 }
5554 if (_json.containsKey("value")) {
5555 value = _json["value"];
5556 }
5557 }
5558
5559 core.Map toJson() {
5560 var _json = new core.Map();
5561 if (customType != null) {
5562 _json["customType"] = customType;
5563 }
5564 if (type != null) {
5565 _json["type"] = type;
5566 }
5567 if (value != null) {
5568 _json["value"] = value;
5569 }
5570 return _json;
5571 }
5572 }
5573
5574
5575 /** JSON template for instant messenger of an user. */
5576 class UserIm {
5577 /** Custom protocol. */
5578 core.String customProtocol;
5579
5580 /** Custom type. */
5581 core.String customType;
5582
5583 /** Instant messenger id. */
5584 core.String im;
5585
5586 /**
5587 * If this is user's primary im. Only one entry could be marked as primary.
5588 */
5589 core.bool primary;
5590
5591 /**
5592 * Protocol used in the instant messenger. It should be one of the values from
5593 * ImProtocolTypes map. Similar to type, it can take a CUSTOM value and
5594 * specify the custom name in customProtocol field.
5595 */
5596 core.String protocol;
5597
5598 /**
5599 * Each entry can have a type which indicates standard types of that entry.
5600 * For example instant messengers could be of home, work etc. In addition to
5601 * the standard type, an entry can have a custom type and can take any value.
5602 * Such types should have the CUSTOM value as type and also have a customType
5603 * value.
5604 */
5605 core.String type;
5606
5607
5608 UserIm();
5609
5610 UserIm.fromJson(core.Map _json) {
5611 if (_json.containsKey("customProtocol")) {
5612 customProtocol = _json["customProtocol"];
5613 }
5614 if (_json.containsKey("customType")) {
5615 customType = _json["customType"];
5616 }
5617 if (_json.containsKey("im")) {
5618 im = _json["im"];
5619 }
5620 if (_json.containsKey("primary")) {
5621 primary = _json["primary"];
5622 }
5623 if (_json.containsKey("protocol")) {
5624 protocol = _json["protocol"];
5625 }
5626 if (_json.containsKey("type")) {
5627 type = _json["type"];
5628 }
5629 }
5630
5631 core.Map toJson() {
5632 var _json = new core.Map();
5633 if (customProtocol != null) {
5634 _json["customProtocol"] = customProtocol;
5635 }
5636 if (customType != null) {
5637 _json["customType"] = customType;
5638 }
5639 if (im != null) {
5640 _json["im"] = im;
5641 }
5642 if (primary != null) {
5643 _json["primary"] = primary;
5644 }
5645 if (protocol != null) {
5646 _json["protocol"] = protocol;
5647 }
5648 if (type != null) {
5649 _json["type"] = type;
5650 }
5651 return _json;
5652 }
5653 }
5654
5655
5656 /**
5657 * JSON request template for setting/revoking admin status of a user in
5658 * Directory API.
5659 */
5660 class UserMakeAdmin {
5661 /** Boolean indicating new admin status of the user */
5662 core.bool status;
5663
5664
5665 UserMakeAdmin();
5666
5667 UserMakeAdmin.fromJson(core.Map _json) {
5668 if (_json.containsKey("status")) {
5669 status = _json["status"];
5670 }
5671 }
5672
5673 core.Map toJson() {
5674 var _json = new core.Map();
5675 if (status != null) {
5676 _json["status"] = status;
5677 }
5678 return _json;
5679 }
5680 }
5681
5682
5683 /** JSON template for name of a user in Directory API. */
5684 class UserName {
5685 /** Last Name */
5686 core.String familyName;
5687
5688 /** Full Name */
5689 core.String fullName;
5690
5691 /** First Name */
5692 core.String givenName;
5693
5694
5695 UserName();
5696
5697 UserName.fromJson(core.Map _json) {
5698 if (_json.containsKey("familyName")) {
5699 familyName = _json["familyName"];
5700 }
5701 if (_json.containsKey("fullName")) {
5702 fullName = _json["fullName"];
5703 }
5704 if (_json.containsKey("givenName")) {
5705 givenName = _json["givenName"];
5706 }
5707 }
5708
5709 core.Map toJson() {
5710 var _json = new core.Map();
5711 if (familyName != null) {
5712 _json["familyName"] = familyName;
5713 }
5714 if (fullName != null) {
5715 _json["fullName"] = fullName;
5716 }
5717 if (givenName != null) {
5718 _json["givenName"] = givenName;
5719 }
5720 return _json;
5721 }
5722 }
5723
5724
5725 /** JSON template for an organization entry. */
5726 class UserOrganization {
5727 /** The cost center of the users department. */
5728 core.String costCenter;
5729
5730 /** Custom type. */
5731 core.String customType;
5732
5733 /** Department within the organization. */
5734 core.String department;
5735
5736 /** Description of the organization. */
5737 core.String description;
5738
5739 /** The domain to which the organization belongs to. */
5740 core.String domain;
5741
5742 /**
5743 * Location of the organization. This need not be fully qualified address.
5744 */
5745 core.String location;
5746
5747 /** Name of the organization */
5748 core.String name;
5749
5750 /** If it user's primary organization. */
5751 core.bool primary;
5752
5753 /** Symbol of the organization. */
5754 core.String symbol;
5755
5756 /** Title (designation) of the user in the organization. */
5757 core.String title;
5758
5759 /**
5760 * Each entry can have a type which indicates standard types of that entry.
5761 * For example organization could be of school, work etc. In addition to the
5762 * standard type, an entry can have a custom type and can give it any name.
5763 * Such types should have the CUSTOM value as type and also have a CustomType
5764 * value.
5765 */
5766 core.String type;
5767
5768
5769 UserOrganization();
5770
5771 UserOrganization.fromJson(core.Map _json) {
5772 if (_json.containsKey("costCenter")) {
5773 costCenter = _json["costCenter"];
5774 }
5775 if (_json.containsKey("customType")) {
5776 customType = _json["customType"];
5777 }
5778 if (_json.containsKey("department")) {
5779 department = _json["department"];
5780 }
5781 if (_json.containsKey("description")) {
5782 description = _json["description"];
5783 }
5784 if (_json.containsKey("domain")) {
5785 domain = _json["domain"];
5786 }
5787 if (_json.containsKey("location")) {
5788 location = _json["location"];
5789 }
5790 if (_json.containsKey("name")) {
5791 name = _json["name"];
5792 }
5793 if (_json.containsKey("primary")) {
5794 primary = _json["primary"];
5795 }
5796 if (_json.containsKey("symbol")) {
5797 symbol = _json["symbol"];
5798 }
5799 if (_json.containsKey("title")) {
5800 title = _json["title"];
5801 }
5802 if (_json.containsKey("type")) {
5803 type = _json["type"];
5804 }
5805 }
5806
5807 core.Map toJson() {
5808 var _json = new core.Map();
5809 if (costCenter != null) {
5810 _json["costCenter"] = costCenter;
5811 }
5812 if (customType != null) {
5813 _json["customType"] = customType;
5814 }
5815 if (department != null) {
5816 _json["department"] = department;
5817 }
5818 if (description != null) {
5819 _json["description"] = description;
5820 }
5821 if (domain != null) {
5822 _json["domain"] = domain;
5823 }
5824 if (location != null) {
5825 _json["location"] = location;
5826 }
5827 if (name != null) {
5828 _json["name"] = name;
5829 }
5830 if (primary != null) {
5831 _json["primary"] = primary;
5832 }
5833 if (symbol != null) {
5834 _json["symbol"] = symbol;
5835 }
5836 if (title != null) {
5837 _json["title"] = title;
5838 }
5839 if (type != null) {
5840 _json["type"] = type;
5841 }
5842 return _json;
5843 }
5844 }
5845
5846
5847 /** JSON template for a phone entry. */
5848 class UserPhone {
5849 /** Custom Type. */
5850 core.String customType;
5851
5852 /** If this is user's primary phone or not. */
5853 core.bool primary;
5854
5855 /**
5856 * Each entry can have a type which indicates standard types of that entry.
5857 * For example phone could be of home_fax, work, mobile etc. In addition to
5858 * the standard type, an entry can have a custom type and can give it any
5859 * name. Such types should have the CUSTOM value as type and also have a
5860 * customType value.
5861 */
5862 core.String type;
5863
5864 /** Phone number. */
5865 core.String value;
5866
5867
5868 UserPhone();
5869
5870 UserPhone.fromJson(core.Map _json) {
5871 if (_json.containsKey("customType")) {
5872 customType = _json["customType"];
5873 }
5874 if (_json.containsKey("primary")) {
5875 primary = _json["primary"];
5876 }
5877 if (_json.containsKey("type")) {
5878 type = _json["type"];
5879 }
5880 if (_json.containsKey("value")) {
5881 value = _json["value"];
5882 }
5883 }
5884
5885 core.Map toJson() {
5886 var _json = new core.Map();
5887 if (customType != null) {
5888 _json["customType"] = customType;
5889 }
5890 if (primary != null) {
5891 _json["primary"] = primary;
5892 }
5893 if (type != null) {
5894 _json["type"] = type;
5895 }
5896 if (value != null) {
5897 _json["value"] = value;
5898 }
5899 return _json;
5900 }
5901 }
5902
5903
5904 /** JSON template for Photo object in Directory API. */
5905 class UserPhoto {
5906 /** ETag of the resource. */
5907 core.String etag;
5908
5909 /** Height in pixels of the photo */
5910 core.int height;
5911
5912 /** Unique identifier of User (Read-only) */
5913 core.String id;
5914
5915 /** Kind of resource this is. */
5916 core.String kind;
5917
5918 /** Mime Type of the photo */
5919 core.String mimeType;
5920
5921 /** Base64 encoded photo data */
5922 core.String photoData;
5923
5924 core.List<core.int> get photoDataAsBytes {
5925 return crypto.CryptoUtils.base64StringToBytes(photoData);
5926 }
5927
5928 void set photoDataAsBytes(core.List<core.int> _bytes) {
5929 photoData = crypto.CryptoUtils.bytesToBase64(_bytes, urlSafe: true);
5930 }
5931
5932 /** Primary email of User (Read-only) */
5933 core.String primaryEmail;
5934
5935 /** Width in pixels of the photo */
5936 core.int width;
5937
5938
5939 UserPhoto();
5940
5941 UserPhoto.fromJson(core.Map _json) {
5942 if (_json.containsKey("etag")) {
5943 etag = _json["etag"];
5944 }
5945 if (_json.containsKey("height")) {
5946 height = _json["height"];
5947 }
5948 if (_json.containsKey("id")) {
5949 id = _json["id"];
5950 }
5951 if (_json.containsKey("kind")) {
5952 kind = _json["kind"];
5953 }
5954 if (_json.containsKey("mimeType")) {
5955 mimeType = _json["mimeType"];
5956 }
5957 if (_json.containsKey("photoData")) {
5958 photoData = _json["photoData"];
5959 }
5960 if (_json.containsKey("primaryEmail")) {
5961 primaryEmail = _json["primaryEmail"];
5962 }
5963 if (_json.containsKey("width")) {
5964 width = _json["width"];
5965 }
5966 }
5967
5968 core.Map toJson() {
5969 var _json = new core.Map();
5970 if (etag != null) {
5971 _json["etag"] = etag;
5972 }
5973 if (height != null) {
5974 _json["height"] = height;
5975 }
5976 if (id != null) {
5977 _json["id"] = id;
5978 }
5979 if (kind != null) {
5980 _json["kind"] = kind;
5981 }
5982 if (mimeType != null) {
5983 _json["mimeType"] = mimeType;
5984 }
5985 if (photoData != null) {
5986 _json["photoData"] = photoData;
5987 }
5988 if (primaryEmail != null) {
5989 _json["primaryEmail"] = primaryEmail;
5990 }
5991 if (width != null) {
5992 _json["width"] = width;
5993 }
5994 return _json;
5995 }
5996 }
5997
5998
5999 /** JSON template for a relation entry. */
6000 class UserRelation {
6001 /** Custom Type. */
6002 core.String customType;
6003
6004 /**
6005 * The relation of the user. Some of the possible values are mother, father,
6006 * sister, brother, manager, assistant, partner.
6007 */
6008 core.String type;
6009
6010 /** The name of the relation. */
6011 core.String value;
6012
6013
6014 UserRelation();
6015
6016 UserRelation.fromJson(core.Map _json) {
6017 if (_json.containsKey("customType")) {
6018 customType = _json["customType"];
6019 }
6020 if (_json.containsKey("type")) {
6021 type = _json["type"];
6022 }
6023 if (_json.containsKey("value")) {
6024 value = _json["value"];
6025 }
6026 }
6027
6028 core.Map toJson() {
6029 var _json = new core.Map();
6030 if (customType != null) {
6031 _json["customType"] = customType;
6032 }
6033 if (type != null) {
6034 _json["type"] = type;
6035 }
6036 if (value != null) {
6037 _json["value"] = value;
6038 }
6039 return _json;
6040 }
6041 }
6042
6043
6044 /** JSON request template to undelete a user in Directory API. */
6045 class UserUndelete {
6046 /** OrgUnit of User */
6047 core.String orgUnitPath;
6048
6049
6050 UserUndelete();
6051
6052 UserUndelete.fromJson(core.Map _json) {
6053 if (_json.containsKey("orgUnitPath")) {
6054 orgUnitPath = _json["orgUnitPath"];
6055 }
6056 }
6057
6058 core.Map toJson() {
6059 var _json = new core.Map();
6060 if (orgUnitPath != null) {
6061 _json["orgUnitPath"] = orgUnitPath;
6062 }
6063 return _json;
6064 }
6065 }
6066
6067
6068 /** JSON response template for List Users operation in Apps Directory API. */
6069 class Users {
6070 /** ETag of the resource. */
6071 core.String etag;
6072
6073 /** Kind of resource this is. */
6074 core.String kind;
6075
6076 /** Token used to access next page of this result. */
6077 core.String nextPageToken;
6078
6079 /**
6080 * Event that triggered this response (only used in case of Push Response)
6081 */
6082 core.String triggerEvent;
6083
6084 /** List of user objects. */
6085 core.List<User> users;
6086
6087
6088 Users();
6089
6090 Users.fromJson(core.Map _json) {
6091 if (_json.containsKey("etag")) {
6092 etag = _json["etag"];
6093 }
6094 if (_json.containsKey("kind")) {
6095 kind = _json["kind"];
6096 }
6097 if (_json.containsKey("nextPageToken")) {
6098 nextPageToken = _json["nextPageToken"];
6099 }
6100 if (_json.containsKey("trigger_event")) {
6101 triggerEvent = _json["trigger_event"];
6102 }
6103 if (_json.containsKey("users")) {
6104 users = _json["users"].map((value) => new User.fromJson(value)).toList();
6105 }
6106 }
6107
6108 core.Map toJson() {
6109 var _json = new core.Map();
6110 if (etag != null) {
6111 _json["etag"] = etag;
6112 }
6113 if (kind != null) {
6114 _json["kind"] = kind;
6115 }
6116 if (nextPageToken != null) {
6117 _json["nextPageToken"] = nextPageToken;
6118 }
6119 if (triggerEvent != null) {
6120 _json["trigger_event"] = triggerEvent;
6121 }
6122 if (users != null) {
6123 _json["users"] = users.map((value) => (value).toJson()).toList();
6124 }
6125 return _json;
6126 }
6127 }
6128
6129
6130 /** JSON template for verification codes in Directory API. */
6131 class VerificationCode {
6132 /** ETag of the resource. */
6133 core.String etag;
6134
6135 /**
6136 * The type of the resource. This is always admin#directory#verificationCode.
6137 */
6138 core.String kind;
6139
6140 /** The obfuscated unique ID of the user. */
6141 core.String userId;
6142
6143 /**
6144 * A current verification code for the user. Invalidated or used verification
6145 * codes are not returned as part of the result.
6146 */
6147 core.String verificationCode;
6148
6149
6150 VerificationCode();
6151
6152 VerificationCode.fromJson(core.Map _json) {
6153 if (_json.containsKey("etag")) {
6154 etag = _json["etag"];
6155 }
6156 if (_json.containsKey("kind")) {
6157 kind = _json["kind"];
6158 }
6159 if (_json.containsKey("userId")) {
6160 userId = _json["userId"];
6161 }
6162 if (_json.containsKey("verificationCode")) {
6163 verificationCode = _json["verificationCode"];
6164 }
6165 }
6166
6167 core.Map toJson() {
6168 var _json = new core.Map();
6169 if (etag != null) {
6170 _json["etag"] = etag;
6171 }
6172 if (kind != null) {
6173 _json["kind"] = kind;
6174 }
6175 if (userId != null) {
6176 _json["userId"] = userId;
6177 }
6178 if (verificationCode != null) {
6179 _json["verificationCode"] = verificationCode;
6180 }
6181 return _json;
6182 }
6183 }
6184
6185
6186 /**
6187 * JSON response template for List verification codes operation in Directory
6188 * API.
6189 */
6190 class VerificationCodes {
6191 /** ETag of the resource. */
6192 core.String etag;
6193
6194 /** A list of verification code resources. */
6195 core.List<VerificationCode> items;
6196
6197 /**
6198 * The type of the resource. This is always
6199 * admin#directory#verificationCodesList.
6200 */
6201 core.String kind;
6202
6203
6204 VerificationCodes();
6205
6206 VerificationCodes.fromJson(core.Map _json) {
6207 if (_json.containsKey("etag")) {
6208 etag = _json["etag"];
6209 }
6210 if (_json.containsKey("items")) {
6211 items = _json["items"].map((value) => new VerificationCode.fromJson(value) ).toList();
6212 }
6213 if (_json.containsKey("kind")) {
6214 kind = _json["kind"];
6215 }
6216 }
6217
6218 core.Map toJson() {
6219 var _json = new core.Map();
6220 if (etag != null) {
6221 _json["etag"] = etag;
6222 }
6223 if (items != null) {
6224 _json["items"] = items.map((value) => (value).toJson()).toList();
6225 }
6226 if (kind != null) {
6227 _json["kind"] = kind;
6228 }
6229 return _json;
6230 }
6231 }
6232
6233
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698