forked from distribution/distribution
-
Notifications
You must be signed in to change notification settings - Fork 0
/
androidenterprise-gen.go
7947 lines (7300 loc) · 257 KB
/
androidenterprise-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
// Package androidenterprise provides access to the Google Play EMM API.
//
// See https://developers.google.com/play/enterprise
//
// Usage example:
//
// import "google.golang.org/api/androidenterprise/v1"
// ...
// androidenterpriseService, err := androidenterprise.New(oauthHttpClient)
package androidenterprise // import "google.golang.org/api/androidenterprise/v1"
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"golang.org/x/net/context/ctxhttp"
"google.golang.org/api/googleapi"
"google.golang.org/api/internal"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// 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 _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = internal.MarshalJSON
var _ = context.Canceled
var _ = ctxhttp.Do
const apiId = "androidenterprise:v1"
const apiName = "androidenterprise"
const apiVersion = "v1"
const basePath = "https://www.googleapis.com/androidenterprise/v1/"
// OAuth2 scopes used by this API.
const (
// Manage corporate Android devices
AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Collections = NewCollectionsService(s)
s.Collectionviewers = NewCollectionviewersService(s)
s.Devices = NewDevicesService(s)
s.Enterprises = NewEnterprisesService(s)
s.Entitlements = NewEntitlementsService(s)
s.Grouplicenses = NewGrouplicensesService(s)
s.Grouplicenseusers = NewGrouplicenseusersService(s)
s.Installs = NewInstallsService(s)
s.Permissions = NewPermissionsService(s)
s.Products = NewProductsService(s)
s.Users = NewUsersService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Collections *CollectionsService
Collectionviewers *CollectionviewersService
Devices *DevicesService
Enterprises *EnterprisesService
Entitlements *EntitlementsService
Grouplicenses *GrouplicensesService
Grouplicenseusers *GrouplicenseusersService
Installs *InstallsService
Permissions *PermissionsService
Products *ProductsService
Users *UsersService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewCollectionsService(s *Service) *CollectionsService {
rs := &CollectionsService{s: s}
return rs
}
type CollectionsService struct {
s *Service
}
func NewCollectionviewersService(s *Service) *CollectionviewersService {
rs := &CollectionviewersService{s: s}
return rs
}
type CollectionviewersService struct {
s *Service
}
func NewDevicesService(s *Service) *DevicesService {
rs := &DevicesService{s: s}
return rs
}
type DevicesService struct {
s *Service
}
func NewEnterprisesService(s *Service) *EnterprisesService {
rs := &EnterprisesService{s: s}
return rs
}
type EnterprisesService struct {
s *Service
}
func NewEntitlementsService(s *Service) *EntitlementsService {
rs := &EntitlementsService{s: s}
return rs
}
type EntitlementsService struct {
s *Service
}
func NewGrouplicensesService(s *Service) *GrouplicensesService {
rs := &GrouplicensesService{s: s}
return rs
}
type GrouplicensesService struct {
s *Service
}
func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService {
rs := &GrouplicenseusersService{s: s}
return rs
}
type GrouplicenseusersService struct {
s *Service
}
func NewInstallsService(s *Service) *InstallsService {
rs := &InstallsService{s: s}
return rs
}
type InstallsService struct {
s *Service
}
func NewPermissionsService(s *Service) *PermissionsService {
rs := &PermissionsService{s: s}
return rs
}
type PermissionsService struct {
s *Service
}
func NewProductsService(s *Service) *ProductsService {
rs := &ProductsService{s: s}
return rs
}
type ProductsService struct {
s *Service
}
func NewUsersService(s *Service) *UsersService {
rs := &UsersService{s: s}
return rs
}
type UsersService struct {
s *Service
}
// AppRestrictionsSchema: Represents the list of app restrictions
// available to be pre-configured for the product.
type AppRestrictionsSchema struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#appRestrictionsSchema".
Kind string `json:"kind,omitempty"`
// Restrictions: The set of restrictions that make up this schema.
Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") 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:"-"`
}
func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) {
type noMethod AppRestrictionsSchema
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// AppRestrictionsSchemaRestriction: A restriction in the App
// Restriction Schema represents a piece of configuration that may be
// pre-applied.
type AppRestrictionsSchemaRestriction struct {
// DefaultValue: The default value of the restriction.
DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"`
// Description: A longer description of the restriction, giving more
// detail of what it affects.
Description string `json:"description,omitempty"`
// Entry: For choice or multiselect restrictions, the list of possible
// entries' human-readable names.
Entry []string `json:"entry,omitempty"`
// EntryValue: For choice or multiselect restrictions, the list of
// possible entries' machine-readable values.
EntryValue []string `json:"entryValue,omitempty"`
// Key: The unique key that the product uses to identify the
// restriction, e.g. "com.google.android.gm.fieldname".
Key string `json:"key,omitempty"`
// RestrictionType: The type of the restriction.
RestrictionType string `json:"restrictionType,omitempty"`
// Title: The name of the restriction.
Title string `json:"title,omitempty"`
// ForceSendFields is a list of field names (e.g. "DefaultValue") 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:"-"`
}
func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) {
type noMethod AppRestrictionsSchemaRestriction
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for
// the restriction.
type AppRestrictionsSchemaRestrictionRestrictionValue struct {
// Type: The type of the value being provided.
Type string `json:"type,omitempty"`
// ValueBool: The boolean value - this will only be present if type is
// bool.
ValueBool bool `json:"valueBool,omitempty"`
// ValueInteger: The integer value - this will only be present if type
// is integer.
ValueInteger int64 `json:"valueInteger,omitempty"`
// ValueMultiselect: The list of string values - this will only be
// present if type is multiselect.
ValueMultiselect []string `json:"valueMultiselect,omitempty"`
// ValueString: The string value - this will be present for types
// string, choice and hidden.
ValueString string `json:"valueString,omitempty"`
// ForceSendFields is a list of field names (e.g. "Type") 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:"-"`
}
func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) {
type noMethod AppRestrictionsSchemaRestrictionRestrictionValue
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// AppVersion: This represents a single version of the app.
type AppVersion struct {
// VersionCode: Unique increasing identifier for the app version.
VersionCode int64 `json:"versionCode,omitempty"`
// VersionString: The string used in the Play Store by the app developer
// to identify the version. The string is not necessarily unique or
// localized (for example, the string could be "1.4").
VersionString string `json:"versionString,omitempty"`
// ForceSendFields is a list of field names (e.g. "VersionCode") 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:"-"`
}
func (s *AppVersion) MarshalJSON() ([]byte, error) {
type noMethod AppVersion
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// ApprovalUrlInfo: Information on an approval URL.
type ApprovalUrlInfo struct {
// ApprovalUrl: A URL that displays a product's permissions and that can
// also be used to approve the product with the Products.approve call.
ApprovalUrl string `json:"approvalUrl,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#approvalUrlInfo".
Kind string `json:"kind,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApprovalUrl") 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:"-"`
}
func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) {
type noMethod ApprovalUrlInfo
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Collection: A collection resource defines a named set of apps that is
// visible to a set of users in the Google Play Store app running on
// those users' managed devices. Those users can then install any of
// those apps if they wish (which will trigger creation of install and
// entitlement resources). A user cannot install an app on a managed
// device unless the app is listed in at least one collection that is
// visible to that user.
//
// Note that the API can be used to directly install an app regardless
// of whether it is in any collection - so an enterprise has a choice of
// either directly pushing apps to users, or allowing users to install
// apps if they want. Which is appropriate will depend on the
// enterprise's policies and the purpose of the apps concerned.
type Collection struct {
// CollectionId: Arbitrary unique ID, allocated by the API on creation.
CollectionId string `json:"collectionId,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#collection".
Kind string `json:"kind,omitempty"`
// Name: A user-friendly name for the collection (should be unique),
// e.g. "Accounting apps".
Name string `json:"name,omitempty"`
// ProductId: The IDs of the products in the collection, in the order in
// which they should be displayed.
ProductId []string `json:"productId,omitempty"`
// Visibility: Whether this collection is visible to all users, or only
// to the users that have been granted access through the
// "Collectionviewers" API. With the launch of the
// "setAvailableProductSet" API, this property should always be set to
// "viewersOnly", as the "allUsers" option will bypass the
// "availableProductSet" for all users within a domain.
//
// The "allUsers" setting is deprecated, and will be removed.
Visibility string `json:"visibility,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "CollectionId") 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:"-"`
}
func (s *Collection) MarshalJSON() ([]byte, error) {
type noMethod Collection
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// CollectionViewersListResponse: The user resources for the collection.
type CollectionViewersListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#collectionViewersListResponse".
Kind string `json:"kind,omitempty"`
// User: A user of an enterprise.
User []*User `json:"user,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") 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:"-"`
}
func (s *CollectionViewersListResponse) MarshalJSON() ([]byte, error) {
type noMethod CollectionViewersListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// CollectionsListResponse: The collection resources for the enterprise.
type CollectionsListResponse struct {
// Collection: An ordered collection of products which can be made
// visible on the Google Play Store to a selected group of users.
Collection []*Collection `json:"collection,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#collectionsListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Collection") 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:"-"`
}
func (s *CollectionsListResponse) MarshalJSON() ([]byte, error) {
type noMethod CollectionsListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Device: A device resource represents a mobile device managed by the
// MDM and belonging to a specific enterprise user.
//
// This collection cannot be modified via the API; it is automatically
// populated as devices are set up to be managed.
type Device struct {
// AndroidId: The Google Play Services Android ID for the device encoded
// as a lowercase hex string, e.g. "123456789abcdef0".
AndroidId string `json:"androidId,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#device".
Kind string `json:"kind,omitempty"`
// ManagementType: The mechanism by which this device is managed by the
// MDM. "managedDevice" means that the MDM's app is a device owner.
// "managedProfile" means that the MDM's app is the profile owner (and
// there is a separate personal profile which is not managed).
// "containerApp" means that the MDM's app is managing the Android for
// Work container app on the device.
ManagementType string `json:"managementType,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AndroidId") 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:"-"`
}
func (s *Device) MarshalJSON() ([]byte, error) {
type noMethod Device
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// DeviceState: The state of a user's device, as accessed by the
// getState and setState methods on device resources.
type DeviceState struct {
// AccountState: The state of the Google account on the device.
// "enabled" indicates that the Google account on the device can be used
// to access Google services (including Google Play), while "disabled"
// means that it cannot. A new device is initially in the "disabled"
// state.
AccountState string `json:"accountState,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#deviceState".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AccountState") 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:"-"`
}
func (s *DeviceState) MarshalJSON() ([]byte, error) {
type noMethod DeviceState
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// DevicesListResponse: The device resources for the user.
type DevicesListResponse struct {
// Device: A managed device.
Device []*Device `json:"device,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#devicesListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Device") 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:"-"`
}
func (s *DevicesListResponse) MarshalJSON() ([]byte, error) {
type noMethod DevicesListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Enterprise: An enterprise resource represents a binding between an
// organisation and their MDM.
//
// To create an enterprise, an admin of the enterprise must first go
// through a Play for Work sign-up flow. At the end of this the admin
// will be presented with a token (a short opaque alphanumeric string).
// They must then present this to the MDM, who then supplies it to the
// enroll method. Until this is done the MDM will not have any access to
// the enterprise.
//
// After calling enroll the MDM should call setAccount to specify the
// service account that will be allowed to act on behalf of the
// enterprise, which will be required for access to the enterprise's
// data through this API. Only one call of setAccount is allowed for a
// given enterprise; the only way to change the account later is to
// unenroll the enterprise and enroll it again (obtaining a new
// token).
//
// The MDM can unenroll an enterprise in order to sever the binding
// between them. Re-enrolling an enterprise is possible, but requires a
// new token to be retrieved. Enterprises.unenroll requires the MDM's
// credentials (as enroll does), not the enterprise's.
// Enterprises.unenroll can only be used for enterprises that were
// previously enrolled with the enroll call. Any enterprises that were
// enrolled using the (deprecated) Enterprises.insert call must be
// unenrolled with Enterprises.delete and can then be re-enrolled using
// the Enterprises.enroll call.
//
// The ID for an enterprise is an opaque string. It is returned by
// insert and enroll and can also be retrieved if the enterprise's
// primary domain is known using the list method.
type Enterprise struct {
// Id: The unique ID for the enterprise.
Id string `json:"id,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#enterprise".
Kind string `json:"kind,omitempty"`
// Name: The name of the enterprise, e.g. "Example Inc".
Name string `json:"name,omitempty"`
// PrimaryDomain: The enterprise's primary domain, e.g. "example.com".
PrimaryDomain string `json:"primaryDomain,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Id") 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:"-"`
}
func (s *Enterprise) MarshalJSON() ([]byte, error) {
type noMethod Enterprise
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// EnterpriseAccount: A service account that can be used to authenticate
// as the enterprise to API calls that require such authentication.
type EnterpriseAccount struct {
// AccountEmail: The email address of the service account.
AccountEmail string `json:"accountEmail,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#enterpriseAccount".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AccountEmail") 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:"-"`
}
func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) {
type noMethod EnterpriseAccount
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// EnterprisesListResponse: The matching enterprise resources.
type EnterprisesListResponse struct {
// Enterprise: An enterprise.
Enterprise []*Enterprise `json:"enterprise,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#enterprisesListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Enterprise") 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:"-"`
}
func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) {
type noMethod EnterprisesListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
type EnterprisesSendTestPushNotificationResponse struct {
// MessageId: The message ID of the test push notification that was
// sent.
MessageId string `json:"messageId,omitempty"`
// TopicName: The name of the Cloud Pub/Sub topic to which notifications
// for this enterprise's enrolled account will be sent.
TopicName string `json:"topicName,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "MessageId") 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:"-"`
}
func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) {
type noMethod EnterprisesSendTestPushNotificationResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Entitlement: The existence of an entitlement resource means that a
// user has the right to use a particular app on any of their devices.
// This might be because the app is free or because they have been
// allocated a license to the app from a group license purchased by the
// enterprise.
//
// It should always be true that a user has an app installed on one of
// their devices only if they have an entitlement to it. So if an
// entitlement is deleted, the app will be uninstalled from all devices.
// Similarly if the user installs an app (and is permitted to do so), or
// the MDM triggers an install of the app, an entitlement to that app is
// automatically created. If this is impossible - e.g. the enterprise
// has not purchased sufficient licenses - then installation
// fails.
//
// Note that entitlements are always user specific, not device specific;
// a user may have an entitlement even though they have not installed
// the app anywhere. Once they have an entitlement they can install the
// app on multiple devices.
//
// The API can be used to create an entitlement. If the app is a free
// app, a group license for that app is created. If it's a paid app,
// creating the entitlement consumes one license; it remains consumed
// until the entitlement is removed. Optionally an installation of the
// app on all the user's managed devices can be triggered at the time
// the entitlement is created. An entitlement cannot be created for an
// app if the app requires permissions that the enterprise has not yet
// accepted.
//
// Entitlements for paid apps that are due to purchases by the user on a
// non-managed profile will have "userPurchase" as entitlement reason;
// those entitlements cannot be removed via the API.
type Entitlement struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#entitlement".
Kind string `json:"kind,omitempty"`
// ProductId: The ID of the product that the entitlement is for, e.g.
// "app:com.google.android.gm".
ProductId string `json:"productId,omitempty"`
// Reason: The reason for the entitlement, e.g. "free" for free apps.
// This is temporary, it will be replaced by the acquisition kind field
// of group licenses.
Reason string `json:"reason,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") 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:"-"`
}
func (s *Entitlement) MarshalJSON() ([]byte, error) {
type noMethod Entitlement
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// EntitlementsListResponse: The entitlement resources for the user.
type EntitlementsListResponse struct {
// Entitlement: An entitlement of a user to a product (e.g. an app). For
// example, a free app that they have installed, or a paid app that they
// have been allocated a license to.
Entitlement []*Entitlement `json:"entitlement,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#entitlementsListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Entitlement") 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:"-"`
}
func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) {
type noMethod EntitlementsListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// GroupLicense: A group license object indicates a product that an
// enterprise admin has approved for use in the enterprise. The product
// may be free or paid. For free products, a group license object is
// created in these cases: if the enterprise admin approves a product in
// Google Play, if the product is added to a collection, or if an
// entitlement for the product is created for a user via the API. For
// paid products, a group license object is only created as part of the
// first bulk purchase of that product in Google Play by the enterprise
// admin.
//
// The API can be used to query group licenses; the available
// information includes the total number of licenses purchased (for paid
// products) and the total number of licenses that have been
// provisioned, that is, the total number of user entitlements in
// existence for the product.
//
// Group license objects are never deleted. If, for example, a free app
// is added to a collection and then removed, the group license will
// remain, allowing the enterprise admin to keep track of any remaining
// entitlements. An enterprise admin may indicate they are no longer
// interested in the group license by marking it as unapproved in Google
// Play.
type GroupLicense struct {
// AcquisitionKind: How this group license was acquired. "bulkPurchase"
// means that this group license object was created because the
// enterprise purchased licenses for this product; this is "free"
// otherwise (for free products).
AcquisitionKind string `json:"acquisitionKind,omitempty"`
// Approval: Whether the product to which this group license relates is
// currently approved by the enterprise, as either "approved" or
// "unapproved". Products are approved when a group license is first
// created, but this approval may be revoked by an enterprise admin via
// Google Play. Unapproved products will not be visible to end users in
// collections and new entitlements to them should not normally be
// created.
Approval string `json:"approval,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#groupLicense".
Kind string `json:"kind,omitempty"`
// NumProvisioned: The total number of provisioned licenses for this
// product. Returned by read operations, but ignored in write
// operations.
NumProvisioned int64 `json:"numProvisioned,omitempty"`
// NumPurchased: The number of purchased licenses (possibly in multiple
// purchases). If this field is omitted then there is no limit on the
// number of licenses that can be provisioned (e.g. if the acquisition
// kind is "free").
NumPurchased int64 `json:"numPurchased,omitempty"`
// ProductId: The ID of the product that the license is for, e.g.
// "app:com.google.android.gm".
ProductId string `json:"productId,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AcquisitionKind") 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:"-"`
}
func (s *GroupLicense) MarshalJSON() ([]byte, error) {
type noMethod GroupLicense
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// GroupLicenseUsersListResponse: The user resources for the group
// license.
type GroupLicenseUsersListResponse struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#groupLicenseUsersListResponse".
Kind string `json:"kind,omitempty"`
// User: A user of an enterprise.
User []*User `json:"user,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Kind") 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:"-"`
}
func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) {
type noMethod GroupLicenseUsersListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// GroupLicensesListResponse: The grouplicense resources for the
// enterprise.
type GroupLicensesListResponse struct {
// GroupLicense: A group license for a product approved for use in the
// enterprise.
GroupLicense []*GroupLicense `json:"groupLicense,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#groupLicensesListResponse".
Kind string `json:"kind,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "GroupLicense") 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:"-"`
}
func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) {
type noMethod GroupLicensesListResponse
raw := noMethod(*s)
return internal.MarshalJSON(raw, s.ForceSendFields)
}
// Install: The existence of an install resource indicates that an app
// is installed on a particular device (or that an install is
// pending).
//
// The API can be used to create an install resource using the update
// method. This triggers the actual install of the app on the device. If
// the user does not already have an entitlement for the app then an
// attempt is made to create one. If this fails (e.g. because the app is
// not free and there is no available license) then the creation of the
// install fails.
//
// The API can also be used to update an installed app. If the update
// method is used on an existing install then the app will be updated to
// the latest available version.
//
// Note that it is not possible to force the installation of a specific
// version of an app; the version code is read-only.
//
// If a user installs an app themselves (as permitted by the
// enterprise), then again an install resource and possibly an
// entitlement resource are automatically created.
//
// The API can also be used to delete an install resource, which
// triggers the removal of the app from the device. Note that deleting
// an install does not automatically remove the corresponding
// entitlement, even if there are no remaining installs. The install
// resource will also be deleted if the user uninstalls the app
// themselves.
type Install struct {
// InstallState: Install state. The state "installPending" means that an
// install request has recently been made and download to the device is
// in progress. The state "installed" means that the app has been
// installed. This field is read-only.
InstallState string `json:"installState,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "androidenterprise#install".
Kind string `json:"kind,omitempty"`