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

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

Issue 2987103002: Api-Roll 52: 2017-07-31 (Closed)
Patch Set: Created 3 years, 4 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.androidmanagement.v1;
4
5 import 'dart:core' as core;
6 import 'dart:async' as async;
7 import 'dart:convert' as convert;
8
9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
10 import 'package:http/http.dart' as http;
11
12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show
13 ApiRequestError, DetailedApiRequestError;
14
15 const core.String USER_AGENT = 'dart-api-client androidmanagement/v1';
16
17 /**
18 * The Android Management API provides remote enterprise management of Android
19 * devices and apps.
20 */
21 class AndroidmanagementApi {
22
23 final commons.ApiRequester _requester;
24
25 EnterprisesResourceApi get enterprises => new EnterprisesResourceApi(_requeste r);
26 SignupUrlsResourceApi get signupUrls => new SignupUrlsResourceApi(_requester);
27
28 AndroidmanagementApi(http.Client client, {core.String rootUrl: "https://androi dmanagement.googleapis.com/", core.String servicePath: ""}) :
29 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A GENT);
30 }
31
32
33 class EnterprisesResourceApi {
34 final commons.ApiRequester _requester;
35
36 EnterprisesApplicationsResourceApi get applications => new EnterprisesApplicat ionsResourceApi(_requester);
37 EnterprisesDevicesResourceApi get devices => new EnterprisesDevicesResourceApi (_requester);
38 EnterprisesEnrollmentTokensResourceApi get enrollmentTokens => new Enterprises EnrollmentTokensResourceApi(_requester);
39 EnterprisesPoliciesResourceApi get policies => new EnterprisesPoliciesResource Api(_requester);
40 EnterprisesWebTokensResourceApi get webTokens => new EnterprisesWebTokensResou rceApi(_requester);
41
42 EnterprisesResourceApi(commons.ApiRequester client) :
43 _requester = client;
44
45 /**
46 * Creates an enterprise by completing the enterprise signup flow.
47 *
48 * [request] - The metadata request object.
49 *
50 * Request parameters:
51 *
52 * [signupUrlName] - The name of the
53 * [`SignupUrl`](/android/management/reference/rest/v1/signupUrls#SignupUrl)
54 * used to sign up for the enterprise.
55 *
56 * [enterpriseToken] - The enterprise token appended to the callback URL.
57 *
58 * [projectId] - The id of the Google Cloud Platform project which will own
59 * the enterprise.
60 *
61 * Completes with a [Enterprise].
62 *
63 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
64 * error.
65 *
66 * If the used [http.Client] completes with an error when making a REST call,
67 * this method will complete with the same error.
68 */
69 async.Future<Enterprise> create(Enterprise request, {core.String signupUrlName , core.String enterpriseToken, core.String projectId}) {
70 var _url = null;
71 var _queryParams = new core.Map();
72 var _uploadMedia = null;
73 var _uploadOptions = null;
74 var _downloadOptions = commons.DownloadOptions.Metadata;
75 var _body = null;
76
77 if (request != null) {
78 _body = convert.JSON.encode((request).toJson());
79 }
80 if (signupUrlName != null) {
81 _queryParams["signupUrlName"] = [signupUrlName];
82 }
83 if (enterpriseToken != null) {
84 _queryParams["enterpriseToken"] = [enterpriseToken];
85 }
86 if (projectId != null) {
87 _queryParams["projectId"] = [projectId];
88 }
89
90 _url = 'v1/enterprises';
91
92 var _response = _requester.request(_url,
93 "POST",
94 body: _body,
95 queryParams: _queryParams,
96 uploadOptions: _uploadOptions,
97 uploadMedia: _uploadMedia,
98 downloadOptions: _downloadOptions);
99 return _response.then((data) => new Enterprise.fromJson(data));
100 }
101
102 /**
103 * Gets an enterprise.
104 *
105 * Request parameters:
106 *
107 * [name] - The name of the enterprise in the form
108 * `enterprises/{enterpriseId}`
109 * Value must have pattern "^enterprises/[^/]+$".
110 *
111 * Completes with a [Enterprise].
112 *
113 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
114 * error.
115 *
116 * If the used [http.Client] completes with an error when making a REST call,
117 * this method will complete with the same error.
118 */
119 async.Future<Enterprise> get(core.String name) {
120 var _url = null;
121 var _queryParams = new core.Map();
122 var _uploadMedia = null;
123 var _uploadOptions = null;
124 var _downloadOptions = commons.DownloadOptions.Metadata;
125 var _body = null;
126
127 if (name == null) {
128 throw new core.ArgumentError("Parameter name is required.");
129 }
130
131 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
132
133 var _response = _requester.request(_url,
134 "GET",
135 body: _body,
136 queryParams: _queryParams,
137 uploadOptions: _uploadOptions,
138 uploadMedia: _uploadMedia,
139 downloadOptions: _downloadOptions);
140 return _response.then((data) => new Enterprise.fromJson(data));
141 }
142
143 /**
144 * Updates an enterprise.
145 *
146 * [request] - The metadata request object.
147 *
148 * Request parameters:
149 *
150 * [name] - The name of the enterprise in the form
151 * `enterprises/{enterpriseId}`
152 * Value must have pattern "^enterprises/[^/]+$".
153 *
154 * [updateMask] - The field mask indicating the fields to update.
155 * If not set, all modifiable fields will be modified.
156 *
157 * Completes with a [Enterprise].
158 *
159 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
160 * error.
161 *
162 * If the used [http.Client] completes with an error when making a REST call,
163 * this method will complete with the same error.
164 */
165 async.Future<Enterprise> patch(Enterprise request, core.String name, {core.Str ing updateMask}) {
166 var _url = null;
167 var _queryParams = new core.Map();
168 var _uploadMedia = null;
169 var _uploadOptions = null;
170 var _downloadOptions = commons.DownloadOptions.Metadata;
171 var _body = null;
172
173 if (request != null) {
174 _body = convert.JSON.encode((request).toJson());
175 }
176 if (name == null) {
177 throw new core.ArgumentError("Parameter name is required.");
178 }
179 if (updateMask != null) {
180 _queryParams["updateMask"] = [updateMask];
181 }
182
183 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
184
185 var _response = _requester.request(_url,
186 "PATCH",
187 body: _body,
188 queryParams: _queryParams,
189 uploadOptions: _uploadOptions,
190 uploadMedia: _uploadMedia,
191 downloadOptions: _downloadOptions);
192 return _response.then((data) => new Enterprise.fromJson(data));
193 }
194
195 }
196
197
198 class EnterprisesApplicationsResourceApi {
199 final commons.ApiRequester _requester;
200
201 EnterprisesApplicationsResourceApi(commons.ApiRequester client) :
202 _requester = client;
203
204 /**
205 * Gets info about an application.
206 *
207 * Request parameters:
208 *
209 * [name] - The name of the application in the form
210 * `enterprises/{enterpriseId}/applications/{package_name}`
211 * Value must have pattern "^enterprises/[^/]+/applications/[^/]+$".
212 *
213 * [languageCode] - The preferred language for localized application info, as
214 * a BCP47 tag
215 * (e.g. "en-US", "de"). If not specified the default language of the
216 * application will be used.
217 *
218 * Completes with a [Application].
219 *
220 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
221 * error.
222 *
223 * If the used [http.Client] completes with an error when making a REST call,
224 * this method will complete with the same error.
225 */
226 async.Future<Application> get(core.String name, {core.String languageCode}) {
227 var _url = null;
228 var _queryParams = new core.Map();
229 var _uploadMedia = null;
230 var _uploadOptions = null;
231 var _downloadOptions = commons.DownloadOptions.Metadata;
232 var _body = null;
233
234 if (name == null) {
235 throw new core.ArgumentError("Parameter name is required.");
236 }
237 if (languageCode != null) {
238 _queryParams["languageCode"] = [languageCode];
239 }
240
241 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
242
243 var _response = _requester.request(_url,
244 "GET",
245 body: _body,
246 queryParams: _queryParams,
247 uploadOptions: _uploadOptions,
248 uploadMedia: _uploadMedia,
249 downloadOptions: _downloadOptions);
250 return _response.then((data) => new Application.fromJson(data));
251 }
252
253 }
254
255
256 class EnterprisesDevicesResourceApi {
257 final commons.ApiRequester _requester;
258
259 EnterprisesDevicesOperationsResourceApi get operations => new EnterprisesDevic esOperationsResourceApi(_requester);
260
261 EnterprisesDevicesResourceApi(commons.ApiRequester client) :
262 _requester = client;
263
264 /**
265 * Deletes a device, which causes the device to be wiped.
266 *
267 * Request parameters:
268 *
269 * [name] - The name of the device in the form
270 * `enterprises/{enterpriseId}/devices/{deviceId}`
271 * Value must have pattern "^enterprises/[^/]+/devices/[^/]+$".
272 *
273 * Completes with a [Empty].
274 *
275 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
276 * error.
277 *
278 * If the used [http.Client] completes with an error when making a REST call,
279 * this method will complete with the same error.
280 */
281 async.Future<Empty> delete(core.String name) {
282 var _url = null;
283 var _queryParams = new core.Map();
284 var _uploadMedia = null;
285 var _uploadOptions = null;
286 var _downloadOptions = commons.DownloadOptions.Metadata;
287 var _body = null;
288
289 if (name == null) {
290 throw new core.ArgumentError("Parameter name is required.");
291 }
292
293 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
294
295 var _response = _requester.request(_url,
296 "DELETE",
297 body: _body,
298 queryParams: _queryParams,
299 uploadOptions: _uploadOptions,
300 uploadMedia: _uploadMedia,
301 downloadOptions: _downloadOptions);
302 return _response.then((data) => new Empty.fromJson(data));
303 }
304
305 /**
306 * Gets a device.
307 *
308 * Request parameters:
309 *
310 * [name] - The name of the device in the form
311 * `enterprises/{enterpriseId}/devices/{deviceId}`
312 * Value must have pattern "^enterprises/[^/]+/devices/[^/]+$".
313 *
314 * Completes with a [Device].
315 *
316 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
317 * error.
318 *
319 * If the used [http.Client] completes with an error when making a REST call,
320 * this method will complete with the same error.
321 */
322 async.Future<Device> get(core.String name) {
323 var _url = null;
324 var _queryParams = new core.Map();
325 var _uploadMedia = null;
326 var _uploadOptions = null;
327 var _downloadOptions = commons.DownloadOptions.Metadata;
328 var _body = null;
329
330 if (name == null) {
331 throw new core.ArgumentError("Parameter name is required.");
332 }
333
334 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
335
336 var _response = _requester.request(_url,
337 "GET",
338 body: _body,
339 queryParams: _queryParams,
340 uploadOptions: _uploadOptions,
341 uploadMedia: _uploadMedia,
342 downloadOptions: _downloadOptions);
343 return _response.then((data) => new Device.fromJson(data));
344 }
345
346 /**
347 * Issues a command to a device. The
348 * [`Operation`](/android/management/reference/rest/v1/enterprises.devices.ope rations#Operation)
349 * resource returned contains a
350 * [`Command`](/android/management/reference/rest/v1/enterprises.devices/issue Command#Command)
351 * in its `metadata` field.
352 * Use the
353 * [get operation
354 * method](/android/management/reference/rest/v1/enterprises.devices.operation s/get)
355 * to get the status of the command.
356 *
357 * [request] - The metadata request object.
358 *
359 * Request parameters:
360 *
361 * [name] - The name of the device in the form
362 * `enterprises/{enterpriseId}/devices/{deviceId}`
363 * Value must have pattern "^enterprises/[^/]+/devices/[^/]+$".
364 *
365 * Completes with a [Operation].
366 *
367 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
368 * error.
369 *
370 * If the used [http.Client] completes with an error when making a REST call,
371 * this method will complete with the same error.
372 */
373 async.Future<Operation> issueCommand(Command request, core.String name) {
374 var _url = null;
375 var _queryParams = new core.Map();
376 var _uploadMedia = null;
377 var _uploadOptions = null;
378 var _downloadOptions = commons.DownloadOptions.Metadata;
379 var _body = null;
380
381 if (request != null) {
382 _body = convert.JSON.encode((request).toJson());
383 }
384 if (name == null) {
385 throw new core.ArgumentError("Parameter name is required.");
386 }
387
388 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':issueComma nd';
389
390 var _response = _requester.request(_url,
391 "POST",
392 body: _body,
393 queryParams: _queryParams,
394 uploadOptions: _uploadOptions,
395 uploadMedia: _uploadMedia,
396 downloadOptions: _downloadOptions);
397 return _response.then((data) => new Operation.fromJson(data));
398 }
399
400 /**
401 * Lists devices for a given enterprise.
402 *
403 * Request parameters:
404 *
405 * [parent] - The name of the enterprise in the form
406 * `enterprises/{enterpriseId}`
407 * Value must have pattern "^enterprises/[^/]+$".
408 *
409 * [pageSize] - The requested page size. The actual page size may be fixed to
410 * a min or max
411 * value.
412 *
413 * [pageToken] - A token identifying a page of results the server should
414 * return.
415 *
416 * Completes with a [ListDevicesResponse].
417 *
418 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
419 * error.
420 *
421 * If the used [http.Client] completes with an error when making a REST call,
422 * this method will complete with the same error.
423 */
424 async.Future<ListDevicesResponse> list(core.String parent, {core.int pageSize, core.String pageToken}) {
425 var _url = null;
426 var _queryParams = new core.Map();
427 var _uploadMedia = null;
428 var _uploadOptions = null;
429 var _downloadOptions = commons.DownloadOptions.Metadata;
430 var _body = null;
431
432 if (parent == null) {
433 throw new core.ArgumentError("Parameter parent is required.");
434 }
435 if (pageSize != null) {
436 _queryParams["pageSize"] = ["${pageSize}"];
437 }
438 if (pageToken != null) {
439 _queryParams["pageToken"] = [pageToken];
440 }
441
442 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/devices' ;
443
444 var _response = _requester.request(_url,
445 "GET",
446 body: _body,
447 queryParams: _queryParams,
448 uploadOptions: _uploadOptions,
449 uploadMedia: _uploadMedia,
450 downloadOptions: _downloadOptions);
451 return _response.then((data) => new ListDevicesResponse.fromJson(data));
452 }
453
454 /**
455 * Updates a device.
456 *
457 * [request] - The metadata request object.
458 *
459 * Request parameters:
460 *
461 * [name] - The name of the device in the form
462 * `enterprises/{enterpriseId}/devices/{deviceId}`
463 * Value must have pattern "^enterprises/[^/]+/devices/[^/]+$".
464 *
465 * [updateMask] - The field mask indicating the fields to update.
466 * If not set, all modifiable fields will be modified.
467 *
468 * Completes with a [Device].
469 *
470 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
471 * error.
472 *
473 * If the used [http.Client] completes with an error when making a REST call,
474 * this method will complete with the same error.
475 */
476 async.Future<Device> patch(Device request, core.String name, {core.String upda teMask}) {
477 var _url = null;
478 var _queryParams = new core.Map();
479 var _uploadMedia = null;
480 var _uploadOptions = null;
481 var _downloadOptions = commons.DownloadOptions.Metadata;
482 var _body = null;
483
484 if (request != null) {
485 _body = convert.JSON.encode((request).toJson());
486 }
487 if (name == null) {
488 throw new core.ArgumentError("Parameter name is required.");
489 }
490 if (updateMask != null) {
491 _queryParams["updateMask"] = [updateMask];
492 }
493
494 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
495
496 var _response = _requester.request(_url,
497 "PATCH",
498 body: _body,
499 queryParams: _queryParams,
500 uploadOptions: _uploadOptions,
501 uploadMedia: _uploadMedia,
502 downloadOptions: _downloadOptions);
503 return _response.then((data) => new Device.fromJson(data));
504 }
505
506 }
507
508
509 class EnterprisesDevicesOperationsResourceApi {
510 final commons.ApiRequester _requester;
511
512 EnterprisesDevicesOperationsResourceApi(commons.ApiRequester client) :
513 _requester = client;
514
515 /**
516 * Starts asynchronous cancellation on a long-running operation. The server
517 * makes a best effort to cancel the operation, but success is not
518 * guaranteed. If the server doesn't support this method, it returns
519 * `google.rpc.Code.UNIMPLEMENTED`. Clients can use
520 * Operations.GetOperation or
521 * other methods to check whether the cancellation succeeded or whether the
522 * operation completed despite cancellation. On successful cancellation,
523 * the operation is not deleted; instead, it becomes an operation with
524 * an Operation.error value with a google.rpc.Status.code of 1,
525 * corresponding to `Code.CANCELLED`.
526 *
527 * Request parameters:
528 *
529 * [name] - The name of the operation resource to be cancelled.
530 * Value must have pattern
531 * "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$".
532 *
533 * Completes with a [Empty].
534 *
535 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
536 * error.
537 *
538 * If the used [http.Client] completes with an error when making a REST call,
539 * this method will complete with the same error.
540 */
541 async.Future<Empty> cancel(core.String name) {
542 var _url = null;
543 var _queryParams = new core.Map();
544 var _uploadMedia = null;
545 var _uploadOptions = null;
546 var _downloadOptions = commons.DownloadOptions.Metadata;
547 var _body = null;
548
549 if (name == null) {
550 throw new core.ArgumentError("Parameter name is required.");
551 }
552
553 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name') + ':cancel';
554
555 var _response = _requester.request(_url,
556 "POST",
557 body: _body,
558 queryParams: _queryParams,
559 uploadOptions: _uploadOptions,
560 uploadMedia: _uploadMedia,
561 downloadOptions: _downloadOptions);
562 return _response.then((data) => new Empty.fromJson(data));
563 }
564
565 /**
566 * Deletes a long-running operation. This method indicates that the client is
567 * no longer interested in the operation result. It does not cancel the
568 * operation. If the server doesn't support this method, it returns
569 * `google.rpc.Code.UNIMPLEMENTED`.
570 *
571 * Request parameters:
572 *
573 * [name] - The name of the operation resource to be deleted.
574 * Value must have pattern
575 * "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$".
576 *
577 * Completes with a [Empty].
578 *
579 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
580 * error.
581 *
582 * If the used [http.Client] completes with an error when making a REST call,
583 * this method will complete with the same error.
584 */
585 async.Future<Empty> delete(core.String name) {
586 var _url = null;
587 var _queryParams = new core.Map();
588 var _uploadMedia = null;
589 var _uploadOptions = null;
590 var _downloadOptions = commons.DownloadOptions.Metadata;
591 var _body = null;
592
593 if (name == null) {
594 throw new core.ArgumentError("Parameter name is required.");
595 }
596
597 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
598
599 var _response = _requester.request(_url,
600 "DELETE",
601 body: _body,
602 queryParams: _queryParams,
603 uploadOptions: _uploadOptions,
604 uploadMedia: _uploadMedia,
605 downloadOptions: _downloadOptions);
606 return _response.then((data) => new Empty.fromJson(data));
607 }
608
609 /**
610 * Gets the latest state of a long-running operation. Clients can use this
611 * method to poll the operation result at intervals as recommended by the API
612 * service.
613 *
614 * Request parameters:
615 *
616 * [name] - The name of the operation resource.
617 * Value must have pattern
618 * "^enterprises/[^/]+/devices/[^/]+/operations/[^/]+$".
619 *
620 * Completes with a [Operation].
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<Operation> get(core.String name) {
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 (name == null) {
637 throw new core.ArgumentError("Parameter name is required.");
638 }
639
640 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
641
642 var _response = _requester.request(_url,
643 "GET",
644 body: _body,
645 queryParams: _queryParams,
646 uploadOptions: _uploadOptions,
647 uploadMedia: _uploadMedia,
648 downloadOptions: _downloadOptions);
649 return _response.then((data) => new Operation.fromJson(data));
650 }
651
652 /**
653 * Lists operations that match the specified filter in the request. If the
654 * server doesn't support this method, it returns `UNIMPLEMENTED`.
655 *
656 * NOTE: the `name` binding allows API services to override the binding
657 * to use different resource name schemes, such as `users / * /operations`. To
658 * override the binding, API services can add a binding such as
659 * `"/v1/{name=users / * }/operations"` to their service configuration.
660 * For backwards compatibility, the default name includes the operations
661 * collection id, however overriding users must ensure the name binding
662 * is the parent resource, without the operations collection id.
663 *
664 * Request parameters:
665 *
666 * [name] - The name of the operation's parent resource.
667 * Value must have pattern "^enterprises/[^/]+/devices/[^/]+/operations$".
668 *
669 * [pageSize] - The standard list page size.
670 *
671 * [filter] - The standard list filter.
672 *
673 * [pageToken] - The standard list page token.
674 *
675 * Completes with a [ListOperationsResponse].
676 *
677 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
678 * error.
679 *
680 * If the used [http.Client] completes with an error when making a REST call,
681 * this method will complete with the same error.
682 */
683 async.Future<ListOperationsResponse> list(core.String name, {core.int pageSize , core.String filter, core.String pageToken}) {
684 var _url = null;
685 var _queryParams = new core.Map();
686 var _uploadMedia = null;
687 var _uploadOptions = null;
688 var _downloadOptions = commons.DownloadOptions.Metadata;
689 var _body = null;
690
691 if (name == null) {
692 throw new core.ArgumentError("Parameter name is required.");
693 }
694 if (pageSize != null) {
695 _queryParams["pageSize"] = ["${pageSize}"];
696 }
697 if (filter != null) {
698 _queryParams["filter"] = [filter];
699 }
700 if (pageToken != null) {
701 _queryParams["pageToken"] = [pageToken];
702 }
703
704 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
705
706 var _response = _requester.request(_url,
707 "GET",
708 body: _body,
709 queryParams: _queryParams,
710 uploadOptions: _uploadOptions,
711 uploadMedia: _uploadMedia,
712 downloadOptions: _downloadOptions);
713 return _response.then((data) => new ListOperationsResponse.fromJson(data));
714 }
715
716 }
717
718
719 class EnterprisesEnrollmentTokensResourceApi {
720 final commons.ApiRequester _requester;
721
722 EnterprisesEnrollmentTokensResourceApi(commons.ApiRequester client) :
723 _requester = client;
724
725 /**
726 * Creates an enrollment token for a given enterprise.
727 *
728 * [request] - The metadata request object.
729 *
730 * Request parameters:
731 *
732 * [parent] - The name of the enterprise in the form
733 * `enterprises/{enterpriseId}`
734 * Value must have pattern "^enterprises/[^/]+$".
735 *
736 * Completes with a [EnrollmentToken].
737 *
738 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
739 * error.
740 *
741 * If the used [http.Client] completes with an error when making a REST call,
742 * this method will complete with the same error.
743 */
744 async.Future<EnrollmentToken> create(EnrollmentToken request, core.String pare nt) {
745 var _url = null;
746 var _queryParams = new core.Map();
747 var _uploadMedia = null;
748 var _uploadOptions = null;
749 var _downloadOptions = commons.DownloadOptions.Metadata;
750 var _body = null;
751
752 if (request != null) {
753 _body = convert.JSON.encode((request).toJson());
754 }
755 if (parent == null) {
756 throw new core.ArgumentError("Parameter parent is required.");
757 }
758
759 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/enrollme ntTokens';
760
761 var _response = _requester.request(_url,
762 "POST",
763 body: _body,
764 queryParams: _queryParams,
765 uploadOptions: _uploadOptions,
766 uploadMedia: _uploadMedia,
767 downloadOptions: _downloadOptions);
768 return _response.then((data) => new EnrollmentToken.fromJson(data));
769 }
770
771 /**
772 * Deletes an enrollment token, which prevents future use of the token.
773 *
774 * Request parameters:
775 *
776 * [name] - The name of the enrollment token in the form
777 * `enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}`
778 * Value must have pattern "^enterprises/[^/]+/enrollmentTokens/[^/]+$".
779 *
780 * Completes with a [Empty].
781 *
782 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
783 * error.
784 *
785 * If the used [http.Client] completes with an error when making a REST call,
786 * this method will complete with the same error.
787 */
788 async.Future<Empty> delete(core.String name) {
789 var _url = null;
790 var _queryParams = new core.Map();
791 var _uploadMedia = null;
792 var _uploadOptions = null;
793 var _downloadOptions = commons.DownloadOptions.Metadata;
794 var _body = null;
795
796 if (name == null) {
797 throw new core.ArgumentError("Parameter name is required.");
798 }
799
800 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
801
802 var _response = _requester.request(_url,
803 "DELETE",
804 body: _body,
805 queryParams: _queryParams,
806 uploadOptions: _uploadOptions,
807 uploadMedia: _uploadMedia,
808 downloadOptions: _downloadOptions);
809 return _response.then((data) => new Empty.fromJson(data));
810 }
811
812 }
813
814
815 class EnterprisesPoliciesResourceApi {
816 final commons.ApiRequester _requester;
817
818 EnterprisesPoliciesResourceApi(commons.ApiRequester client) :
819 _requester = client;
820
821 /**
822 * Deletes a policy. This operation is only permitted if no devices are
823 * currently referencing the policy.
824 *
825 * Request parameters:
826 *
827 * [name] - The name of the policy in the form
828 * `enterprises/{enterpriseId}/policies/{policyId}`
829 * Value must have pattern "^enterprises/[^/]+/policies/[^/]+$".
830 *
831 * Completes with a [Empty].
832 *
833 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
834 * error.
835 *
836 * If the used [http.Client] completes with an error when making a REST call,
837 * this method will complete with the same error.
838 */
839 async.Future<Empty> delete(core.String name) {
840 var _url = null;
841 var _queryParams = new core.Map();
842 var _uploadMedia = null;
843 var _uploadOptions = null;
844 var _downloadOptions = commons.DownloadOptions.Metadata;
845 var _body = null;
846
847 if (name == null) {
848 throw new core.ArgumentError("Parameter name is required.");
849 }
850
851 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
852
853 var _response = _requester.request(_url,
854 "DELETE",
855 body: _body,
856 queryParams: _queryParams,
857 uploadOptions: _uploadOptions,
858 uploadMedia: _uploadMedia,
859 downloadOptions: _downloadOptions);
860 return _response.then((data) => new Empty.fromJson(data));
861 }
862
863 /**
864 * Gets a policy.
865 *
866 * Request parameters:
867 *
868 * [name] - The name of the policy in the form
869 * `enterprises/{enterpriseId}/policies/{policyId}`
870 * Value must have pattern "^enterprises/[^/]+/policies/[^/]+$".
871 *
872 * Completes with a [Policy].
873 *
874 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
875 * error.
876 *
877 * If the used [http.Client] completes with an error when making a REST call,
878 * this method will complete with the same error.
879 */
880 async.Future<Policy> get(core.String name) {
881 var _url = null;
882 var _queryParams = new core.Map();
883 var _uploadMedia = null;
884 var _uploadOptions = null;
885 var _downloadOptions = commons.DownloadOptions.Metadata;
886 var _body = null;
887
888 if (name == null) {
889 throw new core.ArgumentError("Parameter name is required.");
890 }
891
892 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
893
894 var _response = _requester.request(_url,
895 "GET",
896 body: _body,
897 queryParams: _queryParams,
898 uploadOptions: _uploadOptions,
899 uploadMedia: _uploadMedia,
900 downloadOptions: _downloadOptions);
901 return _response.then((data) => new Policy.fromJson(data));
902 }
903
904 /**
905 * Lists policies for a given enterprise.
906 *
907 * Request parameters:
908 *
909 * [parent] - The name of the enterprise in the form
910 * `enterprises/{enterpriseId}`
911 * Value must have pattern "^enterprises/[^/]+$".
912 *
913 * [pageSize] - The requested page size. The actual page size may be fixed to
914 * a min or max
915 * value.
916 *
917 * [pageToken] - A token identifying a page of results the server should
918 * return.
919 *
920 * Completes with a [ListPoliciesResponse].
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<ListPoliciesResponse> list(core.String parent, {core.int pageSize , core.String pageToken}) {
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 (parent == null) {
937 throw new core.ArgumentError("Parameter parent is required.");
938 }
939 if (pageSize != null) {
940 _queryParams["pageSize"] = ["${pageSize}"];
941 }
942 if (pageToken != null) {
943 _queryParams["pageToken"] = [pageToken];
944 }
945
946 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/policies ';
947
948 var _response = _requester.request(_url,
949 "GET",
950 body: _body,
951 queryParams: _queryParams,
952 uploadOptions: _uploadOptions,
953 uploadMedia: _uploadMedia,
954 downloadOptions: _downloadOptions);
955 return _response.then((data) => new ListPoliciesResponse.fromJson(data));
956 }
957
958 /**
959 * Updates or creates a policy.
960 *
961 * [request] - The metadata request object.
962 *
963 * Request parameters:
964 *
965 * [name] - The name of the policy in the form
966 * `enterprises/{enterpriseId}/policies/{policyId}`
967 * Value must have pattern "^enterprises/[^/]+/policies/[^/]+$".
968 *
969 * [updateMask] - The field mask indicating the fields to update.
970 * If not set, all modifiable fields will be modified.
971 *
972 * Completes with a [Policy].
973 *
974 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
975 * error.
976 *
977 * If the used [http.Client] completes with an error when making a REST call,
978 * this method will complete with the same error.
979 */
980 async.Future<Policy> patch(Policy request, core.String name, {core.String upda teMask}) {
981 var _url = null;
982 var _queryParams = new core.Map();
983 var _uploadMedia = null;
984 var _uploadOptions = null;
985 var _downloadOptions = commons.DownloadOptions.Metadata;
986 var _body = null;
987
988 if (request != null) {
989 _body = convert.JSON.encode((request).toJson());
990 }
991 if (name == null) {
992 throw new core.ArgumentError("Parameter name is required.");
993 }
994 if (updateMask != null) {
995 _queryParams["updateMask"] = [updateMask];
996 }
997
998 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
999
1000 var _response = _requester.request(_url,
1001 "PATCH",
1002 body: _body,
1003 queryParams: _queryParams,
1004 uploadOptions: _uploadOptions,
1005 uploadMedia: _uploadMedia,
1006 downloadOptions: _downloadOptions);
1007 return _response.then((data) => new Policy.fromJson(data));
1008 }
1009
1010 }
1011
1012
1013 class EnterprisesWebTokensResourceApi {
1014 final commons.ApiRequester _requester;
1015
1016 EnterprisesWebTokensResourceApi(commons.ApiRequester client) :
1017 _requester = client;
1018
1019 /**
1020 * Creates a web token to access an embeddable managed Google Play web UI for
1021 * a given enterprise.
1022 *
1023 * [request] - The metadata request object.
1024 *
1025 * Request parameters:
1026 *
1027 * [parent] - The name of the enterprise in the form
1028 * `enterprises/{enterpriseId}`
1029 * Value must have pattern "^enterprises/[^/]+$".
1030 *
1031 * Completes with a [WebToken].
1032 *
1033 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1034 * error.
1035 *
1036 * If the used [http.Client] completes with an error when making a REST call,
1037 * this method will complete with the same error.
1038 */
1039 async.Future<WebToken> create(WebToken request, core.String parent) {
1040 var _url = null;
1041 var _queryParams = new core.Map();
1042 var _uploadMedia = null;
1043 var _uploadOptions = null;
1044 var _downloadOptions = commons.DownloadOptions.Metadata;
1045 var _body = null;
1046
1047 if (request != null) {
1048 _body = convert.JSON.encode((request).toJson());
1049 }
1050 if (parent == null) {
1051 throw new core.ArgumentError("Parameter parent is required.");
1052 }
1053
1054 _url = 'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/webToken s';
1055
1056 var _response = _requester.request(_url,
1057 "POST",
1058 body: _body,
1059 queryParams: _queryParams,
1060 uploadOptions: _uploadOptions,
1061 uploadMedia: _uploadMedia,
1062 downloadOptions: _downloadOptions);
1063 return _response.then((data) => new WebToken.fromJson(data));
1064 }
1065
1066 }
1067
1068
1069 class SignupUrlsResourceApi {
1070 final commons.ApiRequester _requester;
1071
1072 SignupUrlsResourceApi(commons.ApiRequester client) :
1073 _requester = client;
1074
1075 /**
1076 * Creates an enterprise signup URL.
1077 *
1078 * Request parameters:
1079 *
1080 * [callbackUrl] - The callback URL to which the admin will be redirected
1081 * after successfully
1082 * creating an enterprise. Before redirecting there the system will add a
1083 * query parameter to this URL named `enterpriseToken` which will
1084 * contain an opaque token to be used for the
1085 * [create
1086 * enterprise](/android/management/reference/rest/v1/enterprises/create)
1087 * request. The URL will be parsed then reformatted in order to add the
1088 * `enterpriseToken` parameter, so there may be some minor formatting changes.
1089 *
1090 * [projectId] - The id of the Google Cloud Platform project which will own
1091 * the enterprise.
1092 *
1093 * Completes with a [SignupUrl].
1094 *
1095 * Completes with a [commons.ApiRequestError] if the API endpoint returned an
1096 * error.
1097 *
1098 * If the used [http.Client] completes with an error when making a REST call,
1099 * this method will complete with the same error.
1100 */
1101 async.Future<SignupUrl> create({core.String callbackUrl, core.String projectId }) {
1102 var _url = null;
1103 var _queryParams = new core.Map();
1104 var _uploadMedia = null;
1105 var _uploadOptions = null;
1106 var _downloadOptions = commons.DownloadOptions.Metadata;
1107 var _body = null;
1108
1109 if (callbackUrl != null) {
1110 _queryParams["callbackUrl"] = [callbackUrl];
1111 }
1112 if (projectId != null) {
1113 _queryParams["projectId"] = [projectId];
1114 }
1115
1116 _url = 'v1/signupUrls';
1117
1118 var _response = _requester.request(_url,
1119 "POST",
1120 body: _body,
1121 queryParams: _queryParams,
1122 uploadOptions: _uploadOptions,
1123 uploadMedia: _uploadMedia,
1124 downloadOptions: _downloadOptions);
1125 return _response.then((data) => new SignupUrl.fromJson(data));
1126 }
1127
1128 }
1129
1130
1131
1132 /**
1133 * A compliance rule condition which is satisfied if the Android Framework API
1134 * level on the device does not meet a minimum requirement. There can only be
1135 * one rule with this type of condition per policy.
1136 */
1137 class ApiLevelCondition {
1138 /**
1139 * The minimum desired Android Framework API level. If the device does not
1140 * meet the minimum requirement, this condition is satisfied. Must be greater
1141 * than zero.
1142 */
1143 core.int minApiLevel;
1144
1145 ApiLevelCondition();
1146
1147 ApiLevelCondition.fromJson(core.Map _json) {
1148 if (_json.containsKey("minApiLevel")) {
1149 minApiLevel = _json["minApiLevel"];
1150 }
1151 }
1152
1153 core.Map<core.String, core.Object> toJson() {
1154 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1155 if (minApiLevel != null) {
1156 _json["minApiLevel"] = minApiLevel;
1157 }
1158 return _json;
1159 }
1160 }
1161
1162 /** Application information. */
1163 class Application {
1164 /**
1165 * The set of managed properties available to be pre-configured for the
1166 * application.
1167 */
1168 core.List<ManagedProperty> managedProperties;
1169 /**
1170 * The name of the application in the form
1171 * `enterprises/{enterpriseId}/applications/{package_name}`
1172 */
1173 core.String name;
1174 /** The permissions required by the app. */
1175 core.List<ApplicationPermission> permissions;
1176 /** The title of the application. Localized. */
1177 core.String title;
1178
1179 Application();
1180
1181 Application.fromJson(core.Map _json) {
1182 if (_json.containsKey("managedProperties")) {
1183 managedProperties = _json["managedProperties"].map((value) => new ManagedP roperty.fromJson(value)).toList();
1184 }
1185 if (_json.containsKey("name")) {
1186 name = _json["name"];
1187 }
1188 if (_json.containsKey("permissions")) {
1189 permissions = _json["permissions"].map((value) => new ApplicationPermissio n.fromJson(value)).toList();
1190 }
1191 if (_json.containsKey("title")) {
1192 title = _json["title"];
1193 }
1194 }
1195
1196 core.Map<core.String, core.Object> toJson() {
1197 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1198 if (managedProperties != null) {
1199 _json["managedProperties"] = managedProperties.map((value) => (value).toJs on()).toList();
1200 }
1201 if (name != null) {
1202 _json["name"] = name;
1203 }
1204 if (permissions != null) {
1205 _json["permissions"] = permissions.map((value) => (value).toJson()).toList ();
1206 }
1207 if (title != null) {
1208 _json["title"] = title;
1209 }
1210 return _json;
1211 }
1212 }
1213
1214 /** Application permission. */
1215 class ApplicationPermission {
1216 /**
1217 * A longer description of the permission, giving more details of
1218 * what it affects. Localized.
1219 */
1220 core.String description;
1221 /** The name of the permission. Localized. */
1222 core.String name;
1223 /** An opaque string uniquely identifying the permission. Not localized. */
1224 core.String permissionId;
1225
1226 ApplicationPermission();
1227
1228 ApplicationPermission.fromJson(core.Map _json) {
1229 if (_json.containsKey("description")) {
1230 description = _json["description"];
1231 }
1232 if (_json.containsKey("name")) {
1233 name = _json["name"];
1234 }
1235 if (_json.containsKey("permissionId")) {
1236 permissionId = _json["permissionId"];
1237 }
1238 }
1239
1240 core.Map<core.String, core.Object> toJson() {
1241 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1242 if (description != null) {
1243 _json["description"] = description;
1244 }
1245 if (name != null) {
1246 _json["name"] = name;
1247 }
1248 if (permissionId != null) {
1249 _json["permissionId"] = permissionId;
1250 }
1251 return _json;
1252 }
1253 }
1254
1255 /** Policy for an individual app. */
1256 class ApplicationPolicy {
1257 /**
1258 * The default policy for all permissions requested by the app. If specified,
1259 * this overrides the policy-level `default_permission_policy` which applies
1260 * to all apps.
1261 * Possible string values are:
1262 * - "PERMISSION_POLICY_UNSPECIFIED" : Policy not specified. If no policy is
1263 * specified for a permission at any
1264 * level, then the `PROMPT` behavior is used by default.
1265 * - "PROMPT" : Prompt the user to grant a permission.
1266 * - "GRANT" : Automatically grant a permission.
1267 * - "DENY" : Automatically deny a permission.
1268 */
1269 core.String defaultPermissionPolicy;
1270 /**
1271 * The type of installation to perform.
1272 * Possible string values are:
1273 * - "INSTALL_TYPE_UNSPECIFIED" : No automatic installation is performed. Any
1274 * other app policies will be
1275 * applied if the user installs the app.
1276 * - "PREINSTALLED" : The application is automatically installed and can be
1277 * removed by the
1278 * user.
1279 * - "FORCE_INSTALLED" : The application is automatically installed and cannot
1280 * be removed by the
1281 * user.
1282 */
1283 core.String installType;
1284 /** Whether the application is allowed to lock itself in full-screen mode. */
1285 core.bool lockTaskAllowed;
1286 /**
1287 * Managed configuration applied to the app. The format for the configuration
1288 * is dictated by the
1289 * [`ManagedProperty`](/android/management/reference/rest/v1/enterprises.appli cations#ManagedProperty)
1290 * values supported by the app. Each field name in the managed configuration
1291 * must match the `key` field of the `ManagedProperty`. The field value must
1292 * be compatible with the `type` of the `ManagedProperty`:
1293 * <table>
1294 * <tr><td><i>type</i></td><td><i>JSON value</i></td></tr>
1295 * <tr><td>`BOOL`</td><td>`true` or `false`</td></tr>
1296 * <tr><td>`STRING`</td><td>string</td></tr>
1297 * <tr><td>`INTEGER`</td><td>number</td></tr>
1298 * <tr><td>`CHOICE`</td><td>string</td></tr>
1299 * <tr><td>`MULTISELECT`</td><td>array of strings</td></tr>
1300 * <tr><td>`HIDDEN`</td><td>string</td></tr>
1301 * <tr><td>`BUNDLE_ARRAY`</td><td>array of objects</td></tr>
1302 * </table>
1303 *
1304 * The values for Object must be JSON objects. It can consist of `num`,
1305 * `String`, `bool` and `null` as well as `Map` and `List` values.
1306 */
1307 core.Map<core.String, core.Object> managedConfiguration;
1308 /**
1309 * The package name of the app, e.g. `com.google.android.youtube` for the
1310 * YouTube app.
1311 */
1312 core.String packageName;
1313 /**
1314 * Explicit permission grants or denials for the app. These values override
1315 * the `default_permission_policy`.
1316 */
1317 core.List<PermissionGrant> permissionGrants;
1318
1319 ApplicationPolicy();
1320
1321 ApplicationPolicy.fromJson(core.Map _json) {
1322 if (_json.containsKey("defaultPermissionPolicy")) {
1323 defaultPermissionPolicy = _json["defaultPermissionPolicy"];
1324 }
1325 if (_json.containsKey("installType")) {
1326 installType = _json["installType"];
1327 }
1328 if (_json.containsKey("lockTaskAllowed")) {
1329 lockTaskAllowed = _json["lockTaskAllowed"];
1330 }
1331 if (_json.containsKey("managedConfiguration")) {
1332 managedConfiguration = _json["managedConfiguration"];
1333 }
1334 if (_json.containsKey("packageName")) {
1335 packageName = _json["packageName"];
1336 }
1337 if (_json.containsKey("permissionGrants")) {
1338 permissionGrants = _json["permissionGrants"].map((value) => new Permission Grant.fromJson(value)).toList();
1339 }
1340 }
1341
1342 core.Map<core.String, core.Object> toJson() {
1343 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1344 if (defaultPermissionPolicy != null) {
1345 _json["defaultPermissionPolicy"] = defaultPermissionPolicy;
1346 }
1347 if (installType != null) {
1348 _json["installType"] = installType;
1349 }
1350 if (lockTaskAllowed != null) {
1351 _json["lockTaskAllowed"] = lockTaskAllowed;
1352 }
1353 if (managedConfiguration != null) {
1354 _json["managedConfiguration"] = managedConfiguration;
1355 }
1356 if (packageName != null) {
1357 _json["packageName"] = packageName;
1358 }
1359 if (permissionGrants != null) {
1360 _json["permissionGrants"] = permissionGrants.map((value) => (value).toJson ()).toList();
1361 }
1362 return _json;
1363 }
1364 }
1365
1366 /** A command. */
1367 class Command {
1368 /**
1369 * The timestamp at which the command was created. The timestamp is
1370 * automatically generated by the server.
1371 */
1372 core.String createTime;
1373 /**
1374 * The duration for which the command is valid. The command will expire if not
1375 * executed by the device during this time. The default duration if
1376 * unspecified is ten minutes. There is no maximum duration.
1377 */
1378 core.String duration;
1379 /**
1380 * For commands of type `RESET_PASSWORD`, optionally specifies the new
1381 * password.
1382 */
1383 core.String newPassword;
1384 /** For commands of type `RESET_PASSWORD`, optionally specifies flags. */
1385 core.List<core.String> resetPasswordFlags;
1386 /**
1387 * The type of the command.
1388 * Possible string values are:
1389 * - "COMMAND_TYPE_UNSPECIFIED" : This value is disallowed.
1390 * - "LOCK" : Lock the device, as if the lock screen timeout had expired.
1391 * - "RESET_PASSWORD" : Reset the user's password.
1392 * - "REBOOT" : Reboot the device. Only supported on API level 24+.
1393 */
1394 core.String type;
1395
1396 Command();
1397
1398 Command.fromJson(core.Map _json) {
1399 if (_json.containsKey("createTime")) {
1400 createTime = _json["createTime"];
1401 }
1402 if (_json.containsKey("duration")) {
1403 duration = _json["duration"];
1404 }
1405 if (_json.containsKey("newPassword")) {
1406 newPassword = _json["newPassword"];
1407 }
1408 if (_json.containsKey("resetPasswordFlags")) {
1409 resetPasswordFlags = _json["resetPasswordFlags"];
1410 }
1411 if (_json.containsKey("type")) {
1412 type = _json["type"];
1413 }
1414 }
1415
1416 core.Map<core.String, core.Object> toJson() {
1417 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1418 if (createTime != null) {
1419 _json["createTime"] = createTime;
1420 }
1421 if (duration != null) {
1422 _json["duration"] = duration;
1423 }
1424 if (newPassword != null) {
1425 _json["newPassword"] = newPassword;
1426 }
1427 if (resetPasswordFlags != null) {
1428 _json["resetPasswordFlags"] = resetPasswordFlags;
1429 }
1430 if (type != null) {
1431 _json["type"] = type;
1432 }
1433 return _json;
1434 }
1435 }
1436
1437 /**
1438 * A rule declaring which mitigating actions to take when a device is not
1439 * compliant with its policy. For every rule, there is always an implicit
1440 * mitigating action to set `policy_compliant` to false for the
1441 * [`Device`](/android/management/reference/rest/v1/enterprises.devices#Device)
1442 * resource, and display a message on the device indicating that the device is
1443 * not compliant with its policy. Other mitigating actions may optionally be
1444 * taken as well, depending on the field values in the rule.
1445 */
1446 class ComplianceRule {
1447 /**
1448 * A condition which is satisfied if the Android Framework API level on the
1449 * device does not meet a minimum requirement.
1450 */
1451 ApiLevelCondition apiLevelCondition;
1452 /**
1453 * If set to true, the rule includes a mitigating action to disable
1454 * applications so that the device is effectively disabled, but application
1455 * data is preserved. If the device is running an app in locked task mode, the
1456 * app will be closed and a UI showing the reason for non-compliance will be
1457 * displayed.
1458 */
1459 core.bool disableApps;
1460 /**
1461 * A condition which is satisfied if there exists *any* matching
1462 * [`NonComplianceDetail`](/android/management/reference/rest/v1/enterprises.d evices#NonComplianceDetail)
1463 * for the device.
1464 */
1465 NonComplianceDetailCondition nonComplianceDetailCondition;
1466
1467 ComplianceRule();
1468
1469 ComplianceRule.fromJson(core.Map _json) {
1470 if (_json.containsKey("apiLevelCondition")) {
1471 apiLevelCondition = new ApiLevelCondition.fromJson(_json["apiLevelConditio n"]);
1472 }
1473 if (_json.containsKey("disableApps")) {
1474 disableApps = _json["disableApps"];
1475 }
1476 if (_json.containsKey("nonComplianceDetailCondition")) {
1477 nonComplianceDetailCondition = new NonComplianceDetailCondition.fromJson(_ json["nonComplianceDetailCondition"]);
1478 }
1479 }
1480
1481 core.Map<core.String, core.Object> toJson() {
1482 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1483 if (apiLevelCondition != null) {
1484 _json["apiLevelCondition"] = (apiLevelCondition).toJson();
1485 }
1486 if (disableApps != null) {
1487 _json["disableApps"] = disableApps;
1488 }
1489 if (nonComplianceDetailCondition != null) {
1490 _json["nonComplianceDetailCondition"] = (nonComplianceDetailCondition).toJ son();
1491 }
1492 return _json;
1493 }
1494 }
1495
1496 /**
1497 * A device owned by an enterprise.
1498 * Unless otherwise noted, all fields are read-only and cannot be modified by
1499 * an update device request.
1500 */
1501 class Device {
1502 /** The API level of the Android platform version running on the device. */
1503 core.int apiLevel;
1504 /** The name of the policy that is currently applied by the device. */
1505 core.String appliedPolicyName;
1506 /** The version of the policy that is currently applied by the device. */
1507 core.String appliedPolicyVersion;
1508 /**
1509 * The state that is currently applied by the device.
1510 * Possible string values are:
1511 * - "DEVICE_STATE_UNSPECIFIED" : This value is disallowed.
1512 * - "ACTIVE" : The device is active.
1513 * - "DISABLED" : The device is disabled.
1514 * - "DELETED" : The device was deleted. This state will never be returned by
1515 * an API call,
1516 * but will be used in the final policy compliance report published to Cloud
1517 * Pub/Sub when the device acknowledges the deletion.
1518 * - "PROVISIONING" : The device is being provisioned. Newly enrolled devices
1519 * will be in this
1520 * state until they have applied policy.
1521 */
1522 core.String appliedState;
1523 /**
1524 * If the device state is `DISABLED`, an optional message that is displayed on
1525 * the device indicating the reason the device is disabled. This field may be
1526 * modified by an update request.
1527 */
1528 UserFacingMessage disabledReason;
1529 /**
1530 * Displays on the device. This information is only available when
1531 * `displayInfoEnabled` is true in the device's policy.
1532 */
1533 core.List<Display> displays;
1534 /** The time of device enrollment. */
1535 core.String enrollmentTime;
1536 /**
1537 * If this device was enrolled with an enrollment token with additional data
1538 * provided, this field contains that data.
1539 */
1540 core.String enrollmentTokenData;
1541 /**
1542 * If this device was enrolled with an enrollment token, this field contains
1543 * the name of the token.
1544 */
1545 core.String enrollmentTokenName;
1546 /** Detailed information about the device hardware. */
1547 HardwareInfo hardwareInfo;
1548 /**
1549 * Hardware status samples in chronological order. This information is only
1550 * available when `hardwareStatusEnabled` is true in the device's policy.
1551 */
1552 core.List<HardwareStatus> hardwareStatusSamples;
1553 /** The last time the device sent a policy compliance report. */
1554 core.String lastPolicyComplianceReportTime;
1555 /** The last time the device fetched its policy. */
1556 core.String lastPolicySyncTime;
1557 /** The last time the device sent a status report. */
1558 core.String lastStatusReportTime;
1559 /**
1560 * Events related to memory and storage measurements in chronological order.
1561 * This information is only available when `memoryInfoEnabled` is true in the
1562 * device's policy.
1563 */
1564 core.List<MemoryEvent> memoryEvents;
1565 /**
1566 * Memory information. This information is only available when
1567 * `memoryInfoEnabled` is true in the device's policy.
1568 */
1569 MemoryInfo memoryInfo;
1570 /**
1571 * The name of the device in the form
1572 * `enterprises/{enterpriseId}/devices/{deviceId}`
1573 */
1574 core.String name;
1575 /**
1576 * Device network information. This information is only available when
1577 * `networkInfoEnabled` is true in the device's policy.
1578 */
1579 NetworkInfo networkInfo;
1580 /**
1581 * Details about policy settings for which the device is not in compliance.
1582 */
1583 core.List<NonComplianceDetail> nonComplianceDetails;
1584 /** Whether the device is compliant with its policy. */
1585 core.bool policyCompliant;
1586 /**
1587 * The name of the policy that is intended to be applied to the device. If
1588 * empty, the policy with id `default` is applied.
1589 * This field may be modified by an update request.
1590 * The name of the policy is in the form
1591 * `enterprises/{enterpriseId}/policies/{policyId}`.
1592 * It is also permissible to only specify the `policyId` when updating this
1593 * field as long as the `policyId` contains no slashes since the rest of the
1594 * policy name can be inferred from context.
1595 */
1596 core.String policyName;
1597 /**
1598 * Power management events on the device in chronological order. This
1599 * information is only available when `powerManagementEventsEnabled` is true
1600 * in the device's policy.
1601 */
1602 core.List<PowerManagementEvent> powerManagementEvents;
1603 /**
1604 * The previous device names used for the same physical device when it has
1605 * been enrolled multiple times. The serial number is used as the unique
1606 * identifier to determine if the same physical device has enrolled
1607 * previously. The names are in chronological order.
1608 */
1609 core.List<core.String> previousDeviceNames;
1610 /**
1611 * Detailed information about the device software. This information is only
1612 * available when `softwareInfoEnabled` is true in the device's policy.
1613 */
1614 SoftwareInfo softwareInfo;
1615 /**
1616 * The state that is intended to be applied to the device. This field may be
1617 * modified by an update request.
1618 * Note that UpdateDevice only handles toggling between `ACTIVE` and
1619 * `DISABLED` states. Use the
1620 * [delete device
1621 * method](/android/management/reference/rest/v1/enterprises.devices/delete)
1622 * to cause the device to enter the `DELETED` state.
1623 * Possible string values are:
1624 * - "DEVICE_STATE_UNSPECIFIED" : This value is disallowed.
1625 * - "ACTIVE" : The device is active.
1626 * - "DISABLED" : The device is disabled.
1627 * - "DELETED" : The device was deleted. This state will never be returned by
1628 * an API call,
1629 * but will be used in the final policy compliance report published to Cloud
1630 * Pub/Sub when the device acknowledges the deletion.
1631 * - "PROVISIONING" : The device is being provisioned. Newly enrolled devices
1632 * will be in this
1633 * state until they have applied policy.
1634 */
1635 core.String state;
1636 /**
1637 * The resource name of the user of the device in the form
1638 * `enterprises/{enterpriseId}/users/{userId}`. This is the name of the
1639 * device account automatically created for this device.
1640 */
1641 core.String userName;
1642
1643 Device();
1644
1645 Device.fromJson(core.Map _json) {
1646 if (_json.containsKey("apiLevel")) {
1647 apiLevel = _json["apiLevel"];
1648 }
1649 if (_json.containsKey("appliedPolicyName")) {
1650 appliedPolicyName = _json["appliedPolicyName"];
1651 }
1652 if (_json.containsKey("appliedPolicyVersion")) {
1653 appliedPolicyVersion = _json["appliedPolicyVersion"];
1654 }
1655 if (_json.containsKey("appliedState")) {
1656 appliedState = _json["appliedState"];
1657 }
1658 if (_json.containsKey("disabledReason")) {
1659 disabledReason = new UserFacingMessage.fromJson(_json["disabledReason"]);
1660 }
1661 if (_json.containsKey("displays")) {
1662 displays = _json["displays"].map((value) => new Display.fromJson(value)).t oList();
1663 }
1664 if (_json.containsKey("enrollmentTime")) {
1665 enrollmentTime = _json["enrollmentTime"];
1666 }
1667 if (_json.containsKey("enrollmentTokenData")) {
1668 enrollmentTokenData = _json["enrollmentTokenData"];
1669 }
1670 if (_json.containsKey("enrollmentTokenName")) {
1671 enrollmentTokenName = _json["enrollmentTokenName"];
1672 }
1673 if (_json.containsKey("hardwareInfo")) {
1674 hardwareInfo = new HardwareInfo.fromJson(_json["hardwareInfo"]);
1675 }
1676 if (_json.containsKey("hardwareStatusSamples")) {
1677 hardwareStatusSamples = _json["hardwareStatusSamples"].map((value) => new HardwareStatus.fromJson(value)).toList();
1678 }
1679 if (_json.containsKey("lastPolicyComplianceReportTime")) {
1680 lastPolicyComplianceReportTime = _json["lastPolicyComplianceReportTime"];
1681 }
1682 if (_json.containsKey("lastPolicySyncTime")) {
1683 lastPolicySyncTime = _json["lastPolicySyncTime"];
1684 }
1685 if (_json.containsKey("lastStatusReportTime")) {
1686 lastStatusReportTime = _json["lastStatusReportTime"];
1687 }
1688 if (_json.containsKey("memoryEvents")) {
1689 memoryEvents = _json["memoryEvents"].map((value) => new MemoryEvent.fromJs on(value)).toList();
1690 }
1691 if (_json.containsKey("memoryInfo")) {
1692 memoryInfo = new MemoryInfo.fromJson(_json["memoryInfo"]);
1693 }
1694 if (_json.containsKey("name")) {
1695 name = _json["name"];
1696 }
1697 if (_json.containsKey("networkInfo")) {
1698 networkInfo = new NetworkInfo.fromJson(_json["networkInfo"]);
1699 }
1700 if (_json.containsKey("nonComplianceDetails")) {
1701 nonComplianceDetails = _json["nonComplianceDetails"].map((value) => new No nComplianceDetail.fromJson(value)).toList();
1702 }
1703 if (_json.containsKey("policyCompliant")) {
1704 policyCompliant = _json["policyCompliant"];
1705 }
1706 if (_json.containsKey("policyName")) {
1707 policyName = _json["policyName"];
1708 }
1709 if (_json.containsKey("powerManagementEvents")) {
1710 powerManagementEvents = _json["powerManagementEvents"].map((value) => new PowerManagementEvent.fromJson(value)).toList();
1711 }
1712 if (_json.containsKey("previousDeviceNames")) {
1713 previousDeviceNames = _json["previousDeviceNames"];
1714 }
1715 if (_json.containsKey("softwareInfo")) {
1716 softwareInfo = new SoftwareInfo.fromJson(_json["softwareInfo"]);
1717 }
1718 if (_json.containsKey("state")) {
1719 state = _json["state"];
1720 }
1721 if (_json.containsKey("userName")) {
1722 userName = _json["userName"];
1723 }
1724 }
1725
1726 core.Map<core.String, core.Object> toJson() {
1727 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1728 if (apiLevel != null) {
1729 _json["apiLevel"] = apiLevel;
1730 }
1731 if (appliedPolicyName != null) {
1732 _json["appliedPolicyName"] = appliedPolicyName;
1733 }
1734 if (appliedPolicyVersion != null) {
1735 _json["appliedPolicyVersion"] = appliedPolicyVersion;
1736 }
1737 if (appliedState != null) {
1738 _json["appliedState"] = appliedState;
1739 }
1740 if (disabledReason != null) {
1741 _json["disabledReason"] = (disabledReason).toJson();
1742 }
1743 if (displays != null) {
1744 _json["displays"] = displays.map((value) => (value).toJson()).toList();
1745 }
1746 if (enrollmentTime != null) {
1747 _json["enrollmentTime"] = enrollmentTime;
1748 }
1749 if (enrollmentTokenData != null) {
1750 _json["enrollmentTokenData"] = enrollmentTokenData;
1751 }
1752 if (enrollmentTokenName != null) {
1753 _json["enrollmentTokenName"] = enrollmentTokenName;
1754 }
1755 if (hardwareInfo != null) {
1756 _json["hardwareInfo"] = (hardwareInfo).toJson();
1757 }
1758 if (hardwareStatusSamples != null) {
1759 _json["hardwareStatusSamples"] = hardwareStatusSamples.map((value) => (val ue).toJson()).toList();
1760 }
1761 if (lastPolicyComplianceReportTime != null) {
1762 _json["lastPolicyComplianceReportTime"] = lastPolicyComplianceReportTime;
1763 }
1764 if (lastPolicySyncTime != null) {
1765 _json["lastPolicySyncTime"] = lastPolicySyncTime;
1766 }
1767 if (lastStatusReportTime != null) {
1768 _json["lastStatusReportTime"] = lastStatusReportTime;
1769 }
1770 if (memoryEvents != null) {
1771 _json["memoryEvents"] = memoryEvents.map((value) => (value).toJson()).toLi st();
1772 }
1773 if (memoryInfo != null) {
1774 _json["memoryInfo"] = (memoryInfo).toJson();
1775 }
1776 if (name != null) {
1777 _json["name"] = name;
1778 }
1779 if (networkInfo != null) {
1780 _json["networkInfo"] = (networkInfo).toJson();
1781 }
1782 if (nonComplianceDetails != null) {
1783 _json["nonComplianceDetails"] = nonComplianceDetails.map((value) => (value ).toJson()).toList();
1784 }
1785 if (policyCompliant != null) {
1786 _json["policyCompliant"] = policyCompliant;
1787 }
1788 if (policyName != null) {
1789 _json["policyName"] = policyName;
1790 }
1791 if (powerManagementEvents != null) {
1792 _json["powerManagementEvents"] = powerManagementEvents.map((value) => (val ue).toJson()).toList();
1793 }
1794 if (previousDeviceNames != null) {
1795 _json["previousDeviceNames"] = previousDeviceNames;
1796 }
1797 if (softwareInfo != null) {
1798 _json["softwareInfo"] = (softwareInfo).toJson();
1799 }
1800 if (state != null) {
1801 _json["state"] = state;
1802 }
1803 if (userName != null) {
1804 _json["userName"] = userName;
1805 }
1806 return _json;
1807 }
1808 }
1809
1810 /** Device display information. */
1811 class Display {
1812 /** Display density expressed as dots-per-inch. */
1813 core.int density;
1814 /** Unique display id. */
1815 core.int displayId;
1816 /** Display height in pixels. */
1817 core.int height;
1818 /** Name of the display. */
1819 core.String name;
1820 /** Refresh rate of the display in frames per second. */
1821 core.int refreshRate;
1822 /**
1823 * State of the display.
1824 * Possible string values are:
1825 * - "DISPLAY_STATE_UNSPECIFIED" : This value is disallowed.
1826 * - "OFF" : Display is off.
1827 * - "ON" : Display is on.
1828 * - "DOZE" : Display is dozing in a low power state
1829 * - "SUSPENDED" : Display is dozing in a suspended low power state.
1830 */
1831 core.String state;
1832 /** Display width in pixels. */
1833 core.int width;
1834
1835 Display();
1836
1837 Display.fromJson(core.Map _json) {
1838 if (_json.containsKey("density")) {
1839 density = _json["density"];
1840 }
1841 if (_json.containsKey("displayId")) {
1842 displayId = _json["displayId"];
1843 }
1844 if (_json.containsKey("height")) {
1845 height = _json["height"];
1846 }
1847 if (_json.containsKey("name")) {
1848 name = _json["name"];
1849 }
1850 if (_json.containsKey("refreshRate")) {
1851 refreshRate = _json["refreshRate"];
1852 }
1853 if (_json.containsKey("state")) {
1854 state = _json["state"];
1855 }
1856 if (_json.containsKey("width")) {
1857 width = _json["width"];
1858 }
1859 }
1860
1861 core.Map<core.String, core.Object> toJson() {
1862 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1863 if (density != null) {
1864 _json["density"] = density;
1865 }
1866 if (displayId != null) {
1867 _json["displayId"] = displayId;
1868 }
1869 if (height != null) {
1870 _json["height"] = height;
1871 }
1872 if (name != null) {
1873 _json["name"] = name;
1874 }
1875 if (refreshRate != null) {
1876 _json["refreshRate"] = refreshRate;
1877 }
1878 if (state != null) {
1879 _json["state"] = state;
1880 }
1881 if (width != null) {
1882 _json["width"] = width;
1883 }
1884 return _json;
1885 }
1886 }
1887
1888 /**
1889 * A generic empty message that you can re-use to avoid defining duplicated
1890 * empty messages in your APIs. A typical example is to use it as the request
1891 * or the response type of an API method. For instance:
1892 *
1893 * service Foo {
1894 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1895 * }
1896 *
1897 * The JSON representation for `Empty` is empty JSON object `{}`.
1898 */
1899 class Empty {
1900
1901 Empty();
1902
1903 Empty.fromJson(core.Map _json) {
1904 }
1905
1906 core.Map<core.String, core.Object> toJson() {
1907 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1908 return _json;
1909 }
1910 }
1911
1912 /** An enrollment token. */
1913 class EnrollmentToken {
1914 /**
1915 * Optional, arbitrary data associated with the enrollment token.
1916 * This could contain, for example, the id of an org unit to which the device
1917 * is assigned after enrollment.
1918 * After a device enrolls with the token, this data will be exposed in the
1919 * `enrollment_token_data` field of the
1920 * [`Device`](/android/management/reference/rest/v1/enterprises.devices#Device )
1921 * resource. The data must be 1024 characters or less; otherwise, the creation
1922 * request will fail.
1923 */
1924 core.String additionalData;
1925 /**
1926 * The duration of the token. If not specified, the duration will be 1 hour.
1927 * The allowed range is 1 minute to 30 days.
1928 */
1929 core.String duration;
1930 /**
1931 * The expiration time of the token. This is a read-only field generated by
1932 * the server.
1933 */
1934 core.String expirationTimestamp;
1935 /**
1936 * The name of the enrollment token, which is generated by the server during
1937 * creation, in the form
1938 * `enterprises/{enterpriseId}/enrollmentTokens/{enrollmentTokenId}`
1939 */
1940 core.String name;
1941 /**
1942 * The name of the policy that will be initially applied to the enrolled
1943 * device in the form `enterprises/{enterpriseId}/policies/{policyId}`.
1944 * If not specified, the policy with id `default` is applied.
1945 * It is permissible to only specify the `policyId` when updating this
1946 * field as long as the `policyId` contains no slashes since the rest of the
1947 * policy name can be inferred from context.
1948 */
1949 core.String policyName;
1950 /**
1951 * A JSON string whose UTF-8 representation can be used to generate a QR code
1952 * to enroll a device with this enrollment token. To enroll a device using
1953 * NFC, the NFC record must contain a serialized `java.util.Properties`
1954 * representation of the properties in the JSON.
1955 */
1956 core.String qrCode;
1957 /**
1958 * The token value which is passed to the device and authorizes the device to
1959 * enroll. This is a read-only field generated by the server.
1960 */
1961 core.String value;
1962
1963 EnrollmentToken();
1964
1965 EnrollmentToken.fromJson(core.Map _json) {
1966 if (_json.containsKey("additionalData")) {
1967 additionalData = _json["additionalData"];
1968 }
1969 if (_json.containsKey("duration")) {
1970 duration = _json["duration"];
1971 }
1972 if (_json.containsKey("expirationTimestamp")) {
1973 expirationTimestamp = _json["expirationTimestamp"];
1974 }
1975 if (_json.containsKey("name")) {
1976 name = _json["name"];
1977 }
1978 if (_json.containsKey("policyName")) {
1979 policyName = _json["policyName"];
1980 }
1981 if (_json.containsKey("qrCode")) {
1982 qrCode = _json["qrCode"];
1983 }
1984 if (_json.containsKey("value")) {
1985 value = _json["value"];
1986 }
1987 }
1988
1989 core.Map<core.String, core.Object> toJson() {
1990 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
1991 if (additionalData != null) {
1992 _json["additionalData"] = additionalData;
1993 }
1994 if (duration != null) {
1995 _json["duration"] = duration;
1996 }
1997 if (expirationTimestamp != null) {
1998 _json["expirationTimestamp"] = expirationTimestamp;
1999 }
2000 if (name != null) {
2001 _json["name"] = name;
2002 }
2003 if (policyName != null) {
2004 _json["policyName"] = policyName;
2005 }
2006 if (qrCode != null) {
2007 _json["qrCode"] = qrCode;
2008 }
2009 if (value != null) {
2010 _json["value"] = value;
2011 }
2012 return _json;
2013 }
2014 }
2015
2016 /** The configuration applied to an enterprise. */
2017 class Enterprise {
2018 /**
2019 * Whether app auto-approval is enabled. When enabled, apps installed via
2020 * policy for this enterprise have all permissions automatically approved.
2021 * When enabled, it is the caller's responsibility to display the permissions
2022 * required by an app to the enterprise admin before setting the app to be
2023 * installed in a policy.
2024 */
2025 core.bool appAutoApprovalEnabled;
2026 /** The notification types to enable via Google Cloud Pub/Sub. */
2027 core.List<core.String> enabledNotificationTypes;
2028 /** The name of the enterprise as it will appear to users. */
2029 core.String enterpriseDisplayName;
2030 /**
2031 * An image displayed as a logo during device provisioning. Supported types
2032 * are: image/bmp, image/gif, image/x-ico, image/jpeg, image/png, image/webp,
2033 * image/vnd.wap.wbmp, image/x-adobe-dng.
2034 */
2035 ExternalData logo;
2036 /**
2037 * The name of the enterprise which is generated by the server during
2038 * creation, in the form
2039 * `enterprises/{enterpriseId}`
2040 */
2041 core.String name;
2042 /**
2043 * A color in RGB format indicating the predominant color to display in the
2044 * device management app UI. The color components are stored as follows:
2045 * `(red << 16) | (green << 8) | blue`, where each component may take a value
2046 * between 0 and 255 inclusive.
2047 */
2048 core.int primaryColor;
2049 /**
2050 * When Cloud Pub/Sub notifications are enabled, this field is required to
2051 * indicate the topic to which the notifications will be published. The format
2052 * of this field is `projects/{project}/topics/{topic}`. You must have granted
2053 * the publish permission on this topic to
2054 * android-cloud-policy@system.gserviceaccount.com
2055 */
2056 core.String pubsubTopic;
2057
2058 Enterprise();
2059
2060 Enterprise.fromJson(core.Map _json) {
2061 if (_json.containsKey("appAutoApprovalEnabled")) {
2062 appAutoApprovalEnabled = _json["appAutoApprovalEnabled"];
2063 }
2064 if (_json.containsKey("enabledNotificationTypes")) {
2065 enabledNotificationTypes = _json["enabledNotificationTypes"];
2066 }
2067 if (_json.containsKey("enterpriseDisplayName")) {
2068 enterpriseDisplayName = _json["enterpriseDisplayName"];
2069 }
2070 if (_json.containsKey("logo")) {
2071 logo = new ExternalData.fromJson(_json["logo"]);
2072 }
2073 if (_json.containsKey("name")) {
2074 name = _json["name"];
2075 }
2076 if (_json.containsKey("primaryColor")) {
2077 primaryColor = _json["primaryColor"];
2078 }
2079 if (_json.containsKey("pubsubTopic")) {
2080 pubsubTopic = _json["pubsubTopic"];
2081 }
2082 }
2083
2084 core.Map<core.String, core.Object> toJson() {
2085 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2086 if (appAutoApprovalEnabled != null) {
2087 _json["appAutoApprovalEnabled"] = appAutoApprovalEnabled;
2088 }
2089 if (enabledNotificationTypes != null) {
2090 _json["enabledNotificationTypes"] = enabledNotificationTypes;
2091 }
2092 if (enterpriseDisplayName != null) {
2093 _json["enterpriseDisplayName"] = enterpriseDisplayName;
2094 }
2095 if (logo != null) {
2096 _json["logo"] = (logo).toJson();
2097 }
2098 if (name != null) {
2099 _json["name"] = name;
2100 }
2101 if (primaryColor != null) {
2102 _json["primaryColor"] = primaryColor;
2103 }
2104 if (pubsubTopic != null) {
2105 _json["pubsubTopic"] = pubsubTopic;
2106 }
2107 return _json;
2108 }
2109 }
2110
2111 /**
2112 * Data hosted at an external location. The data is to be downloaded by Android
2113 * Device Policy and verified against the hash.
2114 */
2115 class ExternalData {
2116 /**
2117 * The base-64 encoded SHA-256 hash of the content hosted at url. If the
2118 * content does not match this hash, Android Device Policy will not use the
2119 * data.
2120 */
2121 core.String sha256Hash;
2122 /**
2123 * The absolute URL to the data, which must use either the http or https
2124 * scheme. Android Device Policy does not provide any credentials in the GET
2125 * request, so the URL must be publicly accessible. Including a long, random
2126 * component in the URL may be used to prevent attackers from discovering the
2127 * URL.
2128 */
2129 core.String url;
2130
2131 ExternalData();
2132
2133 ExternalData.fromJson(core.Map _json) {
2134 if (_json.containsKey("sha256Hash")) {
2135 sha256Hash = _json["sha256Hash"];
2136 }
2137 if (_json.containsKey("url")) {
2138 url = _json["url"];
2139 }
2140 }
2141
2142 core.Map<core.String, core.Object> toJson() {
2143 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2144 if (sha256Hash != null) {
2145 _json["sha256Hash"] = sha256Hash;
2146 }
2147 if (url != null) {
2148 _json["url"] = url;
2149 }
2150 return _json;
2151 }
2152 }
2153
2154 /**
2155 * Information about device hardware. The fields related to temperature
2156 * thresholds are only available when hardwareStatusEnabled is true in the
2157 * device's policy.
2158 */
2159 class HardwareInfo {
2160 /**
2161 * Battery shutdown temperature thresholds in Celsius for each battery on the
2162 * device.
2163 */
2164 core.List<core.double> batteryShutdownTemperatures;
2165 /**
2166 * Battery throttling temperature thresholds in Celsius for each battery on
2167 * the device.
2168 */
2169 core.List<core.double> batteryThrottlingTemperatures;
2170 /** Brand of the device, e.g. `Google`. */
2171 core.String brand;
2172 /**
2173 * CPU shutdown temperature thresholds in Celsius for each CPU on the device.
2174 */
2175 core.List<core.double> cpuShutdownTemperatures;
2176 /**
2177 * CPU throttling temperature thresholds in Celsius for each CPU on the
2178 * device.
2179 */
2180 core.List<core.double> cpuThrottlingTemperatures;
2181 /** Baseband version, e.g. `MDM9625_104662.22.05.34p`. */
2182 core.String deviceBasebandVersion;
2183 /**
2184 * GPU shutdown temperature thresholds in Celsius for each GPU on the device.
2185 */
2186 core.List<core.double> gpuShutdownTemperatures;
2187 /**
2188 * GPU throttling temperature thresholds in Celsius for each GPU on the
2189 * device.
2190 */
2191 core.List<core.double> gpuThrottlingTemperatures;
2192 /** Name of the hardware, e.g. `Angler`. */
2193 core.String hardware;
2194 /** Manufacturer, e.g. `Motorola`. */
2195 core.String manufacturer;
2196 /** The model of the device, e.g. `Asus Nexus 7`. */
2197 core.String model;
2198 /** The device serial number. */
2199 core.String serialNumber;
2200 /** Device skin shutdown temperature thresholds in Celsius. */
2201 core.List<core.double> skinShutdownTemperatures;
2202 /** Device skin throttling temperature thresholds in Celsius. */
2203 core.List<core.double> skinThrottlingTemperatures;
2204
2205 HardwareInfo();
2206
2207 HardwareInfo.fromJson(core.Map _json) {
2208 if (_json.containsKey("batteryShutdownTemperatures")) {
2209 batteryShutdownTemperatures = _json["batteryShutdownTemperatures"];
2210 }
2211 if (_json.containsKey("batteryThrottlingTemperatures")) {
2212 batteryThrottlingTemperatures = _json["batteryThrottlingTemperatures"];
2213 }
2214 if (_json.containsKey("brand")) {
2215 brand = _json["brand"];
2216 }
2217 if (_json.containsKey("cpuShutdownTemperatures")) {
2218 cpuShutdownTemperatures = _json["cpuShutdownTemperatures"];
2219 }
2220 if (_json.containsKey("cpuThrottlingTemperatures")) {
2221 cpuThrottlingTemperatures = _json["cpuThrottlingTemperatures"];
2222 }
2223 if (_json.containsKey("deviceBasebandVersion")) {
2224 deviceBasebandVersion = _json["deviceBasebandVersion"];
2225 }
2226 if (_json.containsKey("gpuShutdownTemperatures")) {
2227 gpuShutdownTemperatures = _json["gpuShutdownTemperatures"];
2228 }
2229 if (_json.containsKey("gpuThrottlingTemperatures")) {
2230 gpuThrottlingTemperatures = _json["gpuThrottlingTemperatures"];
2231 }
2232 if (_json.containsKey("hardware")) {
2233 hardware = _json["hardware"];
2234 }
2235 if (_json.containsKey("manufacturer")) {
2236 manufacturer = _json["manufacturer"];
2237 }
2238 if (_json.containsKey("model")) {
2239 model = _json["model"];
2240 }
2241 if (_json.containsKey("serialNumber")) {
2242 serialNumber = _json["serialNumber"];
2243 }
2244 if (_json.containsKey("skinShutdownTemperatures")) {
2245 skinShutdownTemperatures = _json["skinShutdownTemperatures"];
2246 }
2247 if (_json.containsKey("skinThrottlingTemperatures")) {
2248 skinThrottlingTemperatures = _json["skinThrottlingTemperatures"];
2249 }
2250 }
2251
2252 core.Map<core.String, core.Object> toJson() {
2253 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2254 if (batteryShutdownTemperatures != null) {
2255 _json["batteryShutdownTemperatures"] = batteryShutdownTemperatures;
2256 }
2257 if (batteryThrottlingTemperatures != null) {
2258 _json["batteryThrottlingTemperatures"] = batteryThrottlingTemperatures;
2259 }
2260 if (brand != null) {
2261 _json["brand"] = brand;
2262 }
2263 if (cpuShutdownTemperatures != null) {
2264 _json["cpuShutdownTemperatures"] = cpuShutdownTemperatures;
2265 }
2266 if (cpuThrottlingTemperatures != null) {
2267 _json["cpuThrottlingTemperatures"] = cpuThrottlingTemperatures;
2268 }
2269 if (deviceBasebandVersion != null) {
2270 _json["deviceBasebandVersion"] = deviceBasebandVersion;
2271 }
2272 if (gpuShutdownTemperatures != null) {
2273 _json["gpuShutdownTemperatures"] = gpuShutdownTemperatures;
2274 }
2275 if (gpuThrottlingTemperatures != null) {
2276 _json["gpuThrottlingTemperatures"] = gpuThrottlingTemperatures;
2277 }
2278 if (hardware != null) {
2279 _json["hardware"] = hardware;
2280 }
2281 if (manufacturer != null) {
2282 _json["manufacturer"] = manufacturer;
2283 }
2284 if (model != null) {
2285 _json["model"] = model;
2286 }
2287 if (serialNumber != null) {
2288 _json["serialNumber"] = serialNumber;
2289 }
2290 if (skinShutdownTemperatures != null) {
2291 _json["skinShutdownTemperatures"] = skinShutdownTemperatures;
2292 }
2293 if (skinThrottlingTemperatures != null) {
2294 _json["skinThrottlingTemperatures"] = skinThrottlingTemperatures;
2295 }
2296 return _json;
2297 }
2298 }
2299
2300 /**
2301 * Hardware status. Temperatures may be compared to the temperature thresholds
2302 * available in `hardwareInfo` to determine hardware health.
2303 */
2304 class HardwareStatus {
2305 /**
2306 * Current battery temperatures in Celsius for each battery on the device.
2307 */
2308 core.List<core.double> batteryTemperatures;
2309 /** Current CPU temperatures in Celsius for each CPU on the device. */
2310 core.List<core.double> cpuTemperatures;
2311 /**
2312 * CPU usages in percentage for each core available on the device.
2313 * Usage is 0 for each unplugged core. Empty array implies that CPU usage
2314 * is not supported in the system.
2315 */
2316 core.List<core.double> cpuUsages;
2317 /** The time the measurements were taken. */
2318 core.String createTime;
2319 /**
2320 * Fan speeds in RPM for each fan on the device. Empty array means that there
2321 * are no fans or fan speed is not supported on the system.
2322 */
2323 core.List<core.double> fanSpeeds;
2324 /** Current GPU temperatures in Celsius for each GPU on the device. */
2325 core.List<core.double> gpuTemperatures;
2326 /** Current device skin temperatures in Celsius. */
2327 core.List<core.double> skinTemperatures;
2328
2329 HardwareStatus();
2330
2331 HardwareStatus.fromJson(core.Map _json) {
2332 if (_json.containsKey("batteryTemperatures")) {
2333 batteryTemperatures = _json["batteryTemperatures"];
2334 }
2335 if (_json.containsKey("cpuTemperatures")) {
2336 cpuTemperatures = _json["cpuTemperatures"];
2337 }
2338 if (_json.containsKey("cpuUsages")) {
2339 cpuUsages = _json["cpuUsages"];
2340 }
2341 if (_json.containsKey("createTime")) {
2342 createTime = _json["createTime"];
2343 }
2344 if (_json.containsKey("fanSpeeds")) {
2345 fanSpeeds = _json["fanSpeeds"];
2346 }
2347 if (_json.containsKey("gpuTemperatures")) {
2348 gpuTemperatures = _json["gpuTemperatures"];
2349 }
2350 if (_json.containsKey("skinTemperatures")) {
2351 skinTemperatures = _json["skinTemperatures"];
2352 }
2353 }
2354
2355 core.Map<core.String, core.Object> toJson() {
2356 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2357 if (batteryTemperatures != null) {
2358 _json["batteryTemperatures"] = batteryTemperatures;
2359 }
2360 if (cpuTemperatures != null) {
2361 _json["cpuTemperatures"] = cpuTemperatures;
2362 }
2363 if (cpuUsages != null) {
2364 _json["cpuUsages"] = cpuUsages;
2365 }
2366 if (createTime != null) {
2367 _json["createTime"] = createTime;
2368 }
2369 if (fanSpeeds != null) {
2370 _json["fanSpeeds"] = fanSpeeds;
2371 }
2372 if (gpuTemperatures != null) {
2373 _json["gpuTemperatures"] = gpuTemperatures;
2374 }
2375 if (skinTemperatures != null) {
2376 _json["skinTemperatures"] = skinTemperatures;
2377 }
2378 return _json;
2379 }
2380 }
2381
2382 /** Response to a request to list devices for a given enterprise. */
2383 class ListDevicesResponse {
2384 /** The list of devices. */
2385 core.List<Device> devices;
2386 /** If there are more results, a token to retrieve next page of results. */
2387 core.String nextPageToken;
2388
2389 ListDevicesResponse();
2390
2391 ListDevicesResponse.fromJson(core.Map _json) {
2392 if (_json.containsKey("devices")) {
2393 devices = _json["devices"].map((value) => new Device.fromJson(value)).toLi st();
2394 }
2395 if (_json.containsKey("nextPageToken")) {
2396 nextPageToken = _json["nextPageToken"];
2397 }
2398 }
2399
2400 core.Map<core.String, core.Object> toJson() {
2401 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2402 if (devices != null) {
2403 _json["devices"] = devices.map((value) => (value).toJson()).toList();
2404 }
2405 if (nextPageToken != null) {
2406 _json["nextPageToken"] = nextPageToken;
2407 }
2408 return _json;
2409 }
2410 }
2411
2412 /** The response message for Operations.ListOperations. */
2413 class ListOperationsResponse {
2414 /** The standard List next-page token. */
2415 core.String nextPageToken;
2416 /** A list of operations that matches the specified filter in the request. */
2417 core.List<Operation> operations;
2418
2419 ListOperationsResponse();
2420
2421 ListOperationsResponse.fromJson(core.Map _json) {
2422 if (_json.containsKey("nextPageToken")) {
2423 nextPageToken = _json["nextPageToken"];
2424 }
2425 if (_json.containsKey("operations")) {
2426 operations = _json["operations"].map((value) => new Operation.fromJson(val ue)).toList();
2427 }
2428 }
2429
2430 core.Map<core.String, core.Object> toJson() {
2431 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2432 if (nextPageToken != null) {
2433 _json["nextPageToken"] = nextPageToken;
2434 }
2435 if (operations != null) {
2436 _json["operations"] = operations.map((value) => (value).toJson()).toList() ;
2437 }
2438 return _json;
2439 }
2440 }
2441
2442 /** Response to a request to list policies for a given enterprise. */
2443 class ListPoliciesResponse {
2444 /** If there are more results, a token to retrieve next page of results. */
2445 core.String nextPageToken;
2446 /** The list of policies. */
2447 core.List<Policy> policies;
2448
2449 ListPoliciesResponse();
2450
2451 ListPoliciesResponse.fromJson(core.Map _json) {
2452 if (_json.containsKey("nextPageToken")) {
2453 nextPageToken = _json["nextPageToken"];
2454 }
2455 if (_json.containsKey("policies")) {
2456 policies = _json["policies"].map((value) => new Policy.fromJson(value)).to List();
2457 }
2458 }
2459
2460 core.Map<core.String, core.Object> toJson() {
2461 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2462 if (nextPageToken != null) {
2463 _json["nextPageToken"] = nextPageToken;
2464 }
2465 if (policies != null) {
2466 _json["policies"] = policies.map((value) => (value).toJson()).toList();
2467 }
2468 return _json;
2469 }
2470 }
2471
2472 /** Managed property. */
2473 class ManagedProperty {
2474 /**
2475 * The default value of the properties. `BUNDLE_ARRAY` properties
2476 * never have a default value.
2477 *
2478 * The values for Object must be JSON objects. It can consist of `num`,
2479 * `String`, `bool` and `null` as well as `Map` and `List` values.
2480 */
2481 core.Object defaultValue;
2482 /**
2483 * A longer description of the property, giving more detail of what it
2484 * affects. Localized.
2485 */
2486 core.String description;
2487 /**
2488 * For `CHOICE` or `MULTISELECT` properties, the list
2489 * of possible entries.
2490 */
2491 core.List<ManagedPropertyEntry> entries;
2492 /**
2493 * The unique key that the application uses to identify the property,
2494 * e.g. "com.google.android.gm.fieldname".
2495 */
2496 core.String key;
2497 /**
2498 * For `BUNDLE_ARRAY` properties, the list of nested properties. A
2499 * `BUNDLE_ARRAY` property is at most two levels deep.
2500 */
2501 core.List<ManagedProperty> nestedProperties;
2502 /** The name of the property. Localized. */
2503 core.String title;
2504 /**
2505 * The type of the property.
2506 * Possible string values are:
2507 * - "MANAGED_PROPERTY_TYPE_UNSPECIFIED" : Not used.
2508 * - "BOOL" : A property of boolean type.
2509 * - "STRING" : A property of string type.
2510 * - "INTEGER" : A property of integer type.
2511 * - "CHOICE" : A choice of one item from a set.
2512 * - "MULTISELECT" : A choice of multiple items from a set.
2513 * - "HIDDEN" : A hidden restriction of string type (the default value can be
2514 * used
2515 * to pass along information that cannot be modified, such as a version
2516 * code).
2517 * - "BUNDLE_ARRAY" : An array of property bundles.
2518 */
2519 core.String type;
2520
2521 ManagedProperty();
2522
2523 ManagedProperty.fromJson(core.Map _json) {
2524 if (_json.containsKey("defaultValue")) {
2525 defaultValue = _json["defaultValue"];
2526 }
2527 if (_json.containsKey("description")) {
2528 description = _json["description"];
2529 }
2530 if (_json.containsKey("entries")) {
2531 entries = _json["entries"].map((value) => new ManagedPropertyEntry.fromJso n(value)).toList();
2532 }
2533 if (_json.containsKey("key")) {
2534 key = _json["key"];
2535 }
2536 if (_json.containsKey("nestedProperties")) {
2537 nestedProperties = _json["nestedProperties"].map((value) => new ManagedPro perty.fromJson(value)).toList();
2538 }
2539 if (_json.containsKey("title")) {
2540 title = _json["title"];
2541 }
2542 if (_json.containsKey("type")) {
2543 type = _json["type"];
2544 }
2545 }
2546
2547 core.Map<core.String, core.Object> toJson() {
2548 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2549 if (defaultValue != null) {
2550 _json["defaultValue"] = defaultValue;
2551 }
2552 if (description != null) {
2553 _json["description"] = description;
2554 }
2555 if (entries != null) {
2556 _json["entries"] = entries.map((value) => (value).toJson()).toList();
2557 }
2558 if (key != null) {
2559 _json["key"] = key;
2560 }
2561 if (nestedProperties != null) {
2562 _json["nestedProperties"] = nestedProperties.map((value) => (value).toJson ()).toList();
2563 }
2564 if (title != null) {
2565 _json["title"] = title;
2566 }
2567 if (type != null) {
2568 _json["type"] = type;
2569 }
2570 return _json;
2571 }
2572 }
2573
2574 /** An entry of a managed property. */
2575 class ManagedPropertyEntry {
2576 /** The human-readable name of the value. Localized. */
2577 core.String name;
2578 /**
2579 * The machine-readable value of the entry, which should be used in the
2580 * configuration. Not localized.
2581 */
2582 core.String value;
2583
2584 ManagedPropertyEntry();
2585
2586 ManagedPropertyEntry.fromJson(core.Map _json) {
2587 if (_json.containsKey("name")) {
2588 name = _json["name"];
2589 }
2590 if (_json.containsKey("value")) {
2591 value = _json["value"];
2592 }
2593 }
2594
2595 core.Map<core.String, core.Object> toJson() {
2596 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2597 if (name != null) {
2598 _json["name"] = name;
2599 }
2600 if (value != null) {
2601 _json["value"] = value;
2602 }
2603 return _json;
2604 }
2605 }
2606
2607 /** An event related to memory and storage measurements. */
2608 class MemoryEvent {
2609 /**
2610 * The number of free bytes in the medium, or for `EXTERNAL_STORAGE_DETECTED`,
2611 * the total capacity in bytes of the storage medium.
2612 */
2613 core.String byteCount;
2614 /** The creation time of the event. */
2615 core.String createTime;
2616 /**
2617 * Event type.
2618 * Possible string values are:
2619 * - "MEMORY_EVENT_TYPE_UNSPECIFIED" : Unspecified. No events have this type.
2620 * - "RAM_MEASURED" : Free space in RAM was measured.
2621 * - "INTERNAL_STORAGE_MEASURED" : Free space in internal storage was
2622 * measured.
2623 * - "EXTERNAL_STORAGE_DETECTED" : A new external storage medium was detected.
2624 * The reported byte count is
2625 * the total capacity of the storage medium.
2626 * - "EXTERNAL_STORAGE_REMOVED" : An external storage medium was removed. The
2627 * reported byte count is zero.
2628 * - "EXTERNAL_STORAGE_MEASURED" : Free space in an external storage medium
2629 * was measured.
2630 */
2631 core.String eventType;
2632
2633 MemoryEvent();
2634
2635 MemoryEvent.fromJson(core.Map _json) {
2636 if (_json.containsKey("byteCount")) {
2637 byteCount = _json["byteCount"];
2638 }
2639 if (_json.containsKey("createTime")) {
2640 createTime = _json["createTime"];
2641 }
2642 if (_json.containsKey("eventType")) {
2643 eventType = _json["eventType"];
2644 }
2645 }
2646
2647 core.Map<core.String, core.Object> toJson() {
2648 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2649 if (byteCount != null) {
2650 _json["byteCount"] = byteCount;
2651 }
2652 if (createTime != null) {
2653 _json["createTime"] = createTime;
2654 }
2655 if (eventType != null) {
2656 _json["eventType"] = eventType;
2657 }
2658 return _json;
2659 }
2660 }
2661
2662 /** Information about device memory and storage. */
2663 class MemoryInfo {
2664 /** Total internal storage on device in bytes. */
2665 core.String totalInternalStorage;
2666 /** Total RAM on device in bytes. */
2667 core.String totalRam;
2668
2669 MemoryInfo();
2670
2671 MemoryInfo.fromJson(core.Map _json) {
2672 if (_json.containsKey("totalInternalStorage")) {
2673 totalInternalStorage = _json["totalInternalStorage"];
2674 }
2675 if (_json.containsKey("totalRam")) {
2676 totalRam = _json["totalRam"];
2677 }
2678 }
2679
2680 core.Map<core.String, core.Object> toJson() {
2681 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2682 if (totalInternalStorage != null) {
2683 _json["totalInternalStorage"] = totalInternalStorage;
2684 }
2685 if (totalRam != null) {
2686 _json["totalRam"] = totalRam;
2687 }
2688 return _json;
2689 }
2690 }
2691
2692 /** Device network info. */
2693 class NetworkInfo {
2694 /** IMEI number of the GSM device, e.g. `A1000031212`. */
2695 core.String imei;
2696 /** MEID number of the CDMA device, e.g. `A00000292788E1`. */
2697 core.String meid;
2698 /** WiFi MAC address of the device, e.g. `7c:11:11:11:11:11`. */
2699 core.String wifiMacAddress;
2700
2701 NetworkInfo();
2702
2703 NetworkInfo.fromJson(core.Map _json) {
2704 if (_json.containsKey("imei")) {
2705 imei = _json["imei"];
2706 }
2707 if (_json.containsKey("meid")) {
2708 meid = _json["meid"];
2709 }
2710 if (_json.containsKey("wifiMacAddress")) {
2711 wifiMacAddress = _json["wifiMacAddress"];
2712 }
2713 }
2714
2715 core.Map<core.String, core.Object> toJson() {
2716 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2717 if (imei != null) {
2718 _json["imei"] = imei;
2719 }
2720 if (meid != null) {
2721 _json["meid"] = meid;
2722 }
2723 if (wifiMacAddress != null) {
2724 _json["wifiMacAddress"] = wifiMacAddress;
2725 }
2726 return _json;
2727 }
2728 }
2729
2730 /** Provides detail about non-compliance with a policy setting. */
2731 class NonComplianceDetail {
2732 /**
2733 * If the policy setting could not be applied, the current value of the
2734 * setting on the device.
2735 *
2736 * The values for Object must be JSON objects. It can consist of `num`,
2737 * `String`, `bool` and `null` as well as `Map` and `List` values.
2738 */
2739 core.Object currentValue;
2740 /**
2741 * For settings with nested fields, if a particular nested field is out of
2742 * compliance, this specifies the full path to the offending field. The path
2743 * is formatted in the same way the policy JSON field would be referenced in
2744 * JavaScript, that is:
2745 * 1) For object-typed fields, the field name is followed by a dot then by a
2746 * subfield name.
2747 * 2) For array-typed fields, the field name is followed by the array index
2748 * enclosed in brackets.
2749 * For example, to indicate a problem with the `url` field in the
2750 * `externalData` field in the 3rd application, the path would be
2751 * `applications[2].externalData.url`
2752 */
2753 core.String fieldPath;
2754 /**
2755 * If `package_name` is set and the non-compliance reason is
2756 * `APP_NOT_INSTALLED`, the detailed reason the app cannot be installed.
2757 * Possible string values are:
2758 * - "INSTALLATION_FAILURE_REASON_UNSPECIFIED" : This value is disallowed.
2759 * - "INSTALLATION_FAILURE_REASON_UNKNOWN" : An unknown condition is
2760 * preventing the app from being installed. Some
2761 * potential reaons are that the device does not have enough storage, the
2762 * device network connection is unreliable, or the installation is taking
2763 * longer than expected. The installation will be retried automatically.
2764 * - "IN_PROGRESS" : The installation is still in progress.
2765 * - "NOT_FOUND" : The app was not found in Play.
2766 * - "NOT_COMPATIBLE_WITH_DEVICE" : The app is incompatible with the device.
2767 * - "NOT_APPROVED" : The app has not been approved by the admin.
2768 * - "PERMISSIONS_NOT_ACCEPTED" : The app has new permissions that have not
2769 * been accepted by the admin.
2770 * - "NOT_AVAILABLE_IN_COUNTRY" : The app is not available in the user's
2771 * country.
2772 * - "NO_LICENSES_REMAINING" : There are no more licenses to assign to the
2773 * user.
2774 * - "NOT_ENROLLED" : The enterprise is no longer enrolled with Play for Work
2775 * or Android Device
2776 * Policy is not enabled for the enterprise.
2777 */
2778 core.String installationFailureReason;
2779 /**
2780 * The reason the device is not in compliance with the setting.
2781 * Possible string values are:
2782 * - "NON_COMPLIANCE_REASON_UNSPECIFIED" : This value is disallowed.
2783 * - "API_LEVEL" : The setting is not supported in the API level of Android OS
2784 * version the
2785 * device is running.
2786 * - "ADMIN_TYPE" : The admin type (profile owner, device owner, etc.) does
2787 * not support the
2788 * setting.
2789 * - "USER_ACTION" : The user has not taken required action to comply with the
2790 * setting.
2791 * - "INVALID_VALUE" : The setting has an invalid value.
2792 * - "APP_NOT_INSTALLED" : The application required to implement the policy is
2793 * not installed.
2794 * - "UNSUPPORTED" : The policy is not supported by the version of Android
2795 * Device Policy on
2796 * the device.
2797 * - "APP_INSTALLED" : A blocked application is installed.
2798 * - "PENDING" : The setting was not applied yet at the time of the report,
2799 * but is
2800 * expected to be applied shortly.
2801 * - "APP_INCOMPATIBLE" : The setting cannot be applied to the application
2802 * because its target SDK
2803 * version is not high enough.
2804 */
2805 core.String nonComplianceReason;
2806 /**
2807 * The package name indicating which application is out of compliance, if
2808 * applicable.
2809 */
2810 core.String packageName;
2811 /**
2812 * The name of the policy setting. This is the JSON field name of a top-level
2813 * [`Policy`](/android/management/reference/rest/v1/enterprises.policies#Polic y)
2814 * field.
2815 */
2816 core.String settingName;
2817
2818 NonComplianceDetail();
2819
2820 NonComplianceDetail.fromJson(core.Map _json) {
2821 if (_json.containsKey("currentValue")) {
2822 currentValue = _json["currentValue"];
2823 }
2824 if (_json.containsKey("fieldPath")) {
2825 fieldPath = _json["fieldPath"];
2826 }
2827 if (_json.containsKey("installationFailureReason")) {
2828 installationFailureReason = _json["installationFailureReason"];
2829 }
2830 if (_json.containsKey("nonComplianceReason")) {
2831 nonComplianceReason = _json["nonComplianceReason"];
2832 }
2833 if (_json.containsKey("packageName")) {
2834 packageName = _json["packageName"];
2835 }
2836 if (_json.containsKey("settingName")) {
2837 settingName = _json["settingName"];
2838 }
2839 }
2840
2841 core.Map<core.String, core.Object> toJson() {
2842 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2843 if (currentValue != null) {
2844 _json["currentValue"] = currentValue;
2845 }
2846 if (fieldPath != null) {
2847 _json["fieldPath"] = fieldPath;
2848 }
2849 if (installationFailureReason != null) {
2850 _json["installationFailureReason"] = installationFailureReason;
2851 }
2852 if (nonComplianceReason != null) {
2853 _json["nonComplianceReason"] = nonComplianceReason;
2854 }
2855 if (packageName != null) {
2856 _json["packageName"] = packageName;
2857 }
2858 if (settingName != null) {
2859 _json["settingName"] = settingName;
2860 }
2861 return _json;
2862 }
2863 }
2864
2865 /**
2866 * A compliance rule condition which is satisfied if there exists *any*
2867 * matching
2868 * [`NonComplianceDetail`](/android/management/reference/rest/v1/enterprises.dev ices#NonComplianceDetail)
2869 * for the device. A `NonComplianceDetail` matches a
2870 * `NonComplianceDetailCondition` if *all* the fields which are set within the
2871 * `NonComplianceDetailCondition` match the corresponding `NonComplianceDetail`
2872 * fields.
2873 */
2874 class NonComplianceDetailCondition {
2875 /**
2876 * The reason the device is not in compliance with the setting. If not set,
2877 * then this condition matches any reason.
2878 * Possible string values are:
2879 * - "NON_COMPLIANCE_REASON_UNSPECIFIED" : This value is disallowed.
2880 * - "API_LEVEL" : The setting is not supported in the API level of Android OS
2881 * version the
2882 * device is running.
2883 * - "ADMIN_TYPE" : The admin type (profile owner, device owner, etc.) does
2884 * not support the
2885 * setting.
2886 * - "USER_ACTION" : The user has not taken required action to comply with the
2887 * setting.
2888 * - "INVALID_VALUE" : The setting has an invalid value.
2889 * - "APP_NOT_INSTALLED" : The application required to implement the policy is
2890 * not installed.
2891 * - "UNSUPPORTED" : The policy is not supported by the version of Android
2892 * Device Policy on
2893 * the device.
2894 * - "APP_INSTALLED" : A blocked application is installed.
2895 * - "PENDING" : The setting was not applied yet at the time of the report,
2896 * but is
2897 * expected to be applied shortly.
2898 * - "APP_INCOMPATIBLE" : The setting cannot be applied to the application
2899 * because its target SDK
2900 * version is not high enough.
2901 */
2902 core.String nonComplianceReason;
2903 /**
2904 * The package name indicating which application is out of compliance. If not
2905 * set, then this condition matches any package name. If this field is set,
2906 * then `setting_name` must be unset or set to `applications`; otherwise, the
2907 * condition would never be satisfied.
2908 */
2909 core.String packageName;
2910 /**
2911 * The name of the policy setting. This is the JSON field name of a top-level
2912 * [`Policy`](/android/management/reference/rest/v1/enterprises.policies#Polic y)
2913 * field. If not set, then this condition matches any setting name.
2914 */
2915 core.String settingName;
2916
2917 NonComplianceDetailCondition();
2918
2919 NonComplianceDetailCondition.fromJson(core.Map _json) {
2920 if (_json.containsKey("nonComplianceReason")) {
2921 nonComplianceReason = _json["nonComplianceReason"];
2922 }
2923 if (_json.containsKey("packageName")) {
2924 packageName = _json["packageName"];
2925 }
2926 if (_json.containsKey("settingName")) {
2927 settingName = _json["settingName"];
2928 }
2929 }
2930
2931 core.Map<core.String, core.Object> toJson() {
2932 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
2933 if (nonComplianceReason != null) {
2934 _json["nonComplianceReason"] = nonComplianceReason;
2935 }
2936 if (packageName != null) {
2937 _json["packageName"] = packageName;
2938 }
2939 if (settingName != null) {
2940 _json["settingName"] = settingName;
2941 }
2942 return _json;
2943 }
2944 }
2945
2946 /**
2947 * This resource represents a long-running operation that is the result of a
2948 * network API call.
2949 */
2950 class Operation {
2951 /**
2952 * If the value is `false`, it means the operation is still in progress.
2953 * If true, the operation is completed, and either `error` or `response` is
2954 * available.
2955 */
2956 core.bool done;
2957 /** The error result of the operation in case of failure or cancellation. */
2958 Status error;
2959 /**
2960 * Service-specific metadata associated with the operation. It typically
2961 * contains progress information and common metadata such as create time.
2962 * Some services might not provide such metadata. Any method that returns a
2963 * long-running operation should document the metadata type, if any.
2964 *
2965 * The values for Object must be JSON objects. It can consist of `num`,
2966 * `String`, `bool` and `null` as well as `Map` and `List` values.
2967 */
2968 core.Map<core.String, core.Object> metadata;
2969 /**
2970 * The server-assigned name, which is only unique within the same service that
2971 * originally returns it. If you use the default HTTP mapping, the
2972 * `name` should have the format of `operations/some/unique/name`.
2973 */
2974 core.String name;
2975 /**
2976 * The normal response of the operation in case of success. If the original
2977 * method returns no data on success, such as `Delete`, the response is
2978 * `google.protobuf.Empty`. If the original method is standard
2979 * `Get`/`Create`/`Update`, the response should be the resource. For other
2980 * methods, the response should have the type `XxxResponse`, where `Xxx`
2981 * is the original method name. For example, if the original method name
2982 * is `TakeSnapshot()`, the inferred response type is
2983 * `TakeSnapshotResponse`.
2984 *
2985 * The values for Object must be JSON objects. It can consist of `num`,
2986 * `String`, `bool` and `null` as well as `Map` and `List` values.
2987 */
2988 core.Map<core.String, core.Object> response;
2989
2990 Operation();
2991
2992 Operation.fromJson(core.Map _json) {
2993 if (_json.containsKey("done")) {
2994 done = _json["done"];
2995 }
2996 if (_json.containsKey("error")) {
2997 error = new Status.fromJson(_json["error"]);
2998 }
2999 if (_json.containsKey("metadata")) {
3000 metadata = _json["metadata"];
3001 }
3002 if (_json.containsKey("name")) {
3003 name = _json["name"];
3004 }
3005 if (_json.containsKey("response")) {
3006 response = _json["response"];
3007 }
3008 }
3009
3010 core.Map<core.String, core.Object> toJson() {
3011 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3012 if (done != null) {
3013 _json["done"] = done;
3014 }
3015 if (error != null) {
3016 _json["error"] = (error).toJson();
3017 }
3018 if (metadata != null) {
3019 _json["metadata"] = metadata;
3020 }
3021 if (name != null) {
3022 _json["name"] = name;
3023 }
3024 if (response != null) {
3025 _json["response"] = response;
3026 }
3027 return _json;
3028 }
3029 }
3030
3031 /** Requirements for the password used to unlock a device. */
3032 class PasswordRequirements {
3033 /**
3034 * A device will be wiped after too many incorrect device-unlock passwords
3035 * have been entered. A value of 0 means there is no restriction.
3036 */
3037 core.int maximumFailedPasswordsForWipe;
3038 /** Password expiration timeout. */
3039 core.String passwordExpirationTimeout;
3040 /**
3041 * The length of the password history. After setting this, the user will
3042 * not be able to enter a new password that is the same as any password in
3043 * the history. A value of 0 means there is no restriction.
3044 */
3045 core.int passwordHistoryLength;
3046 /**
3047 * The minimum allowed password length. A value of 0 means there is no
3048 * restriction.
3049 * Only enforced when `password_quality` is `NUMERIC`, `NUMERIC_COMPLEX`,
3050 * `ALPHABETIC`, `ALPHANUMERIC`, or `COMPLEX`.
3051 */
3052 core.int passwordMinimumLength;
3053 /**
3054 * Minimum number of letters required in the password.
3055 * Only enforced when `password_quality` is `COMPLEX`.
3056 */
3057 core.int passwordMinimumLetters;
3058 /**
3059 * Minimum number of lower case letters required in the password.
3060 * Only enforced when `password_quality` is `COMPLEX`.
3061 */
3062 core.int passwordMinimumLowerCase;
3063 /**
3064 * Minimum number of non-letter characters (numerical digits or symbols)
3065 * required in the password.
3066 * Only enforced when `password_quality` is `COMPLEX`.
3067 */
3068 core.int passwordMinimumNonLetter;
3069 /**
3070 * Minimum number of numerical digits required in the password.
3071 * Only enforced when `password_quality` is `COMPLEX`.
3072 */
3073 core.int passwordMinimumNumeric;
3074 /**
3075 * Minimum number of symbols required in the password.
3076 * Only enforced when `password_quality` is `COMPLEX`.
3077 */
3078 core.int passwordMinimumSymbols;
3079 /**
3080 * Minimum number of upper case letters required in the password.
3081 * Only enforced when `password_quality` is `COMPLEX`.
3082 */
3083 core.int passwordMinimumUpperCase;
3084 /**
3085 * The required password quality.
3086 * Possible string values are:
3087 * - "PASSWORD_QUALITY_UNSPECIFIED" : There are no requirements for the
3088 * password.
3089 * - "SOMETHING" : There must be a password, but there are no restrictions on
3090 * its
3091 * characters.
3092 * - "NUMERIC" : The password must contain numeric characters.
3093 * - "NUMERIC_COMPLEX" : The password must contain numeric characters with no
3094 * repeating (4444) or
3095 * ordered (1234, 4321, 2468) sequences.
3096 * - "ALPHABETIC" : The password must contain alphabetic (or symbol)
3097 * characters.
3098 * - "ALPHANUMERIC" : The password must contain at both numeric and alphabetic
3099 * (or symbol)
3100 * characters.
3101 * - "COMPLEX" : The password must contain at least a letter, a numerical
3102 * digit and a
3103 * special symbol. Other password constraints, for example,
3104 * `password_minimum_letters` are enforced.
3105 */
3106 core.String passwordQuality;
3107
3108 PasswordRequirements();
3109
3110 PasswordRequirements.fromJson(core.Map _json) {
3111 if (_json.containsKey("maximumFailedPasswordsForWipe")) {
3112 maximumFailedPasswordsForWipe = _json["maximumFailedPasswordsForWipe"];
3113 }
3114 if (_json.containsKey("passwordExpirationTimeout")) {
3115 passwordExpirationTimeout = _json["passwordExpirationTimeout"];
3116 }
3117 if (_json.containsKey("passwordHistoryLength")) {
3118 passwordHistoryLength = _json["passwordHistoryLength"];
3119 }
3120 if (_json.containsKey("passwordMinimumLength")) {
3121 passwordMinimumLength = _json["passwordMinimumLength"];
3122 }
3123 if (_json.containsKey("passwordMinimumLetters")) {
3124 passwordMinimumLetters = _json["passwordMinimumLetters"];
3125 }
3126 if (_json.containsKey("passwordMinimumLowerCase")) {
3127 passwordMinimumLowerCase = _json["passwordMinimumLowerCase"];
3128 }
3129 if (_json.containsKey("passwordMinimumNonLetter")) {
3130 passwordMinimumNonLetter = _json["passwordMinimumNonLetter"];
3131 }
3132 if (_json.containsKey("passwordMinimumNumeric")) {
3133 passwordMinimumNumeric = _json["passwordMinimumNumeric"];
3134 }
3135 if (_json.containsKey("passwordMinimumSymbols")) {
3136 passwordMinimumSymbols = _json["passwordMinimumSymbols"];
3137 }
3138 if (_json.containsKey("passwordMinimumUpperCase")) {
3139 passwordMinimumUpperCase = _json["passwordMinimumUpperCase"];
3140 }
3141 if (_json.containsKey("passwordQuality")) {
3142 passwordQuality = _json["passwordQuality"];
3143 }
3144 }
3145
3146 core.Map<core.String, core.Object> toJson() {
3147 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3148 if (maximumFailedPasswordsForWipe != null) {
3149 _json["maximumFailedPasswordsForWipe"] = maximumFailedPasswordsForWipe;
3150 }
3151 if (passwordExpirationTimeout != null) {
3152 _json["passwordExpirationTimeout"] = passwordExpirationTimeout;
3153 }
3154 if (passwordHistoryLength != null) {
3155 _json["passwordHistoryLength"] = passwordHistoryLength;
3156 }
3157 if (passwordMinimumLength != null) {
3158 _json["passwordMinimumLength"] = passwordMinimumLength;
3159 }
3160 if (passwordMinimumLetters != null) {
3161 _json["passwordMinimumLetters"] = passwordMinimumLetters;
3162 }
3163 if (passwordMinimumLowerCase != null) {
3164 _json["passwordMinimumLowerCase"] = passwordMinimumLowerCase;
3165 }
3166 if (passwordMinimumNonLetter != null) {
3167 _json["passwordMinimumNonLetter"] = passwordMinimumNonLetter;
3168 }
3169 if (passwordMinimumNumeric != null) {
3170 _json["passwordMinimumNumeric"] = passwordMinimumNumeric;
3171 }
3172 if (passwordMinimumSymbols != null) {
3173 _json["passwordMinimumSymbols"] = passwordMinimumSymbols;
3174 }
3175 if (passwordMinimumUpperCase != null) {
3176 _json["passwordMinimumUpperCase"] = passwordMinimumUpperCase;
3177 }
3178 if (passwordQuality != null) {
3179 _json["passwordQuality"] = passwordQuality;
3180 }
3181 return _json;
3182 }
3183 }
3184
3185 /** Configuration for an Android permission and its grant state. */
3186 class PermissionGrant {
3187 /** The android permission, e.g. `android.permission.READ_CALENDAR`. */
3188 core.String permission;
3189 /**
3190 * The policy for granting the permission.
3191 * Possible string values are:
3192 * - "PERMISSION_POLICY_UNSPECIFIED" : Policy not specified. If no policy is
3193 * specified for a permission at any
3194 * level, then the `PROMPT` behavior is used by default.
3195 * - "PROMPT" : Prompt the user to grant a permission.
3196 * - "GRANT" : Automatically grant a permission.
3197 * - "DENY" : Automatically deny a permission.
3198 */
3199 core.String policy;
3200
3201 PermissionGrant();
3202
3203 PermissionGrant.fromJson(core.Map _json) {
3204 if (_json.containsKey("permission")) {
3205 permission = _json["permission"];
3206 }
3207 if (_json.containsKey("policy")) {
3208 policy = _json["policy"];
3209 }
3210 }
3211
3212 core.Map<core.String, core.Object> toJson() {
3213 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3214 if (permission != null) {
3215 _json["permission"] = permission;
3216 }
3217 if (policy != null) {
3218 _json["policy"] = policy;
3219 }
3220 return _json;
3221 }
3222 }
3223
3224 /**
3225 * A default activity for handling intents that match a particular intent
3226 * filter.
3227 */
3228 class PersistentPreferredActivity {
3229 /**
3230 * The intent actions to match in the filter. If any actions are included in
3231 * the filter, then an intent's action must be one of those values for it to
3232 * match. If no actions are included, the intent action is ignored.
3233 */
3234 core.List<core.String> actions;
3235 /**
3236 * The intent categories to match in the filter. An intent includes the
3237 * categories that it requires, all of which must be included in the filter in
3238 * order to match. In other words, adding a category to the filter has no
3239 * impact on matching unless that category is specified in the intent.
3240 */
3241 core.List<core.String> categories;
3242 /**
3243 * The activity that should be the default intent handler. This should be an
3244 * Android component name, e.g. `com.android.enterprise.app/.MainActivity`.
3245 * Alternatively, the value may be the package name of an app, which causes
3246 * Android Device Policy to choose an appropriate activity from the app to
3247 * handle the intent.
3248 */
3249 core.String receiverActivity;
3250
3251 PersistentPreferredActivity();
3252
3253 PersistentPreferredActivity.fromJson(core.Map _json) {
3254 if (_json.containsKey("actions")) {
3255 actions = _json["actions"];
3256 }
3257 if (_json.containsKey("categories")) {
3258 categories = _json["categories"];
3259 }
3260 if (_json.containsKey("receiverActivity")) {
3261 receiverActivity = _json["receiverActivity"];
3262 }
3263 }
3264
3265 core.Map<core.String, core.Object> toJson() {
3266 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3267 if (actions != null) {
3268 _json["actions"] = actions;
3269 }
3270 if (categories != null) {
3271 _json["categories"] = categories;
3272 }
3273 if (receiverActivity != null) {
3274 _json["receiverActivity"] = receiverActivity;
3275 }
3276 return _json;
3277 }
3278 }
3279
3280 /** A policy, which governs behavior for a device. */
3281 class Policy {
3282 /** Whether adding new users and profiles is disabled. */
3283 core.bool addUserDisabled;
3284 /** Whether adjusting the master volume is disabled. */
3285 core.bool adjustVolumeDisabled;
3286 /** Policy applied to apps. */
3287 core.List<ApplicationPolicy> applications;
3288 /**
3289 * Whether applications other than the ones configured in `applications` are
3290 * blocked from being installed. When set, applications that were
3291 * installed under a previous policy but no longer appear in the policy are
3292 * automatically uninstalled.
3293 */
3294 core.bool blockApplicationsEnabled;
3295 /** Whether all cameras on the device are disabled. */
3296 core.bool cameraDisabled;
3297 /**
3298 * Rules declaring which mitigating actions to take when a device is not
3299 * compliant with its policy. When the conditions for multiple rules are
3300 * satisfied, all of the mitigating actions for the rules are taken. There is
3301 * a maximum limit of 100 rules.
3302 */
3303 core.List<ComplianceRule> complianceRules;
3304 /** Whether the user is allowed to enable debugging features. */
3305 core.bool debuggingFeaturesAllowed;
3306 /**
3307 * The default permission policy for requests for runtime permissions.
3308 * Possible string values are:
3309 * - "PERMISSION_POLICY_UNSPECIFIED" : Policy not specified. If no policy is
3310 * specified for a permission at any
3311 * level, then the `PROMPT` behavior is used by default.
3312 * - "PROMPT" : Prompt the user to grant a permission.
3313 * - "GRANT" : Automatically grant a permission.
3314 * - "DENY" : Automatically deny a permission.
3315 */
3316 core.String defaultPermissionPolicy;
3317 /** Whether factory resetting from settings is disabled. */
3318 core.bool factoryResetDisabled;
3319 /**
3320 * Email addresses of device administrators for factory reset protection.
3321 * When the device is factory reset, it will require one of these admins to
3322 * log in with the Google account email and password to unlock the device.
3323 * If no admins are specified, the device will not provide factory reset
3324 * protection.
3325 */
3326 core.List<core.String> frpAdminEmails;
3327 /**
3328 * Whether the user is allowed to enable the "Unknown Sources" setting,
3329 * which allows installation of apps from unknown sources.
3330 */
3331 core.bool installUnknownSourcesAllowed;
3332 /** Whether the keyguard is disabled. */
3333 core.bool keyguardDisabled;
3334 /**
3335 * Maximum time in milliseconds for user activity until the device will lock.
3336 * A value of 0 means there is no restriction.
3337 */
3338 core.String maximumTimeToLock;
3339 /** Whether adding or removing accounts is disabled. */
3340 core.bool modifyAccountsDisabled;
3341 /**
3342 * The name of the policy in the form
3343 * `enterprises/{enterpriseId}/policies/{policyId}`
3344 */
3345 core.String name;
3346 /**
3347 * Flag to specify if network escape hatch is enabled. If this flag has been
3348 * enabled then upon device boot if device has no network connection, then an
3349 * activity will be shown that allows the user to temporarily connect to a
3350 * network to fetch the latest policy. The launched activity will time out if
3351 * no network has been connected for a given while and will return to the
3352 * previous activity that was shown.
3353 */
3354 core.bool networkEscapeHatchEnabled;
3355 /**
3356 * Network configuration for the device. See
3357 * [configure networks](/android/management/configure-networks)
3358 * for more information.
3359 *
3360 * The values for Object must be JSON objects. It can consist of `num`,
3361 * `String`, `bool` and `null` as well as `Map` and `List` values.
3362 */
3363 core.Map<core.String, core.Object> openNetworkConfiguration;
3364 /** Password requirements. */
3365 PasswordRequirements passwordRequirements;
3366 /** Default intent handler activities. */
3367 core.List<PersistentPreferredActivity> persistentPreferredActivities;
3368 /** Whether removing other users is disabled. */
3369 core.bool removeUserDisabled;
3370 /** Whether rebooting the device into safe boot is disabled. */
3371 core.bool safeBootDisabled;
3372 /** Whether screen capture is disabled. */
3373 core.bool screenCaptureDisabled;
3374 /**
3375 * Whether the status bar is disabled. This disables notifications, quick
3376 * settings and other screen overlays that allow escape from full-screen mode.
3377 */
3378 core.bool statusBarDisabled;
3379 /** Status reporting settings */
3380 StatusReportingSettings statusReportingSettings;
3381 /**
3382 * The battery plugged in modes for which the device stays on. When using this
3383 * setting, it is recommended to clear `maximum_time_to_lock` so that the
3384 * device doesn't lock itself while it stays on.
3385 */
3386 core.List<core.String> stayOnPluggedModes;
3387 /**
3388 * The system update policy, which controls how OS updates are applied. If the
3389 * update type is `WINDOWED` and the device has a device account, the update
3390 * window will automatically apply to Play app updates as well.
3391 */
3392 SystemUpdate systemUpdate;
3393 /**
3394 * Whether the microphone is muted and adjusting microphone volume is
3395 * disabled.
3396 */
3397 core.bool unmuteMicrophoneDisabled;
3398 /**
3399 * The version of the policy. This is a read-only field. The version is
3400 * incremented each time the policy is updated.
3401 */
3402 core.String version;
3403
3404 Policy();
3405
3406 Policy.fromJson(core.Map _json) {
3407 if (_json.containsKey("addUserDisabled")) {
3408 addUserDisabled = _json["addUserDisabled"];
3409 }
3410 if (_json.containsKey("adjustVolumeDisabled")) {
3411 adjustVolumeDisabled = _json["adjustVolumeDisabled"];
3412 }
3413 if (_json.containsKey("applications")) {
3414 applications = _json["applications"].map((value) => new ApplicationPolicy. fromJson(value)).toList();
3415 }
3416 if (_json.containsKey("blockApplicationsEnabled")) {
3417 blockApplicationsEnabled = _json["blockApplicationsEnabled"];
3418 }
3419 if (_json.containsKey("cameraDisabled")) {
3420 cameraDisabled = _json["cameraDisabled"];
3421 }
3422 if (_json.containsKey("complianceRules")) {
3423 complianceRules = _json["complianceRules"].map((value) => new ComplianceRu le.fromJson(value)).toList();
3424 }
3425 if (_json.containsKey("debuggingFeaturesAllowed")) {
3426 debuggingFeaturesAllowed = _json["debuggingFeaturesAllowed"];
3427 }
3428 if (_json.containsKey("defaultPermissionPolicy")) {
3429 defaultPermissionPolicy = _json["defaultPermissionPolicy"];
3430 }
3431 if (_json.containsKey("factoryResetDisabled")) {
3432 factoryResetDisabled = _json["factoryResetDisabled"];
3433 }
3434 if (_json.containsKey("frpAdminEmails")) {
3435 frpAdminEmails = _json["frpAdminEmails"];
3436 }
3437 if (_json.containsKey("installUnknownSourcesAllowed")) {
3438 installUnknownSourcesAllowed = _json["installUnknownSourcesAllowed"];
3439 }
3440 if (_json.containsKey("keyguardDisabled")) {
3441 keyguardDisabled = _json["keyguardDisabled"];
3442 }
3443 if (_json.containsKey("maximumTimeToLock")) {
3444 maximumTimeToLock = _json["maximumTimeToLock"];
3445 }
3446 if (_json.containsKey("modifyAccountsDisabled")) {
3447 modifyAccountsDisabled = _json["modifyAccountsDisabled"];
3448 }
3449 if (_json.containsKey("name")) {
3450 name = _json["name"];
3451 }
3452 if (_json.containsKey("networkEscapeHatchEnabled")) {
3453 networkEscapeHatchEnabled = _json["networkEscapeHatchEnabled"];
3454 }
3455 if (_json.containsKey("openNetworkConfiguration")) {
3456 openNetworkConfiguration = _json["openNetworkConfiguration"];
3457 }
3458 if (_json.containsKey("passwordRequirements")) {
3459 passwordRequirements = new PasswordRequirements.fromJson(_json["passwordRe quirements"]);
3460 }
3461 if (_json.containsKey("persistentPreferredActivities")) {
3462 persistentPreferredActivities = _json["persistentPreferredActivities"].map ((value) => new PersistentPreferredActivity.fromJson(value)).toList();
3463 }
3464 if (_json.containsKey("removeUserDisabled")) {
3465 removeUserDisabled = _json["removeUserDisabled"];
3466 }
3467 if (_json.containsKey("safeBootDisabled")) {
3468 safeBootDisabled = _json["safeBootDisabled"];
3469 }
3470 if (_json.containsKey("screenCaptureDisabled")) {
3471 screenCaptureDisabled = _json["screenCaptureDisabled"];
3472 }
3473 if (_json.containsKey("statusBarDisabled")) {
3474 statusBarDisabled = _json["statusBarDisabled"];
3475 }
3476 if (_json.containsKey("statusReportingSettings")) {
3477 statusReportingSettings = new StatusReportingSettings.fromJson(_json["stat usReportingSettings"]);
3478 }
3479 if (_json.containsKey("stayOnPluggedModes")) {
3480 stayOnPluggedModes = _json["stayOnPluggedModes"];
3481 }
3482 if (_json.containsKey("systemUpdate")) {
3483 systemUpdate = new SystemUpdate.fromJson(_json["systemUpdate"]);
3484 }
3485 if (_json.containsKey("unmuteMicrophoneDisabled")) {
3486 unmuteMicrophoneDisabled = _json["unmuteMicrophoneDisabled"];
3487 }
3488 if (_json.containsKey("version")) {
3489 version = _json["version"];
3490 }
3491 }
3492
3493 core.Map<core.String, core.Object> toJson() {
3494 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3495 if (addUserDisabled != null) {
3496 _json["addUserDisabled"] = addUserDisabled;
3497 }
3498 if (adjustVolumeDisabled != null) {
3499 _json["adjustVolumeDisabled"] = adjustVolumeDisabled;
3500 }
3501 if (applications != null) {
3502 _json["applications"] = applications.map((value) => (value).toJson()).toLi st();
3503 }
3504 if (blockApplicationsEnabled != null) {
3505 _json["blockApplicationsEnabled"] = blockApplicationsEnabled;
3506 }
3507 if (cameraDisabled != null) {
3508 _json["cameraDisabled"] = cameraDisabled;
3509 }
3510 if (complianceRules != null) {
3511 _json["complianceRules"] = complianceRules.map((value) => (value).toJson() ).toList();
3512 }
3513 if (debuggingFeaturesAllowed != null) {
3514 _json["debuggingFeaturesAllowed"] = debuggingFeaturesAllowed;
3515 }
3516 if (defaultPermissionPolicy != null) {
3517 _json["defaultPermissionPolicy"] = defaultPermissionPolicy;
3518 }
3519 if (factoryResetDisabled != null) {
3520 _json["factoryResetDisabled"] = factoryResetDisabled;
3521 }
3522 if (frpAdminEmails != null) {
3523 _json["frpAdminEmails"] = frpAdminEmails;
3524 }
3525 if (installUnknownSourcesAllowed != null) {
3526 _json["installUnknownSourcesAllowed"] = installUnknownSourcesAllowed;
3527 }
3528 if (keyguardDisabled != null) {
3529 _json["keyguardDisabled"] = keyguardDisabled;
3530 }
3531 if (maximumTimeToLock != null) {
3532 _json["maximumTimeToLock"] = maximumTimeToLock;
3533 }
3534 if (modifyAccountsDisabled != null) {
3535 _json["modifyAccountsDisabled"] = modifyAccountsDisabled;
3536 }
3537 if (name != null) {
3538 _json["name"] = name;
3539 }
3540 if (networkEscapeHatchEnabled != null) {
3541 _json["networkEscapeHatchEnabled"] = networkEscapeHatchEnabled;
3542 }
3543 if (openNetworkConfiguration != null) {
3544 _json["openNetworkConfiguration"] = openNetworkConfiguration;
3545 }
3546 if (passwordRequirements != null) {
3547 _json["passwordRequirements"] = (passwordRequirements).toJson();
3548 }
3549 if (persistentPreferredActivities != null) {
3550 _json["persistentPreferredActivities"] = persistentPreferredActivities.map ((value) => (value).toJson()).toList();
3551 }
3552 if (removeUserDisabled != null) {
3553 _json["removeUserDisabled"] = removeUserDisabled;
3554 }
3555 if (safeBootDisabled != null) {
3556 _json["safeBootDisabled"] = safeBootDisabled;
3557 }
3558 if (screenCaptureDisabled != null) {
3559 _json["screenCaptureDisabled"] = screenCaptureDisabled;
3560 }
3561 if (statusBarDisabled != null) {
3562 _json["statusBarDisabled"] = statusBarDisabled;
3563 }
3564 if (statusReportingSettings != null) {
3565 _json["statusReportingSettings"] = (statusReportingSettings).toJson();
3566 }
3567 if (stayOnPluggedModes != null) {
3568 _json["stayOnPluggedModes"] = stayOnPluggedModes;
3569 }
3570 if (systemUpdate != null) {
3571 _json["systemUpdate"] = (systemUpdate).toJson();
3572 }
3573 if (unmuteMicrophoneDisabled != null) {
3574 _json["unmuteMicrophoneDisabled"] = unmuteMicrophoneDisabled;
3575 }
3576 if (version != null) {
3577 _json["version"] = version;
3578 }
3579 return _json;
3580 }
3581 }
3582
3583 /** A power management event. */
3584 class PowerManagementEvent {
3585 /**
3586 * For `BATTERY_LEVEL_COLLECTED` events, the battery level as a percentage.
3587 */
3588 core.double batteryLevel;
3589 /** The creation time of the event. */
3590 core.String createTime;
3591 /**
3592 * Event type.
3593 * Possible string values are:
3594 * - "POWER_MANAGEMENT_EVENT_TYPE_UNSPECIFIED" : Unspecified. No events have
3595 * this type.
3596 * - "BATTERY_LEVEL_COLLECTED" : Battery level was measured.
3597 * - "POWER_CONNECTED" : The device started charging.
3598 * - "POWER_DISCONNECTED" : The device stopped charging.
3599 * - "BATTERY_LOW" : The device entered low-power mode.
3600 * - "BATTERY_OKAY" : The device exited low-power mode.
3601 * - "BOOT_COMPLETED" : The device booted.
3602 * - "SHUTDOWN" : The device shut down.
3603 */
3604 core.String eventType;
3605
3606 PowerManagementEvent();
3607
3608 PowerManagementEvent.fromJson(core.Map _json) {
3609 if (_json.containsKey("batteryLevel")) {
3610 batteryLevel = _json["batteryLevel"];
3611 }
3612 if (_json.containsKey("createTime")) {
3613 createTime = _json["createTime"];
3614 }
3615 if (_json.containsKey("eventType")) {
3616 eventType = _json["eventType"];
3617 }
3618 }
3619
3620 core.Map<core.String, core.Object> toJson() {
3621 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3622 if (batteryLevel != null) {
3623 _json["batteryLevel"] = batteryLevel;
3624 }
3625 if (createTime != null) {
3626 _json["createTime"] = createTime;
3627 }
3628 if (eventType != null) {
3629 _json["eventType"] = eventType;
3630 }
3631 return _json;
3632 }
3633 }
3634
3635 /** An enterprise signup URL. */
3636 class SignupUrl {
3637 /**
3638 * The name of the resource. This must be included in the
3639 * [create
3640 * enterprise](/android/management/reference/rest/v1/enterprises/create)
3641 * request at the end of the signup flow.
3642 */
3643 core.String name;
3644 /**
3645 * A URL under which the Admin can sign up for an enterprise.
3646 * The page pointed to cannot be rendered in an iframe.
3647 */
3648 core.String url;
3649
3650 SignupUrl();
3651
3652 SignupUrl.fromJson(core.Map _json) {
3653 if (_json.containsKey("name")) {
3654 name = _json["name"];
3655 }
3656 if (_json.containsKey("url")) {
3657 url = _json["url"];
3658 }
3659 }
3660
3661 core.Map<core.String, core.Object> toJson() {
3662 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3663 if (name != null) {
3664 _json["name"] = name;
3665 }
3666 if (url != null) {
3667 _json["url"] = url;
3668 }
3669 return _json;
3670 }
3671 }
3672
3673 /** Information about device software. */
3674 class SoftwareInfo {
3675 /**
3676 * Android build Id string meant for displaying to the user,
3677 * e.g. `shamu-userdebug 6.0.1 MOB30I 2756745 dev-keys`.
3678 */
3679 core.String androidBuildNumber;
3680 /** Build time. */
3681 core.String androidBuildTime;
3682 /** The user visible Android version string, e.g. `6.0.1`. */
3683 core.String androidVersion;
3684 /** The system bootloader version number, e.g. `0.6.7`. */
3685 core.String bootloaderVersion;
3686 /** Kernel version, e.g. `2.6.32.9-g103d848`. */
3687 core.String deviceKernelVersion;
3688 /** Security patch level, e.g. `2016-05-01`. */
3689 core.String securityPatchLevel;
3690
3691 SoftwareInfo();
3692
3693 SoftwareInfo.fromJson(core.Map _json) {
3694 if (_json.containsKey("androidBuildNumber")) {
3695 androidBuildNumber = _json["androidBuildNumber"];
3696 }
3697 if (_json.containsKey("androidBuildTime")) {
3698 androidBuildTime = _json["androidBuildTime"];
3699 }
3700 if (_json.containsKey("androidVersion")) {
3701 androidVersion = _json["androidVersion"];
3702 }
3703 if (_json.containsKey("bootloaderVersion")) {
3704 bootloaderVersion = _json["bootloaderVersion"];
3705 }
3706 if (_json.containsKey("deviceKernelVersion")) {
3707 deviceKernelVersion = _json["deviceKernelVersion"];
3708 }
3709 if (_json.containsKey("securityPatchLevel")) {
3710 securityPatchLevel = _json["securityPatchLevel"];
3711 }
3712 }
3713
3714 core.Map<core.String, core.Object> toJson() {
3715 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3716 if (androidBuildNumber != null) {
3717 _json["androidBuildNumber"] = androidBuildNumber;
3718 }
3719 if (androidBuildTime != null) {
3720 _json["androidBuildTime"] = androidBuildTime;
3721 }
3722 if (androidVersion != null) {
3723 _json["androidVersion"] = androidVersion;
3724 }
3725 if (bootloaderVersion != null) {
3726 _json["bootloaderVersion"] = bootloaderVersion;
3727 }
3728 if (deviceKernelVersion != null) {
3729 _json["deviceKernelVersion"] = deviceKernelVersion;
3730 }
3731 if (securityPatchLevel != null) {
3732 _json["securityPatchLevel"] = securityPatchLevel;
3733 }
3734 return _json;
3735 }
3736 }
3737
3738 /**
3739 * The `Status` type defines a logical error model that is suitable for
3740 * different
3741 * programming environments, including REST APIs and RPC APIs. It is used by
3742 * [gRPC](https://github.com/grpc). The error model is designed to be:
3743 *
3744 * - Simple to use and understand for most users
3745 * - Flexible enough to meet unexpected needs
3746 *
3747 * # Overview
3748 *
3749 * The `Status` message contains three pieces of data: error code, error
3750 * message,
3751 * and error details. The error code should be an enum value of
3752 * google.rpc.Code, but it may accept additional error codes if needed. The
3753 * error message should be a developer-facing English message that helps
3754 * developers *understand* and *resolve* the error. If a localized user-facing
3755 * error message is needed, put the localized message in the error details or
3756 * localize it in the client. The optional error details may contain arbitrary
3757 * information about the error. There is a predefined set of error detail types
3758 * in the package `google.rpc` that can be used for common error conditions.
3759 *
3760 * # Language mapping
3761 *
3762 * The `Status` message is the logical representation of the error model, but it
3763 * is not necessarily the actual wire format. When the `Status` message is
3764 * exposed in different client libraries and different wire protocols, it can be
3765 * mapped differently. For example, it will likely be mapped to some exceptions
3766 * in Java, but more likely mapped to some error codes in C.
3767 *
3768 * # Other uses
3769 *
3770 * The error model and the `Status` message can be used in a variety of
3771 * environments, either with or without APIs, to provide a
3772 * consistent developer experience across different environments.
3773 *
3774 * Example uses of this error model include:
3775 *
3776 * - Partial errors. If a service needs to return partial errors to the client,
3777 * it may embed the `Status` in the normal response to indicate the partial
3778 * errors.
3779 *
3780 * - Workflow errors. A typical workflow has multiple steps. Each step may
3781 * have a `Status` message for error reporting.
3782 *
3783 * - Batch operations. If a client uses batch request and batch response, the
3784 * `Status` message should be used directly inside batch response, one for
3785 * each error sub-response.
3786 *
3787 * - Asynchronous operations. If an API call embeds asynchronous operation
3788 * results in its response, the status of those operations should be
3789 * represented directly using the `Status` message.
3790 *
3791 * - Logging. If some API errors are stored in logs, the message `Status` could
3792 * be used directly after any stripping needed for security/privacy reasons.
3793 */
3794 class Status {
3795 /** The status code, which should be an enum value of google.rpc.Code. */
3796 core.int code;
3797 /**
3798 * A list of messages that carry the error details. There is a common set of
3799 * message types for APIs to use.
3800 *
3801 * The values for Object must be JSON objects. It can consist of `num`,
3802 * `String`, `bool` and `null` as well as `Map` and `List` values.
3803 */
3804 core.List<core.Map<core.String, core.Object>> details;
3805 /**
3806 * A developer-facing error message, which should be in English. Any
3807 * user-facing error message should be localized and sent in the
3808 * google.rpc.Status.details field, or localized by the client.
3809 */
3810 core.String message;
3811
3812 Status();
3813
3814 Status.fromJson(core.Map _json) {
3815 if (_json.containsKey("code")) {
3816 code = _json["code"];
3817 }
3818 if (_json.containsKey("details")) {
3819 details = _json["details"];
3820 }
3821 if (_json.containsKey("message")) {
3822 message = _json["message"];
3823 }
3824 }
3825
3826 core.Map<core.String, core.Object> toJson() {
3827 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3828 if (code != null) {
3829 _json["code"] = code;
3830 }
3831 if (details != null) {
3832 _json["details"] = details;
3833 }
3834 if (message != null) {
3835 _json["message"] = message;
3836 }
3837 return _json;
3838 }
3839 }
3840
3841 /** Settings controlling the behavior of status reports. */
3842 class StatusReportingSettings {
3843 /** Whether displays reporting is enabled. */
3844 core.bool displayInfoEnabled;
3845 /** Whether hardware status reporting is enabled. */
3846 core.bool hardwareStatusEnabled;
3847 /** Whether memory info reporting is enabled. */
3848 core.bool memoryInfoEnabled;
3849 /** Whether network info reporting is enabled. */
3850 core.bool networkInfoEnabled;
3851 /** Whether power management event reporting is enabled. */
3852 core.bool powerManagementEventsEnabled;
3853 /** Whether software info reporting is enabled. */
3854 core.bool softwareInfoEnabled;
3855
3856 StatusReportingSettings();
3857
3858 StatusReportingSettings.fromJson(core.Map _json) {
3859 if (_json.containsKey("displayInfoEnabled")) {
3860 displayInfoEnabled = _json["displayInfoEnabled"];
3861 }
3862 if (_json.containsKey("hardwareStatusEnabled")) {
3863 hardwareStatusEnabled = _json["hardwareStatusEnabled"];
3864 }
3865 if (_json.containsKey("memoryInfoEnabled")) {
3866 memoryInfoEnabled = _json["memoryInfoEnabled"];
3867 }
3868 if (_json.containsKey("networkInfoEnabled")) {
3869 networkInfoEnabled = _json["networkInfoEnabled"];
3870 }
3871 if (_json.containsKey("powerManagementEventsEnabled")) {
3872 powerManagementEventsEnabled = _json["powerManagementEventsEnabled"];
3873 }
3874 if (_json.containsKey("softwareInfoEnabled")) {
3875 softwareInfoEnabled = _json["softwareInfoEnabled"];
3876 }
3877 }
3878
3879 core.Map<core.String, core.Object> toJson() {
3880 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3881 if (displayInfoEnabled != null) {
3882 _json["displayInfoEnabled"] = displayInfoEnabled;
3883 }
3884 if (hardwareStatusEnabled != null) {
3885 _json["hardwareStatusEnabled"] = hardwareStatusEnabled;
3886 }
3887 if (memoryInfoEnabled != null) {
3888 _json["memoryInfoEnabled"] = memoryInfoEnabled;
3889 }
3890 if (networkInfoEnabled != null) {
3891 _json["networkInfoEnabled"] = networkInfoEnabled;
3892 }
3893 if (powerManagementEventsEnabled != null) {
3894 _json["powerManagementEventsEnabled"] = powerManagementEventsEnabled;
3895 }
3896 if (softwareInfoEnabled != null) {
3897 _json["softwareInfoEnabled"] = softwareInfoEnabled;
3898 }
3899 return _json;
3900 }
3901 }
3902
3903 /** Configuration for managing system updates */
3904 class SystemUpdate {
3905 /**
3906 * If the type is `WINDOWED`, the end of the maintenance window, measured as
3907 * the number of minutes after midnight in device local time. This value must
3908 * be between 0 and 1439, inclusive. If this value is less than
3909 * `start_minutes`, then the maintenance window spans midnight. If the
3910 * maintenance window specified is smaller than 30 minutes, the actual window
3911 * is extended to 30 minutes beyond the start time.
3912 */
3913 core.int endMinutes;
3914 /**
3915 * If the type is `WINDOWED`, the start of the maintenance window, measured as
3916 * the number of minutes after midnight in device local time. This value must
3917 * be between 0 and 1439, inclusive.
3918 */
3919 core.int startMinutes;
3920 /**
3921 * The type of system update to configure.
3922 * Possible string values are:
3923 * - "SYSTEM_UPDATE_TYPE_UNSPECIFIED" : Follow the default update behavior for
3924 * the device, which typically
3925 * requires the user to accept system updates.
3926 * - "AUTOMATIC" : Install automatically as soon as an update is available.
3927 * - "WINDOWED" : Install automatically within a daily maintenance window. If
3928 * the device
3929 * has a device account, this also configures Play apps to be updated within
3930 * the window. This is strongly recommended for kiosk devices because this
3931 * is the only way apps persistently pinned to the foreground can be updated
3932 * by Play.
3933 * - "POSTPONE" : Postpone automatic install up to a maximum of 30 days.
3934 */
3935 core.String type;
3936
3937 SystemUpdate();
3938
3939 SystemUpdate.fromJson(core.Map _json) {
3940 if (_json.containsKey("endMinutes")) {
3941 endMinutes = _json["endMinutes"];
3942 }
3943 if (_json.containsKey("startMinutes")) {
3944 startMinutes = _json["startMinutes"];
3945 }
3946 if (_json.containsKey("type")) {
3947 type = _json["type"];
3948 }
3949 }
3950
3951 core.Map<core.String, core.Object> toJson() {
3952 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3953 if (endMinutes != null) {
3954 _json["endMinutes"] = endMinutes;
3955 }
3956 if (startMinutes != null) {
3957 _json["startMinutes"] = startMinutes;
3958 }
3959 if (type != null) {
3960 _json["type"] = type;
3961 }
3962 return _json;
3963 }
3964 }
3965
3966 /**
3967 * Provides user facing message with locale info. The maximum message length is
3968 * 4096 characters.
3969 */
3970 class UserFacingMessage {
3971 /**
3972 * The default message that gets displayed if no localized message is
3973 * specified, or the user's locale does not match with any of the localized
3974 * messages. A default message must be provided if any localized messages are
3975 * provided.
3976 */
3977 core.String defaultMessage;
3978 /**
3979 * A map which contains <locale, message> pairs.
3980 * The locale is a BCP 47 language code, e.g. en-US, es-ES, fr.
3981 */
3982 core.Map<core.String, core.String> localizedMessages;
3983
3984 UserFacingMessage();
3985
3986 UserFacingMessage.fromJson(core.Map _json) {
3987 if (_json.containsKey("defaultMessage")) {
3988 defaultMessage = _json["defaultMessage"];
3989 }
3990 if (_json.containsKey("localizedMessages")) {
3991 localizedMessages = _json["localizedMessages"];
3992 }
3993 }
3994
3995 core.Map<core.String, core.Object> toJson() {
3996 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
3997 if (defaultMessage != null) {
3998 _json["defaultMessage"] = defaultMessage;
3999 }
4000 if (localizedMessages != null) {
4001 _json["localizedMessages"] = localizedMessages;
4002 }
4003 return _json;
4004 }
4005 }
4006
4007 /** A web token used to access an embeddable managed Google Play web UI. */
4008 class WebToken {
4009 /**
4010 * The name of the web token, which is generated by the server during
4011 * creation, in the form
4012 * `enterprises/{enterpriseId}/webTokens/{webTokenId}`.
4013 */
4014 core.String name;
4015 /**
4016 * The URL of the parent frame hosting the iframe with the embedded UI. To
4017 * prevent XSS, the iframe may not be hosted at other URLs. The URL must use
4018 * the https scheme.
4019 */
4020 core.String parentFrameUrl;
4021 /**
4022 * Permissions the admin may exercise in the embedded UI. The admin must have
4023 * all of these permissions in order to view the UI.
4024 */
4025 core.List<core.String> permissions;
4026 /**
4027 * The token value which is used in the hosting page to generate the iframe
4028 * with the embedded UI. This is a read-only field generated by the server.
4029 */
4030 core.String value;
4031
4032 WebToken();
4033
4034 WebToken.fromJson(core.Map _json) {
4035 if (_json.containsKey("name")) {
4036 name = _json["name"];
4037 }
4038 if (_json.containsKey("parentFrameUrl")) {
4039 parentFrameUrl = _json["parentFrameUrl"];
4040 }
4041 if (_json.containsKey("permissions")) {
4042 permissions = _json["permissions"];
4043 }
4044 if (_json.containsKey("value")) {
4045 value = _json["value"];
4046 }
4047 }
4048
4049 core.Map<core.String, core.Object> toJson() {
4050 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c ore.Object>();
4051 if (name != null) {
4052 _json["name"] = name;
4053 }
4054 if (parentFrameUrl != null) {
4055 _json["parentFrameUrl"] = parentFrameUrl;
4056 }
4057 if (permissions != null) {
4058 _json["permissions"] = permissions;
4059 }
4060 if (value != null) {
4061 _json["value"] = value;
4062 }
4063 return _json;
4064 }
4065 }
OLDNEW
« no previous file with comments | « generated/googleapis/lib/androidenterprise/v1.dart ('k') | generated/googleapis/lib/appengine/v1.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698