/
classes.rb
3767 lines (3168 loc) · 170 KB
/
classes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'
module Google
module Apis
module AndroidmanagementV1
# Security policies set to the most secure values by default. To maintain the
# security posture of a device, we don't recommend overriding any of the default
# values.
class AdvancedSecurityOverrides
include Google::Apis::Core::Hashable
# Controls Common Criteria Mode—security standards defined in the Common
# Criteria for Information Technology Security Evaluation (https://www.
# commoncriteriaportal.org/) (CC). Enabling Common Criteria Mode increases
# certain security components on a device, including AES-GCM encryption of
# Bluetooth Long Term Keys, and Wi-Fi configuration stores.Warning: Common
# Criteria Mode enforces a strict security model typically only required for IT
# products used in national security systems and other highly sensitive
# organizations. Standard device use may be affected. Only enabled if required.
# Corresponds to the JSON property `commonCriteriaMode`
# @return [String]
attr_accessor :common_criteria_mode
# The policy for untrusted apps (apps from unknown sources) enforced on the
# device. Replaces install_unknown_sources_allowed (deprecated).
# Corresponds to the JSON property `untrustedAppsPolicy`
# @return [String]
attr_accessor :untrusted_apps_policy
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@common_criteria_mode = args[:common_criteria_mode] if args.key?(:common_criteria_mode)
@untrusted_apps_policy = args[:untrusted_apps_policy] if args.key?(:untrusted_apps_policy)
end
end
# Configuration for an always-on VPN connection.
class AlwaysOnVpnPackage
include Google::Apis::Core::Hashable
# Disallows networking when the VPN is not connected.
# Corresponds to the JSON property `lockdownEnabled`
# @return [Boolean]
attr_accessor :lockdown_enabled
alias_method :lockdown_enabled?, :lockdown_enabled
# The package name of the VPN app.
# Corresponds to the JSON property `packageName`
# @return [String]
attr_accessor :package_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@lockdown_enabled = args[:lockdown_enabled] if args.key?(:lockdown_enabled)
@package_name = args[:package_name] if args.key?(:package_name)
end
end
# A compliance rule condition which is satisfied if the Android Framework API
# level on the device doesn't meet a minimum requirement. There can only be one
# rule with this type of condition per policy.
class ApiLevelCondition
include Google::Apis::Core::Hashable
# The minimum desired Android Framework API level. If the device doesn't meet
# the minimum requirement, this condition is satisfied. Must be greater than
# zero.
# Corresponds to the JSON property `minApiLevel`
# @return [Fixnum]
attr_accessor :min_api_level
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@min_api_level = args[:min_api_level] if args.key?(:min_api_level)
end
end
# Id to name association of a app track.
class AppTrackInfo
include Google::Apis::Core::Hashable
# The track name associated with the trackId, set in the Play Console. The name
# is modifiable from Play Console.
# Corresponds to the JSON property `trackAlias`
# @return [String]
attr_accessor :track_alias
# The unmodifiable unique track identifier, taken from the releaseTrackId in the
# URL of the Play Console page that displays the app’s track information.
# Corresponds to the JSON property `trackId`
# @return [String]
attr_accessor :track_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@track_alias = args[:track_alias] if args.key?(:track_alias)
@track_id = args[:track_id] if args.key?(:track_id)
end
end
# Information about an app.
class Application
include Google::Apis::Core::Hashable
# Application tracks visible to the enterprise.
# Corresponds to the JSON property `appTracks`
# @return [Array<Google::Apis::AndroidmanagementV1::AppTrackInfo>]
attr_accessor :app_tracks
# The set of managed properties available to be pre-configured for the app.
# Corresponds to the JSON property `managedProperties`
# @return [Array<Google::Apis::AndroidmanagementV1::ManagedProperty>]
attr_accessor :managed_properties
# The name of the app in the form enterprises/`enterpriseId`/applications/`
# package_name`.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# The permissions required by the app.
# Corresponds to the JSON property `permissions`
# @return [Array<Google::Apis::AndroidmanagementV1::ApplicationPermission>]
attr_accessor :permissions
# The title of the app. Localized.
# Corresponds to the JSON property `title`
# @return [String]
attr_accessor :title
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@app_tracks = args[:app_tracks] if args.key?(:app_tracks)
@managed_properties = args[:managed_properties] if args.key?(:managed_properties)
@name = args[:name] if args.key?(:name)
@permissions = args[:permissions] if args.key?(:permissions)
@title = args[:title] if args.key?(:title)
end
end
# An app-related event.
class ApplicationEvent
include Google::Apis::Core::Hashable
# The creation time of the event.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# App event type.
# Corresponds to the JSON property `eventType`
# @return [String]
attr_accessor :event_type
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@event_type = args[:event_type] if args.key?(:event_type)
end
end
# A permission required by the app.
class ApplicationPermission
include Google::Apis::Core::Hashable
# A longer description of the permission, providing more detail on what it
# affects. Localized.
# Corresponds to the JSON property `description`
# @return [String]
attr_accessor :description
# The name of the permission. Localized.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# An opaque string uniquely identifying the permission. Not localized.
# Corresponds to the JSON property `permissionId`
# @return [String]
attr_accessor :permission_id
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@description = args[:description] if args.key?(:description)
@name = args[:name] if args.key?(:name)
@permission_id = args[:permission_id] if args.key?(:permission_id)
end
end
# Policy for an individual app.
class ApplicationPolicy
include Google::Apis::Core::Hashable
# List of the app’s track IDs that a device belonging to the enterprise can
# access. If the list contains multiple track IDs, devices receive the latest
# version among all accessible tracks. If the list contains no track IDs,
# devices only have access to the app’s production track. More details about
# each track are available in AppTrackInfo.
# Corresponds to the JSON property `accessibleTrackIds`
# @return [Array<String>]
attr_accessor :accessible_track_ids
# This feature is not generally available.
# Corresponds to the JSON property `autoUpdateMode`
# @return [String]
attr_accessor :auto_update_mode
# Controls whether the app can communicate with itself across a device’s work
# and personal profiles, subject to user consent.
# Corresponds to the JSON property `connectedWorkAndPersonalApp`
# @return [String]
attr_accessor :connected_work_and_personal_app
# The default policy for all permissions requested by the app. If specified,
# this overrides the policy-level default_permission_policy which applies to all
# apps. It does not override the permission_grants which applies to all apps.
# Corresponds to the JSON property `defaultPermissionPolicy`
# @return [String]
attr_accessor :default_permission_policy
# The scopes delegated to the app from Android Device Policy.
# Corresponds to the JSON property `delegatedScopes`
# @return [Array<String>]
attr_accessor :delegated_scopes
# Whether the app is disabled. When disabled, the app data is still preserved.
# Corresponds to the JSON property `disabled`
# @return [Boolean]
attr_accessor :disabled
alias_method :disabled?, :disabled
# The type of installation to perform.
# Corresponds to the JSON property `installType`
# @return [String]
attr_accessor :install_type
# Whether the app is allowed to lock itself in full-screen mode. DEPRECATED. Use
# InstallType KIOSK or kioskCustomLauncherEnabled to to configure a dedicated
# device.
# Corresponds to the JSON property `lockTaskAllowed`
# @return [Boolean]
attr_accessor :lock_task_allowed
alias_method :lock_task_allowed?, :lock_task_allowed
# Managed configuration applied to the app. The format for the configuration is
# dictated by the ManagedProperty values supported by the app. Each field name
# in the managed configuration must match the key field of the ManagedProperty.
# The field value must be compatible with the type of the ManagedProperty: *type*
# *JSON value* BOOL true or false STRING string INTEGER number CHOICE string
# MULTISELECT array of strings HIDDEN string BUNDLE_ARRAY array of objects
# Corresponds to the JSON property `managedConfiguration`
# @return [Hash<String,Object>]
attr_accessor :managed_configuration
# The managed configurations template for the app, saved from the managed
# configurations iframe.
# Corresponds to the JSON property `managedConfigurationTemplate`
# @return [Google::Apis::AndroidmanagementV1::ManagedConfigurationTemplate]
attr_accessor :managed_configuration_template
# The minimum version of the app that runs on the device. If set, the device
# attempts to update the app to at least this version code. If the app is not up-
# to-date, the device will contain a NonComplianceDetail with
# non_compliance_reason set to APP_NOT_UPDATED. The app must already be
# published to Google Play with a version code greater than or equal to this
# value. At most 20 apps may specify a minimum version code per policy.
# Corresponds to the JSON property `minimumVersionCode`
# @return [Fixnum]
attr_accessor :minimum_version_code
# The package name of the app. For example, com.google.android.youtube for the
# YouTube app.
# Corresponds to the JSON property `packageName`
# @return [String]
attr_accessor :package_name
# Explicit permission grants or denials for the app. These values override the
# default_permission_policy and permission_grants which apply to all apps.
# Corresponds to the JSON property `permissionGrants`
# @return [Array<Google::Apis::AndroidmanagementV1::PermissionGrant>]
attr_accessor :permission_grants
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@accessible_track_ids = args[:accessible_track_ids] if args.key?(:accessible_track_ids)
@auto_update_mode = args[:auto_update_mode] if args.key?(:auto_update_mode)
@connected_work_and_personal_app = args[:connected_work_and_personal_app] if args.key?(:connected_work_and_personal_app)
@default_permission_policy = args[:default_permission_policy] if args.key?(:default_permission_policy)
@delegated_scopes = args[:delegated_scopes] if args.key?(:delegated_scopes)
@disabled = args[:disabled] if args.key?(:disabled)
@install_type = args[:install_type] if args.key?(:install_type)
@lock_task_allowed = args[:lock_task_allowed] if args.key?(:lock_task_allowed)
@managed_configuration = args[:managed_configuration] if args.key?(:managed_configuration)
@managed_configuration_template = args[:managed_configuration_template] if args.key?(:managed_configuration_template)
@minimum_version_code = args[:minimum_version_code] if args.key?(:minimum_version_code)
@package_name = args[:package_name] if args.key?(:package_name)
@permission_grants = args[:permission_grants] if args.key?(:permission_grants)
end
end
# Information reported about an installed app.
class ApplicationReport
include Google::Apis::Core::Hashable
# The source of the package.
# Corresponds to the JSON property `applicationSource`
# @return [String]
attr_accessor :application_source
# The display name of the app.
# Corresponds to the JSON property `displayName`
# @return [String]
attr_accessor :display_name
# List of app events. The most recent 20 events are stored in the list.
# Corresponds to the JSON property `events`
# @return [Array<Google::Apis::AndroidmanagementV1::ApplicationEvent>]
attr_accessor :events
# The package name of the app that installed this app.
# Corresponds to the JSON property `installerPackageName`
# @return [String]
attr_accessor :installer_package_name
# List of keyed app states reported by the app.
# Corresponds to the JSON property `keyedAppStates`
# @return [Array<Google::Apis::AndroidmanagementV1::KeyedAppState>]
attr_accessor :keyed_app_states
# Package name of the app.
# Corresponds to the JSON property `packageName`
# @return [String]
attr_accessor :package_name
# The SHA-256 hash of the app's APK file, which can be used to verify the app
# hasn't been modified. Each byte of the hash value is represented as a two-
# digit hexadecimal number.
# Corresponds to the JSON property `packageSha256Hash`
# @return [String]
attr_accessor :package_sha256_hash
# The SHA-1 hash of each android.content.pm.Signature (https://developer.android.
# com/reference/android/content/pm/Signature.html) associated with the app
# package. Each byte of each hash value is represented as a two-digit
# hexadecimal number.
# Corresponds to the JSON property `signingKeyCertFingerprints`
# @return [Array<String>]
attr_accessor :signing_key_cert_fingerprints
# Application state.
# Corresponds to the JSON property `state`
# @return [String]
attr_accessor :state
# The app version code, which can be used to determine whether one version is
# more recent than another.
# Corresponds to the JSON property `versionCode`
# @return [Fixnum]
attr_accessor :version_code
# The app version as displayed to the user.
# Corresponds to the JSON property `versionName`
# @return [String]
attr_accessor :version_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@application_source = args[:application_source] if args.key?(:application_source)
@display_name = args[:display_name] if args.key?(:display_name)
@events = args[:events] if args.key?(:events)
@installer_package_name = args[:installer_package_name] if args.key?(:installer_package_name)
@keyed_app_states = args[:keyed_app_states] if args.key?(:keyed_app_states)
@package_name = args[:package_name] if args.key?(:package_name)
@package_sha256_hash = args[:package_sha256_hash] if args.key?(:package_sha256_hash)
@signing_key_cert_fingerprints = args[:signing_key_cert_fingerprints] if args.key?(:signing_key_cert_fingerprints)
@state = args[:state] if args.key?(:state)
@version_code = args[:version_code] if args.key?(:version_code)
@version_name = args[:version_name] if args.key?(:version_name)
end
end
# Settings controlling the behavior of application reports.
class ApplicationReportingSettings
include Google::Apis::Core::Hashable
# Whether removed apps are included in application reports.
# Corresponds to the JSON property `includeRemovedApps`
# @return [Boolean]
attr_accessor :include_removed_apps
alias_method :include_removed_apps?, :include_removed_apps
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@include_removed_apps = args[:include_removed_apps] if args.key?(:include_removed_apps)
end
end
# An action to block access to apps and data on a fully managed device or in a
# work profile. This action also triggers a device or work profile to displays a
# user-facing notification with information (where possible) on how to correct
# the compliance issue. Note: wipeAction must also be specified.
class BlockAction
include Google::Apis::Core::Hashable
# Number of days the policy is non-compliant before the device or work profile
# is blocked. To block access immediately, set to 0. blockAfterDays must be less
# than wipeAfterDays.
# Corresponds to the JSON property `blockAfterDays`
# @return [Fixnum]
attr_accessor :block_after_days
# Specifies the scope of this BlockAction. Only applicable to devices that are
# company-owned.
# Corresponds to the JSON property `blockScope`
# @return [String]
attr_accessor :block_scope
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@block_after_days = args[:block_after_days] if args.key?(:block_after_days)
@block_scope = args[:block_scope] if args.key?(:block_scope)
end
end
# A rule for automatically choosing a private key and certificate to
# authenticate the device to a server.
class ChoosePrivateKeyRule
include Google::Apis::Core::Hashable
# The package names for which outgoing requests are subject to this rule. If no
# package names are specified, then the rule applies to all packages. For each
# package name listed, the rule applies to that package and all other packages
# that shared the same Android UID. The SHA256 hash of the signing key
# signatures of each package_name will be verified against those provided by
# Play
# Corresponds to the JSON property `packageNames`
# @return [Array<String>]
attr_accessor :package_names
# The alias of the private key to be used.
# Corresponds to the JSON property `privateKeyAlias`
# @return [String]
attr_accessor :private_key_alias
# The URL pattern to match against the URL of the outgoing request. The pattern
# may contain asterisk (*) wildcards. Any URL is matched if unspecified.
# Corresponds to the JSON property `urlPattern`
# @return [String]
attr_accessor :url_pattern
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@package_names = args[:package_names] if args.key?(:package_names)
@private_key_alias = args[:private_key_alias] if args.key?(:private_key_alias)
@url_pattern = args[:url_pattern] if args.key?(:url_pattern)
end
end
# A command.
class Command
include Google::Apis::Core::Hashable
# The timestamp at which the command was created. The timestamp is automatically
# generated by the server.
# Corresponds to the JSON property `createTime`
# @return [String]
attr_accessor :create_time
# The duration for which the command is valid. The command will expire if not
# executed by the device during this time. The default duration if unspecified
# is ten minutes. There is no maximum duration.
# Corresponds to the JSON property `duration`
# @return [String]
attr_accessor :duration
# If the command failed, an error code explaining the failure. This is not set
# when the command is cancelled by the caller.
# Corresponds to the JSON property `errorCode`
# @return [String]
attr_accessor :error_code
# For commands of type RESET_PASSWORD, optionally specifies the new password.
# Corresponds to the JSON property `newPassword`
# @return [String]
attr_accessor :new_password
# For commands of type RESET_PASSWORD, optionally specifies flags.
# Corresponds to the JSON property `resetPasswordFlags`
# @return [Array<String>]
attr_accessor :reset_password_flags
# The type of the command.
# Corresponds to the JSON property `type`
# @return [String]
attr_accessor :type
# The resource name of the user that owns the device in the form enterprises/`
# enterpriseId`/users/`userId`. This is automatically generated by the server
# based on the device the command is sent to.
# Corresponds to the JSON property `userName`
# @return [String]
attr_accessor :user_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@create_time = args[:create_time] if args.key?(:create_time)
@duration = args[:duration] if args.key?(:duration)
@error_code = args[:error_code] if args.key?(:error_code)
@new_password = args[:new_password] if args.key?(:new_password)
@reset_password_flags = args[:reset_password_flags] if args.key?(:reset_password_flags)
@type = args[:type] if args.key?(:type)
@user_name = args[:user_name] if args.key?(:user_name)
end
end
# Information about Common Criteria Mode—security standards defined in the
# Common Criteria for Information Technology Security Evaluation (https://www.
# commoncriteriaportal.org/) (CC).This information is only available if
# statusReportingSettings.commonCriteriaModeEnabled is true in the device's
# policy.
class CommonCriteriaModeInfo
include Google::Apis::Core::Hashable
# Whether Common Criteria Mode is enabled.
# Corresponds to the JSON property `commonCriteriaModeStatus`
# @return [String]
attr_accessor :common_criteria_mode_status
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@common_criteria_mode_status = args[:common_criteria_mode_status] if args.key?(:common_criteria_mode_status)
end
end
# A rule declaring which mitigating actions to take when a device is not
# compliant with its policy. For every rule, there is always an implicit
# mitigating action to set policy_compliant to false for the Device resource,
# and display a message on the device indicating that the device is not
# compliant with its policy. Other mitigating actions may optionally be taken as
# well, depending on the field values in the rule.
class ComplianceRule
include Google::Apis::Core::Hashable
# A compliance rule condition which is satisfied if the Android Framework API
# level on the device doesn't meet a minimum requirement. There can only be one
# rule with this type of condition per policy.
# Corresponds to the JSON property `apiLevelCondition`
# @return [Google::Apis::AndroidmanagementV1::ApiLevelCondition]
attr_accessor :api_level_condition
# If set to true, the rule includes a mitigating action to disable apps so that
# the device is effectively disabled, but app data is preserved. If the device
# is running an app in locked task mode, the app will be closed and a UI showing
# the reason for non-compliance will be displayed.
# Corresponds to the JSON property `disableApps`
# @return [Boolean]
attr_accessor :disable_apps
alias_method :disable_apps?, :disable_apps
# A compliance rule condition which is satisfied if there exists any matching
# NonComplianceDetail for the device. A NonComplianceDetail matches a
# NonComplianceDetailCondition if all the fields which are set within the
# NonComplianceDetailCondition match the corresponding NonComplianceDetail
# fields.
# Corresponds to the JSON property `nonComplianceDetailCondition`
# @return [Google::Apis::AndroidmanagementV1::NonComplianceDetailCondition]
attr_accessor :non_compliance_detail_condition
# If set, the rule includes a mitigating action to disable apps specified in the
# list, but app data is preserved.
# Corresponds to the JSON property `packageNamesToDisable`
# @return [Array<String>]
attr_accessor :package_names_to_disable
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@api_level_condition = args[:api_level_condition] if args.key?(:api_level_condition)
@disable_apps = args[:disable_apps] if args.key?(:disable_apps)
@non_compliance_detail_condition = args[:non_compliance_detail_condition] if args.key?(:non_compliance_detail_condition)
@package_names_to_disable = args[:package_names_to_disable] if args.key?(:package_names_to_disable)
end
end
# Represents a whole or partial calendar date, such as a birthday. The time of
# day and time zone are either specified elsewhere or are insignificant. The
# date is relative to the Gregorian Calendar. This can represent one of the
# following: A full date, with non-zero year, month, and day values A month and
# day value, with a zero year, such as an anniversary A year on its own, with
# zero month and day values A year and month value, with a zero day, such as a
# credit card expiration dateRelated types are google.type.TimeOfDay and google.
# protobuf.Timestamp.
class Date
include Google::Apis::Core::Hashable
# Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to
# specify a year by itself or a year and month where the day isn't significant.
# Corresponds to the JSON property `day`
# @return [Fixnum]
attr_accessor :day
# Month of a year. Must be from 1 to 12, or 0 to specify a year without a month
# and day.
# Corresponds to the JSON property `month`
# @return [Fixnum]
attr_accessor :month
# Year of the date. Must be from 1 to 9999, or 0 to specify a date without a
# year.
# Corresponds to the JSON property `year`
# @return [Fixnum]
attr_accessor :year
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@day = args[:day] if args.key?(:day)
@month = args[:month] if args.key?(:month)
@year = args[:year] if args.key?(:year)
end
end
# A device owned by an enterprise. Unless otherwise noted, all fields are read-
# only and can't be modified by enterprises.devices.patch.
class Device
include Google::Apis::Core::Hashable
# The API level of the Android platform version running on the device.
# Corresponds to the JSON property `apiLevel`
# @return [Fixnum]
attr_accessor :api_level
# Reports for apps installed on the device. This information is only available
# when application_reports_enabled is true in the device's policy.
# Corresponds to the JSON property `applicationReports`
# @return [Array<Google::Apis::AndroidmanagementV1::ApplicationReport>]
attr_accessor :application_reports
# The name of the policy currently applied to the device.
# Corresponds to the JSON property `appliedPolicyName`
# @return [String]
attr_accessor :applied_policy_name
# The version of the policy currently applied to the device.
# Corresponds to the JSON property `appliedPolicyVersion`
# @return [Fixnum]
attr_accessor :applied_policy_version
# The state currently applied to the device.
# Corresponds to the JSON property `appliedState`
# @return [String]
attr_accessor :applied_state
# Information about Common Criteria Mode—security standards defined in the
# Common Criteria for Information Technology Security Evaluation (https://www.
# commoncriteriaportal.org/) (CC).This information is only available if
# statusReportingSettings.commonCriteriaModeEnabled is true in the device's
# policy.
# Corresponds to the JSON property `commonCriteriaModeInfo`
# @return [Google::Apis::AndroidmanagementV1::CommonCriteriaModeInfo]
attr_accessor :common_criteria_mode_info
# Information about security related device settings on device.
# Corresponds to the JSON property `deviceSettings`
# @return [Google::Apis::AndroidmanagementV1::DeviceSettings]
attr_accessor :device_settings
# Provides a user-facing message with locale info. The maximum message length is
# 4096 characters.
# Corresponds to the JSON property `disabledReason`
# @return [Google::Apis::AndroidmanagementV1::UserFacingMessage]
attr_accessor :disabled_reason
# Detailed information about displays on the device. This information is only
# available if displayInfoEnabled is true in the device's policy.
# Corresponds to the JSON property `displays`
# @return [Array<Google::Apis::AndroidmanagementV1::DisplayProp>]
attr_accessor :displays
# The time of device enrollment.
# Corresponds to the JSON property `enrollmentTime`
# @return [String]
attr_accessor :enrollment_time
# If the device was enrolled with an enrollment token with additional data
# provided, this field contains that data.
# Corresponds to the JSON property `enrollmentTokenData`
# @return [String]
attr_accessor :enrollment_token_data
# If the device was enrolled with an enrollment token, this field contains the
# name of the token.
# Corresponds to the JSON property `enrollmentTokenName`
# @return [String]
attr_accessor :enrollment_token_name
# Information about device hardware. The fields related to temperature
# thresholds are only available if hardwareStatusEnabled is true in the device's
# policy.
# Corresponds to the JSON property `hardwareInfo`
# @return [Google::Apis::AndroidmanagementV1::HardwareInfo]
attr_accessor :hardware_info
# Hardware status samples in chronological order. This information is only
# available if hardwareStatusEnabled is true in the device's policy.
# Corresponds to the JSON property `hardwareStatusSamples`
# @return [Array<Google::Apis::AndroidmanagementV1::HardwareStatus>]
attr_accessor :hardware_status_samples
# Deprecated.
# Corresponds to the JSON property `lastPolicyComplianceReportTime`
# @return [String]
attr_accessor :last_policy_compliance_report_time
# The last time the device fetched its policy.
# Corresponds to the JSON property `lastPolicySyncTime`
# @return [String]
attr_accessor :last_policy_sync_time
# The last time the device sent a status report.
# Corresponds to the JSON property `lastStatusReportTime`
# @return [String]
attr_accessor :last_status_report_time
# The type of management mode Android Device Policy takes on the device. This
# influences which policy settings are supported.
# Corresponds to the JSON property `managementMode`
# @return [String]
attr_accessor :management_mode
# Events related to memory and storage measurements in chronological order. This
# information is only available if memoryInfoEnabled is true in the device's
# policy.
# Corresponds to the JSON property `memoryEvents`
# @return [Array<Google::Apis::AndroidmanagementV1::MemoryEvent>]
attr_accessor :memory_events
# Information about device memory and storage.
# Corresponds to the JSON property `memoryInfo`
# @return [Google::Apis::AndroidmanagementV1::MemoryInfo]
attr_accessor :memory_info
# The name of the device in the form enterprises/`enterpriseId`/devices/`
# deviceId`.
# Corresponds to the JSON property `name`
# @return [String]
attr_accessor :name
# Device network info.
# Corresponds to the JSON property `networkInfo`
# @return [Google::Apis::AndroidmanagementV1::NetworkInfo]
attr_accessor :network_info
# Details about policy settings that the device is not compliant with.
# Corresponds to the JSON property `nonComplianceDetails`
# @return [Array<Google::Apis::AndroidmanagementV1::NonComplianceDetail>]
attr_accessor :non_compliance_details
# Ownership of the managed device.
# Corresponds to the JSON property `ownership`
# @return [String]
attr_accessor :ownership
# Whether the device is compliant with its policy.
# Corresponds to the JSON property `policyCompliant`
# @return [Boolean]
attr_accessor :policy_compliant
alias_method :policy_compliant?, :policy_compliant
# The name of the policy applied to the device, in the form enterprises/`
# enterpriseId`/policies/`policyId`. If not specified, the policy_name for the
# device's user is applied. This field can be modified by a patch request. You
# can specify only the policyId when calling enterprises.devices.patch, as long
# as the policyId doesn’t contain any slashes. The rest of the policy name is
# inferred.
# Corresponds to the JSON property `policyName`
# @return [String]
attr_accessor :policy_name
# Power management events on the device in chronological order. This information
# is only available if powerManagementEventsEnabled is true in the device's
# policy.
# Corresponds to the JSON property `powerManagementEvents`
# @return [Array<Google::Apis::AndroidmanagementV1::PowerManagementEvent>]
attr_accessor :power_management_events
# If the same physical device has been enrolled multiple times, this field
# contains its previous device names. The serial number is used as the unique
# identifier to determine if the same physical device has enrolled previously.
# The names are in chronological order.
# Corresponds to the JSON property `previousDeviceNames`
# @return [Array<String>]
attr_accessor :previous_device_names
# The security posture of the device, as determined by the current device state
# and the policies applied.
# Corresponds to the JSON property `securityPosture`
# @return [Google::Apis::AndroidmanagementV1::SecurityPosture]
attr_accessor :security_posture
# Information about device software.
# Corresponds to the JSON property `softwareInfo`
# @return [Google::Apis::AndroidmanagementV1::SoftwareInfo]
attr_accessor :software_info
# The state to be applied to the device. This field can be modified by a patch
# request. Note that when calling enterprises.devices.patch, ACTIVE and DISABLED
# are the only allowable values. To enter the device into a DELETED state, call
# enterprises.devices.delete.
# Corresponds to the JSON property `state`
# @return [String]
attr_accessor :state
# Map of selected system properties name and value related to the device. This
# information is only available if systemPropertiesEnabled is true in the device'
# s policy.
# Corresponds to the JSON property `systemProperties`
# @return [Hash<String,String>]
attr_accessor :system_properties
# A user belonging to an enterprise.
# Corresponds to the JSON property `user`
# @return [Google::Apis::AndroidmanagementV1::User]
attr_accessor :user
# The resource name of the user that owns this device in the form enterprises/`
# enterpriseId`/users/`userId`.
# Corresponds to the JSON property `userName`
# @return [String]
attr_accessor :user_name
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@api_level = args[:api_level] if args.key?(:api_level)
@application_reports = args[:application_reports] if args.key?(:application_reports)
@applied_policy_name = args[:applied_policy_name] if args.key?(:applied_policy_name)
@applied_policy_version = args[:applied_policy_version] if args.key?(:applied_policy_version)
@applied_state = args[:applied_state] if args.key?(:applied_state)
@common_criteria_mode_info = args[:common_criteria_mode_info] if args.key?(:common_criteria_mode_info)
@device_settings = args[:device_settings] if args.key?(:device_settings)
@disabled_reason = args[:disabled_reason] if args.key?(:disabled_reason)
@displays = args[:displays] if args.key?(:displays)
@enrollment_time = args[:enrollment_time] if args.key?(:enrollment_time)
@enrollment_token_data = args[:enrollment_token_data] if args.key?(:enrollment_token_data)
@enrollment_token_name = args[:enrollment_token_name] if args.key?(:enrollment_token_name)
@hardware_info = args[:hardware_info] if args.key?(:hardware_info)
@hardware_status_samples = args[:hardware_status_samples] if args.key?(:hardware_status_samples)
@last_policy_compliance_report_time = args[:last_policy_compliance_report_time] if args.key?(:last_policy_compliance_report_time)
@last_policy_sync_time = args[:last_policy_sync_time] if args.key?(:last_policy_sync_time)
@last_status_report_time = args[:last_status_report_time] if args.key?(:last_status_report_time)
@management_mode = args[:management_mode] if args.key?(:management_mode)
@memory_events = args[:memory_events] if args.key?(:memory_events)
@memory_info = args[:memory_info] if args.key?(:memory_info)
@name = args[:name] if args.key?(:name)
@network_info = args[:network_info] if args.key?(:network_info)
@non_compliance_details = args[:non_compliance_details] if args.key?(:non_compliance_details)
@ownership = args[:ownership] if args.key?(:ownership)
@policy_compliant = args[:policy_compliant] if args.key?(:policy_compliant)
@policy_name = args[:policy_name] if args.key?(:policy_name)
@power_management_events = args[:power_management_events] if args.key?(:power_management_events)
@previous_device_names = args[:previous_device_names] if args.key?(:previous_device_names)
@security_posture = args[:security_posture] if args.key?(:security_posture)
@software_info = args[:software_info] if args.key?(:software_info)
@state = args[:state] if args.key?(:state)
@system_properties = args[:system_properties] if args.key?(:system_properties)
@user = args[:user] if args.key?(:user)
@user_name = args[:user_name] if args.key?(:user_name)
end
end
# Information about security related device settings on device.
class DeviceSettings
include Google::Apis::Core::Hashable
# Whether ADB (https://developer.android.com/studio/command-line/adb.html) is
# enabled on the device.
# Corresponds to the JSON property `adbEnabled`
# @return [Boolean]
attr_accessor :adb_enabled
alias_method :adb_enabled?, :adb_enabled
# Whether developer mode is enabled on the device.
# Corresponds to the JSON property `developmentSettingsEnabled`
# @return [Boolean]
attr_accessor :development_settings_enabled
alias_method :development_settings_enabled?, :development_settings_enabled
# Encryption status from DevicePolicyManager.
# Corresponds to the JSON property `encryptionStatus`
# @return [String]
attr_accessor :encryption_status
# Whether the device is secured with PIN/password.
# Corresponds to the JSON property `isDeviceSecure`
# @return [Boolean]
attr_accessor :is_device_secure
alias_method :is_device_secure?, :is_device_secure
# Whether the storage encryption is enabled.
# Corresponds to the JSON property `isEncrypted`
# @return [Boolean]
attr_accessor :is_encrypted
alias_method :is_encrypted?, :is_encrypted
# Whether installing apps from unknown sources is enabled.
# Corresponds to the JSON property `unknownSourcesEnabled`
# @return [Boolean]
attr_accessor :unknown_sources_enabled
alias_method :unknown_sources_enabled?, :unknown_sources_enabled
# Whether Verify Apps (Google Play Protect (https://support.google.com/
# googleplay/answer/2812853)) is enabled on the device.
# Corresponds to the JSON property `verifyAppsEnabled`
# @return [Boolean]
attr_accessor :verify_apps_enabled