-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathandroidmanagement-gen.go
7824 lines (6971 loc) · 294 KB
/
androidmanagement-gen.go
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 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package androidmanagement provides access to the Android Management API.
//
// For product documentation, see: https://developers.google.com/android/management
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/androidmanagement/v1"
// ...
// ctx := context.Background()
// androidmanagementService, err := androidmanagement.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// androidmanagementService, err := androidmanagement.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// androidmanagementService, err := androidmanagement.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package androidmanagement // import "google.golang.org/api/androidmanagement/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
const apiId = "androidmanagement:v1"
const apiName = "androidmanagement"
const apiVersion = "v1"
const basePath = "https://androidmanagement.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// Manage Android devices and apps for your customers
AndroidmanagementScope = "https://www.googleapis.com/auth/androidmanagement"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/androidmanagement",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Enterprises = NewEnterprisesService(s)
s.SignupUrls = NewSignupUrlsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Enterprises *EnterprisesService
SignupUrls *SignupUrlsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewEnterprisesService(s *Service) *EnterprisesService {
rs := &EnterprisesService{s: s}
rs.Applications = NewEnterprisesApplicationsService(s)
rs.Devices = NewEnterprisesDevicesService(s)
rs.EnrollmentTokens = NewEnterprisesEnrollmentTokensService(s)
rs.Policies = NewEnterprisesPoliciesService(s)
rs.WebApps = NewEnterprisesWebAppsService(s)
rs.WebTokens = NewEnterprisesWebTokensService(s)
return rs
}
type EnterprisesService struct {
s *Service
Applications *EnterprisesApplicationsService
Devices *EnterprisesDevicesService
EnrollmentTokens *EnterprisesEnrollmentTokensService
Policies *EnterprisesPoliciesService
WebApps *EnterprisesWebAppsService
WebTokens *EnterprisesWebTokensService
}
func NewEnterprisesApplicationsService(s *Service) *EnterprisesApplicationsService {
rs := &EnterprisesApplicationsService{s: s}
return rs
}
type EnterprisesApplicationsService struct {
s *Service
}
func NewEnterprisesDevicesService(s *Service) *EnterprisesDevicesService {
rs := &EnterprisesDevicesService{s: s}
rs.Operations = NewEnterprisesDevicesOperationsService(s)
return rs
}
type EnterprisesDevicesService struct {
s *Service
Operations *EnterprisesDevicesOperationsService
}
func NewEnterprisesDevicesOperationsService(s *Service) *EnterprisesDevicesOperationsService {
rs := &EnterprisesDevicesOperationsService{s: s}
return rs
}
type EnterprisesDevicesOperationsService struct {
s *Service
}
func NewEnterprisesEnrollmentTokensService(s *Service) *EnterprisesEnrollmentTokensService {
rs := &EnterprisesEnrollmentTokensService{s: s}
return rs
}
type EnterprisesEnrollmentTokensService struct {
s *Service
}
func NewEnterprisesPoliciesService(s *Service) *EnterprisesPoliciesService {
rs := &EnterprisesPoliciesService{s: s}
return rs
}
type EnterprisesPoliciesService struct {
s *Service
}
func NewEnterprisesWebAppsService(s *Service) *EnterprisesWebAppsService {
rs := &EnterprisesWebAppsService{s: s}
return rs
}
type EnterprisesWebAppsService struct {
s *Service
}
func NewEnterprisesWebTokensService(s *Service) *EnterprisesWebTokensService {
rs := &EnterprisesWebTokensService{s: s}
return rs
}
type EnterprisesWebTokensService struct {
s *Service
}
func NewSignupUrlsService(s *Service) *SignupUrlsService {
rs := &SignupUrlsService{s: s}
return rs
}
type SignupUrlsService struct {
s *Service
}
// AlwaysOnVpnPackage: Configuration for an always-on VPN connection.
type AlwaysOnVpnPackage struct {
// LockdownEnabled: Disallows networking when the VPN is not connected.
LockdownEnabled bool `json:"lockdownEnabled,omitempty"`
// PackageName: The package name of the VPN app.
PackageName string `json:"packageName,omitempty"`
// ForceSendFields is a list of field names (e.g. "LockdownEnabled") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "LockdownEnabled") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *AlwaysOnVpnPackage) MarshalJSON() ([]byte, error) {
type NoMethod AlwaysOnVpnPackage
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApiLevelCondition: 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.
type ApiLevelCondition struct {
// MinApiLevel: 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.
MinApiLevel int64 `json:"minApiLevel,omitempty"`
// ForceSendFields is a list of field names (e.g. "MinApiLevel") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "MinApiLevel") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ApiLevelCondition) MarshalJSON() ([]byte, error) {
type NoMethod ApiLevelCondition
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// AppTrackInfo: Id to name association of a app track.
type AppTrackInfo struct {
// TrackAlias: The track name associated with the trackId, set in the
// Play Console. The name is modifiable from Play Console.
TrackAlias string `json:"trackAlias,omitempty"`
// TrackId: The unmodifiable unique track identifier, taken from the
// releaseTrackId in the URL of the Play Console page that displays the
// app’s track information.
TrackId string `json:"trackId,omitempty"`
// ForceSendFields is a list of field names (e.g. "TrackAlias") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "TrackAlias") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *AppTrackInfo) MarshalJSON() ([]byte, error) {
type NoMethod AppTrackInfo
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Application: Information about an app.
type Application struct {
// AppTracks: Application tracks visible to the enterprise.
AppTracks []*AppTrackInfo `json:"appTracks,omitempty"`
// ManagedProperties: The set of managed properties available to be
// pre-configured for the app.
ManagedProperties []*ManagedProperty `json:"managedProperties,omitempty"`
// Name: The name of the app in the form
// enterprises/{enterpriseId}/applications/{package_name}.
Name string `json:"name,omitempty"`
// Permissions: The permissions required by the app.
Permissions []*ApplicationPermission `json:"permissions,omitempty"`
// Title: The title of the app. Localized.
Title string `json:"title,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AppTracks") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AppTracks") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Application) MarshalJSON() ([]byte, error) {
type NoMethod Application
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApplicationEvent: An app-related event.
type ApplicationEvent struct {
// CreateTime: The creation time of the event.
CreateTime string `json:"createTime,omitempty"`
// EventType: App event type.
//
// Possible values:
// "APPLICATION_EVENT_TYPE_UNSPECIFIED" - This value is disallowed.
// "INSTALLED" - The app was installed.
// "CHANGED" - The app was changed, for example, a component was
// enabled or disabled.
// "DATA_CLEARED" - The app data was cleared.
// "REMOVED" - The app was removed.
// "REPLACED" - A new version of the app has been installed, replacing
// the old version.
// "RESTARTED" - The app was restarted.
// "PINNED" - The app was pinned to the foreground.
// "UNPINNED" - The app was unpinned.
EventType string `json:"eventType,omitempty"`
// ForceSendFields is a list of field names (e.g. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ApplicationEvent) MarshalJSON() ([]byte, error) {
type NoMethod ApplicationEvent
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApplicationPermission: A permission required by the app.
type ApplicationPermission struct {
// Description: A longer description of the permission, providing more
// detail on what it affects. Localized.
Description string `json:"description,omitempty"`
// Name: The name of the permission. Localized.
Name string `json:"name,omitempty"`
// PermissionId: An opaque string uniquely identifying the permission.
// Not localized.
PermissionId string `json:"permissionId,omitempty"`
// ForceSendFields is a list of field names (e.g. "Description") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Description") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ApplicationPermission) MarshalJSON() ([]byte, error) {
type NoMethod ApplicationPermission
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApplicationPolicy: Policy for an individual app.
type ApplicationPolicy struct {
// AccessibleTrackIds: 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.
AccessibleTrackIds []string `json:"accessibleTrackIds,omitempty"`
// DefaultPermissionPolicy: 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.
//
// Possible values:
// "PERMISSION_POLICY_UNSPECIFIED" - Policy not specified. If no
// policy is specified for a permission at any level, then the PROMPT
// behavior is used by default.
// "PROMPT" - Prompt the user to grant a permission.
// "GRANT" - Automatically grant a permission.
// "DENY" - Automatically deny a permission.
DefaultPermissionPolicy string `json:"defaultPermissionPolicy,omitempty"`
// DelegatedScopes: The scopes delegated to the app from Android Device
// Policy.
//
// Possible values:
// "DELEGATED_SCOPE_UNSPECIFIED" - No delegation scope specified.
// "CERT_INSTALL" - Grants access to certificate installation and
// management.
// "MANAGED_CONFIGURATIONS" - Grants access to managed configurations
// management.
// "BLOCK_UNINSTALL" - Grants access to blocking uninstallation.
// "PERMISSION_GRANT" - Grants access to permission policy and
// permission grant state.
// "PACKAGE_ACCESS" - Grants access to package access state.
// "ENABLE_SYSTEM_APP" - Grants access for enabling system apps.
DelegatedScopes []string `json:"delegatedScopes,omitempty"`
// Disabled: Whether the app is disabled. When disabled, the app data is
// still preserved.
Disabled bool `json:"disabled,omitempty"`
// InstallType: The type of installation to perform.
//
// Possible values:
// "INSTALL_TYPE_UNSPECIFIED" - Unspecified. Defaults to AVAILABLE.
// "PREINSTALLED" - The app is automatically installed and can be
// removed by the user.
// "FORCE_INSTALLED" - The app is automatically installed and can't be
// removed by the user.
// "BLOCKED" - The app is blocked and can't be installed. If the app
// was installed under a previous policy, it will be uninstalled.
// "AVAILABLE" - The app is available to install.
// "REQUIRED_FOR_SETUP" - The app is automatically installed and can't
// be removed by the user and will prevent setup from completion until
// installation is complete.
// "KIOSK" - The app is automatically installed in kiosk mode: it's
// set as the preferred home intent and whitelisted for lock task mode.
// Device setup won't complete until the app is installed. After
// installation, users won't be able to remove the app. You can only set
// this installType for one app per policy. When this is present in the
// policy, status bar will be automatically disabled.
InstallType string `json:"installType,omitempty"`
// LockTaskAllowed: Whether the app is allowed to lock itself in
// full-screen mode. DEPRECATED. Use InstallType KIOSK or
// kioskCustomLauncherEnabled to to configure a dedicated device.
LockTaskAllowed bool `json:"lockTaskAllowed,omitempty"`
// ManagedConfiguration: 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:
// <table> <tr><td><i>type</i></td><td><i>JSON value</i></td></tr>
// <tr><td>BOOL</td><td>true or false</td></tr>
// <tr><td>STRING</td><td>string</td></tr>
// <tr><td>INTEGER</td><td>number</td></tr>
// <tr><td>CHOICE</td><td>string</td></tr>
// <tr><td>MULTISELECT</td><td>array of strings</td></tr>
// <tr><td>HIDDEN</td><td>string</td></tr>
// <tr><td>BUNDLE_ARRAY</td><td>array of objects</td></tr> </table>
ManagedConfiguration googleapi.RawMessage `json:"managedConfiguration,omitempty"`
// ManagedConfigurationTemplate: The managed configurations template for
// the app, saved from the managed configurations iframe. This field is
// ignored if managed_configuration is set.
ManagedConfigurationTemplate *ManagedConfigurationTemplate `json:"managedConfigurationTemplate,omitempty"`
// MinimumVersionCode: 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.
MinimumVersionCode int64 `json:"minimumVersionCode,omitempty"`
// PackageName: The package name of the app. For example,
// com.google.android.youtube for the YouTube app.
PackageName string `json:"packageName,omitempty"`
// PermissionGrants: Explicit permission grants or denials for the app.
// These values override the default_permission_policy and
// permission_grants which apply to all apps.
PermissionGrants []*PermissionGrant `json:"permissionGrants,omitempty"`
// ForceSendFields is a list of field names (e.g. "AccessibleTrackIds")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AccessibleTrackIds") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ApplicationPolicy) MarshalJSON() ([]byte, error) {
type NoMethod ApplicationPolicy
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApplicationReport: Information reported about an installed app.
type ApplicationReport struct {
// ApplicationSource: The source of the package.
//
// Possible values:
// "APPLICATION_SOURCE_UNSPECIFIED" - The app was sideloaded from an
// unspecified source.
// "SYSTEM_APP_FACTORY_VERSION" - This is a system app from the
// device's factory image.
// "SYSTEM_APP_UPDATED_VERSION" - This is an updated system app.
// "INSTALLED_FROM_PLAY_STORE" - The app was installed from the Google
// Play Store.
ApplicationSource string `json:"applicationSource,omitempty"`
// DisplayName: The display name of the app.
DisplayName string `json:"displayName,omitempty"`
// Events: List of app events. The most recent 20 events are stored in
// the list.
Events []*ApplicationEvent `json:"events,omitempty"`
// InstallerPackageName: The package name of the app that installed this
// app.
InstallerPackageName string `json:"installerPackageName,omitempty"`
// KeyedAppStates: List of keyed app states reported by the app.
KeyedAppStates []*KeyedAppState `json:"keyedAppStates,omitempty"`
// PackageName: Package name of the app.
PackageName string `json:"packageName,omitempty"`
// PackageSha256Hash: 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.
PackageSha256Hash string `json:"packageSha256Hash,omitempty"`
// SigningKeyCertFingerprints: 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.
SigningKeyCertFingerprints []string `json:"signingKeyCertFingerprints,omitempty"`
// State: Application state.
//
// Possible values:
// "INSTALLED" - App is installed on the device
// "REMOVED" - App was removed from the device
State string `json:"state,omitempty"`
// VersionCode: The app version code, which can be used to determine
// whether one version is more recent than another.
VersionCode int64 `json:"versionCode,omitempty"`
// VersionName: The app version as displayed to the user.
VersionName string `json:"versionName,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApplicationSource")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ApplicationSource") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ApplicationReport) MarshalJSON() ([]byte, error) {
type NoMethod ApplicationReport
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApplicationReportingSettings: Settings controlling the behavior of
// application reports.
type ApplicationReportingSettings struct {
// IncludeRemovedApps: Whether removed apps are included in application
// reports.
IncludeRemovedApps bool `json:"includeRemovedApps,omitempty"`
// ForceSendFields is a list of field names (e.g. "IncludeRemovedApps")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "IncludeRemovedApps") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ApplicationReportingSettings) MarshalJSON() ([]byte, error) {
type NoMethod ApplicationReportingSettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BlockAction: 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.
type BlockAction struct {
// BlockAfterDays: 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.
BlockAfterDays int64 `json:"blockAfterDays,omitempty"`
// ForceSendFields is a list of field names (e.g. "BlockAfterDays") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "BlockAfterDays") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *BlockAction) MarshalJSON() ([]byte, error) {
type NoMethod BlockAction
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ChoosePrivateKeyRule: A rule for automatically choosing a private key
// and certificate to authenticate the device to a server.
type ChoosePrivateKeyRule struct {
// PackageNames: 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
PackageNames []string `json:"packageNames,omitempty"`
// PrivateKeyAlias: The alias of the private key to be used.
PrivateKeyAlias string `json:"privateKeyAlias,omitempty"`
// UrlPattern: The URL pattern to match against the URL of the outgoing
// request. The pattern may contain asterisk (*) wildcards. Any URL is
// matched if unspecified.
UrlPattern string `json:"urlPattern,omitempty"`
// ForceSendFields is a list of field names (e.g. "PackageNames") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "PackageNames") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ChoosePrivateKeyRule) MarshalJSON() ([]byte, error) {
type NoMethod ChoosePrivateKeyRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Command: A command.
type Command struct {
// CreateTime: The timestamp at which the command was created. The
// timestamp is automatically generated by the server.
CreateTime string `json:"createTime,omitempty"`
// Duration: 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.
Duration string `json:"duration,omitempty"`
// ErrorCode: If the command failed, an error code explaining the
// failure. This is not set when the command is cancelled by the caller.
//
// Possible values:
// "COMMAND_ERROR_CODE_UNSPECIFIED" - There was no error.
// "UNKNOWN" - An unknown error occurred.
// "API_LEVEL" - The API level of the device does not support this
// command.
// "MANAGEMENT_MODE" - The management mode (profile owner, device
// owner, etc.) does not support the command.
// "INVALID_VALUE" - The command has an invalid parameter value.
// "UNSUPPORTED" - The device doesn't support the command. Updating
// Android Device Policy to the latest version may resolve the issue.
ErrorCode string `json:"errorCode,omitempty"`
// NewPassword: For commands of type RESET_PASSWORD, optionally
// specifies the new password.
NewPassword string `json:"newPassword,omitempty"`
// ResetPasswordFlags: For commands of type RESET_PASSWORD, optionally
// specifies flags.
//
// Possible values:
// "RESET_PASSWORD_FLAG_UNSPECIFIED" - This value is ignored.
// "REQUIRE_ENTRY" - Don't allow other admins to change the password
// again until the user has entered it.
// "DO_NOT_ASK_CREDENTIALS_ON_BOOT" - Don't ask for user credentials
// on device boot.
// "LOCK_NOW" - Lock the device after password reset.
ResetPasswordFlags []string `json:"resetPasswordFlags,omitempty"`
// Type: The type of the command.
//
// Possible values:
// "COMMAND_TYPE_UNSPECIFIED" - This value is disallowed.
// "LOCK" - Lock the device, as if the lock screen timeout had
// expired.
// "RESET_PASSWORD" - Reset the user's password.
// "REBOOT" - Reboot the device. Only supported on API level 24+.
Type string `json:"type,omitempty"`
// UserName: 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.
UserName string `json:"userName,omitempty"`
// ForceSendFields is a list of field names (e.g. "CreateTime") to
// unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CreateTime") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Command) MarshalJSON() ([]byte, error) {
type NoMethod Command
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ComplianceRule: 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.
type ComplianceRule struct {
// ApiLevelCondition: A condition which is satisfied if the Android
// Framework API level on the device doesn't meet a minimum requirement.
ApiLevelCondition *ApiLevelCondition `json:"apiLevelCondition,omitempty"`
// DisableApps: 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.
DisableApps bool `json:"disableApps,omitempty"`
// NonComplianceDetailCondition: A condition which is satisfied if there
// exists any matching NonComplianceDetail for the device.
NonComplianceDetailCondition *NonComplianceDetailCondition `json:"nonComplianceDetailCondition,omitempty"`
// PackageNamesToDisable: If set, the rule includes a mitigating action
// to disable apps specified in the list, but app data is preserved.
PackageNamesToDisable []string `json:"packageNamesToDisable,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApiLevelCondition")
// to unconditionally include in API requests. By default, fields with
// empty values are omitted from API requests. However, any non-pointer,
// non-interface field appearing in ForceSendFields will be sent to the
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ApiLevelCondition") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ComplianceRule) MarshalJSON() ([]byte, error) {
type NoMethod ComplianceRule
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Device: A device owned by an enterprise. Unless otherwise noted, all
// fields are read-only and can't be modified by
// enterprises.devices.patch.
type Device struct {
// ApiLevel: The API level of the Android platform version running on
// the device.
ApiLevel int64 `json:"apiLevel,omitempty"`
// ApplicationReports: Reports for apps installed on the device. This
// information is only available when application_reports_enabled is
// true in the device's policy.
ApplicationReports []*ApplicationReport `json:"applicationReports,omitempty"`
// AppliedPolicyName: The name of the policy currently applied to the
// device.
AppliedPolicyName string `json:"appliedPolicyName,omitempty"`
// AppliedPolicyVersion: The version of the policy currently applied to
// the device.
AppliedPolicyVersion int64 `json:"appliedPolicyVersion,omitempty,string"`
// AppliedState: The state currently applied to the device.
//
// Possible values:
// "DEVICE_STATE_UNSPECIFIED" - This value is disallowed.
// "ACTIVE" - The device is active.
// "DISABLED" - The device is disabled.
// "DELETED" - The device was deleted. This state will never be
// returned by an API call, but is used in the final status report
// published to Cloud Pub/Sub when the device acknowledges the deletion.
// "PROVISIONING" - The device is being provisioned. Newly enrolled
// devices are in this state until they have a policy applied.
AppliedState string `json:"appliedState,omitempty"`
// DeviceSettings: Device settings information. This information is only
// available if deviceSettingsEnabled is true in the device's policy.
DeviceSettings *DeviceSettings `json:"deviceSettings,omitempty"`
// DisabledReason: If the device state is DISABLED, an optional message
// that is displayed on the device indicating the reason the device is
// disabled. This field can be modified by a patch request.
DisabledReason *UserFacingMessage `json:"disabledReason,omitempty"`
// Displays: Detailed information about displays on the device. This
// information is only available if displayInfoEnabled is true in the
// device's policy.
Displays []*Display `json:"displays,omitempty"`
// EnrollmentTime: The time of device enrollment.
EnrollmentTime string `json:"enrollmentTime,omitempty"`
// EnrollmentTokenData: If the device was enrolled with an enrollment
// token with additional data provided, this field contains that data.
EnrollmentTokenData string `json:"enrollmentTokenData,omitempty"`
// EnrollmentTokenName: If the device was enrolled with an enrollment
// token, this field contains the name of the token.
EnrollmentTokenName string `json:"enrollmentTokenName,omitempty"`
// HardwareInfo: Detailed information about the device hardware.
HardwareInfo *HardwareInfo `json:"hardwareInfo,omitempty"`
// HardwareStatusSamples: Hardware status samples in chronological
// order. This information is only available if hardwareStatusEnabled is
// true in the device's policy.
HardwareStatusSamples []*HardwareStatus `json:"hardwareStatusSamples,omitempty"`
// LastPolicyComplianceReportTime: Deprecated.
LastPolicyComplianceReportTime string `json:"lastPolicyComplianceReportTime,omitempty"`
// LastPolicySyncTime: The last time the device fetched its policy.
LastPolicySyncTime string `json:"lastPolicySyncTime,omitempty"`
// LastStatusReportTime: The last time the device sent a status report.
LastStatusReportTime string `json:"lastStatusReportTime,omitempty"`
// ManagementMode: The type of management mode Android Device Policy
// takes on the device. This influences which policy settings are
// supported.
//
// Possible values:
// "MANAGEMENT_MODE_UNSPECIFIED" - This value is disallowed.
// "DEVICE_OWNER" - Device owner. Android Device Policy has full
// control over the device.