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

Side by Side Diff: generated/googleapis/lib/androidenterprise/v1.dart

Issue 1078053002: Roll of googleapis as of 4/7/2015. (Closed) Base URL: https://github.com/dart-lang/googleapis.git@master
Patch Set: Created 5 years, 8 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 // This is a generated file (see the discoveryapis_generator project).
2
3 library googleapis.androidenterprise.v1;
4
5 import 'dart:core' as core;
6 import 'dart:collection' as collection_1;
7 import 'dart:async' as async;
8 import 'dart:convert' as convert;
9
10 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
11 import 'package:crypto/crypto.dart' as crypto;
12 import 'package:http/http.dart' as http;
13
14 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show
15 ApiRequestError, DetailedApiRequestError;
16
17 const core.String USER_AGENT = 'dart-api-client androidenterprise/v1';
18
19 /**
20 * Allows MDMs/EMMs and enterprises to manage the deployment of apps to Android
21 * for Work users.
22 */
23 class AndroidenterpriseApi {
24 /** Manage corporate Android devices */
25 static const AndroidenterpriseScope = "https://www.googleapis.com/auth/android enterprise";
26
27
28 final commons.ApiRequester _requester;
29
30 CollectionsResourceApi get collections => new CollectionsResourceApi(_requeste r);
31 CollectionviewersResourceApi get collectionviewers => new CollectionviewersRes ourceApi(_requester);
32 DevicesResourceApi get devices => new DevicesResourceApi(_requester);
33 EnterprisesResourceApi get enterprises => new EnterprisesResourceApi(_requeste r);
34 EntitlementsResourceApi get entitlements => new EntitlementsResourceApi(_reque ster);
35 GrouplicensesResourceApi get grouplicenses => new GrouplicensesResourceApi(_re quester);
36 GrouplicenseusersResourceApi get grouplicenseusers => new GrouplicenseusersRes ourceApi(_requester);
37 InstallsResourceApi get installs => new InstallsResourceApi(_requester);
38 PermissionsResourceApi get permissions => new PermissionsResourceApi(_requeste r);
39 ProductsResourceApi get products => new ProductsResourceApi(_requester);
40 UsersResourceApi get users => new UsersResourceApi(_requester);
41
42 AndroidenterpriseApi(http.Client client, {core.String rootUrl: "https://www.go ogleapis.com/", core.String servicePath: "androidenterprise/v1/"}) :
43 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT);
44 }
45
46
47 class CollectionsResourceApi {
48 final commons.ApiRequester _requester;
49
50 CollectionsResourceApi(commons.ApiRequester client) :
51 _requester = client;
52
53 /**
54 * Deletes a collection.
55 *
56 * Request parameters:
57 *
58 * [enterpriseId] - The ID of the enterprise.
59 *
60 * [collectionId] - The ID of the collection.
61 *
62 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
63 * error.
64 *
65 * If the used [http.Client] completes with an error when making a REST call,
66 * this method will complete with the same error.
67 */
68 async.Future delete(core.String enterpriseId, core.String collectionId) {
69 var _url = null;
70 var _queryParams = new core.Map();
71 var _uploadMedia = null;
72 var _uploadOptions = null;
73 var _downloadOptions = commons.DownloadOptions.Metadata;
74 var _body = null;
75
76 if (enterpriseId == null) {
77 throw new core.ArgumentError("Parameter enterpriseId is required.");
78 }
79 if (collectionId == null) {
80 throw new core.ArgumentError("Parameter collectionId is required.");
81 }
82
83 _downloadOptions = null;
84
85 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId');
86
87 var _response = _requester.request(_url,
88 "DELETE",
89 body: _body,
90 queryParams: _queryParams,
91 uploadOptions: _uploadOptions,
92 uploadMedia: _uploadMedia,
93 downloadOptions: _downloadOptions);
94 return _response.then((data) => null);
95 }
96
97 /**
98 * Retrieves the details of a collection.
99 *
100 * Request parameters:
101 *
102 * [enterpriseId] - The ID of the enterprise.
103 *
104 * [collectionId] - The ID of the collection.
105 *
106 * Completes with a [Collection].
107 *
108 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
109 * error.
110 *
111 * If the used [http.Client] completes with an error when making a REST call,
112 * this method will complete with the same error.
113 */
114 async.Future<Collection> get(core.String enterpriseId, core.String collectionI d) {
115 var _url = null;
116 var _queryParams = new core.Map();
117 var _uploadMedia = null;
118 var _uploadOptions = null;
119 var _downloadOptions = commons.DownloadOptions.Metadata;
120 var _body = null;
121
122 if (enterpriseId == null) {
123 throw new core.ArgumentError("Parameter enterpriseId is required.");
124 }
125 if (collectionId == null) {
126 throw new core.ArgumentError("Parameter collectionId is required.");
127 }
128
129
130 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId');
131
132 var _response = _requester.request(_url,
133 "GET",
134 body: _body,
135 queryParams: _queryParams,
136 uploadOptions: _uploadOptions,
137 uploadMedia: _uploadMedia,
138 downloadOptions: _downloadOptions);
139 return _response.then((data) => new Collection.fromJson(data));
140 }
141
142 /**
143 * Creates a new collection.
144 *
145 * [request] - The metadata request object.
146 *
147 * Request parameters:
148 *
149 * [enterpriseId] - The ID of the enterprise.
150 *
151 * Completes with a [Collection].
152 *
153 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
154 * error.
155 *
156 * If the used [http.Client] completes with an error when making a REST call,
157 * this method will complete with the same error.
158 */
159 async.Future<Collection> insert(Collection request, core.String enterpriseId) {
160 var _url = null;
161 var _queryParams = new core.Map();
162 var _uploadMedia = null;
163 var _uploadOptions = null;
164 var _downloadOptions = commons.DownloadOptions.Metadata;
165 var _body = null;
166
167 if (request != null) {
168 _body = convert.JSON.encode((request).toJson());
169 }
170 if (enterpriseId == null) {
171 throw new core.ArgumentError("Parameter enterpriseId is required.");
172 }
173
174
175 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections';
176
177 var _response = _requester.request(_url,
178 "POST",
179 body: _body,
180 queryParams: _queryParams,
181 uploadOptions: _uploadOptions,
182 uploadMedia: _uploadMedia,
183 downloadOptions: _downloadOptions);
184 return _response.then((data) => new Collection.fromJson(data));
185 }
186
187 /**
188 * Retrieves the IDs of all the collections for an enterprise.
189 *
190 * Request parameters:
191 *
192 * [enterpriseId] - The ID of the enterprise.
193 *
194 * Completes with a [CollectionsListResponse].
195 *
196 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
197 * error.
198 *
199 * If the used [http.Client] completes with an error when making a REST call,
200 * this method will complete with the same error.
201 */
202 async.Future<CollectionsListResponse> list(core.String enterpriseId) {
203 var _url = null;
204 var _queryParams = new core.Map();
205 var _uploadMedia = null;
206 var _uploadOptions = null;
207 var _downloadOptions = commons.DownloadOptions.Metadata;
208 var _body = null;
209
210 if (enterpriseId == null) {
211 throw new core.ArgumentError("Parameter enterpriseId is required.");
212 }
213
214
215 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections';
216
217 var _response = _requester.request(_url,
218 "GET",
219 body: _body,
220 queryParams: _queryParams,
221 uploadOptions: _uploadOptions,
222 uploadMedia: _uploadMedia,
223 downloadOptions: _downloadOptions);
224 return _response.then((data) => new CollectionsListResponse.fromJson(data));
225 }
226
227 /**
228 * Updates a collection. This method supports patch semantics.
229 *
230 * [request] - The metadata request object.
231 *
232 * Request parameters:
233 *
234 * [enterpriseId] - The ID of the enterprise.
235 *
236 * [collectionId] - The ID of the collection.
237 *
238 * Completes with a [Collection].
239 *
240 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
241 * error.
242 *
243 * If the used [http.Client] completes with an error when making a REST call,
244 * this method will complete with the same error.
245 */
246 async.Future<Collection> patch(Collection request, core.String enterpriseId, c ore.String collectionId) {
247 var _url = null;
248 var _queryParams = new core.Map();
249 var _uploadMedia = null;
250 var _uploadOptions = null;
251 var _downloadOptions = commons.DownloadOptions.Metadata;
252 var _body = null;
253
254 if (request != null) {
255 _body = convert.JSON.encode((request).toJson());
256 }
257 if (enterpriseId == null) {
258 throw new core.ArgumentError("Parameter enterpriseId is required.");
259 }
260 if (collectionId == null) {
261 throw new core.ArgumentError("Parameter collectionId is required.");
262 }
263
264
265 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId');
266
267 var _response = _requester.request(_url,
268 "PATCH",
269 body: _body,
270 queryParams: _queryParams,
271 uploadOptions: _uploadOptions,
272 uploadMedia: _uploadMedia,
273 downloadOptions: _downloadOptions);
274 return _response.then((data) => new Collection.fromJson(data));
275 }
276
277 /**
278 * Updates a collection.
279 *
280 * [request] - The metadata request object.
281 *
282 * Request parameters:
283 *
284 * [enterpriseId] - The ID of the enterprise.
285 *
286 * [collectionId] - The ID of the collection.
287 *
288 * Completes with a [Collection].
289 *
290 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
291 * error.
292 *
293 * If the used [http.Client] completes with an error when making a REST call,
294 * this method will complete with the same error.
295 */
296 async.Future<Collection> update(Collection request, core.String enterpriseId, core.String collectionId) {
297 var _url = null;
298 var _queryParams = new core.Map();
299 var _uploadMedia = null;
300 var _uploadOptions = null;
301 var _downloadOptions = commons.DownloadOptions.Metadata;
302 var _body = null;
303
304 if (request != null) {
305 _body = convert.JSON.encode((request).toJson());
306 }
307 if (enterpriseId == null) {
308 throw new core.ArgumentError("Parameter enterpriseId is required.");
309 }
310 if (collectionId == null) {
311 throw new core.ArgumentError("Parameter collectionId is required.");
312 }
313
314
315 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId');
316
317 var _response = _requester.request(_url,
318 "PUT",
319 body: _body,
320 queryParams: _queryParams,
321 uploadOptions: _uploadOptions,
322 uploadMedia: _uploadMedia,
323 downloadOptions: _downloadOptions);
324 return _response.then((data) => new Collection.fromJson(data));
325 }
326
327 }
328
329
330 class CollectionviewersResourceApi {
331 final commons.ApiRequester _requester;
332
333 CollectionviewersResourceApi(commons.ApiRequester client) :
334 _requester = client;
335
336 /**
337 * Removes the user from the list of those specifically allowed to see the
338 * collection. If the collection's visibility is set to viewersOnly then only
339 * such users will see the collection.
340 *
341 * Request parameters:
342 *
343 * [enterpriseId] - The ID of the enterprise.
344 *
345 * [collectionId] - The ID of the collection.
346 *
347 * [userId] - The ID of the user.
348 *
349 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
350 * error.
351 *
352 * If the used [http.Client] completes with an error when making a REST call,
353 * this method will complete with the same error.
354 */
355 async.Future delete(core.String enterpriseId, core.String collectionId, core.S tring userId) {
356 var _url = null;
357 var _queryParams = new core.Map();
358 var _uploadMedia = null;
359 var _uploadOptions = null;
360 var _downloadOptions = commons.DownloadOptions.Metadata;
361 var _body = null;
362
363 if (enterpriseId == null) {
364 throw new core.ArgumentError("Parameter enterpriseId is required.");
365 }
366 if (collectionId == null) {
367 throw new core.ArgumentError("Parameter collectionId is required.");
368 }
369 if (userId == null) {
370 throw new core.ArgumentError("Parameter userId is required.");
371 }
372
373 _downloadOptions = null;
374
375 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId') + '/users/' + comm ons.Escaper.ecapeVariable('$userId');
376
377 var _response = _requester.request(_url,
378 "DELETE",
379 body: _body,
380 queryParams: _queryParams,
381 uploadOptions: _uploadOptions,
382 uploadMedia: _uploadMedia,
383 downloadOptions: _downloadOptions);
384 return _response.then((data) => null);
385 }
386
387 /**
388 * Retrieves the ID of the user if they have been specifically allowed to see
389 * the collection. If the collection's visibility is set to viewersOnly then
390 * only these users will see the collection.
391 *
392 * Request parameters:
393 *
394 * [enterpriseId] - The ID of the enterprise.
395 *
396 * [collectionId] - The ID of the collection.
397 *
398 * [userId] - The ID of the user.
399 *
400 * Completes with a [User].
401 *
402 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
403 * error.
404 *
405 * If the used [http.Client] completes with an error when making a REST call,
406 * this method will complete with the same error.
407 */
408 async.Future<User> get(core.String enterpriseId, core.String collectionId, cor e.String userId) {
409 var _url = null;
410 var _queryParams = new core.Map();
411 var _uploadMedia = null;
412 var _uploadOptions = null;
413 var _downloadOptions = commons.DownloadOptions.Metadata;
414 var _body = null;
415
416 if (enterpriseId == null) {
417 throw new core.ArgumentError("Parameter enterpriseId is required.");
418 }
419 if (collectionId == null) {
420 throw new core.ArgumentError("Parameter collectionId is required.");
421 }
422 if (userId == null) {
423 throw new core.ArgumentError("Parameter userId is required.");
424 }
425
426
427 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId') + '/users/' + comm ons.Escaper.ecapeVariable('$userId');
428
429 var _response = _requester.request(_url,
430 "GET",
431 body: _body,
432 queryParams: _queryParams,
433 uploadOptions: _uploadOptions,
434 uploadMedia: _uploadMedia,
435 downloadOptions: _downloadOptions);
436 return _response.then((data) => new User.fromJson(data));
437 }
438
439 /**
440 * Retrieves the IDs of the users who have been specifically allowed to see
441 * the collection. If the collection's visibility is set to viewersOnly then
442 * only these users will see the collection.
443 *
444 * Request parameters:
445 *
446 * [enterpriseId] - The ID of the enterprise.
447 *
448 * [collectionId] - The ID of the collection.
449 *
450 * Completes with a [CollectionViewersListResponse].
451 *
452 * Completes with a [commons.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<CollectionViewersListResponse> list(core.String enterpriseId, cor e.String collectionId) {
459 var _url = null;
460 var _queryParams = new core.Map();
461 var _uploadMedia = null;
462 var _uploadOptions = null;
463 var _downloadOptions = commons.DownloadOptions.Metadata;
464 var _body = null;
465
466 if (enterpriseId == null) {
467 throw new core.ArgumentError("Parameter enterpriseId is required.");
468 }
469 if (collectionId == null) {
470 throw new core.ArgumentError("Parameter collectionId is required.");
471 }
472
473
474 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId') + '/users';
475
476 var _response = _requester.request(_url,
477 "GET",
478 body: _body,
479 queryParams: _queryParams,
480 uploadOptions: _uploadOptions,
481 uploadMedia: _uploadMedia,
482 downloadOptions: _downloadOptions);
483 return _response.then((data) => new CollectionViewersListResponse.fromJson(d ata));
484 }
485
486 /**
487 * Adds the user to the list of those specifically allowed to see the
488 * collection. If the collection's visibility is set to viewersOnly then only
489 * such users will see the collection. This method supports patch semantics.
490 *
491 * [request] - The metadata request object.
492 *
493 * Request parameters:
494 *
495 * [enterpriseId] - The ID of the enterprise.
496 *
497 * [collectionId] - The ID of the collection.
498 *
499 * [userId] - The ID of the user.
500 *
501 * Completes with a [User].
502 *
503 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
504 * error.
505 *
506 * If the used [http.Client] completes with an error when making a REST call,
507 * this method will complete with the same error.
508 */
509 async.Future<User> patch(User request, core.String enterpriseId, core.String c ollectionId, core.String userId) {
510 var _url = null;
511 var _queryParams = new core.Map();
512 var _uploadMedia = null;
513 var _uploadOptions = null;
514 var _downloadOptions = commons.DownloadOptions.Metadata;
515 var _body = null;
516
517 if (request != null) {
518 _body = convert.JSON.encode((request).toJson());
519 }
520 if (enterpriseId == null) {
521 throw new core.ArgumentError("Parameter enterpriseId is required.");
522 }
523 if (collectionId == null) {
524 throw new core.ArgumentError("Parameter collectionId is required.");
525 }
526 if (userId == null) {
527 throw new core.ArgumentError("Parameter userId is required.");
528 }
529
530
531 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId') + '/users/' + comm ons.Escaper.ecapeVariable('$userId');
532
533 var _response = _requester.request(_url,
534 "PATCH",
535 body: _body,
536 queryParams: _queryParams,
537 uploadOptions: _uploadOptions,
538 uploadMedia: _uploadMedia,
539 downloadOptions: _downloadOptions);
540 return _response.then((data) => new User.fromJson(data));
541 }
542
543 /**
544 * Adds the user to the list of those specifically allowed to see the
545 * collection. If the collection's visibility is set to viewersOnly then only
546 * such users will see the collection.
547 *
548 * [request] - The metadata request object.
549 *
550 * Request parameters:
551 *
552 * [enterpriseId] - The ID of the enterprise.
553 *
554 * [collectionId] - The ID of the collection.
555 *
556 * [userId] - The ID of the user.
557 *
558 * Completes with a [User].
559 *
560 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
561 * error.
562 *
563 * If the used [http.Client] completes with an error when making a REST call,
564 * this method will complete with the same error.
565 */
566 async.Future<User> update(User request, core.String enterpriseId, core.String collectionId, core.String userId) {
567 var _url = null;
568 var _queryParams = new core.Map();
569 var _uploadMedia = null;
570 var _uploadOptions = null;
571 var _downloadOptions = commons.DownloadOptions.Metadata;
572 var _body = null;
573
574 if (request != null) {
575 _body = convert.JSON.encode((request).toJson());
576 }
577 if (enterpriseId == null) {
578 throw new core.ArgumentError("Parameter enterpriseId is required.");
579 }
580 if (collectionId == null) {
581 throw new core.ArgumentError("Parameter collectionId is required.");
582 }
583 if (userId == null) {
584 throw new core.ArgumentError("Parameter userId is required.");
585 }
586
587
588 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/c ollections/' + commons.Escaper.ecapeVariable('$collectionId') + '/users/' + comm ons.Escaper.ecapeVariable('$userId');
589
590 var _response = _requester.request(_url,
591 "PUT",
592 body: _body,
593 queryParams: _queryParams,
594 uploadOptions: _uploadOptions,
595 uploadMedia: _uploadMedia,
596 downloadOptions: _downloadOptions);
597 return _response.then((data) => new User.fromJson(data));
598 }
599
600 }
601
602
603 class DevicesResourceApi {
604 final commons.ApiRequester _requester;
605
606 DevicesResourceApi(commons.ApiRequester client) :
607 _requester = client;
608
609 /**
610 * Retrieves the details of a device.
611 *
612 * Request parameters:
613 *
614 * [enterpriseId] - The ID of the enterprise.
615 *
616 * [userId] - The ID of the user.
617 *
618 * [deviceId] - The ID of the device.
619 *
620 * Completes with a [Device].
621 *
622 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
623 * error.
624 *
625 * If the used [http.Client] completes with an error when making a REST call,
626 * this method will complete with the same error.
627 */
628 async.Future<Device> get(core.String enterpriseId, core.String userId, core.St ring deviceId) {
629 var _url = null;
630 var _queryParams = new core.Map();
631 var _uploadMedia = null;
632 var _uploadOptions = null;
633 var _downloadOptions = commons.DownloadOptions.Metadata;
634 var _body = null;
635
636 if (enterpriseId == null) {
637 throw new core.ArgumentError("Parameter enterpriseId is required.");
638 }
639 if (userId == null) {
640 throw new core.ArgumentError("Parameter userId is required.");
641 }
642 if (deviceId == null) {
643 throw new core.ArgumentError("Parameter deviceId is required.");
644 }
645
646
647 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId');
648
649 var _response = _requester.request(_url,
650 "GET",
651 body: _body,
652 queryParams: _queryParams,
653 uploadOptions: _uploadOptions,
654 uploadMedia: _uploadMedia,
655 downloadOptions: _downloadOptions);
656 return _response.then((data) => new Device.fromJson(data));
657 }
658
659 /**
660 * Retrieves whether a device is enabled or disabled for access by the user to
661 * Google services. The device state takes effect only if enforcing EMM
662 * policies on Android devices is enabled in the Google Admin Console.
663 * Otherwise, the device state is ignored and all devices are allowed access
664 * to Google services.
665 *
666 * Request parameters:
667 *
668 * [enterpriseId] - The ID of the enterprise.
669 *
670 * [userId] - The ID of the user.
671 *
672 * [deviceId] - The ID of the device.
673 *
674 * Completes with a [DeviceState].
675 *
676 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
677 * error.
678 *
679 * If the used [http.Client] completes with an error when making a REST call,
680 * this method will complete with the same error.
681 */
682 async.Future<DeviceState> getState(core.String enterpriseId, core.String userI d, core.String deviceId) {
683 var _url = null;
684 var _queryParams = new core.Map();
685 var _uploadMedia = null;
686 var _uploadOptions = null;
687 var _downloadOptions = commons.DownloadOptions.Metadata;
688 var _body = null;
689
690 if (enterpriseId == null) {
691 throw new core.ArgumentError("Parameter enterpriseId is required.");
692 }
693 if (userId == null) {
694 throw new core.ArgumentError("Parameter userId is required.");
695 }
696 if (deviceId == null) {
697 throw new core.ArgumentError("Parameter deviceId is required.");
698 }
699
700
701 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId') + '/state';
702
703 var _response = _requester.request(_url,
704 "GET",
705 body: _body,
706 queryParams: _queryParams,
707 uploadOptions: _uploadOptions,
708 uploadMedia: _uploadMedia,
709 downloadOptions: _downloadOptions);
710 return _response.then((data) => new DeviceState.fromJson(data));
711 }
712
713 /**
714 * Retrieves the IDs of all of a user's devices.
715 *
716 * Request parameters:
717 *
718 * [enterpriseId] - The ID of the enterprise.
719 *
720 * [userId] - The ID of the user.
721 *
722 * Completes with a [DevicesListResponse].
723 *
724 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
725 * error.
726 *
727 * If the used [http.Client] completes with an error when making a REST call,
728 * this method will complete with the same error.
729 */
730 async.Future<DevicesListResponse> list(core.String enterpriseId, core.String u serId) {
731 var _url = null;
732 var _queryParams = new core.Map();
733 var _uploadMedia = null;
734 var _uploadOptions = null;
735 var _downloadOptions = commons.DownloadOptions.Metadata;
736 var _body = null;
737
738 if (enterpriseId == null) {
739 throw new core.ArgumentError("Parameter enterpriseId is required.");
740 }
741 if (userId == null) {
742 throw new core.ArgumentError("Parameter userId is required.");
743 }
744
745
746 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices';
747
748 var _response = _requester.request(_url,
749 "GET",
750 body: _body,
751 queryParams: _queryParams,
752 uploadOptions: _uploadOptions,
753 uploadMedia: _uploadMedia,
754 downloadOptions: _downloadOptions);
755 return _response.then((data) => new DevicesListResponse.fromJson(data));
756 }
757
758 /**
759 * Sets whether a device is enabled or disabled for access by the user to
760 * Google services. The device state takes effect only if enforcing EMM
761 * policies on Android devices is enabled in the Google Admin Console.
762 * Otherwise, the device state is ignored and all devices are allowed access
763 * to Google services.
764 *
765 * [request] - The metadata request object.
766 *
767 * Request parameters:
768 *
769 * [enterpriseId] - The ID of the enterprise.
770 *
771 * [userId] - The ID of the user.
772 *
773 * [deviceId] - The ID of the device.
774 *
775 * Completes with a [DeviceState].
776 *
777 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
778 * error.
779 *
780 * If the used [http.Client] completes with an error when making a REST call,
781 * this method will complete with the same error.
782 */
783 async.Future<DeviceState> setState(DeviceState request, core.String enterprise Id, core.String userId, core.String deviceId) {
784 var _url = null;
785 var _queryParams = new core.Map();
786 var _uploadMedia = null;
787 var _uploadOptions = null;
788 var _downloadOptions = commons.DownloadOptions.Metadata;
789 var _body = null;
790
791 if (request != null) {
792 _body = convert.JSON.encode((request).toJson());
793 }
794 if (enterpriseId == null) {
795 throw new core.ArgumentError("Parameter enterpriseId is required.");
796 }
797 if (userId == null) {
798 throw new core.ArgumentError("Parameter userId is required.");
799 }
800 if (deviceId == null) {
801 throw new core.ArgumentError("Parameter deviceId is required.");
802 }
803
804
805 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId') + '/state';
806
807 var _response = _requester.request(_url,
808 "PUT",
809 body: _body,
810 queryParams: _queryParams,
811 uploadOptions: _uploadOptions,
812 uploadMedia: _uploadMedia,
813 downloadOptions: _downloadOptions);
814 return _response.then((data) => new DeviceState.fromJson(data));
815 }
816
817 }
818
819
820 class EnterprisesResourceApi {
821 final commons.ApiRequester _requester;
822
823 EnterprisesResourceApi(commons.ApiRequester client) :
824 _requester = client;
825
826 /**
827 * Deletes the binding between the MDM and enterprise. This is now deprecated;
828 * use this to unenroll customers that were previously enrolled with the
829 * 'insert' call, then enroll them again with the 'enroll' call.
830 *
831 * Request parameters:
832 *
833 * [enterpriseId] - The ID of the enterprise.
834 *
835 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
836 * error.
837 *
838 * If the used [http.Client] completes with an error when making a REST call,
839 * this method will complete with the same error.
840 */
841 async.Future delete(core.String enterpriseId) {
842 var _url = null;
843 var _queryParams = new core.Map();
844 var _uploadMedia = null;
845 var _uploadOptions = null;
846 var _downloadOptions = commons.DownloadOptions.Metadata;
847 var _body = null;
848
849 if (enterpriseId == null) {
850 throw new core.ArgumentError("Parameter enterpriseId is required.");
851 }
852
853 _downloadOptions = null;
854
855 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId');
856
857 var _response = _requester.request(_url,
858 "DELETE",
859 body: _body,
860 queryParams: _queryParams,
861 uploadOptions: _uploadOptions,
862 uploadMedia: _uploadMedia,
863 downloadOptions: _downloadOptions);
864 return _response.then((data) => null);
865 }
866
867 /**
868 * Enrolls an enterprise with the calling MDM.
869 *
870 * [request] - The metadata request object.
871 *
872 * Request parameters:
873 *
874 * [token] - The token provided by the enterprise to register the MDM.
875 *
876 * Completes with a [Enterprise].
877 *
878 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
879 * error.
880 *
881 * If the used [http.Client] completes with an error when making a REST call,
882 * this method will complete with the same error.
883 */
884 async.Future<Enterprise> enroll(Enterprise request, core.String token) {
885 var _url = null;
886 var _queryParams = new core.Map();
887 var _uploadMedia = null;
888 var _uploadOptions = null;
889 var _downloadOptions = commons.DownloadOptions.Metadata;
890 var _body = null;
891
892 if (request != null) {
893 _body = convert.JSON.encode((request).toJson());
894 }
895 if (token == null) {
896 throw new core.ArgumentError("Parameter token is required.");
897 }
898 _queryParams["token"] = [token];
899
900
901 _url = 'enterprises/enroll';
902
903 var _response = _requester.request(_url,
904 "POST",
905 body: _body,
906 queryParams: _queryParams,
907 uploadOptions: _uploadOptions,
908 uploadMedia: _uploadMedia,
909 downloadOptions: _downloadOptions);
910 return _response.then((data) => new Enterprise.fromJson(data));
911 }
912
913 /**
914 * Retrieves the name and domain of an enterprise.
915 *
916 * Request parameters:
917 *
918 * [enterpriseId] - The ID of the enterprise.
919 *
920 * Completes with a [Enterprise].
921 *
922 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
923 * error.
924 *
925 * If the used [http.Client] completes with an error when making a REST call,
926 * this method will complete with the same error.
927 */
928 async.Future<Enterprise> get(core.String enterpriseId) {
929 var _url = null;
930 var _queryParams = new core.Map();
931 var _uploadMedia = null;
932 var _uploadOptions = null;
933 var _downloadOptions = commons.DownloadOptions.Metadata;
934 var _body = null;
935
936 if (enterpriseId == null) {
937 throw new core.ArgumentError("Parameter enterpriseId is required.");
938 }
939
940
941 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId');
942
943 var _response = _requester.request(_url,
944 "GET",
945 body: _body,
946 queryParams: _queryParams,
947 uploadOptions: _uploadOptions,
948 uploadMedia: _uploadMedia,
949 downloadOptions: _downloadOptions);
950 return _response.then((data) => new Enterprise.fromJson(data));
951 }
952
953 /**
954 * Establishes the binding between the MDM and an enterprise. This is now
955 * deprecated; use enroll instead.
956 *
957 * [request] - The metadata request object.
958 *
959 * Request parameters:
960 *
961 * [token] - The token provided by the enterprise to register the MDM.
962 *
963 * Completes with a [Enterprise].
964 *
965 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
966 * error.
967 *
968 * If the used [http.Client] completes with an error when making a REST call,
969 * this method will complete with the same error.
970 */
971 async.Future<Enterprise> insert(Enterprise request, core.String token) {
972 var _url = null;
973 var _queryParams = new core.Map();
974 var _uploadMedia = null;
975 var _uploadOptions = null;
976 var _downloadOptions = commons.DownloadOptions.Metadata;
977 var _body = null;
978
979 if (request != null) {
980 _body = convert.JSON.encode((request).toJson());
981 }
982 if (token == null) {
983 throw new core.ArgumentError("Parameter token is required.");
984 }
985 _queryParams["token"] = [token];
986
987
988 _url = 'enterprises';
989
990 var _response = _requester.request(_url,
991 "POST",
992 body: _body,
993 queryParams: _queryParams,
994 uploadOptions: _uploadOptions,
995 uploadMedia: _uploadMedia,
996 downloadOptions: _downloadOptions);
997 return _response.then((data) => new Enterprise.fromJson(data));
998 }
999
1000 /**
1001 * Looks up an enterprise by domain name.
1002 *
1003 * Request parameters:
1004 *
1005 * [domain] - The exact primary domain name of the enterprise to look up.
1006 *
1007 * Completes with a [EnterprisesListResponse].
1008 *
1009 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1010 * error.
1011 *
1012 * If the used [http.Client] completes with an error when making a REST call,
1013 * this method will complete with the same error.
1014 */
1015 async.Future<EnterprisesListResponse> list(core.String domain) {
1016 var _url = null;
1017 var _queryParams = new core.Map();
1018 var _uploadMedia = null;
1019 var _uploadOptions = null;
1020 var _downloadOptions = commons.DownloadOptions.Metadata;
1021 var _body = null;
1022
1023 if (domain == null) {
1024 throw new core.ArgumentError("Parameter domain is required.");
1025 }
1026 _queryParams["domain"] = [domain];
1027
1028
1029 _url = 'enterprises';
1030
1031 var _response = _requester.request(_url,
1032 "GET",
1033 body: _body,
1034 queryParams: _queryParams,
1035 uploadOptions: _uploadOptions,
1036 uploadMedia: _uploadMedia,
1037 downloadOptions: _downloadOptions);
1038 return _response.then((data) => new EnterprisesListResponse.fromJson(data));
1039 }
1040
1041 /**
1042 * Set the account that will be used to authenticate to the API as the
1043 * enterprise.
1044 *
1045 * [request] - The metadata request object.
1046 *
1047 * Request parameters:
1048 *
1049 * [enterpriseId] - The ID of the enterprise.
1050 *
1051 * Completes with a [EnterpriseAccount].
1052 *
1053 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1054 * error.
1055 *
1056 * If the used [http.Client] completes with an error when making a REST call,
1057 * this method will complete with the same error.
1058 */
1059 async.Future<EnterpriseAccount> setAccount(EnterpriseAccount request, core.Str ing enterpriseId) {
1060 var _url = null;
1061 var _queryParams = new core.Map();
1062 var _uploadMedia = null;
1063 var _uploadOptions = null;
1064 var _downloadOptions = commons.DownloadOptions.Metadata;
1065 var _body = null;
1066
1067 if (request != null) {
1068 _body = convert.JSON.encode((request).toJson());
1069 }
1070 if (enterpriseId == null) {
1071 throw new core.ArgumentError("Parameter enterpriseId is required.");
1072 }
1073
1074
1075 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/a ccount';
1076
1077 var _response = _requester.request(_url,
1078 "PUT",
1079 body: _body,
1080 queryParams: _queryParams,
1081 uploadOptions: _uploadOptions,
1082 uploadMedia: _uploadMedia,
1083 downloadOptions: _downloadOptions);
1084 return _response.then((data) => new EnterpriseAccount.fromJson(data));
1085 }
1086
1087 /**
1088 * Unenrolls an enterprise from the calling MDM.
1089 *
1090 * Request parameters:
1091 *
1092 * [enterpriseId] - The ID of the enterprise.
1093 *
1094 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1095 * error.
1096 *
1097 * If the used [http.Client] completes with an error when making a REST call,
1098 * this method will complete with the same error.
1099 */
1100 async.Future unenroll(core.String enterpriseId) {
1101 var _url = null;
1102 var _queryParams = new core.Map();
1103 var _uploadMedia = null;
1104 var _uploadOptions = null;
1105 var _downloadOptions = commons.DownloadOptions.Metadata;
1106 var _body = null;
1107
1108 if (enterpriseId == null) {
1109 throw new core.ArgumentError("Parameter enterpriseId is required.");
1110 }
1111
1112 _downloadOptions = null;
1113
1114 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u nenroll';
1115
1116 var _response = _requester.request(_url,
1117 "POST",
1118 body: _body,
1119 queryParams: _queryParams,
1120 uploadOptions: _uploadOptions,
1121 uploadMedia: _uploadMedia,
1122 downloadOptions: _downloadOptions);
1123 return _response.then((data) => null);
1124 }
1125
1126 }
1127
1128
1129 class EntitlementsResourceApi {
1130 final commons.ApiRequester _requester;
1131
1132 EntitlementsResourceApi(commons.ApiRequester client) :
1133 _requester = client;
1134
1135 /**
1136 * Removes an entitlement to an app for a user and uninstalls it.
1137 *
1138 * Request parameters:
1139 *
1140 * [enterpriseId] - The ID of the enterprise.
1141 *
1142 * [userId] - The ID of the user.
1143 *
1144 * [entitlementId] - The ID of the entitlement, e.g.
1145 * "app:com.google.android.gm".
1146 *
1147 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1148 * error.
1149 *
1150 * If the used [http.Client] completes with an error when making a REST call,
1151 * this method will complete with the same error.
1152 */
1153 async.Future delete(core.String enterpriseId, core.String userId, core.String entitlementId) {
1154 var _url = null;
1155 var _queryParams = new core.Map();
1156 var _uploadMedia = null;
1157 var _uploadOptions = null;
1158 var _downloadOptions = commons.DownloadOptions.Metadata;
1159 var _body = null;
1160
1161 if (enterpriseId == null) {
1162 throw new core.ArgumentError("Parameter enterpriseId is required.");
1163 }
1164 if (userId == null) {
1165 throw new core.ArgumentError("Parameter userId is required.");
1166 }
1167 if (entitlementId == null) {
1168 throw new core.ArgumentError("Parameter entitlementId is required.");
1169 }
1170
1171 _downloadOptions = null;
1172
1173 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/entitlements/' + commons.E scaper.ecapeVariable('$entitlementId');
1174
1175 var _response = _requester.request(_url,
1176 "DELETE",
1177 body: _body,
1178 queryParams: _queryParams,
1179 uploadOptions: _uploadOptions,
1180 uploadMedia: _uploadMedia,
1181 downloadOptions: _downloadOptions);
1182 return _response.then((data) => null);
1183 }
1184
1185 /**
1186 * Retrieves details of an entitlement.
1187 *
1188 * Request parameters:
1189 *
1190 * [enterpriseId] - The ID of the enterprise.
1191 *
1192 * [userId] - The ID of the user.
1193 *
1194 * [entitlementId] - The ID of the entitlement, e.g.
1195 * "app:com.google.android.gm".
1196 *
1197 * Completes with a [Entitlement].
1198 *
1199 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1200 * error.
1201 *
1202 * If the used [http.Client] completes with an error when making a REST call,
1203 * this method will complete with the same error.
1204 */
1205 async.Future<Entitlement> get(core.String enterpriseId, core.String userId, co re.String entitlementId) {
1206 var _url = null;
1207 var _queryParams = new core.Map();
1208 var _uploadMedia = null;
1209 var _uploadOptions = null;
1210 var _downloadOptions = commons.DownloadOptions.Metadata;
1211 var _body = null;
1212
1213 if (enterpriseId == null) {
1214 throw new core.ArgumentError("Parameter enterpriseId is required.");
1215 }
1216 if (userId == null) {
1217 throw new core.ArgumentError("Parameter userId is required.");
1218 }
1219 if (entitlementId == null) {
1220 throw new core.ArgumentError("Parameter entitlementId is required.");
1221 }
1222
1223
1224 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/entitlements/' + commons.E scaper.ecapeVariable('$entitlementId');
1225
1226 var _response = _requester.request(_url,
1227 "GET",
1228 body: _body,
1229 queryParams: _queryParams,
1230 uploadOptions: _uploadOptions,
1231 uploadMedia: _uploadMedia,
1232 downloadOptions: _downloadOptions);
1233 return _response.then((data) => new Entitlement.fromJson(data));
1234 }
1235
1236 /**
1237 * List of all entitlements for the specified user. Only the ID is set.
1238 *
1239 * Request parameters:
1240 *
1241 * [enterpriseId] - The ID of the enterprise.
1242 *
1243 * [userId] - The ID of the user.
1244 *
1245 * Completes with a [EntitlementsListResponse].
1246 *
1247 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1248 * error.
1249 *
1250 * If the used [http.Client] completes with an error when making a REST call,
1251 * this method will complete with the same error.
1252 */
1253 async.Future<EntitlementsListResponse> list(core.String enterpriseId, core.Str ing userId) {
1254 var _url = null;
1255 var _queryParams = new core.Map();
1256 var _uploadMedia = null;
1257 var _uploadOptions = null;
1258 var _downloadOptions = commons.DownloadOptions.Metadata;
1259 var _body = null;
1260
1261 if (enterpriseId == null) {
1262 throw new core.ArgumentError("Parameter enterpriseId is required.");
1263 }
1264 if (userId == null) {
1265 throw new core.ArgumentError("Parameter userId is required.");
1266 }
1267
1268
1269 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/entitlements';
1270
1271 var _response = _requester.request(_url,
1272 "GET",
1273 body: _body,
1274 queryParams: _queryParams,
1275 uploadOptions: _uploadOptions,
1276 uploadMedia: _uploadMedia,
1277 downloadOptions: _downloadOptions);
1278 return _response.then((data) => new EntitlementsListResponse.fromJson(data)) ;
1279 }
1280
1281 /**
1282 * Adds or updates an entitlement to an app for a user. This method supports
1283 * patch semantics.
1284 *
1285 * [request] - The metadata request object.
1286 *
1287 * Request parameters:
1288 *
1289 * [enterpriseId] - The ID of the enterprise.
1290 *
1291 * [userId] - The ID of the user.
1292 *
1293 * [entitlementId] - The ID of the entitlement, e.g.
1294 * "app:com.google.android.gm".
1295 *
1296 * [install] - Set to true to also install the product on all the user's
1297 * devices where possible. Failure to install on one or more devices will not
1298 * prevent this operation from returning successfully, as long as the
1299 * entitlement was successfully assigned to the user.
1300 *
1301 * Completes with a [Entitlement].
1302 *
1303 * Completes with a [commons.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<Entitlement> patch(Entitlement request, core.String enterpriseId, core.String userId, core.String entitlementId, {core.bool install}) {
1310 var _url = null;
1311 var _queryParams = new core.Map();
1312 var _uploadMedia = null;
1313 var _uploadOptions = null;
1314 var _downloadOptions = commons.DownloadOptions.Metadata;
1315 var _body = null;
1316
1317 if (request != null) {
1318 _body = convert.JSON.encode((request).toJson());
1319 }
1320 if (enterpriseId == null) {
1321 throw new core.ArgumentError("Parameter enterpriseId is required.");
1322 }
1323 if (userId == null) {
1324 throw new core.ArgumentError("Parameter userId is required.");
1325 }
1326 if (entitlementId == null) {
1327 throw new core.ArgumentError("Parameter entitlementId is required.");
1328 }
1329 if (install != null) {
1330 _queryParams["install"] = ["${install}"];
1331 }
1332
1333
1334 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/entitlements/' + commons.E scaper.ecapeVariable('$entitlementId');
1335
1336 var _response = _requester.request(_url,
1337 "PATCH",
1338 body: _body,
1339 queryParams: _queryParams,
1340 uploadOptions: _uploadOptions,
1341 uploadMedia: _uploadMedia,
1342 downloadOptions: _downloadOptions);
1343 return _response.then((data) => new Entitlement.fromJson(data));
1344 }
1345
1346 /**
1347 * Adds or updates an entitlement to an app for a user.
1348 *
1349 * [request] - The metadata request object.
1350 *
1351 * Request parameters:
1352 *
1353 * [enterpriseId] - The ID of the enterprise.
1354 *
1355 * [userId] - The ID of the user.
1356 *
1357 * [entitlementId] - The ID of the entitlement, e.g.
1358 * "app:com.google.android.gm".
1359 *
1360 * [install] - Set to true to also install the product on all the user's
1361 * devices where possible. Failure to install on one or more devices will not
1362 * prevent this operation from returning successfully, as long as the
1363 * entitlement was successfully assigned to the user.
1364 *
1365 * Completes with a [Entitlement].
1366 *
1367 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1368 * error.
1369 *
1370 * If the used [http.Client] completes with an error when making a REST call,
1371 * this method will complete with the same error.
1372 */
1373 async.Future<Entitlement> update(Entitlement request, core.String enterpriseId , core.String userId, core.String entitlementId, {core.bool install}) {
1374 var _url = null;
1375 var _queryParams = new core.Map();
1376 var _uploadMedia = null;
1377 var _uploadOptions = null;
1378 var _downloadOptions = commons.DownloadOptions.Metadata;
1379 var _body = null;
1380
1381 if (request != null) {
1382 _body = convert.JSON.encode((request).toJson());
1383 }
1384 if (enterpriseId == null) {
1385 throw new core.ArgumentError("Parameter enterpriseId is required.");
1386 }
1387 if (userId == null) {
1388 throw new core.ArgumentError("Parameter userId is required.");
1389 }
1390 if (entitlementId == null) {
1391 throw new core.ArgumentError("Parameter entitlementId is required.");
1392 }
1393 if (install != null) {
1394 _queryParams["install"] = ["${install}"];
1395 }
1396
1397
1398 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/entitlements/' + commons.E scaper.ecapeVariable('$entitlementId');
1399
1400 var _response = _requester.request(_url,
1401 "PUT",
1402 body: _body,
1403 queryParams: _queryParams,
1404 uploadOptions: _uploadOptions,
1405 uploadMedia: _uploadMedia,
1406 downloadOptions: _downloadOptions);
1407 return _response.then((data) => new Entitlement.fromJson(data));
1408 }
1409
1410 }
1411
1412
1413 class GrouplicensesResourceApi {
1414 final commons.ApiRequester _requester;
1415
1416 GrouplicensesResourceApi(commons.ApiRequester client) :
1417 _requester = client;
1418
1419 /**
1420 * Retrieves details of an enterprise's group license for a product.
1421 *
1422 * Request parameters:
1423 *
1424 * [enterpriseId] - The ID of the enterprise.
1425 *
1426 * [groupLicenseId] - The ID of the product the group license is for, e.g.
1427 * "app:com.google.android.gm".
1428 *
1429 * Completes with a [GroupLicense].
1430 *
1431 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1432 * error.
1433 *
1434 * If the used [http.Client] completes with an error when making a REST call,
1435 * this method will complete with the same error.
1436 */
1437 async.Future<GroupLicense> get(core.String enterpriseId, core.String groupLice nseId) {
1438 var _url = null;
1439 var _queryParams = new core.Map();
1440 var _uploadMedia = null;
1441 var _uploadOptions = null;
1442 var _downloadOptions = commons.DownloadOptions.Metadata;
1443 var _body = null;
1444
1445 if (enterpriseId == null) {
1446 throw new core.ArgumentError("Parameter enterpriseId is required.");
1447 }
1448 if (groupLicenseId == null) {
1449 throw new core.ArgumentError("Parameter groupLicenseId is required.");
1450 }
1451
1452
1453 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/g roupLicenses/' + commons.Escaper.ecapeVariable('$groupLicenseId');
1454
1455 var _response = _requester.request(_url,
1456 "GET",
1457 body: _body,
1458 queryParams: _queryParams,
1459 uploadOptions: _uploadOptions,
1460 uploadMedia: _uploadMedia,
1461 downloadOptions: _downloadOptions);
1462 return _response.then((data) => new GroupLicense.fromJson(data));
1463 }
1464
1465 /**
1466 * Retrieves IDs of all products for which the enterprise has a group license.
1467 *
1468 * Request parameters:
1469 *
1470 * [enterpriseId] - The ID of the enterprise.
1471 *
1472 * Completes with a [GroupLicensesListResponse].
1473 *
1474 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1475 * error.
1476 *
1477 * If the used [http.Client] completes with an error when making a REST call,
1478 * this method will complete with the same error.
1479 */
1480 async.Future<GroupLicensesListResponse> list(core.String enterpriseId) {
1481 var _url = null;
1482 var _queryParams = new core.Map();
1483 var _uploadMedia = null;
1484 var _uploadOptions = null;
1485 var _downloadOptions = commons.DownloadOptions.Metadata;
1486 var _body = null;
1487
1488 if (enterpriseId == null) {
1489 throw new core.ArgumentError("Parameter enterpriseId is required.");
1490 }
1491
1492
1493 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/g roupLicenses';
1494
1495 var _response = _requester.request(_url,
1496 "GET",
1497 body: _body,
1498 queryParams: _queryParams,
1499 uploadOptions: _uploadOptions,
1500 uploadMedia: _uploadMedia,
1501 downloadOptions: _downloadOptions);
1502 return _response.then((data) => new GroupLicensesListResponse.fromJson(data) );
1503 }
1504
1505 }
1506
1507
1508 class GrouplicenseusersResourceApi {
1509 final commons.ApiRequester _requester;
1510
1511 GrouplicenseusersResourceApi(commons.ApiRequester client) :
1512 _requester = client;
1513
1514 /**
1515 * Retrieves the IDs of the users who have been granted entitlements under the
1516 * license.
1517 *
1518 * Request parameters:
1519 *
1520 * [enterpriseId] - The ID of the enterprise.
1521 *
1522 * [groupLicenseId] - The ID of the product the group license is for, e.g.
1523 * "app:com.google.android.gm".
1524 *
1525 * Completes with a [GroupLicenseUsersListResponse].
1526 *
1527 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1528 * error.
1529 *
1530 * If the used [http.Client] completes with an error when making a REST call,
1531 * this method will complete with the same error.
1532 */
1533 async.Future<GroupLicenseUsersListResponse> list(core.String enterpriseId, cor e.String groupLicenseId) {
1534 var _url = null;
1535 var _queryParams = new core.Map();
1536 var _uploadMedia = null;
1537 var _uploadOptions = null;
1538 var _downloadOptions = commons.DownloadOptions.Metadata;
1539 var _body = null;
1540
1541 if (enterpriseId == null) {
1542 throw new core.ArgumentError("Parameter enterpriseId is required.");
1543 }
1544 if (groupLicenseId == null) {
1545 throw new core.ArgumentError("Parameter groupLicenseId is required.");
1546 }
1547
1548
1549 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/g roupLicenses/' + commons.Escaper.ecapeVariable('$groupLicenseId') + '/users';
1550
1551 var _response = _requester.request(_url,
1552 "GET",
1553 body: _body,
1554 queryParams: _queryParams,
1555 uploadOptions: _uploadOptions,
1556 uploadMedia: _uploadMedia,
1557 downloadOptions: _downloadOptions);
1558 return _response.then((data) => new GroupLicenseUsersListResponse.fromJson(d ata));
1559 }
1560
1561 }
1562
1563
1564 class InstallsResourceApi {
1565 final commons.ApiRequester _requester;
1566
1567 InstallsResourceApi(commons.ApiRequester client) :
1568 _requester = client;
1569
1570 /**
1571 * Requests to remove an app from a device. A call to get or list will still
1572 * show the app as installed on the device until it is actually removed.
1573 *
1574 * Request parameters:
1575 *
1576 * [enterpriseId] - The ID of the enterprise.
1577 *
1578 * [userId] - The ID of the user.
1579 *
1580 * [deviceId] - The Android ID of the device.
1581 *
1582 * [installId] - The ID of the product represented by the install, e.g.
1583 * "app:com.google.android.gm".
1584 *
1585 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1586 * error.
1587 *
1588 * If the used [http.Client] completes with an error when making a REST call,
1589 * this method will complete with the same error.
1590 */
1591 async.Future delete(core.String enterpriseId, core.String userId, core.String deviceId, core.String installId) {
1592 var _url = null;
1593 var _queryParams = new core.Map();
1594 var _uploadMedia = null;
1595 var _uploadOptions = null;
1596 var _downloadOptions = commons.DownloadOptions.Metadata;
1597 var _body = null;
1598
1599 if (enterpriseId == null) {
1600 throw new core.ArgumentError("Parameter enterpriseId is required.");
1601 }
1602 if (userId == null) {
1603 throw new core.ArgumentError("Parameter userId is required.");
1604 }
1605 if (deviceId == null) {
1606 throw new core.ArgumentError("Parameter deviceId is required.");
1607 }
1608 if (installId == null) {
1609 throw new core.ArgumentError("Parameter installId is required.");
1610 }
1611
1612 _downloadOptions = null;
1613
1614 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId') + '/installs/' + commons.Escaper.ecapeVariable('$in stallId');
1615
1616 var _response = _requester.request(_url,
1617 "DELETE",
1618 body: _body,
1619 queryParams: _queryParams,
1620 uploadOptions: _uploadOptions,
1621 uploadMedia: _uploadMedia,
1622 downloadOptions: _downloadOptions);
1623 return _response.then((data) => null);
1624 }
1625
1626 /**
1627 * Retrieves details of an installation of an app on a device.
1628 *
1629 * Request parameters:
1630 *
1631 * [enterpriseId] - The ID of the enterprise.
1632 *
1633 * [userId] - The ID of the user.
1634 *
1635 * [deviceId] - The Android ID of the device.
1636 *
1637 * [installId] - The ID of the product represented by the install, e.g.
1638 * "app:com.google.android.gm".
1639 *
1640 * Completes with a [Install].
1641 *
1642 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1643 * error.
1644 *
1645 * If the used [http.Client] completes with an error when making a REST call,
1646 * this method will complete with the same error.
1647 */
1648 async.Future<Install> get(core.String enterpriseId, core.String userId, core.S tring deviceId, core.String installId) {
1649 var _url = null;
1650 var _queryParams = new core.Map();
1651 var _uploadMedia = null;
1652 var _uploadOptions = null;
1653 var _downloadOptions = commons.DownloadOptions.Metadata;
1654 var _body = null;
1655
1656 if (enterpriseId == null) {
1657 throw new core.ArgumentError("Parameter enterpriseId is required.");
1658 }
1659 if (userId == null) {
1660 throw new core.ArgumentError("Parameter userId is required.");
1661 }
1662 if (deviceId == null) {
1663 throw new core.ArgumentError("Parameter deviceId is required.");
1664 }
1665 if (installId == null) {
1666 throw new core.ArgumentError("Parameter installId is required.");
1667 }
1668
1669
1670 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId') + '/installs/' + commons.Escaper.ecapeVariable('$in stallId');
1671
1672 var _response = _requester.request(_url,
1673 "GET",
1674 body: _body,
1675 queryParams: _queryParams,
1676 uploadOptions: _uploadOptions,
1677 uploadMedia: _uploadMedia,
1678 downloadOptions: _downloadOptions);
1679 return _response.then((data) => new Install.fromJson(data));
1680 }
1681
1682 /**
1683 * Retrieves the details of all apps installed on the specified device.
1684 *
1685 * Request parameters:
1686 *
1687 * [enterpriseId] - The ID of the enterprise.
1688 *
1689 * [userId] - The ID of the user.
1690 *
1691 * [deviceId] - The Android ID of the device.
1692 *
1693 * Completes with a [InstallsListResponse].
1694 *
1695 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1696 * error.
1697 *
1698 * If the used [http.Client] completes with an error when making a REST call,
1699 * this method will complete with the same error.
1700 */
1701 async.Future<InstallsListResponse> list(core.String enterpriseId, core.String userId, core.String deviceId) {
1702 var _url = null;
1703 var _queryParams = new core.Map();
1704 var _uploadMedia = null;
1705 var _uploadOptions = null;
1706 var _downloadOptions = commons.DownloadOptions.Metadata;
1707 var _body = null;
1708
1709 if (enterpriseId == null) {
1710 throw new core.ArgumentError("Parameter enterpriseId is required.");
1711 }
1712 if (userId == null) {
1713 throw new core.ArgumentError("Parameter userId is required.");
1714 }
1715 if (deviceId == null) {
1716 throw new core.ArgumentError("Parameter deviceId is required.");
1717 }
1718
1719
1720 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId') + '/installs';
1721
1722 var _response = _requester.request(_url,
1723 "GET",
1724 body: _body,
1725 queryParams: _queryParams,
1726 uploadOptions: _uploadOptions,
1727 uploadMedia: _uploadMedia,
1728 downloadOptions: _downloadOptions);
1729 return _response.then((data) => new InstallsListResponse.fromJson(data));
1730 }
1731
1732 /**
1733 * Requests to install the latest version of an app to a device. If the app is
1734 * already installed then it is updated to the latest version if necessary.
1735 * This method supports patch semantics.
1736 *
1737 * [request] - The metadata request object.
1738 *
1739 * Request parameters:
1740 *
1741 * [enterpriseId] - The ID of the enterprise.
1742 *
1743 * [userId] - The ID of the user.
1744 *
1745 * [deviceId] - The Android ID of the device.
1746 *
1747 * [installId] - The ID of the product represented by the install, e.g.
1748 * "app:com.google.android.gm".
1749 *
1750 * Completes with a [Install].
1751 *
1752 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1753 * error.
1754 *
1755 * If the used [http.Client] completes with an error when making a REST call,
1756 * this method will complete with the same error.
1757 */
1758 async.Future<Install> patch(Install request, core.String enterpriseId, core.St ring userId, core.String deviceId, core.String installId) {
1759 var _url = null;
1760 var _queryParams = new core.Map();
1761 var _uploadMedia = null;
1762 var _uploadOptions = null;
1763 var _downloadOptions = commons.DownloadOptions.Metadata;
1764 var _body = null;
1765
1766 if (request != null) {
1767 _body = convert.JSON.encode((request).toJson());
1768 }
1769 if (enterpriseId == null) {
1770 throw new core.ArgumentError("Parameter enterpriseId is required.");
1771 }
1772 if (userId == null) {
1773 throw new core.ArgumentError("Parameter userId is required.");
1774 }
1775 if (deviceId == null) {
1776 throw new core.ArgumentError("Parameter deviceId is required.");
1777 }
1778 if (installId == null) {
1779 throw new core.ArgumentError("Parameter installId is required.");
1780 }
1781
1782
1783 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId') + '/installs/' + commons.Escaper.ecapeVariable('$in stallId');
1784
1785 var _response = _requester.request(_url,
1786 "PATCH",
1787 body: _body,
1788 queryParams: _queryParams,
1789 uploadOptions: _uploadOptions,
1790 uploadMedia: _uploadMedia,
1791 downloadOptions: _downloadOptions);
1792 return _response.then((data) => new Install.fromJson(data));
1793 }
1794
1795 /**
1796 * Requests to install the latest version of an app to a device. If the app is
1797 * already installed then it is updated to the latest version if necessary.
1798 *
1799 * [request] - The metadata request object.
1800 *
1801 * Request parameters:
1802 *
1803 * [enterpriseId] - The ID of the enterprise.
1804 *
1805 * [userId] - The ID of the user.
1806 *
1807 * [deviceId] - The Android ID of the device.
1808 *
1809 * [installId] - The ID of the product represented by the install, e.g.
1810 * "app:com.google.android.gm".
1811 *
1812 * Completes with a [Install].
1813 *
1814 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1815 * error.
1816 *
1817 * If the used [http.Client] completes with an error when making a REST call,
1818 * this method will complete with the same error.
1819 */
1820 async.Future<Install> update(Install request, core.String enterpriseId, core.S tring userId, core.String deviceId, core.String installId) {
1821 var _url = null;
1822 var _queryParams = new core.Map();
1823 var _uploadMedia = null;
1824 var _uploadOptions = null;
1825 var _downloadOptions = commons.DownloadOptions.Metadata;
1826 var _body = null;
1827
1828 if (request != null) {
1829 _body = convert.JSON.encode((request).toJson());
1830 }
1831 if (enterpriseId == null) {
1832 throw new core.ArgumentError("Parameter enterpriseId is required.");
1833 }
1834 if (userId == null) {
1835 throw new core.ArgumentError("Parameter userId is required.");
1836 }
1837 if (deviceId == null) {
1838 throw new core.ArgumentError("Parameter deviceId is required.");
1839 }
1840 if (installId == null) {
1841 throw new core.ArgumentError("Parameter installId is required.");
1842 }
1843
1844
1845 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/devices/' + commons.Escape r.ecapeVariable('$deviceId') + '/installs/' + commons.Escaper.ecapeVariable('$in stallId');
1846
1847 var _response = _requester.request(_url,
1848 "PUT",
1849 body: _body,
1850 queryParams: _queryParams,
1851 uploadOptions: _uploadOptions,
1852 uploadMedia: _uploadMedia,
1853 downloadOptions: _downloadOptions);
1854 return _response.then((data) => new Install.fromJson(data));
1855 }
1856
1857 }
1858
1859
1860 class PermissionsResourceApi {
1861 final commons.ApiRequester _requester;
1862
1863 PermissionsResourceApi(commons.ApiRequester client) :
1864 _requester = client;
1865
1866 /**
1867 * Retrieves details of an Android app permission for display to an enterprise
1868 * admin.
1869 *
1870 * Request parameters:
1871 *
1872 * [permissionId] - The ID of the permission.
1873 *
1874 * [language] - The BCP47 tag for the user's preferred language (e.g. "en-US",
1875 * "de")
1876 *
1877 * Completes with a [Permission].
1878 *
1879 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1880 * error.
1881 *
1882 * If the used [http.Client] completes with an error when making a REST call,
1883 * this method will complete with the same error.
1884 */
1885 async.Future<Permission> get(core.String permissionId, {core.String language}) {
1886 var _url = null;
1887 var _queryParams = new core.Map();
1888 var _uploadMedia = null;
1889 var _uploadOptions = null;
1890 var _downloadOptions = commons.DownloadOptions.Metadata;
1891 var _body = null;
1892
1893 if (permissionId == null) {
1894 throw new core.ArgumentError("Parameter permissionId is required.");
1895 }
1896 if (language != null) {
1897 _queryParams["language"] = [language];
1898 }
1899
1900
1901 _url = 'permissions/' + commons.Escaper.ecapeVariable('$permissionId');
1902
1903 var _response = _requester.request(_url,
1904 "GET",
1905 body: _body,
1906 queryParams: _queryParams,
1907 uploadOptions: _uploadOptions,
1908 uploadMedia: _uploadMedia,
1909 downloadOptions: _downloadOptions);
1910 return _response.then((data) => new Permission.fromJson(data));
1911 }
1912
1913 }
1914
1915
1916 class ProductsResourceApi {
1917 final commons.ApiRequester _requester;
1918
1919 ProductsResourceApi(commons.ApiRequester client) :
1920 _requester = client;
1921
1922 /**
1923 * Retrieves details of a product for display to an enterprise admin.
1924 *
1925 * Request parameters:
1926 *
1927 * [enterpriseId] - The ID of the enterprise.
1928 *
1929 * [productId] - The ID of the product, e.g. "app:com.google.android.gm".
1930 *
1931 * [language] - The BCP47 tag for the user's preferred language (e.g. "en-US",
1932 * "de").
1933 *
1934 * Completes with a [Product].
1935 *
1936 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1937 * error.
1938 *
1939 * If the used [http.Client] completes with an error when making a REST call,
1940 * this method will complete with the same error.
1941 */
1942 async.Future<Product> get(core.String enterpriseId, core.String productId, {co re.String language}) {
1943 var _url = null;
1944 var _queryParams = new core.Map();
1945 var _uploadMedia = null;
1946 var _uploadOptions = null;
1947 var _downloadOptions = commons.DownloadOptions.Metadata;
1948 var _body = null;
1949
1950 if (enterpriseId == null) {
1951 throw new core.ArgumentError("Parameter enterpriseId is required.");
1952 }
1953 if (productId == null) {
1954 throw new core.ArgumentError("Parameter productId is required.");
1955 }
1956 if (language != null) {
1957 _queryParams["language"] = [language];
1958 }
1959
1960
1961 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/p roducts/' + commons.Escaper.ecapeVariable('$productId');
1962
1963 var _response = _requester.request(_url,
1964 "GET",
1965 body: _body,
1966 queryParams: _queryParams,
1967 uploadOptions: _uploadOptions,
1968 uploadMedia: _uploadMedia,
1969 downloadOptions: _downloadOptions);
1970 return _response.then((data) => new Product.fromJson(data));
1971 }
1972
1973 /**
1974 * Retrieves the schema defining app restrictions configurable for this
1975 * product. All products have a schema, but this may be empty if no app
1976 * restrictions are defined.
1977 *
1978 * Request parameters:
1979 *
1980 * [enterpriseId] - The ID of the enterprise.
1981 *
1982 * [productId] - The ID of the product.
1983 *
1984 * [language] - The BCP47 tag for the user's preferred language (e.g. "en-US",
1985 * "de").
1986 *
1987 * Completes with a [AppRestrictionsSchema].
1988 *
1989 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1990 * error.
1991 *
1992 * If the used [http.Client] completes with an error when making a REST call,
1993 * this method will complete with the same error.
1994 */
1995 async.Future<AppRestrictionsSchema> getAppRestrictionsSchema(core.String enter priseId, core.String productId, {core.String language}) {
1996 var _url = null;
1997 var _queryParams = new core.Map();
1998 var _uploadMedia = null;
1999 var _uploadOptions = null;
2000 var _downloadOptions = commons.DownloadOptions.Metadata;
2001 var _body = null;
2002
2003 if (enterpriseId == null) {
2004 throw new core.ArgumentError("Parameter enterpriseId is required.");
2005 }
2006 if (productId == null) {
2007 throw new core.ArgumentError("Parameter productId is required.");
2008 }
2009 if (language != null) {
2010 _queryParams["language"] = [language];
2011 }
2012
2013
2014 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/p roducts/' + commons.Escaper.ecapeVariable('$productId') + '/appRestrictionsSchem a';
2015
2016 var _response = _requester.request(_url,
2017 "GET",
2018 body: _body,
2019 queryParams: _queryParams,
2020 uploadOptions: _uploadOptions,
2021 uploadMedia: _uploadMedia,
2022 downloadOptions: _downloadOptions);
2023 return _response.then((data) => new AppRestrictionsSchema.fromJson(data));
2024 }
2025
2026 /**
2027 * Retrieves the Android app permissions required by this app.
2028 *
2029 * Request parameters:
2030 *
2031 * [enterpriseId] - The ID of the enterprise.
2032 *
2033 * [productId] - The ID of the product.
2034 *
2035 * Completes with a [ProductPermissions].
2036 *
2037 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2038 * error.
2039 *
2040 * If the used [http.Client] completes with an error when making a REST call,
2041 * this method will complete with the same error.
2042 */
2043 async.Future<ProductPermissions> getPermissions(core.String enterpriseId, core .String productId) {
2044 var _url = null;
2045 var _queryParams = new core.Map();
2046 var _uploadMedia = null;
2047 var _uploadOptions = null;
2048 var _downloadOptions = commons.DownloadOptions.Metadata;
2049 var _body = null;
2050
2051 if (enterpriseId == null) {
2052 throw new core.ArgumentError("Parameter enterpriseId is required.");
2053 }
2054 if (productId == null) {
2055 throw new core.ArgumentError("Parameter productId is required.");
2056 }
2057
2058
2059 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/p roducts/' + commons.Escaper.ecapeVariable('$productId') + '/permissions';
2060
2061 var _response = _requester.request(_url,
2062 "GET",
2063 body: _body,
2064 queryParams: _queryParams,
2065 uploadOptions: _uploadOptions,
2066 uploadMedia: _uploadMedia,
2067 downloadOptions: _downloadOptions);
2068 return _response.then((data) => new ProductPermissions.fromJson(data));
2069 }
2070
2071 /**
2072 * Updates the set of Android app permissions for this app that have been
2073 * accepted by the enterprise.
2074 *
2075 * [request] - The metadata request object.
2076 *
2077 * Request parameters:
2078 *
2079 * [enterpriseId] - The ID of the enterprise.
2080 *
2081 * [productId] - The ID of the product.
2082 *
2083 * Completes with a [ProductPermissions].
2084 *
2085 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2086 * error.
2087 *
2088 * If the used [http.Client] completes with an error when making a REST call,
2089 * this method will complete with the same error.
2090 */
2091 async.Future<ProductPermissions> updatePermissions(ProductPermissions request, core.String enterpriseId, core.String productId) {
2092 var _url = null;
2093 var _queryParams = new core.Map();
2094 var _uploadMedia = null;
2095 var _uploadOptions = null;
2096 var _downloadOptions = commons.DownloadOptions.Metadata;
2097 var _body = null;
2098
2099 if (request != null) {
2100 _body = convert.JSON.encode((request).toJson());
2101 }
2102 if (enterpriseId == null) {
2103 throw new core.ArgumentError("Parameter enterpriseId is required.");
2104 }
2105 if (productId == null) {
2106 throw new core.ArgumentError("Parameter productId is required.");
2107 }
2108
2109
2110 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/p roducts/' + commons.Escaper.ecapeVariable('$productId') + '/permissions';
2111
2112 var _response = _requester.request(_url,
2113 "PUT",
2114 body: _body,
2115 queryParams: _queryParams,
2116 uploadOptions: _uploadOptions,
2117 uploadMedia: _uploadMedia,
2118 downloadOptions: _downloadOptions);
2119 return _response.then((data) => new ProductPermissions.fromJson(data));
2120 }
2121
2122 }
2123
2124
2125 class UsersResourceApi {
2126 final commons.ApiRequester _requester;
2127
2128 UsersResourceApi(commons.ApiRequester client) :
2129 _requester = client;
2130
2131 /**
2132 * Generates a token (activation code) to allow this user to configure their
2133 * work account in the Android Setup Wizard. Revokes any previously generated
2134 * token.
2135 *
2136 * Request parameters:
2137 *
2138 * [enterpriseId] - The ID of the enterprise.
2139 *
2140 * [userId] - The ID of the user.
2141 *
2142 * Completes with a [UserToken].
2143 *
2144 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2145 * error.
2146 *
2147 * If the used [http.Client] completes with an error when making a REST call,
2148 * this method will complete with the same error.
2149 */
2150 async.Future<UserToken> generateToken(core.String enterpriseId, core.String us erId) {
2151 var _url = null;
2152 var _queryParams = new core.Map();
2153 var _uploadMedia = null;
2154 var _uploadOptions = null;
2155 var _downloadOptions = commons.DownloadOptions.Metadata;
2156 var _body = null;
2157
2158 if (enterpriseId == null) {
2159 throw new core.ArgumentError("Parameter enterpriseId is required.");
2160 }
2161 if (userId == null) {
2162 throw new core.ArgumentError("Parameter userId is required.");
2163 }
2164
2165
2166 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/token';
2167
2168 var _response = _requester.request(_url,
2169 "POST",
2170 body: _body,
2171 queryParams: _queryParams,
2172 uploadOptions: _uploadOptions,
2173 uploadMedia: _uploadMedia,
2174 downloadOptions: _downloadOptions);
2175 return _response.then((data) => new UserToken.fromJson(data));
2176 }
2177
2178 /**
2179 * Retrieves a user's details.
2180 *
2181 * Request parameters:
2182 *
2183 * [enterpriseId] - The ID of the enterprise.
2184 *
2185 * [userId] - The ID of the user.
2186 *
2187 * Completes with a [User].
2188 *
2189 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2190 * error.
2191 *
2192 * If the used [http.Client] completes with an error when making a REST call,
2193 * this method will complete with the same error.
2194 */
2195 async.Future<User> get(core.String enterpriseId, core.String userId) {
2196 var _url = null;
2197 var _queryParams = new core.Map();
2198 var _uploadMedia = null;
2199 var _uploadOptions = null;
2200 var _downloadOptions = commons.DownloadOptions.Metadata;
2201 var _body = null;
2202
2203 if (enterpriseId == null) {
2204 throw new core.ArgumentError("Parameter enterpriseId is required.");
2205 }
2206 if (userId == null) {
2207 throw new core.ArgumentError("Parameter userId is required.");
2208 }
2209
2210
2211 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId');
2212
2213 var _response = _requester.request(_url,
2214 "GET",
2215 body: _body,
2216 queryParams: _queryParams,
2217 uploadOptions: _uploadOptions,
2218 uploadMedia: _uploadMedia,
2219 downloadOptions: _downloadOptions);
2220 return _response.then((data) => new User.fromJson(data));
2221 }
2222
2223 /**
2224 * Looks up a user by email address.
2225 *
2226 * Request parameters:
2227 *
2228 * [enterpriseId] - The ID of the enterprise.
2229 *
2230 * [email] - The exact primary email address of the user to look up.
2231 *
2232 * Completes with a [UsersListResponse].
2233 *
2234 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2235 * error.
2236 *
2237 * If the used [http.Client] completes with an error when making a REST call,
2238 * this method will complete with the same error.
2239 */
2240 async.Future<UsersListResponse> list(core.String enterpriseId, core.String ema il) {
2241 var _url = null;
2242 var _queryParams = new core.Map();
2243 var _uploadMedia = null;
2244 var _uploadOptions = null;
2245 var _downloadOptions = commons.DownloadOptions.Metadata;
2246 var _body = null;
2247
2248 if (enterpriseId == null) {
2249 throw new core.ArgumentError("Parameter enterpriseId is required.");
2250 }
2251 if (email == null) {
2252 throw new core.ArgumentError("Parameter email is required.");
2253 }
2254 _queryParams["email"] = [email];
2255
2256
2257 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers';
2258
2259 var _response = _requester.request(_url,
2260 "GET",
2261 body: _body,
2262 queryParams: _queryParams,
2263 uploadOptions: _uploadOptions,
2264 uploadMedia: _uploadMedia,
2265 downloadOptions: _downloadOptions);
2266 return _response.then((data) => new UsersListResponse.fromJson(data));
2267 }
2268
2269 /**
2270 * Revokes a previously generated token (activation code) for the user.
2271 *
2272 * Request parameters:
2273 *
2274 * [enterpriseId] - The ID of the enterprise.
2275 *
2276 * [userId] - The ID of the user.
2277 *
2278 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
2279 * error.
2280 *
2281 * If the used [http.Client] completes with an error when making a REST call,
2282 * this method will complete with the same error.
2283 */
2284 async.Future revokeToken(core.String enterpriseId, core.String userId) {
2285 var _url = null;
2286 var _queryParams = new core.Map();
2287 var _uploadMedia = null;
2288 var _uploadOptions = null;
2289 var _downloadOptions = commons.DownloadOptions.Metadata;
2290 var _body = null;
2291
2292 if (enterpriseId == null) {
2293 throw new core.ArgumentError("Parameter enterpriseId is required.");
2294 }
2295 if (userId == null) {
2296 throw new core.ArgumentError("Parameter userId is required.");
2297 }
2298
2299 _downloadOptions = null;
2300
2301 _url = 'enterprises/' + commons.Escaper.ecapeVariable('$enterpriseId') + '/u sers/' + commons.Escaper.ecapeVariable('$userId') + '/token';
2302
2303 var _response = _requester.request(_url,
2304 "DELETE",
2305 body: _body,
2306 queryParams: _queryParams,
2307 uploadOptions: _uploadOptions,
2308 uploadMedia: _uploadMedia,
2309 downloadOptions: _downloadOptions);
2310 return _response.then((data) => null);
2311 }
2312
2313 }
2314
2315
2316
2317 /**
2318 * Represents the list of app restrictions available to be pre-configured for
2319 * the product.
2320 */
2321 class AppRestrictionsSchema {
2322 /** The set of restrictions that make up this schema. */
2323 core.List<AppRestrictionsSchemaRestriction> restrictions;
2324
2325
2326 AppRestrictionsSchema();
2327
2328 AppRestrictionsSchema.fromJson(core.Map _json) {
2329 if (_json.containsKey("restrictions")) {
2330 restrictions = _json["restrictions"].map((value) => new AppRestrictionsSch emaRestriction.fromJson(value)).toList();
2331 }
2332 }
2333
2334 core.Map toJson() {
2335 var _json = new core.Map();
2336 if (restrictions != null) {
2337 _json["restrictions"] = restrictions.map((value) => (value).toJson()).toLi st();
2338 }
2339 return _json;
2340 }
2341 }
2342
2343
2344 /**
2345 * A restriction in the App Restriction Schema represents a piece of
2346 * configuration that may be pre-applied.
2347 */
2348 class AppRestrictionsSchemaRestriction {
2349 /** The default value of the restriction. */
2350 AppRestrictionsSchemaRestrictionRestrictionValue defaultValue;
2351
2352 /**
2353 * A longer description of the restriction, giving more detail of what it
2354 * affects.
2355 */
2356 core.String description;
2357
2358 /**
2359 * For choice or multiselect restrictions, the list of possible entries'
2360 * human-readable names.
2361 */
2362 core.List<core.String> entry;
2363
2364 /**
2365 * For choice or multiselect restrictions, the list of possible entries'
2366 * machine-readable values.
2367 */
2368 core.List<core.String> entryValue;
2369
2370 /**
2371 * The unique key that the product uses to identify the restriction, e.g.
2372 * "com.google.android.gm.fieldname".
2373 */
2374 core.String key;
2375
2376 /** The type of the restriction. */
2377 core.String restrictionType;
2378
2379 /** The name of the restriction. */
2380 core.String title;
2381
2382
2383 AppRestrictionsSchemaRestriction();
2384
2385 AppRestrictionsSchemaRestriction.fromJson(core.Map _json) {
2386 if (_json.containsKey("defaultValue")) {
2387 defaultValue = new AppRestrictionsSchemaRestrictionRestrictionValue.fromJs on(_json["defaultValue"]);
2388 }
2389 if (_json.containsKey("description")) {
2390 description = _json["description"];
2391 }
2392 if (_json.containsKey("entry")) {
2393 entry = _json["entry"];
2394 }
2395 if (_json.containsKey("entryValue")) {
2396 entryValue = _json["entryValue"];
2397 }
2398 if (_json.containsKey("key")) {
2399 key = _json["key"];
2400 }
2401 if (_json.containsKey("restrictionType")) {
2402 restrictionType = _json["restrictionType"];
2403 }
2404 if (_json.containsKey("title")) {
2405 title = _json["title"];
2406 }
2407 }
2408
2409 core.Map toJson() {
2410 var _json = new core.Map();
2411 if (defaultValue != null) {
2412 _json["defaultValue"] = (defaultValue).toJson();
2413 }
2414 if (description != null) {
2415 _json["description"] = description;
2416 }
2417 if (entry != null) {
2418 _json["entry"] = entry;
2419 }
2420 if (entryValue != null) {
2421 _json["entryValue"] = entryValue;
2422 }
2423 if (key != null) {
2424 _json["key"] = key;
2425 }
2426 if (restrictionType != null) {
2427 _json["restrictionType"] = restrictionType;
2428 }
2429 if (title != null) {
2430 _json["title"] = title;
2431 }
2432 return _json;
2433 }
2434 }
2435
2436
2437 /** A typed value for the restriction. */
2438 class AppRestrictionsSchemaRestrictionRestrictionValue {
2439 /** The type of the value being provided. */
2440 core.String type;
2441
2442 /** The boolean value - this will only be present if type is bool. */
2443 core.bool valueBool;
2444
2445 /** The integer value - this will only be present if type is integer. */
2446 core.int valueInteger;
2447
2448 /**
2449 * The list of string values - this will only be present if type is
2450 * multiselect.
2451 */
2452 core.List<core.String> valueMultiselect;
2453
2454 /**
2455 * The string value - this will be present for types string, choice and
2456 * hidden.
2457 */
2458 core.String valueString;
2459
2460
2461 AppRestrictionsSchemaRestrictionRestrictionValue();
2462
2463 AppRestrictionsSchemaRestrictionRestrictionValue.fromJson(core.Map _json) {
2464 if (_json.containsKey("type")) {
2465 type = _json["type"];
2466 }
2467 if (_json.containsKey("valueBool")) {
2468 valueBool = _json["valueBool"];
2469 }
2470 if (_json.containsKey("valueInteger")) {
2471 valueInteger = _json["valueInteger"];
2472 }
2473 if (_json.containsKey("valueMultiselect")) {
2474 valueMultiselect = _json["valueMultiselect"];
2475 }
2476 if (_json.containsKey("valueString")) {
2477 valueString = _json["valueString"];
2478 }
2479 }
2480
2481 core.Map toJson() {
2482 var _json = new core.Map();
2483 if (type != null) {
2484 _json["type"] = type;
2485 }
2486 if (valueBool != null) {
2487 _json["valueBool"] = valueBool;
2488 }
2489 if (valueInteger != null) {
2490 _json["valueInteger"] = valueInteger;
2491 }
2492 if (valueMultiselect != null) {
2493 _json["valueMultiselect"] = valueMultiselect;
2494 }
2495 if (valueString != null) {
2496 _json["valueString"] = valueString;
2497 }
2498 return _json;
2499 }
2500 }
2501
2502
2503 /**
2504 * A collection resource defines a named set of apps that is visible to a set of
2505 * users in the Google Play Store app running on those users' managed devices.
2506 * Those users can then install any of those apps if they wish (which will
2507 * trigger creation of install and entitlement resources). A user cannot install
2508 * an app on a managed device unless the app is listed in at least one
2509 * collection that is visible to that user.
2510 *
2511 * Note that the API can be used to directly install an app regardless of
2512 * whether it is in any collection - so an enterprise has a choice of either
2513 * directly pushing apps to users, or allowing users to install apps if they
2514 * want. Which is appropriate will depend on the enterprise's policies and the
2515 * purpose of the apps concerned.
2516 */
2517 class Collection {
2518 /** Arbitrary unique ID, allocated by the API on creation. */
2519 core.String collectionId;
2520
2521 /**
2522 * Identifies what kind of resource this is. Value: the fixed string
2523 * "androidenterprise#collection".
2524 */
2525 core.String kind;
2526
2527 /**
2528 * A user-friendly name for the collection (should be unique), e.g.
2529 * "Accounting apps".
2530 */
2531 core.String name;
2532
2533 /**
2534 * The IDs of the products in the collection, in the order in which they
2535 * should be displayed.
2536 */
2537 core.List<core.String> productId;
2538
2539 /**
2540 * Whether this collection is visible to all users, or only to the users that
2541 * have been granted access through the collection_viewers api. Even if a
2542 * collection is visible to allUsers, it is possible to add and remove
2543 * viewers, but this will have no effect until the collection's visibility
2544 * changes to viewersOnly.
2545 */
2546 core.String visibility;
2547
2548
2549 Collection();
2550
2551 Collection.fromJson(core.Map _json) {
2552 if (_json.containsKey("collectionId")) {
2553 collectionId = _json["collectionId"];
2554 }
2555 if (_json.containsKey("kind")) {
2556 kind = _json["kind"];
2557 }
2558 if (_json.containsKey("name")) {
2559 name = _json["name"];
2560 }
2561 if (_json.containsKey("productId")) {
2562 productId = _json["productId"];
2563 }
2564 if (_json.containsKey("visibility")) {
2565 visibility = _json["visibility"];
2566 }
2567 }
2568
2569 core.Map toJson() {
2570 var _json = new core.Map();
2571 if (collectionId != null) {
2572 _json["collectionId"] = collectionId;
2573 }
2574 if (kind != null) {
2575 _json["kind"] = kind;
2576 }
2577 if (name != null) {
2578 _json["name"] = name;
2579 }
2580 if (productId != null) {
2581 _json["productId"] = productId;
2582 }
2583 if (visibility != null) {
2584 _json["visibility"] = visibility;
2585 }
2586 return _json;
2587 }
2588 }
2589
2590
2591 /** The user resources for the collection. */
2592 class CollectionViewersListResponse {
2593 /**
2594 * Identifies what kind of resource this is. Value: the fixed string
2595 * "androidenterprise#collectionViewersListResponse".
2596 */
2597 core.String kind;
2598
2599 /** A user of an enterprise. */
2600 core.List<User> user;
2601
2602
2603 CollectionViewersListResponse();
2604
2605 CollectionViewersListResponse.fromJson(core.Map _json) {
2606 if (_json.containsKey("kind")) {
2607 kind = _json["kind"];
2608 }
2609 if (_json.containsKey("user")) {
2610 user = _json["user"].map((value) => new User.fromJson(value)).toList();
2611 }
2612 }
2613
2614 core.Map toJson() {
2615 var _json = new core.Map();
2616 if (kind != null) {
2617 _json["kind"] = kind;
2618 }
2619 if (user != null) {
2620 _json["user"] = user.map((value) => (value).toJson()).toList();
2621 }
2622 return _json;
2623 }
2624 }
2625
2626
2627 /** The collection resources for the enterprise. */
2628 class CollectionsListResponse {
2629 /**
2630 * An ordered collection of products which can be made visible on the Google
2631 * Play Store app to a selected group of users.
2632 */
2633 core.List<Collection> collection;
2634
2635 /**
2636 * Identifies what kind of resource this is. Value: the fixed string
2637 * "androidenterprise#collectionsListResponse".
2638 */
2639 core.String kind;
2640
2641
2642 CollectionsListResponse();
2643
2644 CollectionsListResponse.fromJson(core.Map _json) {
2645 if (_json.containsKey("collection")) {
2646 collection = _json["collection"].map((value) => new Collection.fromJson(va lue)).toList();
2647 }
2648 if (_json.containsKey("kind")) {
2649 kind = _json["kind"];
2650 }
2651 }
2652
2653 core.Map toJson() {
2654 var _json = new core.Map();
2655 if (collection != null) {
2656 _json["collection"] = collection.map((value) => (value).toJson()).toList() ;
2657 }
2658 if (kind != null) {
2659 _json["kind"] = kind;
2660 }
2661 return _json;
2662 }
2663 }
2664
2665
2666 /**
2667 * A device resource represents a mobile device managed by the MDM and belonging
2668 * to a specific enterprise user.
2669 *
2670 * This collection cannot be modified via the API; it is automatically populated
2671 * as devices are set up to be managed.
2672 */
2673 class Device {
2674 /**
2675 * The Google Play Services Android ID for the device encoded as a lowercase
2676 * hex string, e.g. "123456789abcdef0".
2677 */
2678 core.String androidId;
2679
2680 /**
2681 * Identifies what kind of resource this is. Value: the fixed string
2682 * "androidenterprise#device".
2683 */
2684 core.String kind;
2685
2686
2687 Device();
2688
2689 Device.fromJson(core.Map _json) {
2690 if (_json.containsKey("androidId")) {
2691 androidId = _json["androidId"];
2692 }
2693 if (_json.containsKey("kind")) {
2694 kind = _json["kind"];
2695 }
2696 }
2697
2698 core.Map toJson() {
2699 var _json = new core.Map();
2700 if (androidId != null) {
2701 _json["androidId"] = androidId;
2702 }
2703 if (kind != null) {
2704 _json["kind"] = kind;
2705 }
2706 return _json;
2707 }
2708 }
2709
2710
2711 /**
2712 * The state of a user's device, as accessed by the getState and setState
2713 * methods on device resources.
2714 */
2715 class DeviceState {
2716 /**
2717 * The state of the Google account on the device. "enabled" indicates that the
2718 * Google account on the device can be used to access Google services
2719 * (including Google Play), while "disabled" means that it cannot. A new
2720 * device is initially in the "disabled" state.
2721 */
2722 core.String accountState;
2723
2724 /**
2725 * Identifies what kind of resource this is. Value: the fixed string
2726 * "androidenterprise#deviceState".
2727 */
2728 core.String kind;
2729
2730
2731 DeviceState();
2732
2733 DeviceState.fromJson(core.Map _json) {
2734 if (_json.containsKey("accountState")) {
2735 accountState = _json["accountState"];
2736 }
2737 if (_json.containsKey("kind")) {
2738 kind = _json["kind"];
2739 }
2740 }
2741
2742 core.Map toJson() {
2743 var _json = new core.Map();
2744 if (accountState != null) {
2745 _json["accountState"] = accountState;
2746 }
2747 if (kind != null) {
2748 _json["kind"] = kind;
2749 }
2750 return _json;
2751 }
2752 }
2753
2754
2755 /** The device resources for the user. */
2756 class DevicesListResponse {
2757 /** A managed device. */
2758 core.List<Device> device;
2759
2760 /**
2761 * Identifies what kind of resource this is. Value: the fixed string
2762 * "androidenterprise#devicesListResponse".
2763 */
2764 core.String kind;
2765
2766
2767 DevicesListResponse();
2768
2769 DevicesListResponse.fromJson(core.Map _json) {
2770 if (_json.containsKey("device")) {
2771 device = _json["device"].map((value) => new Device.fromJson(value)).toList ();
2772 }
2773 if (_json.containsKey("kind")) {
2774 kind = _json["kind"];
2775 }
2776 }
2777
2778 core.Map toJson() {
2779 var _json = new core.Map();
2780 if (device != null) {
2781 _json["device"] = device.map((value) => (value).toJson()).toList();
2782 }
2783 if (kind != null) {
2784 _json["kind"] = kind;
2785 }
2786 return _json;
2787 }
2788 }
2789
2790
2791 /**
2792 * An enterprise resource represents a binding between an organisation and their
2793 * MDM.
2794 *
2795 * To create an enterprise, an admin of the enterprise must first go through a
2796 * Play for Work sign-up flow. At the end of this the admin will be presented
2797 * with a token (a short opaque alphanumeric string). They must then present
2798 * this to the MDM, who then supplies it to the enroll method. Until this is
2799 * done the MDM will not have any access to the enterprise.
2800 *
2801 * After calling enroll the MDM should call setAccount to specify the service
2802 * account that will be allowed to act on behalf of the enterprise, which will
2803 * be required for access to the enterprise's data through this API. Only one
2804 * call of setAccount is allowed for a given enterprise; the only way to change
2805 * the account later is to unenroll the enterprise and enroll it again
2806 * (obtaining a new token).
2807 *
2808 * The MDM can unenroll an enterprise in order to sever the binding between
2809 * them. Re-enrolling an enterprise is possible, but requires a new token to be
2810 * retrieved. Enterprises.unenroll requires the MDM's credentials (as enroll
2811 * does), not the enterprise's. Enterprises.unenroll can only be used for
2812 * enterprises that were previously enrolled with the enroll call. Any
2813 * enterprises that were enrolled using the (deprecated) Enterprises.insert call
2814 * must be unenrolled with Enterprises.delete and can then be re-enrolled using
2815 * the Enterprises.enroll call.
2816 *
2817 * The ID for an enterprise is an opaque string. It is returned by insert and
2818 * enroll and can also be retrieved if the enterprise's primary domain is known
2819 * using the list method.
2820 */
2821 class Enterprise {
2822 /** The unique ID for the enterprise. */
2823 core.String id;
2824
2825 /**
2826 * Identifies what kind of resource this is. Value: the fixed string
2827 * "androidenterprise#enterprise".
2828 */
2829 core.String kind;
2830
2831 /** The name of the enterprise, e.g. "Example Inc". */
2832 core.String name;
2833
2834 /** The enterprise's primary domain, e.g. "example.com". */
2835 core.String primaryDomain;
2836
2837
2838 Enterprise();
2839
2840 Enterprise.fromJson(core.Map _json) {
2841 if (_json.containsKey("id")) {
2842 id = _json["id"];
2843 }
2844 if (_json.containsKey("kind")) {
2845 kind = _json["kind"];
2846 }
2847 if (_json.containsKey("name")) {
2848 name = _json["name"];
2849 }
2850 if (_json.containsKey("primaryDomain")) {
2851 primaryDomain = _json["primaryDomain"];
2852 }
2853 }
2854
2855 core.Map toJson() {
2856 var _json = new core.Map();
2857 if (id != null) {
2858 _json["id"] = id;
2859 }
2860 if (kind != null) {
2861 _json["kind"] = kind;
2862 }
2863 if (name != null) {
2864 _json["name"] = name;
2865 }
2866 if (primaryDomain != null) {
2867 _json["primaryDomain"] = primaryDomain;
2868 }
2869 return _json;
2870 }
2871 }
2872
2873
2874 /**
2875 * A service account that can be used to authenticate as the enterprise to API
2876 * calls that require such authentication.
2877 */
2878 class EnterpriseAccount {
2879 /** The email address of the service account. */
2880 core.String accountEmail;
2881
2882 /**
2883 * Identifies what kind of resource this is. Value: the fixed string
2884 * "androidenterprise#enterpriseAccount".
2885 */
2886 core.String kind;
2887
2888
2889 EnterpriseAccount();
2890
2891 EnterpriseAccount.fromJson(core.Map _json) {
2892 if (_json.containsKey("accountEmail")) {
2893 accountEmail = _json["accountEmail"];
2894 }
2895 if (_json.containsKey("kind")) {
2896 kind = _json["kind"];
2897 }
2898 }
2899
2900 core.Map toJson() {
2901 var _json = new core.Map();
2902 if (accountEmail != null) {
2903 _json["accountEmail"] = accountEmail;
2904 }
2905 if (kind != null) {
2906 _json["kind"] = kind;
2907 }
2908 return _json;
2909 }
2910 }
2911
2912
2913 /** The matching enterprise resources. */
2914 class EnterprisesListResponse {
2915 /** An enterprise. */
2916 core.List<Enterprise> enterprise;
2917
2918 /**
2919 * Identifies what kind of resource this is. Value: the fixed string
2920 * "androidenterprise#enterprisesListResponse".
2921 */
2922 core.String kind;
2923
2924
2925 EnterprisesListResponse();
2926
2927 EnterprisesListResponse.fromJson(core.Map _json) {
2928 if (_json.containsKey("enterprise")) {
2929 enterprise = _json["enterprise"].map((value) => new Enterprise.fromJson(va lue)).toList();
2930 }
2931 if (_json.containsKey("kind")) {
2932 kind = _json["kind"];
2933 }
2934 }
2935
2936 core.Map toJson() {
2937 var _json = new core.Map();
2938 if (enterprise != null) {
2939 _json["enterprise"] = enterprise.map((value) => (value).toJson()).toList() ;
2940 }
2941 if (kind != null) {
2942 _json["kind"] = kind;
2943 }
2944 return _json;
2945 }
2946 }
2947
2948
2949 /**
2950 * The existence of an entitlement resource means that a user has the right to
2951 * use a particular app on any of their devices. This might be because the app
2952 * is free or because they have been allocated a license to the app from a group
2953 * license purchased by the enterprise.
2954 *
2955 * It should always be true that a user has an app installed on one of their
2956 * devices only if they have an entitlement to it. So if an entitlement is
2957 * deleted, the app will be uninstalled from all devices. Similarly if the user
2958 * installs an app (and is permitted to do so), or the MDM triggers an install
2959 * of the app, an entitlement to that app is automatically created. If this is
2960 * impossible - e.g. the enterprise has not purchased sufficient licenses - then
2961 * installation fails.
2962 *
2963 * Note that entitlements are always user specific, not device specific; a user
2964 * may have an entitlement even though they have not installed the app anywhere.
2965 * Once they have an entitlement they can install the app on multiple devices.
2966 *
2967 * The API can be used to create an entitlement. If the app is a free app, a
2968 * group license for that app is created. If it's a paid app, creating the
2969 * entitlement consumes one license; it remains consumed until the entitlement
2970 * is removed. Optionally an installation of the app on all the user's managed
2971 * devices can be triggered at the time the entitlement is created. An
2972 * entitlement cannot be created for an app if the app requires permissions that
2973 * the enterprise has not yet accepted.
2974 *
2975 * Entitlements for paid apps that are due to purchases by the user on a
2976 * non-managed profile will have "userPurchase" as entitlement reason; those
2977 * entitlements cannot be removed via the API.
2978 */
2979 class Entitlement {
2980 /**
2981 * Identifies what kind of resource this is. Value: the fixed string
2982 * "androidenterprise#entitlement".
2983 */
2984 core.String kind;
2985
2986 /**
2987 * The ID of the product that the entitlement is for, e.g.
2988 * "app:com.google.android.gm".
2989 */
2990 core.String productId;
2991
2992 /**
2993 * The reason for the entitlement, e.g. "free" for free apps. This is
2994 * temporary, it will be replaced by the acquisition kind field of group
2995 * licenses.
2996 */
2997 core.String reason;
2998
2999
3000 Entitlement();
3001
3002 Entitlement.fromJson(core.Map _json) {
3003 if (_json.containsKey("kind")) {
3004 kind = _json["kind"];
3005 }
3006 if (_json.containsKey("productId")) {
3007 productId = _json["productId"];
3008 }
3009 if (_json.containsKey("reason")) {
3010 reason = _json["reason"];
3011 }
3012 }
3013
3014 core.Map toJson() {
3015 var _json = new core.Map();
3016 if (kind != null) {
3017 _json["kind"] = kind;
3018 }
3019 if (productId != null) {
3020 _json["productId"] = productId;
3021 }
3022 if (reason != null) {
3023 _json["reason"] = reason;
3024 }
3025 return _json;
3026 }
3027 }
3028
3029
3030 /** The entitlement resources for the user. */
3031 class EntitlementsListResponse {
3032 /**
3033 * An entitlement of a user to a product (e.g. an app). For example, a free
3034 * app that they have installed, or a paid app that they have been allocated a
3035 * license to.
3036 */
3037 core.List<Entitlement> entitlement;
3038
3039 /**
3040 * Identifies what kind of resource this is. Value: the fixed string
3041 * "androidenterprise#entitlementsListResponse".
3042 */
3043 core.String kind;
3044
3045
3046 EntitlementsListResponse();
3047
3048 EntitlementsListResponse.fromJson(core.Map _json) {
3049 if (_json.containsKey("entitlement")) {
3050 entitlement = _json["entitlement"].map((value) => new Entitlement.fromJson (value)).toList();
3051 }
3052 if (_json.containsKey("kind")) {
3053 kind = _json["kind"];
3054 }
3055 }
3056
3057 core.Map toJson() {
3058 var _json = new core.Map();
3059 if (entitlement != null) {
3060 _json["entitlement"] = entitlement.map((value) => (value).toJson()).toList ();
3061 }
3062 if (kind != null) {
3063 _json["kind"] = kind;
3064 }
3065 return _json;
3066 }
3067 }
3068
3069
3070 /**
3071 * A group license object indicates a product that an enterprise admin has
3072 * approved for use in the enterprise. The product may be free or paid. For free
3073 * products, a group license object is created in these cases: if the enterprise
3074 * admin approves a product in Google Play, if the product is added to a
3075 * collection, or if an entitlement for the product is created for a user via
3076 * the API. For paid products, a group license object is only created as part of
3077 * the first bulk purchase of that product in Google Play done by the enterprise
3078 * admin.
3079 *
3080 * The API can be used to query group licenses; the available information
3081 * includes the total number of licenses purchased (for paid products) and the
3082 * total number of licenses that have been provisioned, i.e. the total number of
3083 * user entitlements in existence for the product.
3084 *
3085 * Group license objects are never deleted; if e.g. a free app is added to a
3086 * collection and then removed, the group license will remain, allowing to keep
3087 * track of any remaining entitlements. An enterprise admin may indicate they
3088 * are no longer interested in the group license by marking it as unapproved in
3089 * Google Play.
3090 */
3091 class GroupLicense {
3092 /**
3093 * How this group license was acquired. "bulkPurchase" means that this group
3094 * license object was created because the enterprise purchased licenses for
3095 * this product; this is "free" otherwise (for free products).
3096 */
3097 core.String acquisitionKind;
3098
3099 /**
3100 * Whether the product to which this group license relates is currently
3101 * approved by the enterprise, as either "approved" or "unapproved". Products
3102 * are approved when a group license is first created, but this approval may
3103 * be revoked by an enterprise admin via Google Play. Unapproved products will
3104 * not be visible to end users in collections and new entitlements to them
3105 * should not normally be created.
3106 */
3107 core.String approval;
3108
3109 /**
3110 * Identifies what kind of resource this is. Value: the fixed string
3111 * "androidenterprise#groupLicense".
3112 */
3113 core.String kind;
3114
3115 /**
3116 * The total number of provisioned licenses for this product. Returned by read
3117 * operations, but ignored in write operations.
3118 */
3119 core.int numProvisioned;
3120
3121 /**
3122 * The number of purchased licenses (possibly in multiple purchases). If this
3123 * field is omitted then there is no limit on the number of licenses that can
3124 * be provisioned (e.g. if the acquisition kind is "free").
3125 */
3126 core.int numPurchased;
3127
3128 /**
3129 * The ID of the product that the license is for, e.g.
3130 * "app:com.google.android.gm".
3131 */
3132 core.String productId;
3133
3134
3135 GroupLicense();
3136
3137 GroupLicense.fromJson(core.Map _json) {
3138 if (_json.containsKey("acquisitionKind")) {
3139 acquisitionKind = _json["acquisitionKind"];
3140 }
3141 if (_json.containsKey("approval")) {
3142 approval = _json["approval"];
3143 }
3144 if (_json.containsKey("kind")) {
3145 kind = _json["kind"];
3146 }
3147 if (_json.containsKey("numProvisioned")) {
3148 numProvisioned = _json["numProvisioned"];
3149 }
3150 if (_json.containsKey("numPurchased")) {
3151 numPurchased = _json["numPurchased"];
3152 }
3153 if (_json.containsKey("productId")) {
3154 productId = _json["productId"];
3155 }
3156 }
3157
3158 core.Map toJson() {
3159 var _json = new core.Map();
3160 if (acquisitionKind != null) {
3161 _json["acquisitionKind"] = acquisitionKind;
3162 }
3163 if (approval != null) {
3164 _json["approval"] = approval;
3165 }
3166 if (kind != null) {
3167 _json["kind"] = kind;
3168 }
3169 if (numProvisioned != null) {
3170 _json["numProvisioned"] = numProvisioned;
3171 }
3172 if (numPurchased != null) {
3173 _json["numPurchased"] = numPurchased;
3174 }
3175 if (productId != null) {
3176 _json["productId"] = productId;
3177 }
3178 return _json;
3179 }
3180 }
3181
3182
3183 /** The user resources for the group license. */
3184 class GroupLicenseUsersListResponse {
3185 /**
3186 * Identifies what kind of resource this is. Value: the fixed string
3187 * "androidenterprise#groupLicenseUsersListResponse".
3188 */
3189 core.String kind;
3190
3191 /** A user of an enterprise. */
3192 core.List<User> user;
3193
3194
3195 GroupLicenseUsersListResponse();
3196
3197 GroupLicenseUsersListResponse.fromJson(core.Map _json) {
3198 if (_json.containsKey("kind")) {
3199 kind = _json["kind"];
3200 }
3201 if (_json.containsKey("user")) {
3202 user = _json["user"].map((value) => new User.fromJson(value)).toList();
3203 }
3204 }
3205
3206 core.Map toJson() {
3207 var _json = new core.Map();
3208 if (kind != null) {
3209 _json["kind"] = kind;
3210 }
3211 if (user != null) {
3212 _json["user"] = user.map((value) => (value).toJson()).toList();
3213 }
3214 return _json;
3215 }
3216 }
3217
3218
3219 /** The grouplicense resources for the enterprise. */
3220 class GroupLicensesListResponse {
3221 /** A group license for a product approved for use in the enterprise. */
3222 core.List<GroupLicense> groupLicense;
3223
3224 /**
3225 * Identifies what kind of resource this is. Value: the fixed string
3226 * "androidenterprise#groupLicensesListResponse".
3227 */
3228 core.String kind;
3229
3230
3231 GroupLicensesListResponse();
3232
3233 GroupLicensesListResponse.fromJson(core.Map _json) {
3234 if (_json.containsKey("groupLicense")) {
3235 groupLicense = _json["groupLicense"].map((value) => new GroupLicense.fromJ son(value)).toList();
3236 }
3237 if (_json.containsKey("kind")) {
3238 kind = _json["kind"];
3239 }
3240 }
3241
3242 core.Map toJson() {
3243 var _json = new core.Map();
3244 if (groupLicense != null) {
3245 _json["groupLicense"] = groupLicense.map((value) => (value).toJson()).toLi st();
3246 }
3247 if (kind != null) {
3248 _json["kind"] = kind;
3249 }
3250 return _json;
3251 }
3252 }
3253
3254
3255 /**
3256 * The existence of an install resource indicates that an app is installed on a
3257 * particular device (or that an install is pending).
3258 *
3259 * The API can be used to create an install resource using the update method.
3260 * This triggers the actual install of the app on the device. If the user does
3261 * not already have an entitlement for the app then an attempt is made to create
3262 * one. If this fails (e.g. because the app is not free and there is no
3263 * available license) then the creation of the install fails.
3264 *
3265 * The API can also be used to update an installed app. If the update method is
3266 * used on an existing install then the app will be updated to the latest
3267 * available version.
3268 *
3269 * Note that it is not possible to force the installation of a specific version
3270 * of an app; the version code is read-only.
3271 *
3272 * If a user installs an app themselves (as permitted by the enterprise), then
3273 * again an install resource and possibly an entitlement resource are
3274 * automatically created.
3275 *
3276 * The API can also be used to delete an install resource, which triggers the
3277 * removal of the app from the device. Note that deleting an install does not
3278 * automatically remove the corresponding entitlement, even if there are no
3279 * remaining installs. The install resource will also be deleted if the user
3280 * uninstalls the app themselves.
3281 */
3282 class Install {
3283 /**
3284 * Install state. The state "installPending" means that an install request has
3285 * recently been made and download to the device is in progress. The state
3286 * "installed" means that the app has been installed. This field is read-only.
3287 */
3288 core.String installState;
3289
3290 /**
3291 * Identifies what kind of resource this is. Value: the fixed string
3292 * "androidenterprise#install".
3293 */
3294 core.String kind;
3295
3296 /**
3297 * The ID of the product that the install is for, e.g.
3298 * "app:com.google.android.gm".
3299 */
3300 core.String productId;
3301
3302 /**
3303 * The version of the installed product. Guaranteed to be set only if the
3304 * install state is "installed".
3305 */
3306 core.int versionCode;
3307
3308
3309 Install();
3310
3311 Install.fromJson(core.Map _json) {
3312 if (_json.containsKey("installState")) {
3313 installState = _json["installState"];
3314 }
3315 if (_json.containsKey("kind")) {
3316 kind = _json["kind"];
3317 }
3318 if (_json.containsKey("productId")) {
3319 productId = _json["productId"];
3320 }
3321 if (_json.containsKey("versionCode")) {
3322 versionCode = _json["versionCode"];
3323 }
3324 }
3325
3326 core.Map toJson() {
3327 var _json = new core.Map();
3328 if (installState != null) {
3329 _json["installState"] = installState;
3330 }
3331 if (kind != null) {
3332 _json["kind"] = kind;
3333 }
3334 if (productId != null) {
3335 _json["productId"] = productId;
3336 }
3337 if (versionCode != null) {
3338 _json["versionCode"] = versionCode;
3339 }
3340 return _json;
3341 }
3342 }
3343
3344
3345 /** The install resources for the device. */
3346 class InstallsListResponse {
3347 /**
3348 * An installation of an app for a user on a specific device. The existence of
3349 * an install implies that the user must have an entitlement to the app.
3350 */
3351 core.List<Install> install;
3352
3353 /**
3354 * Identifies what kind of resource this is. Value: the fixed string
3355 * "androidenterprise#installsListResponse".
3356 */
3357 core.String kind;
3358
3359
3360 InstallsListResponse();
3361
3362 InstallsListResponse.fromJson(core.Map _json) {
3363 if (_json.containsKey("install")) {
3364 install = _json["install"].map((value) => new Install.fromJson(value)).toL ist();
3365 }
3366 if (_json.containsKey("kind")) {
3367 kind = _json["kind"];
3368 }
3369 }
3370
3371 core.Map toJson() {
3372 var _json = new core.Map();
3373 if (install != null) {
3374 _json["install"] = install.map((value) => (value).toJson()).toList();
3375 }
3376 if (kind != null) {
3377 _json["kind"] = kind;
3378 }
3379 return _json;
3380 }
3381 }
3382
3383
3384 /**
3385 * A permission represents some extra capability, to be granted to an Android
3386 * app, which requires explicit consent. An enterprise admin must consent to
3387 * these permissions on behalf of their users before an entitlement for the app
3388 * can be created.
3389 *
3390 * The permissions collection is read-only. The information provided for each
3391 * permission (localized name and description) is intended to be used in the MDM
3392 * user interface when obtaining consent from the enterprise.
3393 */
3394 class Permission {
3395 /**
3396 * A longer description of the permissions giving more details of what it
3397 * affects.
3398 */
3399 core.String description;
3400
3401 /**
3402 * Identifies what kind of resource this is. Value: the fixed string
3403 * "androidenterprise#permission".
3404 */
3405 core.String kind;
3406
3407 /** The name of the permission. */
3408 core.String name;
3409
3410 /** An opaque string uniquely identifying the permission. */
3411 core.String permissionId;
3412
3413
3414 Permission();
3415
3416 Permission.fromJson(core.Map _json) {
3417 if (_json.containsKey("description")) {
3418 description = _json["description"];
3419 }
3420 if (_json.containsKey("kind")) {
3421 kind = _json["kind"];
3422 }
3423 if (_json.containsKey("name")) {
3424 name = _json["name"];
3425 }
3426 if (_json.containsKey("permissionId")) {
3427 permissionId = _json["permissionId"];
3428 }
3429 }
3430
3431 core.Map toJson() {
3432 var _json = new core.Map();
3433 if (description != null) {
3434 _json["description"] = description;
3435 }
3436 if (kind != null) {
3437 _json["kind"] = kind;
3438 }
3439 if (name != null) {
3440 _json["name"] = name;
3441 }
3442 if (permissionId != null) {
3443 _json["permissionId"] = permissionId;
3444 }
3445 return _json;
3446 }
3447 }
3448
3449
3450 /**
3451 * A product represents an app in the Google Play Store that is available to at
3452 * least some users in the enterprise. (Some apps are restricted to a single
3453 * enterprise, and no information about them is made available outside that
3454 * enterprise.)
3455 *
3456 * The information provided for each product (localized name, icon, link to the
3457 * full Google Play details page) is intended to allow a basic representation of
3458 * the product within an MDM user interface.
3459 */
3460 class Product {
3461 /** The name of the author of the product (e.g. the app developer). */
3462 core.String authorName;
3463
3464 /** A link to the (consumer) Google Play details page for the product. */
3465 core.String detailsUrl;
3466
3467 /** A link to an image that can be used as an icon for the product. */
3468 core.String iconUrl;
3469
3470 /**
3471 * Identifies what kind of resource this is. Value: the fixed string
3472 * "androidenterprise#product".
3473 */
3474 core.String kind;
3475
3476 /**
3477 * A string of the form "app:
3478 * " - e.g. "app:com.google.android.gm" represents the GMail app.
3479 */
3480 core.String productId;
3481
3482 /** The name of the product. */
3483 core.String title;
3484
3485 /**
3486 * A link to the Google Play for Work details page for the product, for use by
3487 * an Enterprise administrator.
3488 */
3489 core.String workDetailsUrl;
3490
3491
3492 Product();
3493
3494 Product.fromJson(core.Map _json) {
3495 if (_json.containsKey("authorName")) {
3496 authorName = _json["authorName"];
3497 }
3498 if (_json.containsKey("detailsUrl")) {
3499 detailsUrl = _json["detailsUrl"];
3500 }
3501 if (_json.containsKey("iconUrl")) {
3502 iconUrl = _json["iconUrl"];
3503 }
3504 if (_json.containsKey("kind")) {
3505 kind = _json["kind"];
3506 }
3507 if (_json.containsKey("productId")) {
3508 productId = _json["productId"];
3509 }
3510 if (_json.containsKey("title")) {
3511 title = _json["title"];
3512 }
3513 if (_json.containsKey("workDetailsUrl")) {
3514 workDetailsUrl = _json["workDetailsUrl"];
3515 }
3516 }
3517
3518 core.Map toJson() {
3519 var _json = new core.Map();
3520 if (authorName != null) {
3521 _json["authorName"] = authorName;
3522 }
3523 if (detailsUrl != null) {
3524 _json["detailsUrl"] = detailsUrl;
3525 }
3526 if (iconUrl != null) {
3527 _json["iconUrl"] = iconUrl;
3528 }
3529 if (kind != null) {
3530 _json["kind"] = kind;
3531 }
3532 if (productId != null) {
3533 _json["productId"] = productId;
3534 }
3535 if (title != null) {
3536 _json["title"] = title;
3537 }
3538 if (workDetailsUrl != null) {
3539 _json["workDetailsUrl"] = workDetailsUrl;
3540 }
3541 return _json;
3542 }
3543 }
3544
3545
3546 /**
3547 * A product permissions resource represents the set of permissions required by
3548 * a specific app and whether or not they have been accepted by an enterprise
3549 * admin.
3550 *
3551 * The API can be used to read the set of permissions, and also to update the
3552 * set to indicate that permissions have been accepted.
3553 */
3554 class ProductPermission {
3555 /** An opaque string uniquely identifying the permission. */
3556 core.String permissionId;
3557
3558 /** Whether the permission has been accepted or not. */
3559 core.String state;
3560
3561
3562 ProductPermission();
3563
3564 ProductPermission.fromJson(core.Map _json) {
3565 if (_json.containsKey("permissionId")) {
3566 permissionId = _json["permissionId"];
3567 }
3568 if (_json.containsKey("state")) {
3569 state = _json["state"];
3570 }
3571 }
3572
3573 core.Map toJson() {
3574 var _json = new core.Map();
3575 if (permissionId != null) {
3576 _json["permissionId"] = permissionId;
3577 }
3578 if (state != null) {
3579 _json["state"] = state;
3580 }
3581 return _json;
3582 }
3583 }
3584
3585
3586 /**
3587 * Information about the permissions required by a specific app and whether they
3588 * have been accepted by the enterprise.
3589 */
3590 class ProductPermissions {
3591 /**
3592 * Identifies what kind of resource this is. Value: the fixed string
3593 * "androidenterprise#productPermissions".
3594 */
3595 core.String kind;
3596
3597 /** The permissions required by the app. */
3598 core.List<ProductPermission> permission;
3599
3600 /**
3601 * The ID of the app that the permissions relate to, e.g.
3602 * "app:com.google.android.gm".
3603 */
3604 core.String productId;
3605
3606
3607 ProductPermissions();
3608
3609 ProductPermissions.fromJson(core.Map _json) {
3610 if (_json.containsKey("kind")) {
3611 kind = _json["kind"];
3612 }
3613 if (_json.containsKey("permission")) {
3614 permission = _json["permission"].map((value) => new ProductPermission.from Json(value)).toList();
3615 }
3616 if (_json.containsKey("productId")) {
3617 productId = _json["productId"];
3618 }
3619 }
3620
3621 core.Map toJson() {
3622 var _json = new core.Map();
3623 if (kind != null) {
3624 _json["kind"] = kind;
3625 }
3626 if (permission != null) {
3627 _json["permission"] = permission.map((value) => (value).toJson()).toList() ;
3628 }
3629 if (productId != null) {
3630 _json["productId"] = productId;
3631 }
3632 return _json;
3633 }
3634 }
3635
3636
3637 /**
3638 * A user resource represents an individual user within the enterprise's domain.
3639 *
3640 * Note that each user is associated with a Google account based on the user's
3641 * corporate email address (which must be in one of the enterprise's domains).
3642 * As part of installing an MDM app to manage a device the Google account must
3643 * be provisioned to the device, and so the user resource must be created before
3644 * that. This can be done using the Google Admin SDK Directory API.
3645 *
3646 * The ID for a user is an opaque string. It can be retrieved using the list
3647 * method queried by the user's primary email address.
3648 */
3649 class User {
3650 /** The unique ID for the user. */
3651 core.String id;
3652
3653 /**
3654 * Identifies what kind of resource this is. Value: the fixed string
3655 * "androidenterprise#user".
3656 */
3657 core.String kind;
3658
3659 /** The user's primary email, e.g. "jsmith@example.com". */
3660 core.String primaryEmail;
3661
3662
3663 User();
3664
3665 User.fromJson(core.Map _json) {
3666 if (_json.containsKey("id")) {
3667 id = _json["id"];
3668 }
3669 if (_json.containsKey("kind")) {
3670 kind = _json["kind"];
3671 }
3672 if (_json.containsKey("primaryEmail")) {
3673 primaryEmail = _json["primaryEmail"];
3674 }
3675 }
3676
3677 core.Map toJson() {
3678 var _json = new core.Map();
3679 if (id != null) {
3680 _json["id"] = id;
3681 }
3682 if (kind != null) {
3683 _json["kind"] = kind;
3684 }
3685 if (primaryEmail != null) {
3686 _json["primaryEmail"] = primaryEmail;
3687 }
3688 return _json;
3689 }
3690 }
3691
3692
3693 /**
3694 * A UserToken is used by a user when setting up a managed device or profile
3695 * with their work account on a device. When the user enters their email address
3696 * and token (activation code) the appropriate MDM app can be automatically
3697 * downloaded.
3698 */
3699 class UserToken {
3700 /**
3701 * Identifies what kind of resource this is. Value: the fixed string
3702 * "androidenterprise#userToken".
3703 */
3704 core.String kind;
3705
3706 /**
3707 * The token (activation code) to be entered by the user. This consists of a
3708 * sequence of decimal digits. Note that the leading digit may be 0.
3709 */
3710 core.String token;
3711
3712 /** The unique ID for the user. */
3713 core.String userId;
3714
3715
3716 UserToken();
3717
3718 UserToken.fromJson(core.Map _json) {
3719 if (_json.containsKey("kind")) {
3720 kind = _json["kind"];
3721 }
3722 if (_json.containsKey("token")) {
3723 token = _json["token"];
3724 }
3725 if (_json.containsKey("userId")) {
3726 userId = _json["userId"];
3727 }
3728 }
3729
3730 core.Map toJson() {
3731 var _json = new core.Map();
3732 if (kind != null) {
3733 _json["kind"] = kind;
3734 }
3735 if (token != null) {
3736 _json["token"] = token;
3737 }
3738 if (userId != null) {
3739 _json["userId"] = userId;
3740 }
3741 return _json;
3742 }
3743 }
3744
3745
3746 /** The matching user resources. */
3747 class UsersListResponse {
3748 /**
3749 * Identifies what kind of resource this is. Value: the fixed string
3750 * "androidenterprise#usersListResponse".
3751 */
3752 core.String kind;
3753
3754 /** A user of an enterprise. */
3755 core.List<User> user;
3756
3757
3758 UsersListResponse();
3759
3760 UsersListResponse.fromJson(core.Map _json) {
3761 if (_json.containsKey("kind")) {
3762 kind = _json["kind"];
3763 }
3764 if (_json.containsKey("user")) {
3765 user = _json["user"].map((value) => new User.fromJson(value)).toList();
3766 }
3767 }
3768
3769 core.Map toJson() {
3770 var _json = new core.Map();
3771 if (kind != null) {
3772 _json["kind"] = kind;
3773 }
3774 if (user != null) {
3775 _json["user"] = user.map((value) => (value).toJson()).toList();
3776 }
3777 return _json;
3778 }
3779 }
OLDNEW
« no previous file with comments | « generated/googleapis/lib/analytics/v3.dart ('k') | generated/googleapis/lib/androidpublisher/v2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698