1// Package androidenterprise provides access to the Google Play EMM API.
2//
3// See https://developers.google.com/android/work/play/emm-api
4//
5// Usage example:
6//
7//   import "google.golang.org/api/androidenterprise/v1"
8//   ...
9//   androidenterpriseService, err := androidenterprise.New(oauthHttpClient)
10package androidenterprise // import "google.golang.org/api/androidenterprise/v1"
11
12import (
13	"bytes"
14	"encoding/json"
15	"errors"
16	"fmt"
17	context "golang.org/x/net/context"
18	ctxhttp "golang.org/x/net/context/ctxhttp"
19	gensupport "google.golang.org/api/gensupport"
20	googleapi "google.golang.org/api/googleapi"
21	"io"
22	"net/http"
23	"net/url"
24	"strconv"
25	"strings"
26)
27
28// Always reference these packages, just in case the auto-generated code
29// below doesn't.
30var _ = bytes.NewBuffer
31var _ = strconv.Itoa
32var _ = fmt.Sprintf
33var _ = json.NewDecoder
34var _ = io.Copy
35var _ = url.Parse
36var _ = gensupport.MarshalJSON
37var _ = googleapi.Version
38var _ = errors.New
39var _ = strings.Replace
40var _ = context.Canceled
41var _ = ctxhttp.Do
42
43const apiId = "androidenterprise:v1"
44const apiName = "androidenterprise"
45const apiVersion = "v1"
46const basePath = "https://www.googleapis.com/androidenterprise/v1/"
47
48// OAuth2 scopes used by this API.
49const (
50	// Manage corporate Android devices
51	AndroidenterpriseScope = "https://www.googleapis.com/auth/androidenterprise"
52)
53
54func New(client *http.Client) (*Service, error) {
55	if client == nil {
56		return nil, errors.New("client is nil")
57	}
58	s := &Service{client: client, BasePath: basePath}
59	s.Collections = NewCollectionsService(s)
60	s.Collectionviewers = NewCollectionviewersService(s)
61	s.Devices = NewDevicesService(s)
62	s.Enterprises = NewEnterprisesService(s)
63	s.Entitlements = NewEntitlementsService(s)
64	s.Grouplicenses = NewGrouplicensesService(s)
65	s.Grouplicenseusers = NewGrouplicenseusersService(s)
66	s.Installs = NewInstallsService(s)
67	s.Permissions = NewPermissionsService(s)
68	s.Products = NewProductsService(s)
69	s.Storelayoutclusters = NewStorelayoutclustersService(s)
70	s.Storelayoutpages = NewStorelayoutpagesService(s)
71	s.Users = NewUsersService(s)
72	return s, nil
73}
74
75type Service struct {
76	client    *http.Client
77	BasePath  string // API endpoint base URL
78	UserAgent string // optional additional User-Agent fragment
79
80	Collections *CollectionsService
81
82	Collectionviewers *CollectionviewersService
83
84	Devices *DevicesService
85
86	Enterprises *EnterprisesService
87
88	Entitlements *EntitlementsService
89
90	Grouplicenses *GrouplicensesService
91
92	Grouplicenseusers *GrouplicenseusersService
93
94	Installs *InstallsService
95
96	Permissions *PermissionsService
97
98	Products *ProductsService
99
100	Storelayoutclusters *StorelayoutclustersService
101
102	Storelayoutpages *StorelayoutpagesService
103
104	Users *UsersService
105}
106
107func (s *Service) userAgent() string {
108	if s.UserAgent == "" {
109		return googleapi.UserAgent
110	}
111	return googleapi.UserAgent + " " + s.UserAgent
112}
113
114func NewCollectionsService(s *Service) *CollectionsService {
115	rs := &CollectionsService{s: s}
116	return rs
117}
118
119type CollectionsService struct {
120	s *Service
121}
122
123func NewCollectionviewersService(s *Service) *CollectionviewersService {
124	rs := &CollectionviewersService{s: s}
125	return rs
126}
127
128type CollectionviewersService struct {
129	s *Service
130}
131
132func NewDevicesService(s *Service) *DevicesService {
133	rs := &DevicesService{s: s}
134	return rs
135}
136
137type DevicesService struct {
138	s *Service
139}
140
141func NewEnterprisesService(s *Service) *EnterprisesService {
142	rs := &EnterprisesService{s: s}
143	return rs
144}
145
146type EnterprisesService struct {
147	s *Service
148}
149
150func NewEntitlementsService(s *Service) *EntitlementsService {
151	rs := &EntitlementsService{s: s}
152	return rs
153}
154
155type EntitlementsService struct {
156	s *Service
157}
158
159func NewGrouplicensesService(s *Service) *GrouplicensesService {
160	rs := &GrouplicensesService{s: s}
161	return rs
162}
163
164type GrouplicensesService struct {
165	s *Service
166}
167
168func NewGrouplicenseusersService(s *Service) *GrouplicenseusersService {
169	rs := &GrouplicenseusersService{s: s}
170	return rs
171}
172
173type GrouplicenseusersService struct {
174	s *Service
175}
176
177func NewInstallsService(s *Service) *InstallsService {
178	rs := &InstallsService{s: s}
179	return rs
180}
181
182type InstallsService struct {
183	s *Service
184}
185
186func NewPermissionsService(s *Service) *PermissionsService {
187	rs := &PermissionsService{s: s}
188	return rs
189}
190
191type PermissionsService struct {
192	s *Service
193}
194
195func NewProductsService(s *Service) *ProductsService {
196	rs := &ProductsService{s: s}
197	return rs
198}
199
200type ProductsService struct {
201	s *Service
202}
203
204func NewStorelayoutclustersService(s *Service) *StorelayoutclustersService {
205	rs := &StorelayoutclustersService{s: s}
206	return rs
207}
208
209type StorelayoutclustersService struct {
210	s *Service
211}
212
213func NewStorelayoutpagesService(s *Service) *StorelayoutpagesService {
214	rs := &StorelayoutpagesService{s: s}
215	return rs
216}
217
218type StorelayoutpagesService struct {
219	s *Service
220}
221
222func NewUsersService(s *Service) *UsersService {
223	rs := &UsersService{s: s}
224	return rs
225}
226
227type UsersService struct {
228	s *Service
229}
230
231// AppRestrictionsSchema: Represents the list of app restrictions
232// available to be pre-configured for the product.
233type AppRestrictionsSchema struct {
234	// Kind: Identifies what kind of resource this is. Value: the fixed
235	// string "androidenterprise#appRestrictionsSchema".
236	Kind string `json:"kind,omitempty"`
237
238	// Restrictions: The set of restrictions that make up this schema.
239	Restrictions []*AppRestrictionsSchemaRestriction `json:"restrictions,omitempty"`
240
241	// ServerResponse contains the HTTP response code and headers from the
242	// server.
243	googleapi.ServerResponse `json:"-"`
244
245	// ForceSendFields is a list of field names (e.g. "Kind") to
246	// unconditionally include in API requests. By default, fields with
247	// empty values are omitted from API requests. However, any non-pointer,
248	// non-interface field appearing in ForceSendFields will be sent to the
249	// server regardless of whether the field is empty or not. This may be
250	// used to include empty fields in Patch requests.
251	ForceSendFields []string `json:"-"`
252}
253
254func (s *AppRestrictionsSchema) MarshalJSON() ([]byte, error) {
255	type noMethod AppRestrictionsSchema
256	raw := noMethod(*s)
257	return gensupport.MarshalJSON(raw, s.ForceSendFields)
258}
259
260// AppRestrictionsSchemaRestriction: A restriction in the App
261// Restriction Schema represents a piece of configuration that may be
262// pre-applied.
263type AppRestrictionsSchemaRestriction struct {
264	// DefaultValue: The default value of the restriction.
265	DefaultValue *AppRestrictionsSchemaRestrictionRestrictionValue `json:"defaultValue,omitempty"`
266
267	// Description: A longer description of the restriction, giving more
268	// detail of what it affects.
269	Description string `json:"description,omitempty"`
270
271	// Entry: For choice or multiselect restrictions, the list of possible
272	// entries' human-readable names.
273	Entry []string `json:"entry,omitempty"`
274
275	// EntryValue: For choice or multiselect restrictions, the list of
276	// possible entries' machine-readable values.
277	EntryValue []string `json:"entryValue,omitempty"`
278
279	// Key: The unique key that the product uses to identify the
280	// restriction, e.g. "com.google.android.gm.fieldname".
281	Key string `json:"key,omitempty"`
282
283	// RestrictionType: The type of the restriction.
284	RestrictionType string `json:"restrictionType,omitempty"`
285
286	// Title: The name of the restriction.
287	Title string `json:"title,omitempty"`
288
289	// ForceSendFields is a list of field names (e.g. "DefaultValue") to
290	// unconditionally include in API requests. By default, fields with
291	// empty values are omitted from API requests. However, any non-pointer,
292	// non-interface field appearing in ForceSendFields will be sent to the
293	// server regardless of whether the field is empty or not. This may be
294	// used to include empty fields in Patch requests.
295	ForceSendFields []string `json:"-"`
296}
297
298func (s *AppRestrictionsSchemaRestriction) MarshalJSON() ([]byte, error) {
299	type noMethod AppRestrictionsSchemaRestriction
300	raw := noMethod(*s)
301	return gensupport.MarshalJSON(raw, s.ForceSendFields)
302}
303
304// AppRestrictionsSchemaRestrictionRestrictionValue: A typed value for
305// the restriction.
306type AppRestrictionsSchemaRestrictionRestrictionValue struct {
307	// Type: The type of the value being provided.
308	Type string `json:"type,omitempty"`
309
310	// ValueBool: The boolean value - this will only be present if type is
311	// bool.
312	ValueBool bool `json:"valueBool,omitempty"`
313
314	// ValueInteger: The integer value - this will only be present if type
315	// is integer.
316	ValueInteger int64 `json:"valueInteger,omitempty"`
317
318	// ValueMultiselect: The list of string values - this will only be
319	// present if type is multiselect.
320	ValueMultiselect []string `json:"valueMultiselect,omitempty"`
321
322	// ValueString: The string value - this will be present for types
323	// string, choice and hidden.
324	ValueString string `json:"valueString,omitempty"`
325
326	// ForceSendFields is a list of field names (e.g. "Type") to
327	// unconditionally include in API requests. By default, fields with
328	// empty values are omitted from API requests. However, any non-pointer,
329	// non-interface field appearing in ForceSendFields will be sent to the
330	// server regardless of whether the field is empty or not. This may be
331	// used to include empty fields in Patch requests.
332	ForceSendFields []string `json:"-"`
333}
334
335func (s *AppRestrictionsSchemaRestrictionRestrictionValue) MarshalJSON() ([]byte, error) {
336	type noMethod AppRestrictionsSchemaRestrictionRestrictionValue
337	raw := noMethod(*s)
338	return gensupport.MarshalJSON(raw, s.ForceSendFields)
339}
340
341// AppVersion: This represents a single version of the app.
342type AppVersion struct {
343	// VersionCode: Unique increasing identifier for the app version.
344	VersionCode int64 `json:"versionCode,omitempty"`
345
346	// VersionString: The string used in the Play Store by the app developer
347	// to identify the version. The string is not necessarily unique or
348	// localized (for example, the string could be "1.4").
349	VersionString string `json:"versionString,omitempty"`
350
351	// ForceSendFields is a list of field names (e.g. "VersionCode") to
352	// unconditionally include in API requests. By default, fields with
353	// empty values are omitted from API requests. However, any non-pointer,
354	// non-interface field appearing in ForceSendFields will be sent to the
355	// server regardless of whether the field is empty or not. This may be
356	// used to include empty fields in Patch requests.
357	ForceSendFields []string `json:"-"`
358}
359
360func (s *AppVersion) MarshalJSON() ([]byte, error) {
361	type noMethod AppVersion
362	raw := noMethod(*s)
363	return gensupport.MarshalJSON(raw, s.ForceSendFields)
364}
365
366// ApprovalUrlInfo: Information on an approval URL.
367type ApprovalUrlInfo struct {
368	// ApprovalUrl: A URL that displays a product's permissions and that can
369	// also be used to approve the product with the Products.approve call.
370	ApprovalUrl string `json:"approvalUrl,omitempty"`
371
372	// Kind: Identifies what kind of resource this is. Value: the fixed
373	// string "androidenterprise#approvalUrlInfo".
374	Kind string `json:"kind,omitempty"`
375
376	// ForceSendFields is a list of field names (e.g. "ApprovalUrl") to
377	// unconditionally include in API requests. By default, fields with
378	// empty values are omitted from API requests. However, any non-pointer,
379	// non-interface field appearing in ForceSendFields will be sent to the
380	// server regardless of whether the field is empty or not. This may be
381	// used to include empty fields in Patch requests.
382	ForceSendFields []string `json:"-"`
383}
384
385func (s *ApprovalUrlInfo) MarshalJSON() ([]byte, error) {
386	type noMethod ApprovalUrlInfo
387	raw := noMethod(*s)
388	return gensupport.MarshalJSON(raw, s.ForceSendFields)
389}
390
391// Collection: A collection resource defines a named set of apps that is
392// visible to a set of users in the Google Play Store app running on
393// those users' managed devices. Those users can then install any of
394// those apps if they wish (which will trigger creation of install and
395// entitlement resources). A user cannot install an app on a managed
396// device unless the app is listed in at least one collection that is
397// visible to that user.
398//
399// Note that the API can be used to directly install an app regardless
400// of whether it is in any collection - so an enterprise has a choice of
401// either directly pushing apps to users, or allowing users to install
402// apps if they want. Which is appropriate will depend on the
403// enterprise's policies and the purpose of the apps concerned.
404type Collection struct {
405	// CollectionId: Arbitrary unique ID, allocated by the API on creation.
406	CollectionId string `json:"collectionId,omitempty"`
407
408	// Kind: Identifies what kind of resource this is. Value: the fixed
409	// string "androidenterprise#collection".
410	Kind string `json:"kind,omitempty"`
411
412	// Name: A user-friendly name for the collection (should be unique),
413	// e.g. "Accounting apps".
414	Name string `json:"name,omitempty"`
415
416	// ProductId: The IDs of the products in the collection, in the order in
417	// which they should be displayed.
418	ProductId []string `json:"productId,omitempty"`
419
420	// Visibility: Whether this collection is visible to all users, or only
421	// to the users that have been granted access through the
422	// "Collectionviewers" API. With the launch of the
423	// "setAvailableProductSet" API, this property should always be set to
424	// "viewersOnly", as the "allUsers" option will bypass the
425	// "availableProductSet" for all users within a domain.
426	//
427	// The "allUsers" setting is deprecated, and will be removed.
428	Visibility string `json:"visibility,omitempty"`
429
430	// ServerResponse contains the HTTP response code and headers from the
431	// server.
432	googleapi.ServerResponse `json:"-"`
433
434	// ForceSendFields is a list of field names (e.g. "CollectionId") to
435	// unconditionally include in API requests. By default, fields with
436	// empty values are omitted from API requests. However, any non-pointer,
437	// non-interface field appearing in ForceSendFields will be sent to the
438	// server regardless of whether the field is empty or not. This may be
439	// used to include empty fields in Patch requests.
440	ForceSendFields []string `json:"-"`
441}
442
443func (s *Collection) MarshalJSON() ([]byte, error) {
444	type noMethod Collection
445	raw := noMethod(*s)
446	return gensupport.MarshalJSON(raw, s.ForceSendFields)
447}
448
449// CollectionViewersListResponse: The user resources for the collection.
450type CollectionViewersListResponse struct {
451	// Kind: Identifies what kind of resource this is. Value: the fixed
452	// string "androidenterprise#collectionViewersListResponse".
453	Kind string `json:"kind,omitempty"`
454
455	// User: A user of an enterprise.
456	User []*User `json:"user,omitempty"`
457
458	// ServerResponse contains the HTTP response code and headers from the
459	// server.
460	googleapi.ServerResponse `json:"-"`
461
462	// ForceSendFields is a list of field names (e.g. "Kind") to
463	// unconditionally include in API requests. By default, fields with
464	// empty values are omitted from API requests. However, any non-pointer,
465	// non-interface field appearing in ForceSendFields will be sent to the
466	// server regardless of whether the field is empty or not. This may be
467	// used to include empty fields in Patch requests.
468	ForceSendFields []string `json:"-"`
469}
470
471func (s *CollectionViewersListResponse) MarshalJSON() ([]byte, error) {
472	type noMethod CollectionViewersListResponse
473	raw := noMethod(*s)
474	return gensupport.MarshalJSON(raw, s.ForceSendFields)
475}
476
477// CollectionsListResponse: The collection resources for the enterprise.
478type CollectionsListResponse struct {
479	// Collection: An ordered collection of products which can be made
480	// visible on the Google Play Store to a selected group of users.
481	Collection []*Collection `json:"collection,omitempty"`
482
483	// Kind: Identifies what kind of resource this is. Value: the fixed
484	// string "androidenterprise#collectionsListResponse".
485	Kind string `json:"kind,omitempty"`
486
487	// ServerResponse contains the HTTP response code and headers from the
488	// server.
489	googleapi.ServerResponse `json:"-"`
490
491	// ForceSendFields is a list of field names (e.g. "Collection") to
492	// unconditionally include in API requests. By default, fields with
493	// empty values are omitted from API requests. However, any non-pointer,
494	// non-interface field appearing in ForceSendFields will be sent to the
495	// server regardless of whether the field is empty or not. This may be
496	// used to include empty fields in Patch requests.
497	ForceSendFields []string `json:"-"`
498}
499
500func (s *CollectionsListResponse) MarshalJSON() ([]byte, error) {
501	type noMethod CollectionsListResponse
502	raw := noMethod(*s)
503	return gensupport.MarshalJSON(raw, s.ForceSendFields)
504}
505
506// Device: A device resource represents a mobile device managed by the
507// EMM and belonging to a specific enterprise user.
508//
509// This collection cannot be modified via the API; it is automatically
510// populated as devices are set up to be managed.
511type Device struct {
512	// AndroidId: The Google Play Services Android ID for the device encoded
513	// as a lowercase hex string, e.g. "123456789abcdef0".
514	AndroidId string `json:"androidId,omitempty"`
515
516	// Kind: Identifies what kind of resource this is. Value: the fixed
517	// string "androidenterprise#device".
518	Kind string `json:"kind,omitempty"`
519
520	// ManagementType: The mechanism by which this device is managed by the
521	// EMM. "managedDevice" means that the EMM's app is a device owner.
522	// "managedProfile" means that the EMM's app is the profile owner (and
523	// there is a separate personal profile which is not managed).
524	// "containerApp" means that the EMM's app is managing the Android for
525	// Work container app on the device.
526	ManagementType string `json:"managementType,omitempty"`
527
528	// ServerResponse contains the HTTP response code and headers from the
529	// server.
530	googleapi.ServerResponse `json:"-"`
531
532	// ForceSendFields is a list of field names (e.g. "AndroidId") to
533	// unconditionally include in API requests. By default, fields with
534	// empty values are omitted from API requests. However, any non-pointer,
535	// non-interface field appearing in ForceSendFields will be sent to the
536	// server regardless of whether the field is empty or not. This may be
537	// used to include empty fields in Patch requests.
538	ForceSendFields []string `json:"-"`
539}
540
541func (s *Device) MarshalJSON() ([]byte, error) {
542	type noMethod Device
543	raw := noMethod(*s)
544	return gensupport.MarshalJSON(raw, s.ForceSendFields)
545}
546
547// DeviceState: The state of a user's device, as accessed by the
548// getState and setState methods on device resources.
549type DeviceState struct {
550	// AccountState: The state of the Google account on the device.
551	// "enabled" indicates that the Google account on the device can be used
552	// to access Google services (including Google Play), while "disabled"
553	// means that it cannot. A new device is initially in the "disabled"
554	// state.
555	AccountState string `json:"accountState,omitempty"`
556
557	// Kind: Identifies what kind of resource this is. Value: the fixed
558	// string "androidenterprise#deviceState".
559	Kind string `json:"kind,omitempty"`
560
561	// ServerResponse contains the HTTP response code and headers from the
562	// server.
563	googleapi.ServerResponse `json:"-"`
564
565	// ForceSendFields is a list of field names (e.g. "AccountState") to
566	// unconditionally include in API requests. By default, fields with
567	// empty values are omitted from API requests. However, any non-pointer,
568	// non-interface field appearing in ForceSendFields will be sent to the
569	// server regardless of whether the field is empty or not. This may be
570	// used to include empty fields in Patch requests.
571	ForceSendFields []string `json:"-"`
572}
573
574func (s *DeviceState) MarshalJSON() ([]byte, error) {
575	type noMethod DeviceState
576	raw := noMethod(*s)
577	return gensupport.MarshalJSON(raw, s.ForceSendFields)
578}
579
580// DevicesListResponse: The device resources for the user.
581type DevicesListResponse struct {
582	// Device: A managed device.
583	Device []*Device `json:"device,omitempty"`
584
585	// Kind: Identifies what kind of resource this is. Value: the fixed
586	// string "androidenterprise#devicesListResponse".
587	Kind string `json:"kind,omitempty"`
588
589	// ServerResponse contains the HTTP response code and headers from the
590	// server.
591	googleapi.ServerResponse `json:"-"`
592
593	// ForceSendFields is a list of field names (e.g. "Device") to
594	// unconditionally include in API requests. By default, fields with
595	// empty values are omitted from API requests. However, any non-pointer,
596	// non-interface field appearing in ForceSendFields will be sent to the
597	// server regardless of whether the field is empty or not. This may be
598	// used to include empty fields in Patch requests.
599	ForceSendFields []string `json:"-"`
600}
601
602func (s *DevicesListResponse) MarshalJSON() ([]byte, error) {
603	type noMethod DevicesListResponse
604	raw := noMethod(*s)
605	return gensupport.MarshalJSON(raw, s.ForceSendFields)
606}
607
608// Enterprise: An enterprise resource represents a binding between an
609// organisation and their EMM.
610//
611// To create an enterprise, an admin of the enterprise must first go
612// through a Play for Work sign-up flow. At the end of this the admin
613// will be presented with a token (a short opaque alphanumeric string).
614// They must then present this to the EMM, who then supplies it to the
615// enroll method. Until this is done the EMM will not have any access to
616// the enterprise.
617//
618// After calling enroll the EMM should call setAccount to specify the
619// service account that will be allowed to act on behalf of the
620// enterprise, which will be required for access to the enterprise's
621// data through this API. Only one call of setAccount is allowed for a
622// given enterprise; the only way to change the account later is to
623// unenroll the enterprise and enroll it again (obtaining a new
624// token).
625//
626// The EMM can unenroll an enterprise in order to sever the binding
627// between them. Re-enrolling an enterprise is possible, but requires a
628// new token to be retrieved. Enterprises.unenroll requires the EMM's
629// credentials (as enroll does), not the enterprise's.
630// Enterprises.unenroll can only be used for enterprises that were
631// previously enrolled with the enroll call. Any enterprises that were
632// enrolled using the (deprecated) Enterprises.insert call must be
633// unenrolled with Enterprises.delete and can then be re-enrolled using
634// the Enterprises.enroll call.
635//
636// The ID for an enterprise is an opaque string. It is returned by
637// insert and enroll and can also be retrieved if the enterprise's
638// primary domain is known using the list method.
639type Enterprise struct {
640	// Id: The unique ID for the enterprise.
641	Id string `json:"id,omitempty"`
642
643	// Kind: Identifies what kind of resource this is. Value: the fixed
644	// string "androidenterprise#enterprise".
645	Kind string `json:"kind,omitempty"`
646
647	// Name: The name of the enterprise, e.g. "Example Inc".
648	Name string `json:"name,omitempty"`
649
650	// PrimaryDomain: The enterprise's primary domain, e.g. "example.com".
651	PrimaryDomain string `json:"primaryDomain,omitempty"`
652
653	// ServerResponse contains the HTTP response code and headers from the
654	// server.
655	googleapi.ServerResponse `json:"-"`
656
657	// ForceSendFields is a list of field names (e.g. "Id") to
658	// unconditionally include in API requests. By default, fields with
659	// empty values are omitted from API requests. However, any non-pointer,
660	// non-interface field appearing in ForceSendFields will be sent to the
661	// server regardless of whether the field is empty or not. This may be
662	// used to include empty fields in Patch requests.
663	ForceSendFields []string `json:"-"`
664}
665
666func (s *Enterprise) MarshalJSON() ([]byte, error) {
667	type noMethod Enterprise
668	raw := noMethod(*s)
669	return gensupport.MarshalJSON(raw, s.ForceSendFields)
670}
671
672// EnterpriseAccount: A service account that can be used to authenticate
673// as the enterprise to API calls that require such authentication.
674type EnterpriseAccount struct {
675	// AccountEmail: The email address of the service account.
676	AccountEmail string `json:"accountEmail,omitempty"`
677
678	// Kind: Identifies what kind of resource this is. Value: the fixed
679	// string "androidenterprise#enterpriseAccount".
680	Kind string `json:"kind,omitempty"`
681
682	// ServerResponse contains the HTTP response code and headers from the
683	// server.
684	googleapi.ServerResponse `json:"-"`
685
686	// ForceSendFields is a list of field names (e.g. "AccountEmail") to
687	// unconditionally include in API requests. By default, fields with
688	// empty values are omitted from API requests. However, any non-pointer,
689	// non-interface field appearing in ForceSendFields will be sent to the
690	// server regardless of whether the field is empty or not. This may be
691	// used to include empty fields in Patch requests.
692	ForceSendFields []string `json:"-"`
693}
694
695func (s *EnterpriseAccount) MarshalJSON() ([]byte, error) {
696	type noMethod EnterpriseAccount
697	raw := noMethod(*s)
698	return gensupport.MarshalJSON(raw, s.ForceSendFields)
699}
700
701// EnterprisesListResponse: The matching enterprise resources.
702type EnterprisesListResponse struct {
703	// Enterprise: An enterprise.
704	Enterprise []*Enterprise `json:"enterprise,omitempty"`
705
706	// Kind: Identifies what kind of resource this is. Value: the fixed
707	// string "androidenterprise#enterprisesListResponse".
708	Kind string `json:"kind,omitempty"`
709
710	// ServerResponse contains the HTTP response code and headers from the
711	// server.
712	googleapi.ServerResponse `json:"-"`
713
714	// ForceSendFields is a list of field names (e.g. "Enterprise") to
715	// unconditionally include in API requests. By default, fields with
716	// empty values are omitted from API requests. However, any non-pointer,
717	// non-interface field appearing in ForceSendFields will be sent to the
718	// server regardless of whether the field is empty or not. This may be
719	// used to include empty fields in Patch requests.
720	ForceSendFields []string `json:"-"`
721}
722
723func (s *EnterprisesListResponse) MarshalJSON() ([]byte, error) {
724	type noMethod EnterprisesListResponse
725	raw := noMethod(*s)
726	return gensupport.MarshalJSON(raw, s.ForceSendFields)
727}
728
729type EnterprisesSendTestPushNotificationResponse struct {
730	// MessageId: The message ID of the test push notification that was
731	// sent.
732	MessageId string `json:"messageId,omitempty"`
733
734	// TopicName: The name of the Cloud Pub/Sub topic to which notifications
735	// for this enterprise's enrolled account will be sent.
736	TopicName string `json:"topicName,omitempty"`
737
738	// ServerResponse contains the HTTP response code and headers from the
739	// server.
740	googleapi.ServerResponse `json:"-"`
741
742	// ForceSendFields is a list of field names (e.g. "MessageId") to
743	// unconditionally include in API requests. By default, fields with
744	// empty values are omitted from API requests. However, any non-pointer,
745	// non-interface field appearing in ForceSendFields will be sent to the
746	// server regardless of whether the field is empty or not. This may be
747	// used to include empty fields in Patch requests.
748	ForceSendFields []string `json:"-"`
749}
750
751func (s *EnterprisesSendTestPushNotificationResponse) MarshalJSON() ([]byte, error) {
752	type noMethod EnterprisesSendTestPushNotificationResponse
753	raw := noMethod(*s)
754	return gensupport.MarshalJSON(raw, s.ForceSendFields)
755}
756
757// Entitlement: The existence of an entitlement resource means that a
758// user has the right to use a particular app on any of their devices.
759// This might be because the app is free or because they have been
760// allocated a license to the app from a group license purchased by the
761// enterprise.
762//
763// It should always be true that a user has an app installed on one of
764// their devices only if they have an entitlement to it. So if an
765// entitlement is deleted, the app will be uninstalled from all devices.
766// Similarly if the user installs an app (and is permitted to do so), or
767// the EMM triggers an install of the app, an entitlement to that app is
768// automatically created. If this is impossible - e.g. the enterprise
769// has not purchased sufficient licenses - then installation
770// fails.
771//
772// Note that entitlements are always user specific, not device specific;
773// a user may have an entitlement even though they have not installed
774// the app anywhere. Once they have an entitlement they can install the
775// app on multiple devices.
776//
777// The API can be used to create an entitlement. If the app is a free
778// app, a group license for that app is created. If it's a paid app,
779// creating the entitlement consumes one license; it remains consumed
780// until the entitlement is removed. Optionally an installation of the
781// app on all the user's managed devices can be triggered at the time
782// the entitlement is created. An entitlement cannot be created for an
783// app if the app requires permissions that the enterprise has not yet
784// accepted.
785//
786// Entitlements for paid apps that are due to purchases by the user on a
787// non-managed profile will have "userPurchase" as entitlement reason;
788// those entitlements cannot be removed via the API.
789type Entitlement struct {
790	// Kind: Identifies what kind of resource this is. Value: the fixed
791	// string "androidenterprise#entitlement".
792	Kind string `json:"kind,omitempty"`
793
794	// ProductId: The ID of the product that the entitlement is for, e.g.
795	// "app:com.google.android.gm".
796	ProductId string `json:"productId,omitempty"`
797
798	// Reason: The reason for the entitlement, e.g. "free" for free apps.
799	// This is temporary, it will be replaced by the acquisition kind field
800	// of group licenses.
801	Reason string `json:"reason,omitempty"`
802
803	// ServerResponse contains the HTTP response code and headers from the
804	// server.
805	googleapi.ServerResponse `json:"-"`
806
807	// ForceSendFields is a list of field names (e.g. "Kind") to
808	// unconditionally include in API requests. By default, fields with
809	// empty values are omitted from API requests. However, any non-pointer,
810	// non-interface field appearing in ForceSendFields will be sent to the
811	// server regardless of whether the field is empty or not. This may be
812	// used to include empty fields in Patch requests.
813	ForceSendFields []string `json:"-"`
814}
815
816func (s *Entitlement) MarshalJSON() ([]byte, error) {
817	type noMethod Entitlement
818	raw := noMethod(*s)
819	return gensupport.MarshalJSON(raw, s.ForceSendFields)
820}
821
822// EntitlementsListResponse: The entitlement resources for the user.
823type EntitlementsListResponse struct {
824	// Entitlement: An entitlement of a user to a product (e.g. an app). For
825	// example, a free app that they have installed, or a paid app that they
826	// have been allocated a license to.
827	Entitlement []*Entitlement `json:"entitlement,omitempty"`
828
829	// Kind: Identifies what kind of resource this is. Value: the fixed
830	// string "androidenterprise#entitlementsListResponse".
831	Kind string `json:"kind,omitempty"`
832
833	// ServerResponse contains the HTTP response code and headers from the
834	// server.
835	googleapi.ServerResponse `json:"-"`
836
837	// ForceSendFields is a list of field names (e.g. "Entitlement") to
838	// unconditionally include in API requests. By default, fields with
839	// empty values are omitted from API requests. However, any non-pointer,
840	// non-interface field appearing in ForceSendFields will be sent to the
841	// server regardless of whether the field is empty or not. This may be
842	// used to include empty fields in Patch requests.
843	ForceSendFields []string `json:"-"`
844}
845
846func (s *EntitlementsListResponse) MarshalJSON() ([]byte, error) {
847	type noMethod EntitlementsListResponse
848	raw := noMethod(*s)
849	return gensupport.MarshalJSON(raw, s.ForceSendFields)
850}
851
852// GroupLicense: A group license object indicates a product that an
853// enterprise admin has approved for use in the enterprise. The product
854// may be free or paid. For free products, a group license object is
855// created in these cases: if the enterprise admin approves a product in
856// Google Play, if the product is added to a collection, or if an
857// entitlement for the product is created for a user via the API. For
858// paid products, a group license object is only created as part of the
859// first bulk purchase of that product in Google Play by the enterprise
860// admin.
861//
862// The API can be used to query group licenses; the available
863// information includes the total number of licenses purchased (for paid
864// products) and the total number of licenses that have been
865// provisioned, that is, the total number of user entitlements in
866// existence for the product.
867//
868// Group license objects are never deleted. If, for example, a free app
869// is added to a collection and then removed, the group license will
870// remain, allowing the enterprise admin to keep track of any remaining
871// entitlements. An enterprise admin may indicate they are no longer
872// interested in the group license by marking it as unapproved in Google
873// Play.
874type GroupLicense struct {
875	// AcquisitionKind: How this group license was acquired. "bulkPurchase"
876	// means that this group license object was created because the
877	// enterprise purchased licenses for this product; this is "free"
878	// otherwise (for free products).
879	AcquisitionKind string `json:"acquisitionKind,omitempty"`
880
881	// Approval: Whether the product to which this group license relates is
882	// currently approved by the enterprise, as either "approved" or
883	// "unapproved". Products are approved when a group license is first
884	// created, but this approval may be revoked by an enterprise admin via
885	// Google Play. Unapproved products will not be visible to end users in
886	// collections and new entitlements to them should not normally be
887	// created.
888	Approval string `json:"approval,omitempty"`
889
890	// Kind: Identifies what kind of resource this is. Value: the fixed
891	// string "androidenterprise#groupLicense".
892	Kind string `json:"kind,omitempty"`
893
894	// NumProvisioned: The total number of provisioned licenses for this
895	// product. Returned by read operations, but ignored in write
896	// operations.
897	NumProvisioned int64 `json:"numProvisioned,omitempty"`
898
899	// NumPurchased: The number of purchased licenses (possibly in multiple
900	// purchases). If this field is omitted then there is no limit on the
901	// number of licenses that can be provisioned (e.g. if the acquisition
902	// kind is "free").
903	NumPurchased int64 `json:"numPurchased,omitempty"`
904
905	// ProductId: The ID of the product that the license is for, e.g.
906	// "app:com.google.android.gm".
907	ProductId string `json:"productId,omitempty"`
908
909	// ServerResponse contains the HTTP response code and headers from the
910	// server.
911	googleapi.ServerResponse `json:"-"`
912
913	// ForceSendFields is a list of field names (e.g. "AcquisitionKind") to
914	// unconditionally include in API requests. By default, fields with
915	// empty values are omitted from API requests. However, any non-pointer,
916	// non-interface field appearing in ForceSendFields will be sent to the
917	// server regardless of whether the field is empty or not. This may be
918	// used to include empty fields in Patch requests.
919	ForceSendFields []string `json:"-"`
920}
921
922func (s *GroupLicense) MarshalJSON() ([]byte, error) {
923	type noMethod GroupLicense
924	raw := noMethod(*s)
925	return gensupport.MarshalJSON(raw, s.ForceSendFields)
926}
927
928// GroupLicenseUsersListResponse: The user resources for the group
929// license.
930type GroupLicenseUsersListResponse struct {
931	// Kind: Identifies what kind of resource this is. Value: the fixed
932	// string "androidenterprise#groupLicenseUsersListResponse".
933	Kind string `json:"kind,omitempty"`
934
935	// User: A user of an enterprise.
936	User []*User `json:"user,omitempty"`
937
938	// ServerResponse contains the HTTP response code and headers from the
939	// server.
940	googleapi.ServerResponse `json:"-"`
941
942	// ForceSendFields is a list of field names (e.g. "Kind") to
943	// unconditionally include in API requests. By default, fields with
944	// empty values are omitted from API requests. However, any non-pointer,
945	// non-interface field appearing in ForceSendFields will be sent to the
946	// server regardless of whether the field is empty or not. This may be
947	// used to include empty fields in Patch requests.
948	ForceSendFields []string `json:"-"`
949}
950
951func (s *GroupLicenseUsersListResponse) MarshalJSON() ([]byte, error) {
952	type noMethod GroupLicenseUsersListResponse
953	raw := noMethod(*s)
954	return gensupport.MarshalJSON(raw, s.ForceSendFields)
955}
956
957// GroupLicensesListResponse: The grouplicense resources for the
958// enterprise.
959type GroupLicensesListResponse struct {
960	// GroupLicense: A group license for a product approved for use in the
961	// enterprise.
962	GroupLicense []*GroupLicense `json:"groupLicense,omitempty"`
963
964	// Kind: Identifies what kind of resource this is. Value: the fixed
965	// string "androidenterprise#groupLicensesListResponse".
966	Kind string `json:"kind,omitempty"`
967
968	// ServerResponse contains the HTTP response code and headers from the
969	// server.
970	googleapi.ServerResponse `json:"-"`
971
972	// ForceSendFields is a list of field names (e.g. "GroupLicense") to
973	// unconditionally include in API requests. By default, fields with
974	// empty values are omitted from API requests. However, any non-pointer,
975	// non-interface field appearing in ForceSendFields will be sent to the
976	// server regardless of whether the field is empty or not. This may be
977	// used to include empty fields in Patch requests.
978	ForceSendFields []string `json:"-"`
979}
980
981func (s *GroupLicensesListResponse) MarshalJSON() ([]byte, error) {
982	type noMethod GroupLicensesListResponse
983	raw := noMethod(*s)
984	return gensupport.MarshalJSON(raw, s.ForceSendFields)
985}
986
987// Install: The existence of an install resource indicates that an app
988// is installed on a particular device (or that an install is
989// pending).
990//
991// The API can be used to create an install resource using the update
992// method. This triggers the actual install of the app on the device. If
993// the user does not already have an entitlement for the app then an
994// attempt is made to create one. If this fails (e.g. because the app is
995// not free and there is no available license) then the creation of the
996// install fails.
997//
998// The API can also be used to update an installed app. If the update
999// method is used on an existing install then the app will be updated to
1000// the latest available version.
1001//
1002// Note that it is not possible to force the installation of a specific
1003// version of an app; the version code is read-only.
1004//
1005// If a user installs an app themselves (as permitted by the
1006// enterprise), then again an install resource and possibly an
1007// entitlement resource are automatically created.
1008//
1009// The API can also be used to delete an install resource, which
1010// triggers the removal of the app from the device. Note that deleting
1011// an install does not automatically remove the corresponding
1012// entitlement, even if there are no remaining installs. The install
1013// resource will also be deleted if the user uninstalls the app
1014// themselves.
1015type Install struct {
1016	// InstallState: Install state. The state "installPending" means that an
1017	// install request has recently been made and download to the device is
1018	// in progress. The state "installed" means that the app has been
1019	// installed. This field is read-only.
1020	InstallState string `json:"installState,omitempty"`
1021
1022	// Kind: Identifies what kind of resource this is. Value: the fixed
1023	// string "androidenterprise#install".
1024	Kind string `json:"kind,omitempty"`
1025
1026	// ProductId: The ID of the product that the install is for, e.g.
1027	// "app:com.google.android.gm".
1028	ProductId string `json:"productId,omitempty"`
1029
1030	// VersionCode: The version of the installed product. Guaranteed to be
1031	// set only if the install state is "installed".
1032	VersionCode int64 `json:"versionCode,omitempty"`
1033
1034	// ServerResponse contains the HTTP response code and headers from the
1035	// server.
1036	googleapi.ServerResponse `json:"-"`
1037
1038	// ForceSendFields is a list of field names (e.g. "InstallState") to
1039	// unconditionally include in API requests. By default, fields with
1040	// empty values are omitted from API requests. However, any non-pointer,
1041	// non-interface field appearing in ForceSendFields will be sent to the
1042	// server regardless of whether the field is empty or not. This may be
1043	// used to include empty fields in Patch requests.
1044	ForceSendFields []string `json:"-"`
1045}
1046
1047func (s *Install) MarshalJSON() ([]byte, error) {
1048	type noMethod Install
1049	raw := noMethod(*s)
1050	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1051}
1052
1053// InstallsListResponse: The install resources for the device.
1054type InstallsListResponse struct {
1055	// Install: An installation of an app for a user on a specific device.
1056	// The existence of an install implies that the user must have an
1057	// entitlement to the app.
1058	Install []*Install `json:"install,omitempty"`
1059
1060	// Kind: Identifies what kind of resource this is. Value: the fixed
1061	// string "androidenterprise#installsListResponse".
1062	Kind string `json:"kind,omitempty"`
1063
1064	// ServerResponse contains the HTTP response code and headers from the
1065	// server.
1066	googleapi.ServerResponse `json:"-"`
1067
1068	// ForceSendFields is a list of field names (e.g. "Install") to
1069	// unconditionally include in API requests. By default, fields with
1070	// empty values are omitted from API requests. However, any non-pointer,
1071	// non-interface field appearing in ForceSendFields will be sent to the
1072	// server regardless of whether the field is empty or not. This may be
1073	// used to include empty fields in Patch requests.
1074	ForceSendFields []string `json:"-"`
1075}
1076
1077func (s *InstallsListResponse) MarshalJSON() ([]byte, error) {
1078	type noMethod InstallsListResponse
1079	raw := noMethod(*s)
1080	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1081}
1082
1083// LocalizedText: A localized string with its locale.
1084type LocalizedText struct {
1085	// Locale: The BCP47 tag for a locale. (e.g. "en-US", "de").
1086	Locale string `json:"locale,omitempty"`
1087
1088	// Text: The text localized in the associated locale.
1089	Text string `json:"text,omitempty"`
1090
1091	// ForceSendFields is a list of field names (e.g. "Locale") to
1092	// unconditionally include in API requests. By default, fields with
1093	// empty values are omitted from API requests. However, any non-pointer,
1094	// non-interface field appearing in ForceSendFields will be sent to the
1095	// server regardless of whether the field is empty or not. This may be
1096	// used to include empty fields in Patch requests.
1097	ForceSendFields []string `json:"-"`
1098}
1099
1100func (s *LocalizedText) MarshalJSON() ([]byte, error) {
1101	type noMethod LocalizedText
1102	raw := noMethod(*s)
1103	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1104}
1105
1106// Permission: A permission represents some extra capability, to be
1107// granted to an Android app, which requires explicit consent. An
1108// enterprise admin must consent to these permissions on behalf of their
1109// users before an entitlement for the app can be created.
1110//
1111// The permissions collection is read-only. The information provided for
1112// each permission (localized name and description) is intended to be
1113// used in the EMM user interface when obtaining consent from the
1114// enterprise.
1115type Permission struct {
1116	// Description: A longer description of the permissions giving more
1117	// details of what it affects.
1118	Description string `json:"description,omitempty"`
1119
1120	// Kind: Identifies what kind of resource this is. Value: the fixed
1121	// string "androidenterprise#permission".
1122	Kind string `json:"kind,omitempty"`
1123
1124	// Name: The name of the permission.
1125	Name string `json:"name,omitempty"`
1126
1127	// PermissionId: An opaque string uniquely identifying the permission.
1128	PermissionId string `json:"permissionId,omitempty"`
1129
1130	// ServerResponse contains the HTTP response code and headers from the
1131	// server.
1132	googleapi.ServerResponse `json:"-"`
1133
1134	// ForceSendFields is a list of field names (e.g. "Description") to
1135	// unconditionally include in API requests. By default, fields with
1136	// empty values are omitted from API requests. However, any non-pointer,
1137	// non-interface field appearing in ForceSendFields will be sent to the
1138	// server regardless of whether the field is empty or not. This may be
1139	// used to include empty fields in Patch requests.
1140	ForceSendFields []string `json:"-"`
1141}
1142
1143func (s *Permission) MarshalJSON() ([]byte, error) {
1144	type noMethod Permission
1145	raw := noMethod(*s)
1146	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1147}
1148
1149// Product: A product represents an app in the Google Play Store that is
1150// available to at least some users in the enterprise. (Some apps are
1151// restricted to a single enterprise, and no information about them is
1152// made available outside that enterprise.)
1153//
1154// The information provided for each product (localized name, icon, link
1155// to the full Google Play details page) is intended to allow a basic
1156// representation of the product within an EMM user interface.
1157type Product struct {
1158	// AppVersion: App versions currently available for this product. The
1159	// returned list contains only public versions. Alpha and beta versions
1160	// are not included.
1161	AppVersion []*AppVersion `json:"appVersion,omitempty"`
1162
1163	// AuthorName: The name of the author of the product (e.g. the app
1164	// developer).
1165	AuthorName string `json:"authorName,omitempty"`
1166
1167	// DetailsUrl: A link to the (consumer) Google Play details page for the
1168	// product.
1169	DetailsUrl string `json:"detailsUrl,omitempty"`
1170
1171	// DistributionChannel: How and to whom the package is made available.
1172	// The value publicGoogleHosted means that the package is available
1173	// through the Play Store and not restricted to a specific enterprise.
1174	// The value privateGoogleHosted means that the package is a private app
1175	// (restricted to an enterprise) but hosted by Google. The value
1176	// privateSelfHosted means that the package is a private app (restricted
1177	// to an enterprise) and is privately hosted.
1178	DistributionChannel string `json:"distributionChannel,omitempty"`
1179
1180	// IconUrl: A link to an image that can be used as an icon for the
1181	// product.
1182	IconUrl string `json:"iconUrl,omitempty"`
1183
1184	// Kind: Identifies what kind of resource this is. Value: the fixed
1185	// string "androidenterprise#product".
1186	Kind string `json:"kind,omitempty"`
1187
1188	// ProductId: A string of the form app:<package name>. For example,
1189	// app:com.google.android.gm represents the Gmail app.
1190	ProductId string `json:"productId,omitempty"`
1191
1192	// ProductPricing: Whether this product is free, free with in-app
1193	// purchases, or paid.
1194	ProductPricing string `json:"productPricing,omitempty"`
1195
1196	// RequiresContainerApp: Whether this app can only be installed on
1197	// devices using the Android for Work container app.
1198	RequiresContainerApp bool `json:"requiresContainerApp,omitempty"`
1199
1200	// Title: The name of the product.
1201	Title string `json:"title,omitempty"`
1202
1203	// WorkDetailsUrl: A link to the Google Play for Work details page for
1204	// the product, for use by an Enterprise administrator.
1205	WorkDetailsUrl string `json:"workDetailsUrl,omitempty"`
1206
1207	// ServerResponse contains the HTTP response code and headers from the
1208	// server.
1209	googleapi.ServerResponse `json:"-"`
1210
1211	// ForceSendFields is a list of field names (e.g. "AppVersion") to
1212	// unconditionally include in API requests. By default, fields with
1213	// empty values are omitted from API requests. However, any non-pointer,
1214	// non-interface field appearing in ForceSendFields will be sent to the
1215	// server regardless of whether the field is empty or not. This may be
1216	// used to include empty fields in Patch requests.
1217	ForceSendFields []string `json:"-"`
1218}
1219
1220func (s *Product) MarshalJSON() ([]byte, error) {
1221	type noMethod Product
1222	raw := noMethod(*s)
1223	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1224}
1225
1226// ProductPermission: A product permissions resource represents the set
1227// of permissions required by a specific app and whether or not they
1228// have been accepted by an enterprise admin.
1229//
1230// The API can be used to read the set of permissions, and also to
1231// update the set to indicate that permissions have been accepted.
1232type ProductPermission struct {
1233	// PermissionId: An opaque string uniquely identifying the permission.
1234	PermissionId string `json:"permissionId,omitempty"`
1235
1236	// State: Whether the permission has been accepted or not.
1237	State string `json:"state,omitempty"`
1238
1239	// ForceSendFields is a list of field names (e.g. "PermissionId") to
1240	// unconditionally include in API requests. By default, fields with
1241	// empty values are omitted from API requests. However, any non-pointer,
1242	// non-interface field appearing in ForceSendFields will be sent to the
1243	// server regardless of whether the field is empty or not. This may be
1244	// used to include empty fields in Patch requests.
1245	ForceSendFields []string `json:"-"`
1246}
1247
1248func (s *ProductPermission) MarshalJSON() ([]byte, error) {
1249	type noMethod ProductPermission
1250	raw := noMethod(*s)
1251	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1252}
1253
1254// ProductPermissions: Information about the permissions required by a
1255// specific app and whether they have been accepted by the enterprise.
1256type ProductPermissions struct {
1257	// Kind: Identifies what kind of resource this is. Value: the fixed
1258	// string "androidenterprise#productPermissions".
1259	Kind string `json:"kind,omitempty"`
1260
1261	// Permission: The permissions required by the app.
1262	Permission []*ProductPermission `json:"permission,omitempty"`
1263
1264	// ProductId: The ID of the app that the permissions relate to, e.g.
1265	// "app:com.google.android.gm".
1266	ProductId string `json:"productId,omitempty"`
1267
1268	// ServerResponse contains the HTTP response code and headers from the
1269	// server.
1270	googleapi.ServerResponse `json:"-"`
1271
1272	// ForceSendFields is a list of field names (e.g. "Kind") to
1273	// unconditionally include in API requests. By default, fields with
1274	// empty values are omitted from API requests. However, any non-pointer,
1275	// non-interface field appearing in ForceSendFields will be sent to the
1276	// server regardless of whether the field is empty or not. This may be
1277	// used to include empty fields in Patch requests.
1278	ForceSendFields []string `json:"-"`
1279}
1280
1281func (s *ProductPermissions) MarshalJSON() ([]byte, error) {
1282	type noMethod ProductPermissions
1283	raw := noMethod(*s)
1284	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1285}
1286
1287// ProductSet: A set of products.
1288type ProductSet struct {
1289	// Kind: Identifies what kind of resource this is. Value: the fixed
1290	// string "androidenterprise#productSet".
1291	Kind string `json:"kind,omitempty"`
1292
1293	// ProductId: The list of product IDs making up the set of products.
1294	ProductId []string `json:"productId,omitempty"`
1295
1296	// ServerResponse contains the HTTP response code and headers from the
1297	// server.
1298	googleapi.ServerResponse `json:"-"`
1299
1300	// ForceSendFields is a list of field names (e.g. "Kind") to
1301	// unconditionally include in API requests. By default, fields with
1302	// empty values are omitted from API requests. However, any non-pointer,
1303	// non-interface field appearing in ForceSendFields will be sent to the
1304	// server regardless of whether the field is empty or not. This may be
1305	// used to include empty fields in Patch requests.
1306	ForceSendFields []string `json:"-"`
1307}
1308
1309func (s *ProductSet) MarshalJSON() ([]byte, error) {
1310	type noMethod ProductSet
1311	raw := noMethod(*s)
1312	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1313}
1314
1315type ProductsApproveRequest struct {
1316	// ApprovalUrlInfo: The approval URL that was shown to the user. Only
1317	// the permissions shown to the user with that URL will be accepted,
1318	// which may not be the product's entire set of permissions. For
1319	// example, the URL may only display new permissions from an update
1320	// after the product was approved, or not include new permissions if the
1321	// product was updated since the URL was generated.
1322	ApprovalUrlInfo *ApprovalUrlInfo `json:"approvalUrlInfo,omitempty"`
1323
1324	// ForceSendFields is a list of field names (e.g. "ApprovalUrlInfo") to
1325	// unconditionally include in API requests. By default, fields with
1326	// empty values are omitted from API requests. However, any non-pointer,
1327	// non-interface field appearing in ForceSendFields will be sent to the
1328	// server regardless of whether the field is empty or not. This may be
1329	// used to include empty fields in Patch requests.
1330	ForceSendFields []string `json:"-"`
1331}
1332
1333func (s *ProductsApproveRequest) MarshalJSON() ([]byte, error) {
1334	type noMethod ProductsApproveRequest
1335	raw := noMethod(*s)
1336	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1337}
1338
1339type ProductsGenerateApprovalUrlResponse struct {
1340	// Url: A URL that can be rendered in an iframe to display the
1341	// permissions (if any) of a product. This URL can be used to approve
1342	// the product only once and only within 24 hours of being generated,
1343	// using the Products.approve call. If the product is currently
1344	// unapproved and has no permissions, this URL will point to an empty
1345	// page. If the product is currently approved, a URL will only be
1346	// generated if that product has added permissions since it was last
1347	// approved, and the URL will only display those new permissions that
1348	// have not yet been accepted.
1349	Url string `json:"url,omitempty"`
1350
1351	// ServerResponse contains the HTTP response code and headers from the
1352	// server.
1353	googleapi.ServerResponse `json:"-"`
1354
1355	// ForceSendFields is a list of field names (e.g. "Url") to
1356	// unconditionally include in API requests. By default, fields with
1357	// empty values are omitted from API requests. However, any non-pointer,
1358	// non-interface field appearing in ForceSendFields will be sent to the
1359	// server regardless of whether the field is empty or not. This may be
1360	// used to include empty fields in Patch requests.
1361	ForceSendFields []string `json:"-"`
1362}
1363
1364func (s *ProductsGenerateApprovalUrlResponse) MarshalJSON() ([]byte, error) {
1365	type noMethod ProductsGenerateApprovalUrlResponse
1366	raw := noMethod(*s)
1367	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1368}
1369
1370// StoreCluster: Definition of a Google Play for Work store cluster, a
1371// list of products displayed as part of a store page.
1372type StoreCluster struct {
1373	// Id: Unique ID of this cluster. Assigned by the server. Immutable once
1374	// assigned.
1375	Id string `json:"id,omitempty"`
1376
1377	// Kind: Identifies what kind of resource this is. Value: the fixed
1378	// string "androidenterprise#storeCluster".
1379	Kind string `json:"kind,omitempty"`
1380
1381	// Name: Ordered list of localized strings giving the name of this page.
1382	// The text displayed is the one that best matches the user locale, or
1383	// the first entry if there is no good match. There needs to be at least
1384	// one entry.
1385	Name []*LocalizedText `json:"name,omitempty"`
1386
1387	// OrderInPage: String (US-ASCII only) used to determine order of this
1388	// cluster within the parent page's elements. Page elements are sorted
1389	// in lexicographic order of this field. Duplicated values are allowed,
1390	// but ordering between elements with duplicate order is undefined.
1391	//
1392	// The value of this field is never visible to a user, it is used solely
1393	// for the purpose of defining an ordering. Maximum length is 20
1394	// characters.
1395	OrderInPage string `json:"orderInPage,omitempty"`
1396
1397	// ProductId: List of products in the order they are displayed in the
1398	// cluster. There should not be duplicates within a cluster.
1399	ProductId []string `json:"productId,omitempty"`
1400
1401	// ServerResponse contains the HTTP response code and headers from the
1402	// server.
1403	googleapi.ServerResponse `json:"-"`
1404
1405	// ForceSendFields is a list of field names (e.g. "Id") to
1406	// unconditionally include in API requests. By default, fields with
1407	// empty values are omitted from API requests. However, any non-pointer,
1408	// non-interface field appearing in ForceSendFields will be sent to the
1409	// server regardless of whether the field is empty or not. This may be
1410	// used to include empty fields in Patch requests.
1411	ForceSendFields []string `json:"-"`
1412}
1413
1414func (s *StoreCluster) MarshalJSON() ([]byte, error) {
1415	type noMethod StoreCluster
1416	raw := noMethod(*s)
1417	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1418}
1419
1420// StoreLayout: General setting for the Google Play for Work store
1421// layout, currently only specifying the page to display the first time
1422// the store is opened.
1423type StoreLayout struct {
1424	// HomepageId: The ID of the store page to be used as the homepage. The
1425	// homepage will be used as the first page shown in the Google Play for
1426	// Work store.
1427	//
1428	// If there is no homepage set, an empty store is shown. The homepage
1429	// can be unset (by not specifying it) to empty the store.
1430	//
1431	// If there exists at least one page, this field must be set to the ID
1432	// of a valid page.
1433	HomepageId string `json:"homepageId,omitempty"`
1434
1435	// Kind: Identifies what kind of resource this is. Value: the fixed
1436	// string "androidenterprise#storeLayout".
1437	Kind string `json:"kind,omitempty"`
1438
1439	// ServerResponse contains the HTTP response code and headers from the
1440	// server.
1441	googleapi.ServerResponse `json:"-"`
1442
1443	// ForceSendFields is a list of field names (e.g. "HomepageId") to
1444	// unconditionally include in API requests. By default, fields with
1445	// empty values are omitted from API requests. However, any non-pointer,
1446	// non-interface field appearing in ForceSendFields will be sent to the
1447	// server regardless of whether the field is empty or not. This may be
1448	// used to include empty fields in Patch requests.
1449	ForceSendFields []string `json:"-"`
1450}
1451
1452func (s *StoreLayout) MarshalJSON() ([]byte, error) {
1453	type noMethod StoreLayout
1454	raw := noMethod(*s)
1455	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1456}
1457
1458// StoreLayoutClustersListResponse: The store page resources for the
1459// enterprise.
1460type StoreLayoutClustersListResponse struct {
1461	// Cluster: A store cluster of an enterprise.
1462	Cluster []*StoreCluster `json:"cluster,omitempty"`
1463
1464	// Kind: Identifies what kind of resource this is. Value: the fixed
1465	// string "androidenterprise#storeLayoutClustersListResponse".
1466	Kind string `json:"kind,omitempty"`
1467
1468	// ServerResponse contains the HTTP response code and headers from the
1469	// server.
1470	googleapi.ServerResponse `json:"-"`
1471
1472	// ForceSendFields is a list of field names (e.g. "Cluster") to
1473	// unconditionally include in API requests. By default, fields with
1474	// empty values are omitted from API requests. However, any non-pointer,
1475	// non-interface field appearing in ForceSendFields will be sent to the
1476	// server regardless of whether the field is empty or not. This may be
1477	// used to include empty fields in Patch requests.
1478	ForceSendFields []string `json:"-"`
1479}
1480
1481func (s *StoreLayoutClustersListResponse) MarshalJSON() ([]byte, error) {
1482	type noMethod StoreLayoutClustersListResponse
1483	raw := noMethod(*s)
1484	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1485}
1486
1487// StoreLayoutPagesListResponse: The store page resources for the
1488// enterprise.
1489type StoreLayoutPagesListResponse struct {
1490	// Kind: Identifies what kind of resource this is. Value: the fixed
1491	// string "androidenterprise#storeLayoutPagesListResponse".
1492	Kind string `json:"kind,omitempty"`
1493
1494	// Page: A store page of an enterprise.
1495	Page []*StorePage `json:"page,omitempty"`
1496
1497	// ServerResponse contains the HTTP response code and headers from the
1498	// server.
1499	googleapi.ServerResponse `json:"-"`
1500
1501	// ForceSendFields is a list of field names (e.g. "Kind") to
1502	// unconditionally include in API requests. By default, fields with
1503	// empty values are omitted from API requests. However, any non-pointer,
1504	// non-interface field appearing in ForceSendFields will be sent to the
1505	// server regardless of whether the field is empty or not. This may be
1506	// used to include empty fields in Patch requests.
1507	ForceSendFields []string `json:"-"`
1508}
1509
1510func (s *StoreLayoutPagesListResponse) MarshalJSON() ([]byte, error) {
1511	type noMethod StoreLayoutPagesListResponse
1512	raw := noMethod(*s)
1513	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1514}
1515
1516// StorePage: Definition of a Google Play for Work store page, made of a
1517// localized name and links to other pages. A page also contains
1518// clusters defined as a subcollection.
1519type StorePage struct {
1520	// Id: Unique ID of this page. Assigned by the server. Immutable once
1521	// assigned.
1522	Id string `json:"id,omitempty"`
1523
1524	// Kind: Identifies what kind of resource this is. Value: the fixed
1525	// string "androidenterprise#storePage".
1526	Kind string `json:"kind,omitempty"`
1527
1528	// Link: Ordered list of pages a user should be able to reach from this
1529	// page. The pages must exist, must not be this page, and once a link is
1530	// created the page linked to cannot be deleted until all links to it
1531	// are removed. It is recommended that the basic pages are created
1532	// first, before adding the links between pages.
1533	//
1534	// No attempt is made to verify that all pages are reachable from the
1535	// homepage.
1536	Link []string `json:"link,omitempty"`
1537
1538	// Name: Ordered list of localized strings giving the name of this page.
1539	// The text displayed is the one that best matches the user locale, or
1540	// the first entry if there is no good match. There needs to be at least
1541	// one entry.
1542	Name []*LocalizedText `json:"name,omitempty"`
1543
1544	// ServerResponse contains the HTTP response code and headers from the
1545	// server.
1546	googleapi.ServerResponse `json:"-"`
1547
1548	// ForceSendFields is a list of field names (e.g. "Id") to
1549	// unconditionally include in API requests. By default, fields with
1550	// empty values are omitted from API requests. However, any non-pointer,
1551	// non-interface field appearing in ForceSendFields will be sent to the
1552	// server regardless of whether the field is empty or not. This may be
1553	// used to include empty fields in Patch requests.
1554	ForceSendFields []string `json:"-"`
1555}
1556
1557func (s *StorePage) MarshalJSON() ([]byte, error) {
1558	type noMethod StorePage
1559	raw := noMethod(*s)
1560	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1561}
1562
1563// User: A user resource represents an individual user within the
1564// enterprise's domain.
1565//
1566// Note that each user is associated with a Google account based on the
1567// user's corporate email address (which must be in one of the
1568// enterprise's domains). As part of installing the EMM's DPC app to
1569// manage a device the Google account must be provisioned to the device,
1570// and so the user resource must be created before that. This can be
1571// done using the Google Admin SDK Directory API.
1572//
1573// The ID for a user is an opaque string. It can be retrieved using the
1574// list method queried by the user's primary email address.
1575type User struct {
1576	// Id: The unique ID for the user.
1577	Id string `json:"id,omitempty"`
1578
1579	// Kind: Identifies what kind of resource this is. Value: the fixed
1580	// string "androidenterprise#user".
1581	Kind string `json:"kind,omitempty"`
1582
1583	// PrimaryEmail: The user's primary email, e.g. "jsmith@example.com".
1584	// Will always be set for Google managed users and not set for EMM
1585	// managed users.
1586	PrimaryEmail string `json:"primaryEmail,omitempty"`
1587
1588	// ServerResponse contains the HTTP response code and headers from the
1589	// server.
1590	googleapi.ServerResponse `json:"-"`
1591
1592	// ForceSendFields is a list of field names (e.g. "Id") to
1593	// unconditionally include in API requests. By default, fields with
1594	// empty values are omitted from API requests. However, any non-pointer,
1595	// non-interface field appearing in ForceSendFields will be sent to the
1596	// server regardless of whether the field is empty or not. This may be
1597	// used to include empty fields in Patch requests.
1598	ForceSendFields []string `json:"-"`
1599}
1600
1601func (s *User) MarshalJSON() ([]byte, error) {
1602	type noMethod User
1603	raw := noMethod(*s)
1604	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1605}
1606
1607// UserToken: A UserToken is used by a user when setting up a managed
1608// device or profile with their work account on a device. When the user
1609// enters their email address and token (activation code) the
1610// appropriate EMM app can be automatically downloaded.
1611type UserToken struct {
1612	// Kind: Identifies what kind of resource this is. Value: the fixed
1613	// string "androidenterprise#userToken".
1614	Kind string `json:"kind,omitempty"`
1615
1616	// Token: The token (activation code) to be entered by the user. This
1617	// consists of a sequence of decimal digits. Note that the leading digit
1618	// may be 0.
1619	Token string `json:"token,omitempty"`
1620
1621	// UserId: The unique ID for the user.
1622	UserId string `json:"userId,omitempty"`
1623
1624	// ServerResponse contains the HTTP response code and headers from the
1625	// server.
1626	googleapi.ServerResponse `json:"-"`
1627
1628	// ForceSendFields is a list of field names (e.g. "Kind") to
1629	// unconditionally include in API requests. By default, fields with
1630	// empty values are omitted from API requests. However, any non-pointer,
1631	// non-interface field appearing in ForceSendFields will be sent to the
1632	// server regardless of whether the field is empty or not. This may be
1633	// used to include empty fields in Patch requests.
1634	ForceSendFields []string `json:"-"`
1635}
1636
1637func (s *UserToken) MarshalJSON() ([]byte, error) {
1638	type noMethod UserToken
1639	raw := noMethod(*s)
1640	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1641}
1642
1643// UsersListResponse: The matching user resources.
1644type UsersListResponse struct {
1645	// Kind: Identifies what kind of resource this is. Value: the fixed
1646	// string "androidenterprise#usersListResponse".
1647	Kind string `json:"kind,omitempty"`
1648
1649	// User: A user of an enterprise.
1650	User []*User `json:"user,omitempty"`
1651
1652	// ServerResponse contains the HTTP response code and headers from the
1653	// server.
1654	googleapi.ServerResponse `json:"-"`
1655
1656	// ForceSendFields is a list of field names (e.g. "Kind") to
1657	// unconditionally include in API requests. By default, fields with
1658	// empty values are omitted from API requests. However, any non-pointer,
1659	// non-interface field appearing in ForceSendFields will be sent to the
1660	// server regardless of whether the field is empty or not. This may be
1661	// used to include empty fields in Patch requests.
1662	ForceSendFields []string `json:"-"`
1663}
1664
1665func (s *UsersListResponse) MarshalJSON() ([]byte, error) {
1666	type noMethod UsersListResponse
1667	raw := noMethod(*s)
1668	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1669}
1670
1671// method id "androidenterprise.collections.delete":
1672
1673type CollectionsDeleteCall struct {
1674	s            *Service
1675	enterpriseId string
1676	collectionId string
1677	urlParams_   gensupport.URLParams
1678	ctx_         context.Context
1679}
1680
1681// Delete: Deletes a collection.
1682func (r *CollectionsService) Delete(enterpriseId string, collectionId string) *CollectionsDeleteCall {
1683	c := &CollectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1684	c.enterpriseId = enterpriseId
1685	c.collectionId = collectionId
1686	return c
1687}
1688
1689// Fields allows partial responses to be retrieved. See
1690// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1691// for more information.
1692func (c *CollectionsDeleteCall) Fields(s ...googleapi.Field) *CollectionsDeleteCall {
1693	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1694	return c
1695}
1696
1697// Context sets the context to be used in this call's Do method. Any
1698// pending HTTP request will be aborted if the provided context is
1699// canceled.
1700func (c *CollectionsDeleteCall) Context(ctx context.Context) *CollectionsDeleteCall {
1701	c.ctx_ = ctx
1702	return c
1703}
1704
1705func (c *CollectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
1706	var body io.Reader = nil
1707	c.urlParams_.Set("alt", alt)
1708	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
1709	urls += "?" + c.urlParams_.Encode()
1710	req, _ := http.NewRequest("DELETE", urls, body)
1711	googleapi.Expand(req.URL, map[string]string{
1712		"enterpriseId": c.enterpriseId,
1713		"collectionId": c.collectionId,
1714	})
1715	req.Header.Set("User-Agent", c.s.userAgent())
1716	if c.ctx_ != nil {
1717		return ctxhttp.Do(c.ctx_, c.s.client, req)
1718	}
1719	return c.s.client.Do(req)
1720}
1721
1722// Do executes the "androidenterprise.collections.delete" call.
1723func (c *CollectionsDeleteCall) Do(opts ...googleapi.CallOption) error {
1724	gensupport.SetOptions(c.urlParams_, opts...)
1725	res, err := c.doRequest("json")
1726	if err != nil {
1727		return err
1728	}
1729	defer googleapi.CloseBody(res)
1730	if err := googleapi.CheckResponse(res); err != nil {
1731		return err
1732	}
1733	return nil
1734	// {
1735	//   "description": "Deletes a collection.",
1736	//   "httpMethod": "DELETE",
1737	//   "id": "androidenterprise.collections.delete",
1738	//   "parameterOrder": [
1739	//     "enterpriseId",
1740	//     "collectionId"
1741	//   ],
1742	//   "parameters": {
1743	//     "collectionId": {
1744	//       "description": "The ID of the collection.",
1745	//       "location": "path",
1746	//       "required": true,
1747	//       "type": "string"
1748	//     },
1749	//     "enterpriseId": {
1750	//       "description": "The ID of the enterprise.",
1751	//       "location": "path",
1752	//       "required": true,
1753	//       "type": "string"
1754	//     }
1755	//   },
1756	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}",
1757	//   "scopes": [
1758	//     "https://www.googleapis.com/auth/androidenterprise"
1759	//   ]
1760	// }
1761
1762}
1763
1764// method id "androidenterprise.collections.get":
1765
1766type CollectionsGetCall struct {
1767	s            *Service
1768	enterpriseId string
1769	collectionId string
1770	urlParams_   gensupport.URLParams
1771	ifNoneMatch_ string
1772	ctx_         context.Context
1773}
1774
1775// Get: Retrieves the details of a collection.
1776func (r *CollectionsService) Get(enterpriseId string, collectionId string) *CollectionsGetCall {
1777	c := &CollectionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1778	c.enterpriseId = enterpriseId
1779	c.collectionId = collectionId
1780	return c
1781}
1782
1783// Fields allows partial responses to be retrieved. See
1784// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1785// for more information.
1786func (c *CollectionsGetCall) Fields(s ...googleapi.Field) *CollectionsGetCall {
1787	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1788	return c
1789}
1790
1791// IfNoneMatch sets the optional parameter which makes the operation
1792// fail if the object's ETag matches the given value. This is useful for
1793// getting updates only after the object has changed since the last
1794// request. Use googleapi.IsNotModified to check whether the response
1795// error from Do is the result of In-None-Match.
1796func (c *CollectionsGetCall) IfNoneMatch(entityTag string) *CollectionsGetCall {
1797	c.ifNoneMatch_ = entityTag
1798	return c
1799}
1800
1801// Context sets the context to be used in this call's Do method. Any
1802// pending HTTP request will be aborted if the provided context is
1803// canceled.
1804func (c *CollectionsGetCall) Context(ctx context.Context) *CollectionsGetCall {
1805	c.ctx_ = ctx
1806	return c
1807}
1808
1809func (c *CollectionsGetCall) doRequest(alt string) (*http.Response, error) {
1810	var body io.Reader = nil
1811	c.urlParams_.Set("alt", alt)
1812	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
1813	urls += "?" + c.urlParams_.Encode()
1814	req, _ := http.NewRequest("GET", urls, body)
1815	googleapi.Expand(req.URL, map[string]string{
1816		"enterpriseId": c.enterpriseId,
1817		"collectionId": c.collectionId,
1818	})
1819	req.Header.Set("User-Agent", c.s.userAgent())
1820	if c.ifNoneMatch_ != "" {
1821		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1822	}
1823	if c.ctx_ != nil {
1824		return ctxhttp.Do(c.ctx_, c.s.client, req)
1825	}
1826	return c.s.client.Do(req)
1827}
1828
1829// Do executes the "androidenterprise.collections.get" call.
1830// Exactly one of *Collection or error will be non-nil. Any non-2xx
1831// status code is an error. Response headers are in either
1832// *Collection.ServerResponse.Header or (if a response was returned at
1833// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1834// to check whether the returned error was because
1835// http.StatusNotModified was returned.
1836func (c *CollectionsGetCall) Do(opts ...googleapi.CallOption) (*Collection, error) {
1837	gensupport.SetOptions(c.urlParams_, opts...)
1838	res, err := c.doRequest("json")
1839	if res != nil && res.StatusCode == http.StatusNotModified {
1840		if res.Body != nil {
1841			res.Body.Close()
1842		}
1843		return nil, &googleapi.Error{
1844			Code:   res.StatusCode,
1845			Header: res.Header,
1846		}
1847	}
1848	if err != nil {
1849		return nil, err
1850	}
1851	defer googleapi.CloseBody(res)
1852	if err := googleapi.CheckResponse(res); err != nil {
1853		return nil, err
1854	}
1855	ret := &Collection{
1856		ServerResponse: googleapi.ServerResponse{
1857			Header:         res.Header,
1858			HTTPStatusCode: res.StatusCode,
1859		},
1860	}
1861	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1862		return nil, err
1863	}
1864	return ret, nil
1865	// {
1866	//   "description": "Retrieves the details of a collection.",
1867	//   "httpMethod": "GET",
1868	//   "id": "androidenterprise.collections.get",
1869	//   "parameterOrder": [
1870	//     "enterpriseId",
1871	//     "collectionId"
1872	//   ],
1873	//   "parameters": {
1874	//     "collectionId": {
1875	//       "description": "The ID of the collection.",
1876	//       "location": "path",
1877	//       "required": true,
1878	//       "type": "string"
1879	//     },
1880	//     "enterpriseId": {
1881	//       "description": "The ID of the enterprise.",
1882	//       "location": "path",
1883	//       "required": true,
1884	//       "type": "string"
1885	//     }
1886	//   },
1887	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}",
1888	//   "response": {
1889	//     "$ref": "Collection"
1890	//   },
1891	//   "scopes": [
1892	//     "https://www.googleapis.com/auth/androidenterprise"
1893	//   ]
1894	// }
1895
1896}
1897
1898// method id "androidenterprise.collections.insert":
1899
1900type CollectionsInsertCall struct {
1901	s            *Service
1902	enterpriseId string
1903	collection   *Collection
1904	urlParams_   gensupport.URLParams
1905	ctx_         context.Context
1906}
1907
1908// Insert: Creates a new collection.
1909func (r *CollectionsService) Insert(enterpriseId string, collection *Collection) *CollectionsInsertCall {
1910	c := &CollectionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1911	c.enterpriseId = enterpriseId
1912	c.collection = collection
1913	return c
1914}
1915
1916// Fields allows partial responses to be retrieved. See
1917// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1918// for more information.
1919func (c *CollectionsInsertCall) Fields(s ...googleapi.Field) *CollectionsInsertCall {
1920	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1921	return c
1922}
1923
1924// Context sets the context to be used in this call's Do method. Any
1925// pending HTTP request will be aborted if the provided context is
1926// canceled.
1927func (c *CollectionsInsertCall) Context(ctx context.Context) *CollectionsInsertCall {
1928	c.ctx_ = ctx
1929	return c
1930}
1931
1932func (c *CollectionsInsertCall) doRequest(alt string) (*http.Response, error) {
1933	var body io.Reader = nil
1934	body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection)
1935	if err != nil {
1936		return nil, err
1937	}
1938	ctype := "application/json"
1939	c.urlParams_.Set("alt", alt)
1940	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections")
1941	urls += "?" + c.urlParams_.Encode()
1942	req, _ := http.NewRequest("POST", urls, body)
1943	googleapi.Expand(req.URL, map[string]string{
1944		"enterpriseId": c.enterpriseId,
1945	})
1946	req.Header.Set("Content-Type", ctype)
1947	req.Header.Set("User-Agent", c.s.userAgent())
1948	if c.ctx_ != nil {
1949		return ctxhttp.Do(c.ctx_, c.s.client, req)
1950	}
1951	return c.s.client.Do(req)
1952}
1953
1954// Do executes the "androidenterprise.collections.insert" call.
1955// Exactly one of *Collection or error will be non-nil. Any non-2xx
1956// status code is an error. Response headers are in either
1957// *Collection.ServerResponse.Header or (if a response was returned at
1958// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1959// to check whether the returned error was because
1960// http.StatusNotModified was returned.
1961func (c *CollectionsInsertCall) Do(opts ...googleapi.CallOption) (*Collection, error) {
1962	gensupport.SetOptions(c.urlParams_, opts...)
1963	res, err := c.doRequest("json")
1964	if res != nil && res.StatusCode == http.StatusNotModified {
1965		if res.Body != nil {
1966			res.Body.Close()
1967		}
1968		return nil, &googleapi.Error{
1969			Code:   res.StatusCode,
1970			Header: res.Header,
1971		}
1972	}
1973	if err != nil {
1974		return nil, err
1975	}
1976	defer googleapi.CloseBody(res)
1977	if err := googleapi.CheckResponse(res); err != nil {
1978		return nil, err
1979	}
1980	ret := &Collection{
1981		ServerResponse: googleapi.ServerResponse{
1982			Header:         res.Header,
1983			HTTPStatusCode: res.StatusCode,
1984		},
1985	}
1986	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1987		return nil, err
1988	}
1989	return ret, nil
1990	// {
1991	//   "description": "Creates a new collection.",
1992	//   "httpMethod": "POST",
1993	//   "id": "androidenterprise.collections.insert",
1994	//   "parameterOrder": [
1995	//     "enterpriseId"
1996	//   ],
1997	//   "parameters": {
1998	//     "enterpriseId": {
1999	//       "description": "The ID of the enterprise.",
2000	//       "location": "path",
2001	//       "required": true,
2002	//       "type": "string"
2003	//     }
2004	//   },
2005	//   "path": "enterprises/{enterpriseId}/collections",
2006	//   "request": {
2007	//     "$ref": "Collection"
2008	//   },
2009	//   "response": {
2010	//     "$ref": "Collection"
2011	//   },
2012	//   "scopes": [
2013	//     "https://www.googleapis.com/auth/androidenterprise"
2014	//   ]
2015	// }
2016
2017}
2018
2019// method id "androidenterprise.collections.list":
2020
2021type CollectionsListCall struct {
2022	s            *Service
2023	enterpriseId string
2024	urlParams_   gensupport.URLParams
2025	ifNoneMatch_ string
2026	ctx_         context.Context
2027}
2028
2029// List: Retrieves the IDs of all the collections for an enterprise.
2030func (r *CollectionsService) List(enterpriseId string) *CollectionsListCall {
2031	c := &CollectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2032	c.enterpriseId = enterpriseId
2033	return c
2034}
2035
2036// Fields allows partial responses to be retrieved. See
2037// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2038// for more information.
2039func (c *CollectionsListCall) Fields(s ...googleapi.Field) *CollectionsListCall {
2040	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2041	return c
2042}
2043
2044// IfNoneMatch sets the optional parameter which makes the operation
2045// fail if the object's ETag matches the given value. This is useful for
2046// getting updates only after the object has changed since the last
2047// request. Use googleapi.IsNotModified to check whether the response
2048// error from Do is the result of In-None-Match.
2049func (c *CollectionsListCall) IfNoneMatch(entityTag string) *CollectionsListCall {
2050	c.ifNoneMatch_ = entityTag
2051	return c
2052}
2053
2054// Context sets the context to be used in this call's Do method. Any
2055// pending HTTP request will be aborted if the provided context is
2056// canceled.
2057func (c *CollectionsListCall) Context(ctx context.Context) *CollectionsListCall {
2058	c.ctx_ = ctx
2059	return c
2060}
2061
2062func (c *CollectionsListCall) doRequest(alt string) (*http.Response, error) {
2063	var body io.Reader = nil
2064	c.urlParams_.Set("alt", alt)
2065	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections")
2066	urls += "?" + c.urlParams_.Encode()
2067	req, _ := http.NewRequest("GET", urls, body)
2068	googleapi.Expand(req.URL, map[string]string{
2069		"enterpriseId": c.enterpriseId,
2070	})
2071	req.Header.Set("User-Agent", c.s.userAgent())
2072	if c.ifNoneMatch_ != "" {
2073		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2074	}
2075	if c.ctx_ != nil {
2076		return ctxhttp.Do(c.ctx_, c.s.client, req)
2077	}
2078	return c.s.client.Do(req)
2079}
2080
2081// Do executes the "androidenterprise.collections.list" call.
2082// Exactly one of *CollectionsListResponse or error will be non-nil. Any
2083// non-2xx status code is an error. Response headers are in either
2084// *CollectionsListResponse.ServerResponse.Header or (if a response was
2085// returned at all) in error.(*googleapi.Error).Header. Use
2086// googleapi.IsNotModified to check whether the returned error was
2087// because http.StatusNotModified was returned.
2088func (c *CollectionsListCall) Do(opts ...googleapi.CallOption) (*CollectionsListResponse, error) {
2089	gensupport.SetOptions(c.urlParams_, opts...)
2090	res, err := c.doRequest("json")
2091	if res != nil && res.StatusCode == http.StatusNotModified {
2092		if res.Body != nil {
2093			res.Body.Close()
2094		}
2095		return nil, &googleapi.Error{
2096			Code:   res.StatusCode,
2097			Header: res.Header,
2098		}
2099	}
2100	if err != nil {
2101		return nil, err
2102	}
2103	defer googleapi.CloseBody(res)
2104	if err := googleapi.CheckResponse(res); err != nil {
2105		return nil, err
2106	}
2107	ret := &CollectionsListResponse{
2108		ServerResponse: googleapi.ServerResponse{
2109			Header:         res.Header,
2110			HTTPStatusCode: res.StatusCode,
2111		},
2112	}
2113	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2114		return nil, err
2115	}
2116	return ret, nil
2117	// {
2118	//   "description": "Retrieves the IDs of all the collections for an enterprise.",
2119	//   "httpMethod": "GET",
2120	//   "id": "androidenterprise.collections.list",
2121	//   "parameterOrder": [
2122	//     "enterpriseId"
2123	//   ],
2124	//   "parameters": {
2125	//     "enterpriseId": {
2126	//       "description": "The ID of the enterprise.",
2127	//       "location": "path",
2128	//       "required": true,
2129	//       "type": "string"
2130	//     }
2131	//   },
2132	//   "path": "enterprises/{enterpriseId}/collections",
2133	//   "response": {
2134	//     "$ref": "CollectionsListResponse"
2135	//   },
2136	//   "scopes": [
2137	//     "https://www.googleapis.com/auth/androidenterprise"
2138	//   ]
2139	// }
2140
2141}
2142
2143// method id "androidenterprise.collections.patch":
2144
2145type CollectionsPatchCall struct {
2146	s            *Service
2147	enterpriseId string
2148	collectionId string
2149	collection   *Collection
2150	urlParams_   gensupport.URLParams
2151	ctx_         context.Context
2152}
2153
2154// Patch: Updates a collection. This method supports patch semantics.
2155func (r *CollectionsService) Patch(enterpriseId string, collectionId string, collection *Collection) *CollectionsPatchCall {
2156	c := &CollectionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2157	c.enterpriseId = enterpriseId
2158	c.collectionId = collectionId
2159	c.collection = collection
2160	return c
2161}
2162
2163// Fields allows partial responses to be retrieved. See
2164// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2165// for more information.
2166func (c *CollectionsPatchCall) Fields(s ...googleapi.Field) *CollectionsPatchCall {
2167	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2168	return c
2169}
2170
2171// Context sets the context to be used in this call's Do method. Any
2172// pending HTTP request will be aborted if the provided context is
2173// canceled.
2174func (c *CollectionsPatchCall) Context(ctx context.Context) *CollectionsPatchCall {
2175	c.ctx_ = ctx
2176	return c
2177}
2178
2179func (c *CollectionsPatchCall) doRequest(alt string) (*http.Response, error) {
2180	var body io.Reader = nil
2181	body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection)
2182	if err != nil {
2183		return nil, err
2184	}
2185	ctype := "application/json"
2186	c.urlParams_.Set("alt", alt)
2187	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
2188	urls += "?" + c.urlParams_.Encode()
2189	req, _ := http.NewRequest("PATCH", urls, body)
2190	googleapi.Expand(req.URL, map[string]string{
2191		"enterpriseId": c.enterpriseId,
2192		"collectionId": c.collectionId,
2193	})
2194	req.Header.Set("Content-Type", ctype)
2195	req.Header.Set("User-Agent", c.s.userAgent())
2196	if c.ctx_ != nil {
2197		return ctxhttp.Do(c.ctx_, c.s.client, req)
2198	}
2199	return c.s.client.Do(req)
2200}
2201
2202// Do executes the "androidenterprise.collections.patch" call.
2203// Exactly one of *Collection or error will be non-nil. Any non-2xx
2204// status code is an error. Response headers are in either
2205// *Collection.ServerResponse.Header or (if a response was returned at
2206// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2207// to check whether the returned error was because
2208// http.StatusNotModified was returned.
2209func (c *CollectionsPatchCall) Do(opts ...googleapi.CallOption) (*Collection, error) {
2210	gensupport.SetOptions(c.urlParams_, opts...)
2211	res, err := c.doRequest("json")
2212	if res != nil && res.StatusCode == http.StatusNotModified {
2213		if res.Body != nil {
2214			res.Body.Close()
2215		}
2216		return nil, &googleapi.Error{
2217			Code:   res.StatusCode,
2218			Header: res.Header,
2219		}
2220	}
2221	if err != nil {
2222		return nil, err
2223	}
2224	defer googleapi.CloseBody(res)
2225	if err := googleapi.CheckResponse(res); err != nil {
2226		return nil, err
2227	}
2228	ret := &Collection{
2229		ServerResponse: googleapi.ServerResponse{
2230			Header:         res.Header,
2231			HTTPStatusCode: res.StatusCode,
2232		},
2233	}
2234	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2235		return nil, err
2236	}
2237	return ret, nil
2238	// {
2239	//   "description": "Updates a collection. This method supports patch semantics.",
2240	//   "httpMethod": "PATCH",
2241	//   "id": "androidenterprise.collections.patch",
2242	//   "parameterOrder": [
2243	//     "enterpriseId",
2244	//     "collectionId"
2245	//   ],
2246	//   "parameters": {
2247	//     "collectionId": {
2248	//       "description": "The ID of the collection.",
2249	//       "location": "path",
2250	//       "required": true,
2251	//       "type": "string"
2252	//     },
2253	//     "enterpriseId": {
2254	//       "description": "The ID of the enterprise.",
2255	//       "location": "path",
2256	//       "required": true,
2257	//       "type": "string"
2258	//     }
2259	//   },
2260	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}",
2261	//   "request": {
2262	//     "$ref": "Collection"
2263	//   },
2264	//   "response": {
2265	//     "$ref": "Collection"
2266	//   },
2267	//   "scopes": [
2268	//     "https://www.googleapis.com/auth/androidenterprise"
2269	//   ]
2270	// }
2271
2272}
2273
2274// method id "androidenterprise.collections.update":
2275
2276type CollectionsUpdateCall struct {
2277	s            *Service
2278	enterpriseId string
2279	collectionId string
2280	collection   *Collection
2281	urlParams_   gensupport.URLParams
2282	ctx_         context.Context
2283}
2284
2285// Update: Updates a collection.
2286func (r *CollectionsService) Update(enterpriseId string, collectionId string, collection *Collection) *CollectionsUpdateCall {
2287	c := &CollectionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2288	c.enterpriseId = enterpriseId
2289	c.collectionId = collectionId
2290	c.collection = collection
2291	return c
2292}
2293
2294// Fields allows partial responses to be retrieved. See
2295// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2296// for more information.
2297func (c *CollectionsUpdateCall) Fields(s ...googleapi.Field) *CollectionsUpdateCall {
2298	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2299	return c
2300}
2301
2302// Context sets the context to be used in this call's Do method. Any
2303// pending HTTP request will be aborted if the provided context is
2304// canceled.
2305func (c *CollectionsUpdateCall) Context(ctx context.Context) *CollectionsUpdateCall {
2306	c.ctx_ = ctx
2307	return c
2308}
2309
2310func (c *CollectionsUpdateCall) doRequest(alt string) (*http.Response, error) {
2311	var body io.Reader = nil
2312	body, err := googleapi.WithoutDataWrapper.JSONReader(c.collection)
2313	if err != nil {
2314		return nil, err
2315	}
2316	ctype := "application/json"
2317	c.urlParams_.Set("alt", alt)
2318	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}")
2319	urls += "?" + c.urlParams_.Encode()
2320	req, _ := http.NewRequest("PUT", urls, body)
2321	googleapi.Expand(req.URL, map[string]string{
2322		"enterpriseId": c.enterpriseId,
2323		"collectionId": c.collectionId,
2324	})
2325	req.Header.Set("Content-Type", ctype)
2326	req.Header.Set("User-Agent", c.s.userAgent())
2327	if c.ctx_ != nil {
2328		return ctxhttp.Do(c.ctx_, c.s.client, req)
2329	}
2330	return c.s.client.Do(req)
2331}
2332
2333// Do executes the "androidenterprise.collections.update" call.
2334// Exactly one of *Collection or error will be non-nil. Any non-2xx
2335// status code is an error. Response headers are in either
2336// *Collection.ServerResponse.Header or (if a response was returned at
2337// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2338// to check whether the returned error was because
2339// http.StatusNotModified was returned.
2340func (c *CollectionsUpdateCall) Do(opts ...googleapi.CallOption) (*Collection, error) {
2341	gensupport.SetOptions(c.urlParams_, opts...)
2342	res, err := c.doRequest("json")
2343	if res != nil && res.StatusCode == http.StatusNotModified {
2344		if res.Body != nil {
2345			res.Body.Close()
2346		}
2347		return nil, &googleapi.Error{
2348			Code:   res.StatusCode,
2349			Header: res.Header,
2350		}
2351	}
2352	if err != nil {
2353		return nil, err
2354	}
2355	defer googleapi.CloseBody(res)
2356	if err := googleapi.CheckResponse(res); err != nil {
2357		return nil, err
2358	}
2359	ret := &Collection{
2360		ServerResponse: googleapi.ServerResponse{
2361			Header:         res.Header,
2362			HTTPStatusCode: res.StatusCode,
2363		},
2364	}
2365	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2366		return nil, err
2367	}
2368	return ret, nil
2369	// {
2370	//   "description": "Updates a collection.",
2371	//   "httpMethod": "PUT",
2372	//   "id": "androidenterprise.collections.update",
2373	//   "parameterOrder": [
2374	//     "enterpriseId",
2375	//     "collectionId"
2376	//   ],
2377	//   "parameters": {
2378	//     "collectionId": {
2379	//       "description": "The ID of the collection.",
2380	//       "location": "path",
2381	//       "required": true,
2382	//       "type": "string"
2383	//     },
2384	//     "enterpriseId": {
2385	//       "description": "The ID of the enterprise.",
2386	//       "location": "path",
2387	//       "required": true,
2388	//       "type": "string"
2389	//     }
2390	//   },
2391	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}",
2392	//   "request": {
2393	//     "$ref": "Collection"
2394	//   },
2395	//   "response": {
2396	//     "$ref": "Collection"
2397	//   },
2398	//   "scopes": [
2399	//     "https://www.googleapis.com/auth/androidenterprise"
2400	//   ]
2401	// }
2402
2403}
2404
2405// method id "androidenterprise.collectionviewers.delete":
2406
2407type CollectionviewersDeleteCall struct {
2408	s            *Service
2409	enterpriseId string
2410	collectionId string
2411	userId       string
2412	urlParams_   gensupport.URLParams
2413	ctx_         context.Context
2414}
2415
2416// Delete: Removes the user from the list of those specifically allowed
2417// to see the collection. If the collection's visibility is set to
2418// viewersOnly then only such users will see the collection.
2419func (r *CollectionviewersService) Delete(enterpriseId string, collectionId string, userId string) *CollectionviewersDeleteCall {
2420	c := &CollectionviewersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2421	c.enterpriseId = enterpriseId
2422	c.collectionId = collectionId
2423	c.userId = userId
2424	return c
2425}
2426
2427// Fields allows partial responses to be retrieved. See
2428// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2429// for more information.
2430func (c *CollectionviewersDeleteCall) Fields(s ...googleapi.Field) *CollectionviewersDeleteCall {
2431	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2432	return c
2433}
2434
2435// Context sets the context to be used in this call's Do method. Any
2436// pending HTTP request will be aborted if the provided context is
2437// canceled.
2438func (c *CollectionviewersDeleteCall) Context(ctx context.Context) *CollectionviewersDeleteCall {
2439	c.ctx_ = ctx
2440	return c
2441}
2442
2443func (c *CollectionviewersDeleteCall) doRequest(alt string) (*http.Response, error) {
2444	var body io.Reader = nil
2445	c.urlParams_.Set("alt", alt)
2446	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
2447	urls += "?" + c.urlParams_.Encode()
2448	req, _ := http.NewRequest("DELETE", urls, body)
2449	googleapi.Expand(req.URL, map[string]string{
2450		"enterpriseId": c.enterpriseId,
2451		"collectionId": c.collectionId,
2452		"userId":       c.userId,
2453	})
2454	req.Header.Set("User-Agent", c.s.userAgent())
2455	if c.ctx_ != nil {
2456		return ctxhttp.Do(c.ctx_, c.s.client, req)
2457	}
2458	return c.s.client.Do(req)
2459}
2460
2461// Do executes the "androidenterprise.collectionviewers.delete" call.
2462func (c *CollectionviewersDeleteCall) Do(opts ...googleapi.CallOption) error {
2463	gensupport.SetOptions(c.urlParams_, opts...)
2464	res, err := c.doRequest("json")
2465	if err != nil {
2466		return err
2467	}
2468	defer googleapi.CloseBody(res)
2469	if err := googleapi.CheckResponse(res); err != nil {
2470		return err
2471	}
2472	return nil
2473	// {
2474	//   "description": "Removes the user from the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.",
2475	//   "httpMethod": "DELETE",
2476	//   "id": "androidenterprise.collectionviewers.delete",
2477	//   "parameterOrder": [
2478	//     "enterpriseId",
2479	//     "collectionId",
2480	//     "userId"
2481	//   ],
2482	//   "parameters": {
2483	//     "collectionId": {
2484	//       "description": "The ID of the collection.",
2485	//       "location": "path",
2486	//       "required": true,
2487	//       "type": "string"
2488	//     },
2489	//     "enterpriseId": {
2490	//       "description": "The ID of the enterprise.",
2491	//       "location": "path",
2492	//       "required": true,
2493	//       "type": "string"
2494	//     },
2495	//     "userId": {
2496	//       "description": "The ID of the user.",
2497	//       "location": "path",
2498	//       "required": true,
2499	//       "type": "string"
2500	//     }
2501	//   },
2502	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
2503	//   "scopes": [
2504	//     "https://www.googleapis.com/auth/androidenterprise"
2505	//   ]
2506	// }
2507
2508}
2509
2510// method id "androidenterprise.collectionviewers.get":
2511
2512type CollectionviewersGetCall struct {
2513	s            *Service
2514	enterpriseId string
2515	collectionId string
2516	userId       string
2517	urlParams_   gensupport.URLParams
2518	ifNoneMatch_ string
2519	ctx_         context.Context
2520}
2521
2522// Get: Retrieves the ID of the user if they have been specifically
2523// allowed to see the collection. If the collection's visibility is set
2524// to viewersOnly then only these users will see the collection.
2525func (r *CollectionviewersService) Get(enterpriseId string, collectionId string, userId string) *CollectionviewersGetCall {
2526	c := &CollectionviewersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2527	c.enterpriseId = enterpriseId
2528	c.collectionId = collectionId
2529	c.userId = userId
2530	return c
2531}
2532
2533// Fields allows partial responses to be retrieved. See
2534// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2535// for more information.
2536func (c *CollectionviewersGetCall) Fields(s ...googleapi.Field) *CollectionviewersGetCall {
2537	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2538	return c
2539}
2540
2541// IfNoneMatch sets the optional parameter which makes the operation
2542// fail if the object's ETag matches the given value. This is useful for
2543// getting updates only after the object has changed since the last
2544// request. Use googleapi.IsNotModified to check whether the response
2545// error from Do is the result of In-None-Match.
2546func (c *CollectionviewersGetCall) IfNoneMatch(entityTag string) *CollectionviewersGetCall {
2547	c.ifNoneMatch_ = entityTag
2548	return c
2549}
2550
2551// Context sets the context to be used in this call's Do method. Any
2552// pending HTTP request will be aborted if the provided context is
2553// canceled.
2554func (c *CollectionviewersGetCall) Context(ctx context.Context) *CollectionviewersGetCall {
2555	c.ctx_ = ctx
2556	return c
2557}
2558
2559func (c *CollectionviewersGetCall) doRequest(alt string) (*http.Response, error) {
2560	var body io.Reader = nil
2561	c.urlParams_.Set("alt", alt)
2562	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
2563	urls += "?" + c.urlParams_.Encode()
2564	req, _ := http.NewRequest("GET", urls, body)
2565	googleapi.Expand(req.URL, map[string]string{
2566		"enterpriseId": c.enterpriseId,
2567		"collectionId": c.collectionId,
2568		"userId":       c.userId,
2569	})
2570	req.Header.Set("User-Agent", c.s.userAgent())
2571	if c.ifNoneMatch_ != "" {
2572		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2573	}
2574	if c.ctx_ != nil {
2575		return ctxhttp.Do(c.ctx_, c.s.client, req)
2576	}
2577	return c.s.client.Do(req)
2578}
2579
2580// Do executes the "androidenterprise.collectionviewers.get" call.
2581// Exactly one of *User or error will be non-nil. Any non-2xx status
2582// code is an error. Response headers are in either
2583// *User.ServerResponse.Header or (if a response was returned at all) in
2584// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2585// whether the returned error was because http.StatusNotModified was
2586// returned.
2587func (c *CollectionviewersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
2588	gensupport.SetOptions(c.urlParams_, opts...)
2589	res, err := c.doRequest("json")
2590	if res != nil && res.StatusCode == http.StatusNotModified {
2591		if res.Body != nil {
2592			res.Body.Close()
2593		}
2594		return nil, &googleapi.Error{
2595			Code:   res.StatusCode,
2596			Header: res.Header,
2597		}
2598	}
2599	if err != nil {
2600		return nil, err
2601	}
2602	defer googleapi.CloseBody(res)
2603	if err := googleapi.CheckResponse(res); err != nil {
2604		return nil, err
2605	}
2606	ret := &User{
2607		ServerResponse: googleapi.ServerResponse{
2608			Header:         res.Header,
2609			HTTPStatusCode: res.StatusCode,
2610		},
2611	}
2612	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2613		return nil, err
2614	}
2615	return ret, nil
2616	// {
2617	//   "description": "Retrieves the ID of the user if they have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.",
2618	//   "httpMethod": "GET",
2619	//   "id": "androidenterprise.collectionviewers.get",
2620	//   "parameterOrder": [
2621	//     "enterpriseId",
2622	//     "collectionId",
2623	//     "userId"
2624	//   ],
2625	//   "parameters": {
2626	//     "collectionId": {
2627	//       "description": "The ID of the collection.",
2628	//       "location": "path",
2629	//       "required": true,
2630	//       "type": "string"
2631	//     },
2632	//     "enterpriseId": {
2633	//       "description": "The ID of the enterprise.",
2634	//       "location": "path",
2635	//       "required": true,
2636	//       "type": "string"
2637	//     },
2638	//     "userId": {
2639	//       "description": "The ID of the user.",
2640	//       "location": "path",
2641	//       "required": true,
2642	//       "type": "string"
2643	//     }
2644	//   },
2645	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
2646	//   "response": {
2647	//     "$ref": "User"
2648	//   },
2649	//   "scopes": [
2650	//     "https://www.googleapis.com/auth/androidenterprise"
2651	//   ]
2652	// }
2653
2654}
2655
2656// method id "androidenterprise.collectionviewers.list":
2657
2658type CollectionviewersListCall struct {
2659	s            *Service
2660	enterpriseId string
2661	collectionId string
2662	urlParams_   gensupport.URLParams
2663	ifNoneMatch_ string
2664	ctx_         context.Context
2665}
2666
2667// List: Retrieves the IDs of the users who have been specifically
2668// allowed to see the collection. If the collection's visibility is set
2669// to viewersOnly then only these users will see the collection.
2670func (r *CollectionviewersService) List(enterpriseId string, collectionId string) *CollectionviewersListCall {
2671	c := &CollectionviewersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2672	c.enterpriseId = enterpriseId
2673	c.collectionId = collectionId
2674	return c
2675}
2676
2677// Fields allows partial responses to be retrieved. See
2678// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2679// for more information.
2680func (c *CollectionviewersListCall) Fields(s ...googleapi.Field) *CollectionviewersListCall {
2681	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2682	return c
2683}
2684
2685// IfNoneMatch sets the optional parameter which makes the operation
2686// fail if the object's ETag matches the given value. This is useful for
2687// getting updates only after the object has changed since the last
2688// request. Use googleapi.IsNotModified to check whether the response
2689// error from Do is the result of In-None-Match.
2690func (c *CollectionviewersListCall) IfNoneMatch(entityTag string) *CollectionviewersListCall {
2691	c.ifNoneMatch_ = entityTag
2692	return c
2693}
2694
2695// Context sets the context to be used in this call's Do method. Any
2696// pending HTTP request will be aborted if the provided context is
2697// canceled.
2698func (c *CollectionviewersListCall) Context(ctx context.Context) *CollectionviewersListCall {
2699	c.ctx_ = ctx
2700	return c
2701}
2702
2703func (c *CollectionviewersListCall) doRequest(alt string) (*http.Response, error) {
2704	var body io.Reader = nil
2705	c.urlParams_.Set("alt", alt)
2706	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users")
2707	urls += "?" + c.urlParams_.Encode()
2708	req, _ := http.NewRequest("GET", urls, body)
2709	googleapi.Expand(req.URL, map[string]string{
2710		"enterpriseId": c.enterpriseId,
2711		"collectionId": c.collectionId,
2712	})
2713	req.Header.Set("User-Agent", c.s.userAgent())
2714	if c.ifNoneMatch_ != "" {
2715		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2716	}
2717	if c.ctx_ != nil {
2718		return ctxhttp.Do(c.ctx_, c.s.client, req)
2719	}
2720	return c.s.client.Do(req)
2721}
2722
2723// Do executes the "androidenterprise.collectionviewers.list" call.
2724// Exactly one of *CollectionViewersListResponse or error will be
2725// non-nil. Any non-2xx status code is an error. Response headers are in
2726// either *CollectionViewersListResponse.ServerResponse.Header or (if a
2727// response was returned at all) in error.(*googleapi.Error).Header. Use
2728// googleapi.IsNotModified to check whether the returned error was
2729// because http.StatusNotModified was returned.
2730func (c *CollectionviewersListCall) Do(opts ...googleapi.CallOption) (*CollectionViewersListResponse, error) {
2731	gensupport.SetOptions(c.urlParams_, opts...)
2732	res, err := c.doRequest("json")
2733	if res != nil && res.StatusCode == http.StatusNotModified {
2734		if res.Body != nil {
2735			res.Body.Close()
2736		}
2737		return nil, &googleapi.Error{
2738			Code:   res.StatusCode,
2739			Header: res.Header,
2740		}
2741	}
2742	if err != nil {
2743		return nil, err
2744	}
2745	defer googleapi.CloseBody(res)
2746	if err := googleapi.CheckResponse(res); err != nil {
2747		return nil, err
2748	}
2749	ret := &CollectionViewersListResponse{
2750		ServerResponse: googleapi.ServerResponse{
2751			Header:         res.Header,
2752			HTTPStatusCode: res.StatusCode,
2753		},
2754	}
2755	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2756		return nil, err
2757	}
2758	return ret, nil
2759	// {
2760	//   "description": "Retrieves the IDs of the users who have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection.",
2761	//   "httpMethod": "GET",
2762	//   "id": "androidenterprise.collectionviewers.list",
2763	//   "parameterOrder": [
2764	//     "enterpriseId",
2765	//     "collectionId"
2766	//   ],
2767	//   "parameters": {
2768	//     "collectionId": {
2769	//       "description": "The ID of the collection.",
2770	//       "location": "path",
2771	//       "required": true,
2772	//       "type": "string"
2773	//     },
2774	//     "enterpriseId": {
2775	//       "description": "The ID of the enterprise.",
2776	//       "location": "path",
2777	//       "required": true,
2778	//       "type": "string"
2779	//     }
2780	//   },
2781	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}/users",
2782	//   "response": {
2783	//     "$ref": "CollectionViewersListResponse"
2784	//   },
2785	//   "scopes": [
2786	//     "https://www.googleapis.com/auth/androidenterprise"
2787	//   ]
2788	// }
2789
2790}
2791
2792// method id "androidenterprise.collectionviewers.patch":
2793
2794type CollectionviewersPatchCall struct {
2795	s            *Service
2796	enterpriseId string
2797	collectionId string
2798	userId       string
2799	user         *User
2800	urlParams_   gensupport.URLParams
2801	ctx_         context.Context
2802}
2803
2804// Patch: Adds the user to the list of those specifically allowed to see
2805// the collection. If the collection's visibility is set to viewersOnly
2806// then only such users will see the collection. This method supports
2807// patch semantics.
2808func (r *CollectionviewersService) Patch(enterpriseId string, collectionId string, userId string, user *User) *CollectionviewersPatchCall {
2809	c := &CollectionviewersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2810	c.enterpriseId = enterpriseId
2811	c.collectionId = collectionId
2812	c.userId = userId
2813	c.user = user
2814	return c
2815}
2816
2817// Fields allows partial responses to be retrieved. See
2818// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2819// for more information.
2820func (c *CollectionviewersPatchCall) Fields(s ...googleapi.Field) *CollectionviewersPatchCall {
2821	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2822	return c
2823}
2824
2825// Context sets the context to be used in this call's Do method. Any
2826// pending HTTP request will be aborted if the provided context is
2827// canceled.
2828func (c *CollectionviewersPatchCall) Context(ctx context.Context) *CollectionviewersPatchCall {
2829	c.ctx_ = ctx
2830	return c
2831}
2832
2833func (c *CollectionviewersPatchCall) doRequest(alt string) (*http.Response, error) {
2834	var body io.Reader = nil
2835	body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
2836	if err != nil {
2837		return nil, err
2838	}
2839	ctype := "application/json"
2840	c.urlParams_.Set("alt", alt)
2841	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
2842	urls += "?" + c.urlParams_.Encode()
2843	req, _ := http.NewRequest("PATCH", urls, body)
2844	googleapi.Expand(req.URL, map[string]string{
2845		"enterpriseId": c.enterpriseId,
2846		"collectionId": c.collectionId,
2847		"userId":       c.userId,
2848	})
2849	req.Header.Set("Content-Type", ctype)
2850	req.Header.Set("User-Agent", c.s.userAgent())
2851	if c.ctx_ != nil {
2852		return ctxhttp.Do(c.ctx_, c.s.client, req)
2853	}
2854	return c.s.client.Do(req)
2855}
2856
2857// Do executes the "androidenterprise.collectionviewers.patch" call.
2858// Exactly one of *User or error will be non-nil. Any non-2xx status
2859// code is an error. Response headers are in either
2860// *User.ServerResponse.Header or (if a response was returned at all) in
2861// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2862// whether the returned error was because http.StatusNotModified was
2863// returned.
2864func (c *CollectionviewersPatchCall) Do(opts ...googleapi.CallOption) (*User, error) {
2865	gensupport.SetOptions(c.urlParams_, opts...)
2866	res, err := c.doRequest("json")
2867	if res != nil && res.StatusCode == http.StatusNotModified {
2868		if res.Body != nil {
2869			res.Body.Close()
2870		}
2871		return nil, &googleapi.Error{
2872			Code:   res.StatusCode,
2873			Header: res.Header,
2874		}
2875	}
2876	if err != nil {
2877		return nil, err
2878	}
2879	defer googleapi.CloseBody(res)
2880	if err := googleapi.CheckResponse(res); err != nil {
2881		return nil, err
2882	}
2883	ret := &User{
2884		ServerResponse: googleapi.ServerResponse{
2885			Header:         res.Header,
2886			HTTPStatusCode: res.StatusCode,
2887		},
2888	}
2889	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2890		return nil, err
2891	}
2892	return ret, nil
2893	// {
2894	//   "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. This method supports patch semantics.",
2895	//   "httpMethod": "PATCH",
2896	//   "id": "androidenterprise.collectionviewers.patch",
2897	//   "parameterOrder": [
2898	//     "enterpriseId",
2899	//     "collectionId",
2900	//     "userId"
2901	//   ],
2902	//   "parameters": {
2903	//     "collectionId": {
2904	//       "description": "The ID of the collection.",
2905	//       "location": "path",
2906	//       "required": true,
2907	//       "type": "string"
2908	//     },
2909	//     "enterpriseId": {
2910	//       "description": "The ID of the enterprise.",
2911	//       "location": "path",
2912	//       "required": true,
2913	//       "type": "string"
2914	//     },
2915	//     "userId": {
2916	//       "description": "The ID of the user.",
2917	//       "location": "path",
2918	//       "required": true,
2919	//       "type": "string"
2920	//     }
2921	//   },
2922	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
2923	//   "request": {
2924	//     "$ref": "User"
2925	//   },
2926	//   "response": {
2927	//     "$ref": "User"
2928	//   },
2929	//   "scopes": [
2930	//     "https://www.googleapis.com/auth/androidenterprise"
2931	//   ]
2932	// }
2933
2934}
2935
2936// method id "androidenterprise.collectionviewers.update":
2937
2938type CollectionviewersUpdateCall struct {
2939	s            *Service
2940	enterpriseId string
2941	collectionId string
2942	userId       string
2943	user         *User
2944	urlParams_   gensupport.URLParams
2945	ctx_         context.Context
2946}
2947
2948// Update: Adds the user to the list of those specifically allowed to
2949// see the collection. If the collection's visibility is set to
2950// viewersOnly then only such users will see the collection.
2951func (r *CollectionviewersService) Update(enterpriseId string, collectionId string, userId string, user *User) *CollectionviewersUpdateCall {
2952	c := &CollectionviewersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2953	c.enterpriseId = enterpriseId
2954	c.collectionId = collectionId
2955	c.userId = userId
2956	c.user = user
2957	return c
2958}
2959
2960// Fields allows partial responses to be retrieved. See
2961// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2962// for more information.
2963func (c *CollectionviewersUpdateCall) Fields(s ...googleapi.Field) *CollectionviewersUpdateCall {
2964	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2965	return c
2966}
2967
2968// Context sets the context to be used in this call's Do method. Any
2969// pending HTTP request will be aborted if the provided context is
2970// canceled.
2971func (c *CollectionviewersUpdateCall) Context(ctx context.Context) *CollectionviewersUpdateCall {
2972	c.ctx_ = ctx
2973	return c
2974}
2975
2976func (c *CollectionviewersUpdateCall) doRequest(alt string) (*http.Response, error) {
2977	var body io.Reader = nil
2978	body, err := googleapi.WithoutDataWrapper.JSONReader(c.user)
2979	if err != nil {
2980		return nil, err
2981	}
2982	ctype := "application/json"
2983	c.urlParams_.Set("alt", alt)
2984	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}")
2985	urls += "?" + c.urlParams_.Encode()
2986	req, _ := http.NewRequest("PUT", urls, body)
2987	googleapi.Expand(req.URL, map[string]string{
2988		"enterpriseId": c.enterpriseId,
2989		"collectionId": c.collectionId,
2990		"userId":       c.userId,
2991	})
2992	req.Header.Set("Content-Type", ctype)
2993	req.Header.Set("User-Agent", c.s.userAgent())
2994	if c.ctx_ != nil {
2995		return ctxhttp.Do(c.ctx_, c.s.client, req)
2996	}
2997	return c.s.client.Do(req)
2998}
2999
3000// Do executes the "androidenterprise.collectionviewers.update" call.
3001// Exactly one of *User or error will be non-nil. Any non-2xx status
3002// code is an error. Response headers are in either
3003// *User.ServerResponse.Header or (if a response was returned at all) in
3004// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3005// whether the returned error was because http.StatusNotModified was
3006// returned.
3007func (c *CollectionviewersUpdateCall) Do(opts ...googleapi.CallOption) (*User, error) {
3008	gensupport.SetOptions(c.urlParams_, opts...)
3009	res, err := c.doRequest("json")
3010	if res != nil && res.StatusCode == http.StatusNotModified {
3011		if res.Body != nil {
3012			res.Body.Close()
3013		}
3014		return nil, &googleapi.Error{
3015			Code:   res.StatusCode,
3016			Header: res.Header,
3017		}
3018	}
3019	if err != nil {
3020		return nil, err
3021	}
3022	defer googleapi.CloseBody(res)
3023	if err := googleapi.CheckResponse(res); err != nil {
3024		return nil, err
3025	}
3026	ret := &User{
3027		ServerResponse: googleapi.ServerResponse{
3028			Header:         res.Header,
3029			HTTPStatusCode: res.StatusCode,
3030		},
3031	}
3032	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3033		return nil, err
3034	}
3035	return ret, nil
3036	// {
3037	//   "description": "Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection.",
3038	//   "httpMethod": "PUT",
3039	//   "id": "androidenterprise.collectionviewers.update",
3040	//   "parameterOrder": [
3041	//     "enterpriseId",
3042	//     "collectionId",
3043	//     "userId"
3044	//   ],
3045	//   "parameters": {
3046	//     "collectionId": {
3047	//       "description": "The ID of the collection.",
3048	//       "location": "path",
3049	//       "required": true,
3050	//       "type": "string"
3051	//     },
3052	//     "enterpriseId": {
3053	//       "description": "The ID of the enterprise.",
3054	//       "location": "path",
3055	//       "required": true,
3056	//       "type": "string"
3057	//     },
3058	//     "userId": {
3059	//       "description": "The ID of the user.",
3060	//       "location": "path",
3061	//       "required": true,
3062	//       "type": "string"
3063	//     }
3064	//   },
3065	//   "path": "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}",
3066	//   "request": {
3067	//     "$ref": "User"
3068	//   },
3069	//   "response": {
3070	//     "$ref": "User"
3071	//   },
3072	//   "scopes": [
3073	//     "https://www.googleapis.com/auth/androidenterprise"
3074	//   ]
3075	// }
3076
3077}
3078
3079// method id "androidenterprise.devices.get":
3080
3081type DevicesGetCall struct {
3082	s            *Service
3083	enterpriseId string
3084	userId       string
3085	deviceId     string
3086	urlParams_   gensupport.URLParams
3087	ifNoneMatch_ string
3088	ctx_         context.Context
3089}
3090
3091// Get: Retrieves the details of a device.
3092func (r *DevicesService) Get(enterpriseId string, userId string, deviceId string) *DevicesGetCall {
3093	c := &DevicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3094	c.enterpriseId = enterpriseId
3095	c.userId = userId
3096	c.deviceId = deviceId
3097	return c
3098}
3099
3100// Fields allows partial responses to be retrieved. See
3101// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3102// for more information.
3103func (c *DevicesGetCall) Fields(s ...googleapi.Field) *DevicesGetCall {
3104	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3105	return c
3106}
3107
3108// IfNoneMatch sets the optional parameter which makes the operation
3109// fail if the object's ETag matches the given value. This is useful for
3110// getting updates only after the object has changed since the last
3111// request. Use googleapi.IsNotModified to check whether the response
3112// error from Do is the result of In-None-Match.
3113func (c *DevicesGetCall) IfNoneMatch(entityTag string) *DevicesGetCall {
3114	c.ifNoneMatch_ = entityTag
3115	return c
3116}
3117
3118// Context sets the context to be used in this call's Do method. Any
3119// pending HTTP request will be aborted if the provided context is
3120// canceled.
3121func (c *DevicesGetCall) Context(ctx context.Context) *DevicesGetCall {
3122	c.ctx_ = ctx
3123	return c
3124}
3125
3126func (c *DevicesGetCall) doRequest(alt string) (*http.Response, error) {
3127	var body io.Reader = nil
3128	c.urlParams_.Set("alt", alt)
3129	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}")
3130	urls += "?" + c.urlParams_.Encode()
3131	req, _ := http.NewRequest("GET", urls, body)
3132	googleapi.Expand(req.URL, map[string]string{
3133		"enterpriseId": c.enterpriseId,
3134		"userId":       c.userId,
3135		"deviceId":     c.deviceId,
3136	})
3137	req.Header.Set("User-Agent", c.s.userAgent())
3138	if c.ifNoneMatch_ != "" {
3139		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3140	}
3141	if c.ctx_ != nil {
3142		return ctxhttp.Do(c.ctx_, c.s.client, req)
3143	}
3144	return c.s.client.Do(req)
3145}
3146
3147// Do executes the "androidenterprise.devices.get" call.
3148// Exactly one of *Device or error will be non-nil. Any non-2xx status
3149// code is an error. Response headers are in either
3150// *Device.ServerResponse.Header or (if a response was returned at all)
3151// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3152// check whether the returned error was because http.StatusNotModified
3153// was returned.
3154func (c *DevicesGetCall) Do(opts ...googleapi.CallOption) (*Device, error) {
3155	gensupport.SetOptions(c.urlParams_, opts...)
3156	res, err := c.doRequest("json")
3157	if res != nil && res.StatusCode == http.StatusNotModified {
3158		if res.Body != nil {
3159			res.Body.Close()
3160		}
3161		return nil, &googleapi.Error{
3162			Code:   res.StatusCode,
3163			Header: res.Header,
3164		}
3165	}
3166	if err != nil {
3167		return nil, err
3168	}
3169	defer googleapi.CloseBody(res)
3170	if err := googleapi.CheckResponse(res); err != nil {
3171		return nil, err
3172	}
3173	ret := &Device{
3174		ServerResponse: googleapi.ServerResponse{
3175			Header:         res.Header,
3176			HTTPStatusCode: res.StatusCode,
3177		},
3178	}
3179	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3180		return nil, err
3181	}
3182	return ret, nil
3183	// {
3184	//   "description": "Retrieves the details of a device.",
3185	//   "httpMethod": "GET",
3186	//   "id": "androidenterprise.devices.get",
3187	//   "parameterOrder": [
3188	//     "enterpriseId",
3189	//     "userId",
3190	//     "deviceId"
3191	//   ],
3192	//   "parameters": {
3193	//     "deviceId": {
3194	//       "description": "The ID of the device.",
3195	//       "location": "path",
3196	//       "required": true,
3197	//       "type": "string"
3198	//     },
3199	//     "enterpriseId": {
3200	//       "description": "The ID of the enterprise.",
3201	//       "location": "path",
3202	//       "required": true,
3203	//       "type": "string"
3204	//     },
3205	//     "userId": {
3206	//       "description": "The ID of the user.",
3207	//       "location": "path",
3208	//       "required": true,
3209	//       "type": "string"
3210	//     }
3211	//   },
3212	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}",
3213	//   "response": {
3214	//     "$ref": "Device"
3215	//   },
3216	//   "scopes": [
3217	//     "https://www.googleapis.com/auth/androidenterprise"
3218	//   ]
3219	// }
3220
3221}
3222
3223// method id "androidenterprise.devices.getState":
3224
3225type DevicesGetStateCall struct {
3226	s            *Service
3227	enterpriseId string
3228	userId       string
3229	deviceId     string
3230	urlParams_   gensupport.URLParams
3231	ifNoneMatch_ string
3232	ctx_         context.Context
3233}
3234
3235// GetState: Retrieves whether a device is enabled or disabled for
3236// access by the user to Google services. The device state takes effect
3237// only if enforcing EMM policies on Android devices is enabled in the
3238// Google Admin Console. Otherwise, the device state is ignored and all
3239// devices are allowed access to Google services.
3240func (r *DevicesService) GetState(enterpriseId string, userId string, deviceId string) *DevicesGetStateCall {
3241	c := &DevicesGetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3242	c.enterpriseId = enterpriseId
3243	c.userId = userId
3244	c.deviceId = deviceId
3245	return c
3246}
3247
3248// Fields allows partial responses to be retrieved. See
3249// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3250// for more information.
3251func (c *DevicesGetStateCall) Fields(s ...googleapi.Field) *DevicesGetStateCall {
3252	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3253	return c
3254}
3255
3256// IfNoneMatch sets the optional parameter which makes the operation
3257// fail if the object's ETag matches the given value. This is useful for
3258// getting updates only after the object has changed since the last
3259// request. Use googleapi.IsNotModified to check whether the response
3260// error from Do is the result of In-None-Match.
3261func (c *DevicesGetStateCall) IfNoneMatch(entityTag string) *DevicesGetStateCall {
3262	c.ifNoneMatch_ = entityTag
3263	return c
3264}
3265
3266// Context sets the context to be used in this call's Do method. Any
3267// pending HTTP request will be aborted if the provided context is
3268// canceled.
3269func (c *DevicesGetStateCall) Context(ctx context.Context) *DevicesGetStateCall {
3270	c.ctx_ = ctx
3271	return c
3272}
3273
3274func (c *DevicesGetStateCall) doRequest(alt string) (*http.Response, error) {
3275	var body io.Reader = nil
3276	c.urlParams_.Set("alt", alt)
3277	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
3278	urls += "?" + c.urlParams_.Encode()
3279	req, _ := http.NewRequest("GET", urls, body)
3280	googleapi.Expand(req.URL, map[string]string{
3281		"enterpriseId": c.enterpriseId,
3282		"userId":       c.userId,
3283		"deviceId":     c.deviceId,
3284	})
3285	req.Header.Set("User-Agent", c.s.userAgent())
3286	if c.ifNoneMatch_ != "" {
3287		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3288	}
3289	if c.ctx_ != nil {
3290		return ctxhttp.Do(c.ctx_, c.s.client, req)
3291	}
3292	return c.s.client.Do(req)
3293}
3294
3295// Do executes the "androidenterprise.devices.getState" call.
3296// Exactly one of *DeviceState or error will be non-nil. Any non-2xx
3297// status code is an error. Response headers are in either
3298// *DeviceState.ServerResponse.Header or (if a response was returned at
3299// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3300// to check whether the returned error was because
3301// http.StatusNotModified was returned.
3302func (c *DevicesGetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) {
3303	gensupport.SetOptions(c.urlParams_, opts...)
3304	res, err := c.doRequest("json")
3305	if res != nil && res.StatusCode == http.StatusNotModified {
3306		if res.Body != nil {
3307			res.Body.Close()
3308		}
3309		return nil, &googleapi.Error{
3310			Code:   res.StatusCode,
3311			Header: res.Header,
3312		}
3313	}
3314	if err != nil {
3315		return nil, err
3316	}
3317	defer googleapi.CloseBody(res)
3318	if err := googleapi.CheckResponse(res); err != nil {
3319		return nil, err
3320	}
3321	ret := &DeviceState{
3322		ServerResponse: googleapi.ServerResponse{
3323			Header:         res.Header,
3324			HTTPStatusCode: res.StatusCode,
3325		},
3326	}
3327	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3328		return nil, err
3329	}
3330	return ret, nil
3331	// {
3332	//   "description": "Retrieves whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.",
3333	//   "httpMethod": "GET",
3334	//   "id": "androidenterprise.devices.getState",
3335	//   "parameterOrder": [
3336	//     "enterpriseId",
3337	//     "userId",
3338	//     "deviceId"
3339	//   ],
3340	//   "parameters": {
3341	//     "deviceId": {
3342	//       "description": "The ID of the device.",
3343	//       "location": "path",
3344	//       "required": true,
3345	//       "type": "string"
3346	//     },
3347	//     "enterpriseId": {
3348	//       "description": "The ID of the enterprise.",
3349	//       "location": "path",
3350	//       "required": true,
3351	//       "type": "string"
3352	//     },
3353	//     "userId": {
3354	//       "description": "The ID of the user.",
3355	//       "location": "path",
3356	//       "required": true,
3357	//       "type": "string"
3358	//     }
3359	//   },
3360	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
3361	//   "response": {
3362	//     "$ref": "DeviceState"
3363	//   },
3364	//   "scopes": [
3365	//     "https://www.googleapis.com/auth/androidenterprise"
3366	//   ]
3367	// }
3368
3369}
3370
3371// method id "androidenterprise.devices.list":
3372
3373type DevicesListCall struct {
3374	s            *Service
3375	enterpriseId string
3376	userId       string
3377	urlParams_   gensupport.URLParams
3378	ifNoneMatch_ string
3379	ctx_         context.Context
3380}
3381
3382// List: Retrieves the IDs of all of a user's devices.
3383func (r *DevicesService) List(enterpriseId string, userId string) *DevicesListCall {
3384	c := &DevicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3385	c.enterpriseId = enterpriseId
3386	c.userId = userId
3387	return c
3388}
3389
3390// Fields allows partial responses to be retrieved. See
3391// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3392// for more information.
3393func (c *DevicesListCall) Fields(s ...googleapi.Field) *DevicesListCall {
3394	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3395	return c
3396}
3397
3398// IfNoneMatch sets the optional parameter which makes the operation
3399// fail if the object's ETag matches the given value. This is useful for
3400// getting updates only after the object has changed since the last
3401// request. Use googleapi.IsNotModified to check whether the response
3402// error from Do is the result of In-None-Match.
3403func (c *DevicesListCall) IfNoneMatch(entityTag string) *DevicesListCall {
3404	c.ifNoneMatch_ = entityTag
3405	return c
3406}
3407
3408// Context sets the context to be used in this call's Do method. Any
3409// pending HTTP request will be aborted if the provided context is
3410// canceled.
3411func (c *DevicesListCall) Context(ctx context.Context) *DevicesListCall {
3412	c.ctx_ = ctx
3413	return c
3414}
3415
3416func (c *DevicesListCall) doRequest(alt string) (*http.Response, error) {
3417	var body io.Reader = nil
3418	c.urlParams_.Set("alt", alt)
3419	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices")
3420	urls += "?" + c.urlParams_.Encode()
3421	req, _ := http.NewRequest("GET", urls, body)
3422	googleapi.Expand(req.URL, map[string]string{
3423		"enterpriseId": c.enterpriseId,
3424		"userId":       c.userId,
3425	})
3426	req.Header.Set("User-Agent", c.s.userAgent())
3427	if c.ifNoneMatch_ != "" {
3428		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3429	}
3430	if c.ctx_ != nil {
3431		return ctxhttp.Do(c.ctx_, c.s.client, req)
3432	}
3433	return c.s.client.Do(req)
3434}
3435
3436// Do executes the "androidenterprise.devices.list" call.
3437// Exactly one of *DevicesListResponse or error will be non-nil. Any
3438// non-2xx status code is an error. Response headers are in either
3439// *DevicesListResponse.ServerResponse.Header or (if a response was
3440// returned at all) in error.(*googleapi.Error).Header. Use
3441// googleapi.IsNotModified to check whether the returned error was
3442// because http.StatusNotModified was returned.
3443func (c *DevicesListCall) Do(opts ...googleapi.CallOption) (*DevicesListResponse, error) {
3444	gensupport.SetOptions(c.urlParams_, opts...)
3445	res, err := c.doRequest("json")
3446	if res != nil && res.StatusCode == http.StatusNotModified {
3447		if res.Body != nil {
3448			res.Body.Close()
3449		}
3450		return nil, &googleapi.Error{
3451			Code:   res.StatusCode,
3452			Header: res.Header,
3453		}
3454	}
3455	if err != nil {
3456		return nil, err
3457	}
3458	defer googleapi.CloseBody(res)
3459	if err := googleapi.CheckResponse(res); err != nil {
3460		return nil, err
3461	}
3462	ret := &DevicesListResponse{
3463		ServerResponse: googleapi.ServerResponse{
3464			Header:         res.Header,
3465			HTTPStatusCode: res.StatusCode,
3466		},
3467	}
3468	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3469		return nil, err
3470	}
3471	return ret, nil
3472	// {
3473	//   "description": "Retrieves the IDs of all of a user's devices.",
3474	//   "httpMethod": "GET",
3475	//   "id": "androidenterprise.devices.list",
3476	//   "parameterOrder": [
3477	//     "enterpriseId",
3478	//     "userId"
3479	//   ],
3480	//   "parameters": {
3481	//     "enterpriseId": {
3482	//       "description": "The ID of the enterprise.",
3483	//       "location": "path",
3484	//       "required": true,
3485	//       "type": "string"
3486	//     },
3487	//     "userId": {
3488	//       "description": "The ID of the user.",
3489	//       "location": "path",
3490	//       "required": true,
3491	//       "type": "string"
3492	//     }
3493	//   },
3494	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices",
3495	//   "response": {
3496	//     "$ref": "DevicesListResponse"
3497	//   },
3498	//   "scopes": [
3499	//     "https://www.googleapis.com/auth/androidenterprise"
3500	//   ]
3501	// }
3502
3503}
3504
3505// method id "androidenterprise.devices.setState":
3506
3507type DevicesSetStateCall struct {
3508	s            *Service
3509	enterpriseId string
3510	userId       string
3511	deviceId     string
3512	devicestate  *DeviceState
3513	urlParams_   gensupport.URLParams
3514	ctx_         context.Context
3515}
3516
3517// SetState: Sets whether a device is enabled or disabled for access by
3518// the user to Google services. The device state takes effect only if
3519// enforcing EMM policies on Android devices is enabled in the Google
3520// Admin Console. Otherwise, the device state is ignored and all devices
3521// are allowed access to Google services.
3522func (r *DevicesService) SetState(enterpriseId string, userId string, deviceId string, devicestate *DeviceState) *DevicesSetStateCall {
3523	c := &DevicesSetStateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3524	c.enterpriseId = enterpriseId
3525	c.userId = userId
3526	c.deviceId = deviceId
3527	c.devicestate = devicestate
3528	return c
3529}
3530
3531// Fields allows partial responses to be retrieved. See
3532// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3533// for more information.
3534func (c *DevicesSetStateCall) Fields(s ...googleapi.Field) *DevicesSetStateCall {
3535	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3536	return c
3537}
3538
3539// Context sets the context to be used in this call's Do method. Any
3540// pending HTTP request will be aborted if the provided context is
3541// canceled.
3542func (c *DevicesSetStateCall) Context(ctx context.Context) *DevicesSetStateCall {
3543	c.ctx_ = ctx
3544	return c
3545}
3546
3547func (c *DevicesSetStateCall) doRequest(alt string) (*http.Response, error) {
3548	var body io.Reader = nil
3549	body, err := googleapi.WithoutDataWrapper.JSONReader(c.devicestate)
3550	if err != nil {
3551		return nil, err
3552	}
3553	ctype := "application/json"
3554	c.urlParams_.Set("alt", alt)
3555	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state")
3556	urls += "?" + c.urlParams_.Encode()
3557	req, _ := http.NewRequest("PUT", urls, body)
3558	googleapi.Expand(req.URL, map[string]string{
3559		"enterpriseId": c.enterpriseId,
3560		"userId":       c.userId,
3561		"deviceId":     c.deviceId,
3562	})
3563	req.Header.Set("Content-Type", ctype)
3564	req.Header.Set("User-Agent", c.s.userAgent())
3565	if c.ctx_ != nil {
3566		return ctxhttp.Do(c.ctx_, c.s.client, req)
3567	}
3568	return c.s.client.Do(req)
3569}
3570
3571// Do executes the "androidenterprise.devices.setState" call.
3572// Exactly one of *DeviceState or error will be non-nil. Any non-2xx
3573// status code is an error. Response headers are in either
3574// *DeviceState.ServerResponse.Header or (if a response was returned at
3575// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3576// to check whether the returned error was because
3577// http.StatusNotModified was returned.
3578func (c *DevicesSetStateCall) Do(opts ...googleapi.CallOption) (*DeviceState, error) {
3579	gensupport.SetOptions(c.urlParams_, opts...)
3580	res, err := c.doRequest("json")
3581	if res != nil && res.StatusCode == http.StatusNotModified {
3582		if res.Body != nil {
3583			res.Body.Close()
3584		}
3585		return nil, &googleapi.Error{
3586			Code:   res.StatusCode,
3587			Header: res.Header,
3588		}
3589	}
3590	if err != nil {
3591		return nil, err
3592	}
3593	defer googleapi.CloseBody(res)
3594	if err := googleapi.CheckResponse(res); err != nil {
3595		return nil, err
3596	}
3597	ret := &DeviceState{
3598		ServerResponse: googleapi.ServerResponse{
3599			Header:         res.Header,
3600			HTTPStatusCode: res.StatusCode,
3601		},
3602	}
3603	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3604		return nil, err
3605	}
3606	return ret, nil
3607	// {
3608	//   "description": "Sets whether a device is enabled or disabled for access by the user to Google services. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services.",
3609	//   "httpMethod": "PUT",
3610	//   "id": "androidenterprise.devices.setState",
3611	//   "parameterOrder": [
3612	//     "enterpriseId",
3613	//     "userId",
3614	//     "deviceId"
3615	//   ],
3616	//   "parameters": {
3617	//     "deviceId": {
3618	//       "description": "The ID of the device.",
3619	//       "location": "path",
3620	//       "required": true,
3621	//       "type": "string"
3622	//     },
3623	//     "enterpriseId": {
3624	//       "description": "The ID of the enterprise.",
3625	//       "location": "path",
3626	//       "required": true,
3627	//       "type": "string"
3628	//     },
3629	//     "userId": {
3630	//       "description": "The ID of the user.",
3631	//       "location": "path",
3632	//       "required": true,
3633	//       "type": "string"
3634	//     }
3635	//   },
3636	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state",
3637	//   "request": {
3638	//     "$ref": "DeviceState"
3639	//   },
3640	//   "response": {
3641	//     "$ref": "DeviceState"
3642	//   },
3643	//   "scopes": [
3644	//     "https://www.googleapis.com/auth/androidenterprise"
3645	//   ]
3646	// }
3647
3648}
3649
3650// method id "androidenterprise.enterprises.delete":
3651
3652type EnterprisesDeleteCall struct {
3653	s            *Service
3654	enterpriseId string
3655	urlParams_   gensupport.URLParams
3656	ctx_         context.Context
3657}
3658
3659// Delete: Deletes the binding between the EMM and enterprise. This is
3660// now deprecated; use this to unenroll customers that were previously
3661// enrolled with the 'insert' call, then enroll them again with the
3662// 'enroll' call.
3663func (r *EnterprisesService) Delete(enterpriseId string) *EnterprisesDeleteCall {
3664	c := &EnterprisesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3665	c.enterpriseId = enterpriseId
3666	return c
3667}
3668
3669// Fields allows partial responses to be retrieved. See
3670// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3671// for more information.
3672func (c *EnterprisesDeleteCall) Fields(s ...googleapi.Field) *EnterprisesDeleteCall {
3673	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3674	return c
3675}
3676
3677// Context sets the context to be used in this call's Do method. Any
3678// pending HTTP request will be aborted if the provided context is
3679// canceled.
3680func (c *EnterprisesDeleteCall) Context(ctx context.Context) *EnterprisesDeleteCall {
3681	c.ctx_ = ctx
3682	return c
3683}
3684
3685func (c *EnterprisesDeleteCall) doRequest(alt string) (*http.Response, error) {
3686	var body io.Reader = nil
3687	c.urlParams_.Set("alt", alt)
3688	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}")
3689	urls += "?" + c.urlParams_.Encode()
3690	req, _ := http.NewRequest("DELETE", urls, body)
3691	googleapi.Expand(req.URL, map[string]string{
3692		"enterpriseId": c.enterpriseId,
3693	})
3694	req.Header.Set("User-Agent", c.s.userAgent())
3695	if c.ctx_ != nil {
3696		return ctxhttp.Do(c.ctx_, c.s.client, req)
3697	}
3698	return c.s.client.Do(req)
3699}
3700
3701// Do executes the "androidenterprise.enterprises.delete" call.
3702func (c *EnterprisesDeleteCall) Do(opts ...googleapi.CallOption) error {
3703	gensupport.SetOptions(c.urlParams_, opts...)
3704	res, err := c.doRequest("json")
3705	if err != nil {
3706		return err
3707	}
3708	defer googleapi.CloseBody(res)
3709	if err := googleapi.CheckResponse(res); err != nil {
3710		return err
3711	}
3712	return nil
3713	// {
3714	//   "description": "Deletes the binding between the EMM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call.",
3715	//   "httpMethod": "DELETE",
3716	//   "id": "androidenterprise.enterprises.delete",
3717	//   "parameterOrder": [
3718	//     "enterpriseId"
3719	//   ],
3720	//   "parameters": {
3721	//     "enterpriseId": {
3722	//       "description": "The ID of the enterprise.",
3723	//       "location": "path",
3724	//       "required": true,
3725	//       "type": "string"
3726	//     }
3727	//   },
3728	//   "path": "enterprises/{enterpriseId}",
3729	//   "scopes": [
3730	//     "https://www.googleapis.com/auth/androidenterprise"
3731	//   ]
3732	// }
3733
3734}
3735
3736// method id "androidenterprise.enterprises.enroll":
3737
3738type EnterprisesEnrollCall struct {
3739	s          *Service
3740	enterprise *Enterprise
3741	urlParams_ gensupport.URLParams
3742	ctx_       context.Context
3743}
3744
3745// Enroll: Enrolls an enterprise with the calling EMM.
3746func (r *EnterprisesService) Enroll(token string, enterprise *Enterprise) *EnterprisesEnrollCall {
3747	c := &EnterprisesEnrollCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3748	c.urlParams_.Set("token", token)
3749	c.enterprise = enterprise
3750	return c
3751}
3752
3753// Fields allows partial responses to be retrieved. See
3754// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3755// for more information.
3756func (c *EnterprisesEnrollCall) Fields(s ...googleapi.Field) *EnterprisesEnrollCall {
3757	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3758	return c
3759}
3760
3761// Context sets the context to be used in this call's Do method. Any
3762// pending HTTP request will be aborted if the provided context is
3763// canceled.
3764func (c *EnterprisesEnrollCall) Context(ctx context.Context) *EnterprisesEnrollCall {
3765	c.ctx_ = ctx
3766	return c
3767}
3768
3769func (c *EnterprisesEnrollCall) doRequest(alt string) (*http.Response, error) {
3770	var body io.Reader = nil
3771	body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
3772	if err != nil {
3773		return nil, err
3774	}
3775	ctype := "application/json"
3776	c.urlParams_.Set("alt", alt)
3777	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/enroll")
3778	urls += "?" + c.urlParams_.Encode()
3779	req, _ := http.NewRequest("POST", urls, body)
3780	googleapi.SetOpaque(req.URL)
3781	req.Header.Set("Content-Type", ctype)
3782	req.Header.Set("User-Agent", c.s.userAgent())
3783	if c.ctx_ != nil {
3784		return ctxhttp.Do(c.ctx_, c.s.client, req)
3785	}
3786	return c.s.client.Do(req)
3787}
3788
3789// Do executes the "androidenterprise.enterprises.enroll" call.
3790// Exactly one of *Enterprise or error will be non-nil. Any non-2xx
3791// status code is an error. Response headers are in either
3792// *Enterprise.ServerResponse.Header or (if a response was returned at
3793// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3794// to check whether the returned error was because
3795// http.StatusNotModified was returned.
3796func (c *EnterprisesEnrollCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
3797	gensupport.SetOptions(c.urlParams_, opts...)
3798	res, err := c.doRequest("json")
3799	if res != nil && res.StatusCode == http.StatusNotModified {
3800		if res.Body != nil {
3801			res.Body.Close()
3802		}
3803		return nil, &googleapi.Error{
3804			Code:   res.StatusCode,
3805			Header: res.Header,
3806		}
3807	}
3808	if err != nil {
3809		return nil, err
3810	}
3811	defer googleapi.CloseBody(res)
3812	if err := googleapi.CheckResponse(res); err != nil {
3813		return nil, err
3814	}
3815	ret := &Enterprise{
3816		ServerResponse: googleapi.ServerResponse{
3817			Header:         res.Header,
3818			HTTPStatusCode: res.StatusCode,
3819		},
3820	}
3821	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3822		return nil, err
3823	}
3824	return ret, nil
3825	// {
3826	//   "description": "Enrolls an enterprise with the calling EMM.",
3827	//   "httpMethod": "POST",
3828	//   "id": "androidenterprise.enterprises.enroll",
3829	//   "parameterOrder": [
3830	//     "token"
3831	//   ],
3832	//   "parameters": {
3833	//     "token": {
3834	//       "description": "The token provided by the enterprise to register the EMM.",
3835	//       "location": "query",
3836	//       "required": true,
3837	//       "type": "string"
3838	//     }
3839	//   },
3840	//   "path": "enterprises/enroll",
3841	//   "request": {
3842	//     "$ref": "Enterprise"
3843	//   },
3844	//   "response": {
3845	//     "$ref": "Enterprise"
3846	//   },
3847	//   "scopes": [
3848	//     "https://www.googleapis.com/auth/androidenterprise"
3849	//   ]
3850	// }
3851
3852}
3853
3854// method id "androidenterprise.enterprises.get":
3855
3856type EnterprisesGetCall struct {
3857	s            *Service
3858	enterpriseId string
3859	urlParams_   gensupport.URLParams
3860	ifNoneMatch_ string
3861	ctx_         context.Context
3862}
3863
3864// Get: Retrieves the name and domain of an enterprise.
3865func (r *EnterprisesService) Get(enterpriseId string) *EnterprisesGetCall {
3866	c := &EnterprisesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3867	c.enterpriseId = enterpriseId
3868	return c
3869}
3870
3871// Fields allows partial responses to be retrieved. See
3872// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3873// for more information.
3874func (c *EnterprisesGetCall) Fields(s ...googleapi.Field) *EnterprisesGetCall {
3875	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3876	return c
3877}
3878
3879// IfNoneMatch sets the optional parameter which makes the operation
3880// fail if the object's ETag matches the given value. This is useful for
3881// getting updates only after the object has changed since the last
3882// request. Use googleapi.IsNotModified to check whether the response
3883// error from Do is the result of In-None-Match.
3884func (c *EnterprisesGetCall) IfNoneMatch(entityTag string) *EnterprisesGetCall {
3885	c.ifNoneMatch_ = entityTag
3886	return c
3887}
3888
3889// Context sets the context to be used in this call's Do method. Any
3890// pending HTTP request will be aborted if the provided context is
3891// canceled.
3892func (c *EnterprisesGetCall) Context(ctx context.Context) *EnterprisesGetCall {
3893	c.ctx_ = ctx
3894	return c
3895}
3896
3897func (c *EnterprisesGetCall) doRequest(alt string) (*http.Response, error) {
3898	var body io.Reader = nil
3899	c.urlParams_.Set("alt", alt)
3900	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}")
3901	urls += "?" + c.urlParams_.Encode()
3902	req, _ := http.NewRequest("GET", urls, body)
3903	googleapi.Expand(req.URL, map[string]string{
3904		"enterpriseId": c.enterpriseId,
3905	})
3906	req.Header.Set("User-Agent", c.s.userAgent())
3907	if c.ifNoneMatch_ != "" {
3908		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3909	}
3910	if c.ctx_ != nil {
3911		return ctxhttp.Do(c.ctx_, c.s.client, req)
3912	}
3913	return c.s.client.Do(req)
3914}
3915
3916// Do executes the "androidenterprise.enterprises.get" call.
3917// Exactly one of *Enterprise or error will be non-nil. Any non-2xx
3918// status code is an error. Response headers are in either
3919// *Enterprise.ServerResponse.Header or (if a response was returned at
3920// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3921// to check whether the returned error was because
3922// http.StatusNotModified was returned.
3923func (c *EnterprisesGetCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
3924	gensupport.SetOptions(c.urlParams_, opts...)
3925	res, err := c.doRequest("json")
3926	if res != nil && res.StatusCode == http.StatusNotModified {
3927		if res.Body != nil {
3928			res.Body.Close()
3929		}
3930		return nil, &googleapi.Error{
3931			Code:   res.StatusCode,
3932			Header: res.Header,
3933		}
3934	}
3935	if err != nil {
3936		return nil, err
3937	}
3938	defer googleapi.CloseBody(res)
3939	if err := googleapi.CheckResponse(res); err != nil {
3940		return nil, err
3941	}
3942	ret := &Enterprise{
3943		ServerResponse: googleapi.ServerResponse{
3944			Header:         res.Header,
3945			HTTPStatusCode: res.StatusCode,
3946		},
3947	}
3948	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3949		return nil, err
3950	}
3951	return ret, nil
3952	// {
3953	//   "description": "Retrieves the name and domain of an enterprise.",
3954	//   "httpMethod": "GET",
3955	//   "id": "androidenterprise.enterprises.get",
3956	//   "parameterOrder": [
3957	//     "enterpriseId"
3958	//   ],
3959	//   "parameters": {
3960	//     "enterpriseId": {
3961	//       "description": "The ID of the enterprise.",
3962	//       "location": "path",
3963	//       "required": true,
3964	//       "type": "string"
3965	//     }
3966	//   },
3967	//   "path": "enterprises/{enterpriseId}",
3968	//   "response": {
3969	//     "$ref": "Enterprise"
3970	//   },
3971	//   "scopes": [
3972	//     "https://www.googleapis.com/auth/androidenterprise"
3973	//   ]
3974	// }
3975
3976}
3977
3978// method id "androidenterprise.enterprises.getStoreLayout":
3979
3980type EnterprisesGetStoreLayoutCall struct {
3981	s            *Service
3982	enterpriseId string
3983	urlParams_   gensupport.URLParams
3984	ifNoneMatch_ string
3985	ctx_         context.Context
3986}
3987
3988// GetStoreLayout: Returns the store layout resource.
3989func (r *EnterprisesService) GetStoreLayout(enterpriseId string) *EnterprisesGetStoreLayoutCall {
3990	c := &EnterprisesGetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3991	c.enterpriseId = enterpriseId
3992	return c
3993}
3994
3995// Fields allows partial responses to be retrieved. See
3996// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3997// for more information.
3998func (c *EnterprisesGetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesGetStoreLayoutCall {
3999	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4000	return c
4001}
4002
4003// IfNoneMatch sets the optional parameter which makes the operation
4004// fail if the object's ETag matches the given value. This is useful for
4005// getting updates only after the object has changed since the last
4006// request. Use googleapi.IsNotModified to check whether the response
4007// error from Do is the result of In-None-Match.
4008func (c *EnterprisesGetStoreLayoutCall) IfNoneMatch(entityTag string) *EnterprisesGetStoreLayoutCall {
4009	c.ifNoneMatch_ = entityTag
4010	return c
4011}
4012
4013// Context sets the context to be used in this call's Do method. Any
4014// pending HTTP request will be aborted if the provided context is
4015// canceled.
4016func (c *EnterprisesGetStoreLayoutCall) Context(ctx context.Context) *EnterprisesGetStoreLayoutCall {
4017	c.ctx_ = ctx
4018	return c
4019}
4020
4021func (c *EnterprisesGetStoreLayoutCall) doRequest(alt string) (*http.Response, error) {
4022	var body io.Reader = nil
4023	c.urlParams_.Set("alt", alt)
4024	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout")
4025	urls += "?" + c.urlParams_.Encode()
4026	req, _ := http.NewRequest("GET", urls, body)
4027	googleapi.Expand(req.URL, map[string]string{
4028		"enterpriseId": c.enterpriseId,
4029	})
4030	req.Header.Set("User-Agent", c.s.userAgent())
4031	if c.ifNoneMatch_ != "" {
4032		req.Header.Set("If-None-Match", c.ifNoneMatch_)
4033	}
4034	if c.ctx_ != nil {
4035		return ctxhttp.Do(c.ctx_, c.s.client, req)
4036	}
4037	return c.s.client.Do(req)
4038}
4039
4040// Do executes the "androidenterprise.enterprises.getStoreLayout" call.
4041// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx
4042// status code is an error. Response headers are in either
4043// *StoreLayout.ServerResponse.Header or (if a response was returned at
4044// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4045// to check whether the returned error was because
4046// http.StatusNotModified was returned.
4047func (c *EnterprisesGetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) {
4048	gensupport.SetOptions(c.urlParams_, opts...)
4049	res, err := c.doRequest("json")
4050	if res != nil && res.StatusCode == http.StatusNotModified {
4051		if res.Body != nil {
4052			res.Body.Close()
4053		}
4054		return nil, &googleapi.Error{
4055			Code:   res.StatusCode,
4056			Header: res.Header,
4057		}
4058	}
4059	if err != nil {
4060		return nil, err
4061	}
4062	defer googleapi.CloseBody(res)
4063	if err := googleapi.CheckResponse(res); err != nil {
4064		return nil, err
4065	}
4066	ret := &StoreLayout{
4067		ServerResponse: googleapi.ServerResponse{
4068			Header:         res.Header,
4069			HTTPStatusCode: res.StatusCode,
4070		},
4071	}
4072	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4073		return nil, err
4074	}
4075	return ret, nil
4076	// {
4077	//   "description": "Returns the store layout resource.",
4078	//   "httpMethod": "GET",
4079	//   "id": "androidenterprise.enterprises.getStoreLayout",
4080	//   "parameterOrder": [
4081	//     "enterpriseId"
4082	//   ],
4083	//   "parameters": {
4084	//     "enterpriseId": {
4085	//       "description": "The ID of the enterprise.",
4086	//       "location": "path",
4087	//       "required": true,
4088	//       "type": "string"
4089	//     }
4090	//   },
4091	//   "path": "enterprises/{enterpriseId}/storeLayout",
4092	//   "response": {
4093	//     "$ref": "StoreLayout"
4094	//   },
4095	//   "scopes": [
4096	//     "https://www.googleapis.com/auth/androidenterprise"
4097	//   ]
4098	// }
4099
4100}
4101
4102// method id "androidenterprise.enterprises.insert":
4103
4104type EnterprisesInsertCall struct {
4105	s          *Service
4106	enterprise *Enterprise
4107	urlParams_ gensupport.URLParams
4108	ctx_       context.Context
4109}
4110
4111// Insert: Establishes the binding between the EMM and an enterprise.
4112// This is now deprecated; use enroll instead.
4113func (r *EnterprisesService) Insert(token string, enterprise *Enterprise) *EnterprisesInsertCall {
4114	c := &EnterprisesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4115	c.urlParams_.Set("token", token)
4116	c.enterprise = enterprise
4117	return c
4118}
4119
4120// Fields allows partial responses to be retrieved. See
4121// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4122// for more information.
4123func (c *EnterprisesInsertCall) Fields(s ...googleapi.Field) *EnterprisesInsertCall {
4124	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4125	return c
4126}
4127
4128// Context sets the context to be used in this call's Do method. Any
4129// pending HTTP request will be aborted if the provided context is
4130// canceled.
4131func (c *EnterprisesInsertCall) Context(ctx context.Context) *EnterprisesInsertCall {
4132	c.ctx_ = ctx
4133	return c
4134}
4135
4136func (c *EnterprisesInsertCall) doRequest(alt string) (*http.Response, error) {
4137	var body io.Reader = nil
4138	body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterprise)
4139	if err != nil {
4140		return nil, err
4141	}
4142	ctype := "application/json"
4143	c.urlParams_.Set("alt", alt)
4144	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises")
4145	urls += "?" + c.urlParams_.Encode()
4146	req, _ := http.NewRequest("POST", urls, body)
4147	googleapi.SetOpaque(req.URL)
4148	req.Header.Set("Content-Type", ctype)
4149	req.Header.Set("User-Agent", c.s.userAgent())
4150	if c.ctx_ != nil {
4151		return ctxhttp.Do(c.ctx_, c.s.client, req)
4152	}
4153	return c.s.client.Do(req)
4154}
4155
4156// Do executes the "androidenterprise.enterprises.insert" call.
4157// Exactly one of *Enterprise or error will be non-nil. Any non-2xx
4158// status code is an error. Response headers are in either
4159// *Enterprise.ServerResponse.Header or (if a response was returned at
4160// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4161// to check whether the returned error was because
4162// http.StatusNotModified was returned.
4163func (c *EnterprisesInsertCall) Do(opts ...googleapi.CallOption) (*Enterprise, error) {
4164	gensupport.SetOptions(c.urlParams_, opts...)
4165	res, err := c.doRequest("json")
4166	if res != nil && res.StatusCode == http.StatusNotModified {
4167		if res.Body != nil {
4168			res.Body.Close()
4169		}
4170		return nil, &googleapi.Error{
4171			Code:   res.StatusCode,
4172			Header: res.Header,
4173		}
4174	}
4175	if err != nil {
4176		return nil, err
4177	}
4178	defer googleapi.CloseBody(res)
4179	if err := googleapi.CheckResponse(res); err != nil {
4180		return nil, err
4181	}
4182	ret := &Enterprise{
4183		ServerResponse: googleapi.ServerResponse{
4184			Header:         res.Header,
4185			HTTPStatusCode: res.StatusCode,
4186		},
4187	}
4188	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4189		return nil, err
4190	}
4191	return ret, nil
4192	// {
4193	//   "description": "Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead.",
4194	//   "httpMethod": "POST",
4195	//   "id": "androidenterprise.enterprises.insert",
4196	//   "parameterOrder": [
4197	//     "token"
4198	//   ],
4199	//   "parameters": {
4200	//     "token": {
4201	//       "description": "The token provided by the enterprise to register the EMM.",
4202	//       "location": "query",
4203	//       "required": true,
4204	//       "type": "string"
4205	//     }
4206	//   },
4207	//   "path": "enterprises",
4208	//   "request": {
4209	//     "$ref": "Enterprise"
4210	//   },
4211	//   "response": {
4212	//     "$ref": "Enterprise"
4213	//   },
4214	//   "scopes": [
4215	//     "https://www.googleapis.com/auth/androidenterprise"
4216	//   ]
4217	// }
4218
4219}
4220
4221// method id "androidenterprise.enterprises.list":
4222
4223type EnterprisesListCall struct {
4224	s            *Service
4225	urlParams_   gensupport.URLParams
4226	ifNoneMatch_ string
4227	ctx_         context.Context
4228}
4229
4230// List: Looks up an enterprise by domain name.
4231func (r *EnterprisesService) List(domain string) *EnterprisesListCall {
4232	c := &EnterprisesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4233	c.urlParams_.Set("domain", domain)
4234	return c
4235}
4236
4237// Fields allows partial responses to be retrieved. See
4238// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4239// for more information.
4240func (c *EnterprisesListCall) Fields(s ...googleapi.Field) *EnterprisesListCall {
4241	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4242	return c
4243}
4244
4245// IfNoneMatch sets the optional parameter which makes the operation
4246// fail if the object's ETag matches the given value. This is useful for
4247// getting updates only after the object has changed since the last
4248// request. Use googleapi.IsNotModified to check whether the response
4249// error from Do is the result of In-None-Match.
4250func (c *EnterprisesListCall) IfNoneMatch(entityTag string) *EnterprisesListCall {
4251	c.ifNoneMatch_ = entityTag
4252	return c
4253}
4254
4255// Context sets the context to be used in this call's Do method. Any
4256// pending HTTP request will be aborted if the provided context is
4257// canceled.
4258func (c *EnterprisesListCall) Context(ctx context.Context) *EnterprisesListCall {
4259	c.ctx_ = ctx
4260	return c
4261}
4262
4263func (c *EnterprisesListCall) doRequest(alt string) (*http.Response, error) {
4264	var body io.Reader = nil
4265	c.urlParams_.Set("alt", alt)
4266	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises")
4267	urls += "?" + c.urlParams_.Encode()
4268	req, _ := http.NewRequest("GET", urls, body)
4269	googleapi.SetOpaque(req.URL)
4270	req.Header.Set("User-Agent", c.s.userAgent())
4271	if c.ifNoneMatch_ != "" {
4272		req.Header.Set("If-None-Match", c.ifNoneMatch_)
4273	}
4274	if c.ctx_ != nil {
4275		return ctxhttp.Do(c.ctx_, c.s.client, req)
4276	}
4277	return c.s.client.Do(req)
4278}
4279
4280// Do executes the "androidenterprise.enterprises.list" call.
4281// Exactly one of *EnterprisesListResponse or error will be non-nil. Any
4282// non-2xx status code is an error. Response headers are in either
4283// *EnterprisesListResponse.ServerResponse.Header or (if a response was
4284// returned at all) in error.(*googleapi.Error).Header. Use
4285// googleapi.IsNotModified to check whether the returned error was
4286// because http.StatusNotModified was returned.
4287func (c *EnterprisesListCall) Do(opts ...googleapi.CallOption) (*EnterprisesListResponse, error) {
4288	gensupport.SetOptions(c.urlParams_, opts...)
4289	res, err := c.doRequest("json")
4290	if res != nil && res.StatusCode == http.StatusNotModified {
4291		if res.Body != nil {
4292			res.Body.Close()
4293		}
4294		return nil, &googleapi.Error{
4295			Code:   res.StatusCode,
4296			Header: res.Header,
4297		}
4298	}
4299	if err != nil {
4300		return nil, err
4301	}
4302	defer googleapi.CloseBody(res)
4303	if err := googleapi.CheckResponse(res); err != nil {
4304		return nil, err
4305	}
4306	ret := &EnterprisesListResponse{
4307		ServerResponse: googleapi.ServerResponse{
4308			Header:         res.Header,
4309			HTTPStatusCode: res.StatusCode,
4310		},
4311	}
4312	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4313		return nil, err
4314	}
4315	return ret, nil
4316	// {
4317	//   "description": "Looks up an enterprise by domain name.",
4318	//   "httpMethod": "GET",
4319	//   "id": "androidenterprise.enterprises.list",
4320	//   "parameterOrder": [
4321	//     "domain"
4322	//   ],
4323	//   "parameters": {
4324	//     "domain": {
4325	//       "description": "The exact primary domain name of the enterprise to look up.",
4326	//       "location": "query",
4327	//       "required": true,
4328	//       "type": "string"
4329	//     }
4330	//   },
4331	//   "path": "enterprises",
4332	//   "response": {
4333	//     "$ref": "EnterprisesListResponse"
4334	//   },
4335	//   "scopes": [
4336	//     "https://www.googleapis.com/auth/androidenterprise"
4337	//   ]
4338	// }
4339
4340}
4341
4342// method id "androidenterprise.enterprises.sendTestPushNotification":
4343
4344type EnterprisesSendTestPushNotificationCall struct {
4345	s            *Service
4346	enterpriseId string
4347	urlParams_   gensupport.URLParams
4348	ctx_         context.Context
4349}
4350
4351// SendTestPushNotification: Sends a test push notification to validate
4352// the EMM integration with the Google Cloud Pub/Sub service for this
4353// enterprise.
4354func (r *EnterprisesService) SendTestPushNotification(enterpriseId string) *EnterprisesSendTestPushNotificationCall {
4355	c := &EnterprisesSendTestPushNotificationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4356	c.enterpriseId = enterpriseId
4357	return c
4358}
4359
4360// Fields allows partial responses to be retrieved. See
4361// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4362// for more information.
4363func (c *EnterprisesSendTestPushNotificationCall) Fields(s ...googleapi.Field) *EnterprisesSendTestPushNotificationCall {
4364	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4365	return c
4366}
4367
4368// Context sets the context to be used in this call's Do method. Any
4369// pending HTTP request will be aborted if the provided context is
4370// canceled.
4371func (c *EnterprisesSendTestPushNotificationCall) Context(ctx context.Context) *EnterprisesSendTestPushNotificationCall {
4372	c.ctx_ = ctx
4373	return c
4374}
4375
4376func (c *EnterprisesSendTestPushNotificationCall) doRequest(alt string) (*http.Response, error) {
4377	var body io.Reader = nil
4378	c.urlParams_.Set("alt", alt)
4379	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/sendTestPushNotification")
4380	urls += "?" + c.urlParams_.Encode()
4381	req, _ := http.NewRequest("POST", urls, body)
4382	googleapi.Expand(req.URL, map[string]string{
4383		"enterpriseId": c.enterpriseId,
4384	})
4385	req.Header.Set("User-Agent", c.s.userAgent())
4386	if c.ctx_ != nil {
4387		return ctxhttp.Do(c.ctx_, c.s.client, req)
4388	}
4389	return c.s.client.Do(req)
4390}
4391
4392// Do executes the "androidenterprise.enterprises.sendTestPushNotification" call.
4393// Exactly one of *EnterprisesSendTestPushNotificationResponse or error
4394// will be non-nil. Any non-2xx status code is an error. Response
4395// headers are in either
4396// *EnterprisesSendTestPushNotificationResponse.ServerResponse.Header or
4397// (if a response was returned at all) in
4398// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4399// whether the returned error was because http.StatusNotModified was
4400// returned.
4401func (c *EnterprisesSendTestPushNotificationCall) Do(opts ...googleapi.CallOption) (*EnterprisesSendTestPushNotificationResponse, error) {
4402	gensupport.SetOptions(c.urlParams_, opts...)
4403	res, err := c.doRequest("json")
4404	if res != nil && res.StatusCode == http.StatusNotModified {
4405		if res.Body != nil {
4406			res.Body.Close()
4407		}
4408		return nil, &googleapi.Error{
4409			Code:   res.StatusCode,
4410			Header: res.Header,
4411		}
4412	}
4413	if err != nil {
4414		return nil, err
4415	}
4416	defer googleapi.CloseBody(res)
4417	if err := googleapi.CheckResponse(res); err != nil {
4418		return nil, err
4419	}
4420	ret := &EnterprisesSendTestPushNotificationResponse{
4421		ServerResponse: googleapi.ServerResponse{
4422			Header:         res.Header,
4423			HTTPStatusCode: res.StatusCode,
4424		},
4425	}
4426	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4427		return nil, err
4428	}
4429	return ret, nil
4430	// {
4431	//   "description": "Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise.",
4432	//   "httpMethod": "POST",
4433	//   "id": "androidenterprise.enterprises.sendTestPushNotification",
4434	//   "parameterOrder": [
4435	//     "enterpriseId"
4436	//   ],
4437	//   "parameters": {
4438	//     "enterpriseId": {
4439	//       "description": "The ID of the enterprise.",
4440	//       "location": "path",
4441	//       "required": true,
4442	//       "type": "string"
4443	//     }
4444	//   },
4445	//   "path": "enterprises/{enterpriseId}/sendTestPushNotification",
4446	//   "response": {
4447	//     "$ref": "EnterprisesSendTestPushNotificationResponse"
4448	//   },
4449	//   "scopes": [
4450	//     "https://www.googleapis.com/auth/androidenterprise"
4451	//   ]
4452	// }
4453
4454}
4455
4456// method id "androidenterprise.enterprises.setAccount":
4457
4458type EnterprisesSetAccountCall struct {
4459	s                 *Service
4460	enterpriseId      string
4461	enterpriseaccount *EnterpriseAccount
4462	urlParams_        gensupport.URLParams
4463	ctx_              context.Context
4464}
4465
4466// SetAccount: Set the account that will be used to authenticate to the
4467// API as the enterprise.
4468func (r *EnterprisesService) SetAccount(enterpriseId string, enterpriseaccount *EnterpriseAccount) *EnterprisesSetAccountCall {
4469	c := &EnterprisesSetAccountCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4470	c.enterpriseId = enterpriseId
4471	c.enterpriseaccount = enterpriseaccount
4472	return c
4473}
4474
4475// Fields allows partial responses to be retrieved. See
4476// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4477// for more information.
4478func (c *EnterprisesSetAccountCall) Fields(s ...googleapi.Field) *EnterprisesSetAccountCall {
4479	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4480	return c
4481}
4482
4483// Context sets the context to be used in this call's Do method. Any
4484// pending HTTP request will be aborted if the provided context is
4485// canceled.
4486func (c *EnterprisesSetAccountCall) Context(ctx context.Context) *EnterprisesSetAccountCall {
4487	c.ctx_ = ctx
4488	return c
4489}
4490
4491func (c *EnterprisesSetAccountCall) doRequest(alt string) (*http.Response, error) {
4492	var body io.Reader = nil
4493	body, err := googleapi.WithoutDataWrapper.JSONReader(c.enterpriseaccount)
4494	if err != nil {
4495		return nil, err
4496	}
4497	ctype := "application/json"
4498	c.urlParams_.Set("alt", alt)
4499	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/account")
4500	urls += "?" + c.urlParams_.Encode()
4501	req, _ := http.NewRequest("PUT", urls, body)
4502	googleapi.Expand(req.URL, map[string]string{
4503		"enterpriseId": c.enterpriseId,
4504	})
4505	req.Header.Set("Content-Type", ctype)
4506	req.Header.Set("User-Agent", c.s.userAgent())
4507	if c.ctx_ != nil {
4508		return ctxhttp.Do(c.ctx_, c.s.client, req)
4509	}
4510	return c.s.client.Do(req)
4511}
4512
4513// Do executes the "androidenterprise.enterprises.setAccount" call.
4514// Exactly one of *EnterpriseAccount or error will be non-nil. Any
4515// non-2xx status code is an error. Response headers are in either
4516// *EnterpriseAccount.ServerResponse.Header or (if a response was
4517// returned at all) in error.(*googleapi.Error).Header. Use
4518// googleapi.IsNotModified to check whether the returned error was
4519// because http.StatusNotModified was returned.
4520func (c *EnterprisesSetAccountCall) Do(opts ...googleapi.CallOption) (*EnterpriseAccount, error) {
4521	gensupport.SetOptions(c.urlParams_, opts...)
4522	res, err := c.doRequest("json")
4523	if res != nil && res.StatusCode == http.StatusNotModified {
4524		if res.Body != nil {
4525			res.Body.Close()
4526		}
4527		return nil, &googleapi.Error{
4528			Code:   res.StatusCode,
4529			Header: res.Header,
4530		}
4531	}
4532	if err != nil {
4533		return nil, err
4534	}
4535	defer googleapi.CloseBody(res)
4536	if err := googleapi.CheckResponse(res); err != nil {
4537		return nil, err
4538	}
4539	ret := &EnterpriseAccount{
4540		ServerResponse: googleapi.ServerResponse{
4541			Header:         res.Header,
4542			HTTPStatusCode: res.StatusCode,
4543		},
4544	}
4545	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4546		return nil, err
4547	}
4548	return ret, nil
4549	// {
4550	//   "description": "Set the account that will be used to authenticate to the API as the enterprise.",
4551	//   "httpMethod": "PUT",
4552	//   "id": "androidenterprise.enterprises.setAccount",
4553	//   "parameterOrder": [
4554	//     "enterpriseId"
4555	//   ],
4556	//   "parameters": {
4557	//     "enterpriseId": {
4558	//       "description": "The ID of the enterprise.",
4559	//       "location": "path",
4560	//       "required": true,
4561	//       "type": "string"
4562	//     }
4563	//   },
4564	//   "path": "enterprises/{enterpriseId}/account",
4565	//   "request": {
4566	//     "$ref": "EnterpriseAccount"
4567	//   },
4568	//   "response": {
4569	//     "$ref": "EnterpriseAccount"
4570	//   },
4571	//   "scopes": [
4572	//     "https://www.googleapis.com/auth/androidenterprise"
4573	//   ]
4574	// }
4575
4576}
4577
4578// method id "androidenterprise.enterprises.setStoreLayout":
4579
4580type EnterprisesSetStoreLayoutCall struct {
4581	s            *Service
4582	enterpriseId string
4583	storelayout  *StoreLayout
4584	urlParams_   gensupport.URLParams
4585	ctx_         context.Context
4586}
4587
4588// SetStoreLayout: Sets the store layout resource.
4589func (r *EnterprisesService) SetStoreLayout(enterpriseId string, storelayout *StoreLayout) *EnterprisesSetStoreLayoutCall {
4590	c := &EnterprisesSetStoreLayoutCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4591	c.enterpriseId = enterpriseId
4592	c.storelayout = storelayout
4593	return c
4594}
4595
4596// Fields allows partial responses to be retrieved. See
4597// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4598// for more information.
4599func (c *EnterprisesSetStoreLayoutCall) Fields(s ...googleapi.Field) *EnterprisesSetStoreLayoutCall {
4600	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4601	return c
4602}
4603
4604// Context sets the context to be used in this call's Do method. Any
4605// pending HTTP request will be aborted if the provided context is
4606// canceled.
4607func (c *EnterprisesSetStoreLayoutCall) Context(ctx context.Context) *EnterprisesSetStoreLayoutCall {
4608	c.ctx_ = ctx
4609	return c
4610}
4611
4612func (c *EnterprisesSetStoreLayoutCall) doRequest(alt string) (*http.Response, error) {
4613	var body io.Reader = nil
4614	body, err := googleapi.WithoutDataWrapper.JSONReader(c.storelayout)
4615	if err != nil {
4616		return nil, err
4617	}
4618	ctype := "application/json"
4619	c.urlParams_.Set("alt", alt)
4620	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout")
4621	urls += "?" + c.urlParams_.Encode()
4622	req, _ := http.NewRequest("PUT", urls, body)
4623	googleapi.Expand(req.URL, map[string]string{
4624		"enterpriseId": c.enterpriseId,
4625	})
4626	req.Header.Set("Content-Type", ctype)
4627	req.Header.Set("User-Agent", c.s.userAgent())
4628	if c.ctx_ != nil {
4629		return ctxhttp.Do(c.ctx_, c.s.client, req)
4630	}
4631	return c.s.client.Do(req)
4632}
4633
4634// Do executes the "androidenterprise.enterprises.setStoreLayout" call.
4635// Exactly one of *StoreLayout or error will be non-nil. Any non-2xx
4636// status code is an error. Response headers are in either
4637// *StoreLayout.ServerResponse.Header or (if a response was returned at
4638// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4639// to check whether the returned error was because
4640// http.StatusNotModified was returned.
4641func (c *EnterprisesSetStoreLayoutCall) Do(opts ...googleapi.CallOption) (*StoreLayout, error) {
4642	gensupport.SetOptions(c.urlParams_, opts...)
4643	res, err := c.doRequest("json")
4644	if res != nil && res.StatusCode == http.StatusNotModified {
4645		if res.Body != nil {
4646			res.Body.Close()
4647		}
4648		return nil, &googleapi.Error{
4649			Code:   res.StatusCode,
4650			Header: res.Header,
4651		}
4652	}
4653	if err != nil {
4654		return nil, err
4655	}
4656	defer googleapi.CloseBody(res)
4657	if err := googleapi.CheckResponse(res); err != nil {
4658		return nil, err
4659	}
4660	ret := &StoreLayout{
4661		ServerResponse: googleapi.ServerResponse{
4662			Header:         res.Header,
4663			HTTPStatusCode: res.StatusCode,
4664		},
4665	}
4666	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4667		return nil, err
4668	}
4669	return ret, nil
4670	// {
4671	//   "description": "Sets the store layout resource.",
4672	//   "httpMethod": "PUT",
4673	//   "id": "androidenterprise.enterprises.setStoreLayout",
4674	//   "parameterOrder": [
4675	//     "enterpriseId"
4676	//   ],
4677	//   "parameters": {
4678	//     "enterpriseId": {
4679	//       "description": "The ID of the enterprise.",
4680	//       "location": "path",
4681	//       "required": true,
4682	//       "type": "string"
4683	//     }
4684	//   },
4685	//   "path": "enterprises/{enterpriseId}/storeLayout",
4686	//   "request": {
4687	//     "$ref": "StoreLayout"
4688	//   },
4689	//   "response": {
4690	//     "$ref": "StoreLayout"
4691	//   },
4692	//   "scopes": [
4693	//     "https://www.googleapis.com/auth/androidenterprise"
4694	//   ]
4695	// }
4696
4697}
4698
4699// method id "androidenterprise.enterprises.unenroll":
4700
4701type EnterprisesUnenrollCall struct {
4702	s            *Service
4703	enterpriseId string
4704	urlParams_   gensupport.URLParams
4705	ctx_         context.Context
4706}
4707
4708// Unenroll: Unenrolls an enterprise from the calling EMM.
4709func (r *EnterprisesService) Unenroll(enterpriseId string) *EnterprisesUnenrollCall {
4710	c := &EnterprisesUnenrollCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4711	c.enterpriseId = enterpriseId
4712	return c
4713}
4714
4715// Fields allows partial responses to be retrieved. See
4716// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4717// for more information.
4718func (c *EnterprisesUnenrollCall) Fields(s ...googleapi.Field) *EnterprisesUnenrollCall {
4719	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4720	return c
4721}
4722
4723// Context sets the context to be used in this call's Do method. Any
4724// pending HTTP request will be aborted if the provided context is
4725// canceled.
4726func (c *EnterprisesUnenrollCall) Context(ctx context.Context) *EnterprisesUnenrollCall {
4727	c.ctx_ = ctx
4728	return c
4729}
4730
4731func (c *EnterprisesUnenrollCall) doRequest(alt string) (*http.Response, error) {
4732	var body io.Reader = nil
4733	c.urlParams_.Set("alt", alt)
4734	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/unenroll")
4735	urls += "?" + c.urlParams_.Encode()
4736	req, _ := http.NewRequest("POST", urls, body)
4737	googleapi.Expand(req.URL, map[string]string{
4738		"enterpriseId": c.enterpriseId,
4739	})
4740	req.Header.Set("User-Agent", c.s.userAgent())
4741	if c.ctx_ != nil {
4742		return ctxhttp.Do(c.ctx_, c.s.client, req)
4743	}
4744	return c.s.client.Do(req)
4745}
4746
4747// Do executes the "androidenterprise.enterprises.unenroll" call.
4748func (c *EnterprisesUnenrollCall) Do(opts ...googleapi.CallOption) error {
4749	gensupport.SetOptions(c.urlParams_, opts...)
4750	res, err := c.doRequest("json")
4751	if err != nil {
4752		return err
4753	}
4754	defer googleapi.CloseBody(res)
4755	if err := googleapi.CheckResponse(res); err != nil {
4756		return err
4757	}
4758	return nil
4759	// {
4760	//   "description": "Unenrolls an enterprise from the calling EMM.",
4761	//   "httpMethod": "POST",
4762	//   "id": "androidenterprise.enterprises.unenroll",
4763	//   "parameterOrder": [
4764	//     "enterpriseId"
4765	//   ],
4766	//   "parameters": {
4767	//     "enterpriseId": {
4768	//       "description": "The ID of the enterprise.",
4769	//       "location": "path",
4770	//       "required": true,
4771	//       "type": "string"
4772	//     }
4773	//   },
4774	//   "path": "enterprises/{enterpriseId}/unenroll",
4775	//   "scopes": [
4776	//     "https://www.googleapis.com/auth/androidenterprise"
4777	//   ]
4778	// }
4779
4780}
4781
4782// method id "androidenterprise.entitlements.delete":
4783
4784type EntitlementsDeleteCall struct {
4785	s             *Service
4786	enterpriseId  string
4787	userId        string
4788	entitlementId string
4789	urlParams_    gensupport.URLParams
4790	ctx_          context.Context
4791}
4792
4793// Delete: Removes an entitlement to an app for a user and uninstalls
4794// it.
4795func (r *EntitlementsService) Delete(enterpriseId string, userId string, entitlementId string) *EntitlementsDeleteCall {
4796	c := &EntitlementsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4797	c.enterpriseId = enterpriseId
4798	c.userId = userId
4799	c.entitlementId = entitlementId
4800	return c
4801}
4802
4803// Fields allows partial responses to be retrieved. See
4804// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4805// for more information.
4806func (c *EntitlementsDeleteCall) Fields(s ...googleapi.Field) *EntitlementsDeleteCall {
4807	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4808	return c
4809}
4810
4811// Context sets the context to be used in this call's Do method. Any
4812// pending HTTP request will be aborted if the provided context is
4813// canceled.
4814func (c *EntitlementsDeleteCall) Context(ctx context.Context) *EntitlementsDeleteCall {
4815	c.ctx_ = ctx
4816	return c
4817}
4818
4819func (c *EntitlementsDeleteCall) doRequest(alt string) (*http.Response, error) {
4820	var body io.Reader = nil
4821	c.urlParams_.Set("alt", alt)
4822	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
4823	urls += "?" + c.urlParams_.Encode()
4824	req, _ := http.NewRequest("DELETE", urls, body)
4825	googleapi.Expand(req.URL, map[string]string{
4826		"enterpriseId":  c.enterpriseId,
4827		"userId":        c.userId,
4828		"entitlementId": c.entitlementId,
4829	})
4830	req.Header.Set("User-Agent", c.s.userAgent())
4831	if c.ctx_ != nil {
4832		return ctxhttp.Do(c.ctx_, c.s.client, req)
4833	}
4834	return c.s.client.Do(req)
4835}
4836
4837// Do executes the "androidenterprise.entitlements.delete" call.
4838func (c *EntitlementsDeleteCall) Do(opts ...googleapi.CallOption) error {
4839	gensupport.SetOptions(c.urlParams_, opts...)
4840	res, err := c.doRequest("json")
4841	if err != nil {
4842		return err
4843	}
4844	defer googleapi.CloseBody(res)
4845	if err := googleapi.CheckResponse(res); err != nil {
4846		return err
4847	}
4848	return nil
4849	// {
4850	//   "description": "Removes an entitlement to an app for a user and uninstalls it.",
4851	//   "httpMethod": "DELETE",
4852	//   "id": "androidenterprise.entitlements.delete",
4853	//   "parameterOrder": [
4854	//     "enterpriseId",
4855	//     "userId",
4856	//     "entitlementId"
4857	//   ],
4858	//   "parameters": {
4859	//     "enterpriseId": {
4860	//       "description": "The ID of the enterprise.",
4861	//       "location": "path",
4862	//       "required": true,
4863	//       "type": "string"
4864	//     },
4865	//     "entitlementId": {
4866	//       "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
4867	//       "location": "path",
4868	//       "required": true,
4869	//       "type": "string"
4870	//     },
4871	//     "userId": {
4872	//       "description": "The ID of the user.",
4873	//       "location": "path",
4874	//       "required": true,
4875	//       "type": "string"
4876	//     }
4877	//   },
4878	//   "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
4879	//   "scopes": [
4880	//     "https://www.googleapis.com/auth/androidenterprise"
4881	//   ]
4882	// }
4883
4884}
4885
4886// method id "androidenterprise.entitlements.get":
4887
4888type EntitlementsGetCall struct {
4889	s             *Service
4890	enterpriseId  string
4891	userId        string
4892	entitlementId string
4893	urlParams_    gensupport.URLParams
4894	ifNoneMatch_  string
4895	ctx_          context.Context
4896}
4897
4898// Get: Retrieves details of an entitlement.
4899func (r *EntitlementsService) Get(enterpriseId string, userId string, entitlementId string) *EntitlementsGetCall {
4900	c := &EntitlementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4901	c.enterpriseId = enterpriseId
4902	c.userId = userId
4903	c.entitlementId = entitlementId
4904	return c
4905}
4906
4907// Fields allows partial responses to be retrieved. See
4908// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4909// for more information.
4910func (c *EntitlementsGetCall) Fields(s ...googleapi.Field) *EntitlementsGetCall {
4911	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4912	return c
4913}
4914
4915// IfNoneMatch sets the optional parameter which makes the operation
4916// fail if the object's ETag matches the given value. This is useful for
4917// getting updates only after the object has changed since the last
4918// request. Use googleapi.IsNotModified to check whether the response
4919// error from Do is the result of In-None-Match.
4920func (c *EntitlementsGetCall) IfNoneMatch(entityTag string) *EntitlementsGetCall {
4921	c.ifNoneMatch_ = entityTag
4922	return c
4923}
4924
4925// Context sets the context to be used in this call's Do method. Any
4926// pending HTTP request will be aborted if the provided context is
4927// canceled.
4928func (c *EntitlementsGetCall) Context(ctx context.Context) *EntitlementsGetCall {
4929	c.ctx_ = ctx
4930	return c
4931}
4932
4933func (c *EntitlementsGetCall) doRequest(alt string) (*http.Response, error) {
4934	var body io.Reader = nil
4935	c.urlParams_.Set("alt", alt)
4936	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
4937	urls += "?" + c.urlParams_.Encode()
4938	req, _ := http.NewRequest("GET", urls, body)
4939	googleapi.Expand(req.URL, map[string]string{
4940		"enterpriseId":  c.enterpriseId,
4941		"userId":        c.userId,
4942		"entitlementId": c.entitlementId,
4943	})
4944	req.Header.Set("User-Agent", c.s.userAgent())
4945	if c.ifNoneMatch_ != "" {
4946		req.Header.Set("If-None-Match", c.ifNoneMatch_)
4947	}
4948	if c.ctx_ != nil {
4949		return ctxhttp.Do(c.ctx_, c.s.client, req)
4950	}
4951	return c.s.client.Do(req)
4952}
4953
4954// Do executes the "androidenterprise.entitlements.get" call.
4955// Exactly one of *Entitlement or error will be non-nil. Any non-2xx
4956// status code is an error. Response headers are in either
4957// *Entitlement.ServerResponse.Header or (if a response was returned at
4958// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4959// to check whether the returned error was because
4960// http.StatusNotModified was returned.
4961func (c *EntitlementsGetCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
4962	gensupport.SetOptions(c.urlParams_, opts...)
4963	res, err := c.doRequest("json")
4964	if res != nil && res.StatusCode == http.StatusNotModified {
4965		if res.Body != nil {
4966			res.Body.Close()
4967		}
4968		return nil, &googleapi.Error{
4969			Code:   res.StatusCode,
4970			Header: res.Header,
4971		}
4972	}
4973	if err != nil {
4974		return nil, err
4975	}
4976	defer googleapi.CloseBody(res)
4977	if err := googleapi.CheckResponse(res); err != nil {
4978		return nil, err
4979	}
4980	ret := &Entitlement{
4981		ServerResponse: googleapi.ServerResponse{
4982			Header:         res.Header,
4983			HTTPStatusCode: res.StatusCode,
4984		},
4985	}
4986	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4987		return nil, err
4988	}
4989	return ret, nil
4990	// {
4991	//   "description": "Retrieves details of an entitlement.",
4992	//   "httpMethod": "GET",
4993	//   "id": "androidenterprise.entitlements.get",
4994	//   "parameterOrder": [
4995	//     "enterpriseId",
4996	//     "userId",
4997	//     "entitlementId"
4998	//   ],
4999	//   "parameters": {
5000	//     "enterpriseId": {
5001	//       "description": "The ID of the enterprise.",
5002	//       "location": "path",
5003	//       "required": true,
5004	//       "type": "string"
5005	//     },
5006	//     "entitlementId": {
5007	//       "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
5008	//       "location": "path",
5009	//       "required": true,
5010	//       "type": "string"
5011	//     },
5012	//     "userId": {
5013	//       "description": "The ID of the user.",
5014	//       "location": "path",
5015	//       "required": true,
5016	//       "type": "string"
5017	//     }
5018	//   },
5019	//   "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
5020	//   "response": {
5021	//     "$ref": "Entitlement"
5022	//   },
5023	//   "scopes": [
5024	//     "https://www.googleapis.com/auth/androidenterprise"
5025	//   ]
5026	// }
5027
5028}
5029
5030// method id "androidenterprise.entitlements.list":
5031
5032type EntitlementsListCall struct {
5033	s            *Service
5034	enterpriseId string
5035	userId       string
5036	urlParams_   gensupport.URLParams
5037	ifNoneMatch_ string
5038	ctx_         context.Context
5039}
5040
5041// List: List of all entitlements for the specified user. Only the ID is
5042// set.
5043func (r *EntitlementsService) List(enterpriseId string, userId string) *EntitlementsListCall {
5044	c := &EntitlementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5045	c.enterpriseId = enterpriseId
5046	c.userId = userId
5047	return c
5048}
5049
5050// Fields allows partial responses to be retrieved. See
5051// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5052// for more information.
5053func (c *EntitlementsListCall) Fields(s ...googleapi.Field) *EntitlementsListCall {
5054	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5055	return c
5056}
5057
5058// IfNoneMatch sets the optional parameter which makes the operation
5059// fail if the object's ETag matches the given value. This is useful for
5060// getting updates only after the object has changed since the last
5061// request. Use googleapi.IsNotModified to check whether the response
5062// error from Do is the result of In-None-Match.
5063func (c *EntitlementsListCall) IfNoneMatch(entityTag string) *EntitlementsListCall {
5064	c.ifNoneMatch_ = entityTag
5065	return c
5066}
5067
5068// Context sets the context to be used in this call's Do method. Any
5069// pending HTTP request will be aborted if the provided context is
5070// canceled.
5071func (c *EntitlementsListCall) Context(ctx context.Context) *EntitlementsListCall {
5072	c.ctx_ = ctx
5073	return c
5074}
5075
5076func (c *EntitlementsListCall) doRequest(alt string) (*http.Response, error) {
5077	var body io.Reader = nil
5078	c.urlParams_.Set("alt", alt)
5079	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements")
5080	urls += "?" + c.urlParams_.Encode()
5081	req, _ := http.NewRequest("GET", urls, body)
5082	googleapi.Expand(req.URL, map[string]string{
5083		"enterpriseId": c.enterpriseId,
5084		"userId":       c.userId,
5085	})
5086	req.Header.Set("User-Agent", c.s.userAgent())
5087	if c.ifNoneMatch_ != "" {
5088		req.Header.Set("If-None-Match", c.ifNoneMatch_)
5089	}
5090	if c.ctx_ != nil {
5091		return ctxhttp.Do(c.ctx_, c.s.client, req)
5092	}
5093	return c.s.client.Do(req)
5094}
5095
5096// Do executes the "androidenterprise.entitlements.list" call.
5097// Exactly one of *EntitlementsListResponse or error will be non-nil.
5098// Any non-2xx status code is an error. Response headers are in either
5099// *EntitlementsListResponse.ServerResponse.Header or (if a response was
5100// returned at all) in error.(*googleapi.Error).Header. Use
5101// googleapi.IsNotModified to check whether the returned error was
5102// because http.StatusNotModified was returned.
5103func (c *EntitlementsListCall) Do(opts ...googleapi.CallOption) (*EntitlementsListResponse, error) {
5104	gensupport.SetOptions(c.urlParams_, opts...)
5105	res, err := c.doRequest("json")
5106	if res != nil && res.StatusCode == http.StatusNotModified {
5107		if res.Body != nil {
5108			res.Body.Close()
5109		}
5110		return nil, &googleapi.Error{
5111			Code:   res.StatusCode,
5112			Header: res.Header,
5113		}
5114	}
5115	if err != nil {
5116		return nil, err
5117	}
5118	defer googleapi.CloseBody(res)
5119	if err := googleapi.CheckResponse(res); err != nil {
5120		return nil, err
5121	}
5122	ret := &EntitlementsListResponse{
5123		ServerResponse: googleapi.ServerResponse{
5124			Header:         res.Header,
5125			HTTPStatusCode: res.StatusCode,
5126		},
5127	}
5128	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5129		return nil, err
5130	}
5131	return ret, nil
5132	// {
5133	//   "description": "List of all entitlements for the specified user. Only the ID is set.",
5134	//   "httpMethod": "GET",
5135	//   "id": "androidenterprise.entitlements.list",
5136	//   "parameterOrder": [
5137	//     "enterpriseId",
5138	//     "userId"
5139	//   ],
5140	//   "parameters": {
5141	//     "enterpriseId": {
5142	//       "description": "The ID of the enterprise.",
5143	//       "location": "path",
5144	//       "required": true,
5145	//       "type": "string"
5146	//     },
5147	//     "userId": {
5148	//       "description": "The ID of the user.",
5149	//       "location": "path",
5150	//       "required": true,
5151	//       "type": "string"
5152	//     }
5153	//   },
5154	//   "path": "enterprises/{enterpriseId}/users/{userId}/entitlements",
5155	//   "response": {
5156	//     "$ref": "EntitlementsListResponse"
5157	//   },
5158	//   "scopes": [
5159	//     "https://www.googleapis.com/auth/androidenterprise"
5160	//   ]
5161	// }
5162
5163}
5164
5165// method id "androidenterprise.entitlements.patch":
5166
5167type EntitlementsPatchCall struct {
5168	s             *Service
5169	enterpriseId  string
5170	userId        string
5171	entitlementId string
5172	entitlement   *Entitlement
5173	urlParams_    gensupport.URLParams
5174	ctx_          context.Context
5175}
5176
5177// Patch: Adds or updates an entitlement to an app for a user. This
5178// method supports patch semantics.
5179func (r *EntitlementsService) Patch(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsPatchCall {
5180	c := &EntitlementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5181	c.enterpriseId = enterpriseId
5182	c.userId = userId
5183	c.entitlementId = entitlementId
5184	c.entitlement = entitlement
5185	return c
5186}
5187
5188// Install sets the optional parameter "install": Set to true to also
5189// install the product on all the user's devices where possible. Failure
5190// to install on one or more devices will not prevent this operation
5191// from returning successfully, as long as the entitlement was
5192// successfully assigned to the user.
5193func (c *EntitlementsPatchCall) Install(install bool) *EntitlementsPatchCall {
5194	c.urlParams_.Set("install", fmt.Sprint(install))
5195	return c
5196}
5197
5198// Fields allows partial responses to be retrieved. See
5199// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5200// for more information.
5201func (c *EntitlementsPatchCall) Fields(s ...googleapi.Field) *EntitlementsPatchCall {
5202	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5203	return c
5204}
5205
5206// Context sets the context to be used in this call's Do method. Any
5207// pending HTTP request will be aborted if the provided context is
5208// canceled.
5209func (c *EntitlementsPatchCall) Context(ctx context.Context) *EntitlementsPatchCall {
5210	c.ctx_ = ctx
5211	return c
5212}
5213
5214func (c *EntitlementsPatchCall) doRequest(alt string) (*http.Response, error) {
5215	var body io.Reader = nil
5216	body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
5217	if err != nil {
5218		return nil, err
5219	}
5220	ctype := "application/json"
5221	c.urlParams_.Set("alt", alt)
5222	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
5223	urls += "?" + c.urlParams_.Encode()
5224	req, _ := http.NewRequest("PATCH", urls, body)
5225	googleapi.Expand(req.URL, map[string]string{
5226		"enterpriseId":  c.enterpriseId,
5227		"userId":        c.userId,
5228		"entitlementId": c.entitlementId,
5229	})
5230	req.Header.Set("Content-Type", ctype)
5231	req.Header.Set("User-Agent", c.s.userAgent())
5232	if c.ctx_ != nil {
5233		return ctxhttp.Do(c.ctx_, c.s.client, req)
5234	}
5235	return c.s.client.Do(req)
5236}
5237
5238// Do executes the "androidenterprise.entitlements.patch" call.
5239// Exactly one of *Entitlement or error will be non-nil. Any non-2xx
5240// status code is an error. Response headers are in either
5241// *Entitlement.ServerResponse.Header or (if a response was returned at
5242// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5243// to check whether the returned error was because
5244// http.StatusNotModified was returned.
5245func (c *EntitlementsPatchCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
5246	gensupport.SetOptions(c.urlParams_, opts...)
5247	res, err := c.doRequest("json")
5248	if res != nil && res.StatusCode == http.StatusNotModified {
5249		if res.Body != nil {
5250			res.Body.Close()
5251		}
5252		return nil, &googleapi.Error{
5253			Code:   res.StatusCode,
5254			Header: res.Header,
5255		}
5256	}
5257	if err != nil {
5258		return nil, err
5259	}
5260	defer googleapi.CloseBody(res)
5261	if err := googleapi.CheckResponse(res); err != nil {
5262		return nil, err
5263	}
5264	ret := &Entitlement{
5265		ServerResponse: googleapi.ServerResponse{
5266			Header:         res.Header,
5267			HTTPStatusCode: res.StatusCode,
5268		},
5269	}
5270	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5271		return nil, err
5272	}
5273	return ret, nil
5274	// {
5275	//   "description": "Adds or updates an entitlement to an app for a user. This method supports patch semantics.",
5276	//   "httpMethod": "PATCH",
5277	//   "id": "androidenterprise.entitlements.patch",
5278	//   "parameterOrder": [
5279	//     "enterpriseId",
5280	//     "userId",
5281	//     "entitlementId"
5282	//   ],
5283	//   "parameters": {
5284	//     "enterpriseId": {
5285	//       "description": "The ID of the enterprise.",
5286	//       "location": "path",
5287	//       "required": true,
5288	//       "type": "string"
5289	//     },
5290	//     "entitlementId": {
5291	//       "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
5292	//       "location": "path",
5293	//       "required": true,
5294	//       "type": "string"
5295	//     },
5296	//     "install": {
5297	//       "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.",
5298	//       "location": "query",
5299	//       "type": "boolean"
5300	//     },
5301	//     "userId": {
5302	//       "description": "The ID of the user.",
5303	//       "location": "path",
5304	//       "required": true,
5305	//       "type": "string"
5306	//     }
5307	//   },
5308	//   "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
5309	//   "request": {
5310	//     "$ref": "Entitlement"
5311	//   },
5312	//   "response": {
5313	//     "$ref": "Entitlement"
5314	//   },
5315	//   "scopes": [
5316	//     "https://www.googleapis.com/auth/androidenterprise"
5317	//   ]
5318	// }
5319
5320}
5321
5322// method id "androidenterprise.entitlements.update":
5323
5324type EntitlementsUpdateCall struct {
5325	s             *Service
5326	enterpriseId  string
5327	userId        string
5328	entitlementId string
5329	entitlement   *Entitlement
5330	urlParams_    gensupport.URLParams
5331	ctx_          context.Context
5332}
5333
5334// Update: Adds or updates an entitlement to an app for a user.
5335func (r *EntitlementsService) Update(enterpriseId string, userId string, entitlementId string, entitlement *Entitlement) *EntitlementsUpdateCall {
5336	c := &EntitlementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5337	c.enterpriseId = enterpriseId
5338	c.userId = userId
5339	c.entitlementId = entitlementId
5340	c.entitlement = entitlement
5341	return c
5342}
5343
5344// Install sets the optional parameter "install": Set to true to also
5345// install the product on all the user's devices where possible. Failure
5346// to install on one or more devices will not prevent this operation
5347// from returning successfully, as long as the entitlement was
5348// successfully assigned to the user.
5349func (c *EntitlementsUpdateCall) Install(install bool) *EntitlementsUpdateCall {
5350	c.urlParams_.Set("install", fmt.Sprint(install))
5351	return c
5352}
5353
5354// Fields allows partial responses to be retrieved. See
5355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5356// for more information.
5357func (c *EntitlementsUpdateCall) Fields(s ...googleapi.Field) *EntitlementsUpdateCall {
5358	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5359	return c
5360}
5361
5362// Context sets the context to be used in this call's Do method. Any
5363// pending HTTP request will be aborted if the provided context is
5364// canceled.
5365func (c *EntitlementsUpdateCall) Context(ctx context.Context) *EntitlementsUpdateCall {
5366	c.ctx_ = ctx
5367	return c
5368}
5369
5370func (c *EntitlementsUpdateCall) doRequest(alt string) (*http.Response, error) {
5371	var body io.Reader = nil
5372	body, err := googleapi.WithoutDataWrapper.JSONReader(c.entitlement)
5373	if err != nil {
5374		return nil, err
5375	}
5376	ctype := "application/json"
5377	c.urlParams_.Set("alt", alt)
5378	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}")
5379	urls += "?" + c.urlParams_.Encode()
5380	req, _ := http.NewRequest("PUT", urls, body)
5381	googleapi.Expand(req.URL, map[string]string{
5382		"enterpriseId":  c.enterpriseId,
5383		"userId":        c.userId,
5384		"entitlementId": c.entitlementId,
5385	})
5386	req.Header.Set("Content-Type", ctype)
5387	req.Header.Set("User-Agent", c.s.userAgent())
5388	if c.ctx_ != nil {
5389		return ctxhttp.Do(c.ctx_, c.s.client, req)
5390	}
5391	return c.s.client.Do(req)
5392}
5393
5394// Do executes the "androidenterprise.entitlements.update" call.
5395// Exactly one of *Entitlement or error will be non-nil. Any non-2xx
5396// status code is an error. Response headers are in either
5397// *Entitlement.ServerResponse.Header or (if a response was returned at
5398// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5399// to check whether the returned error was because
5400// http.StatusNotModified was returned.
5401func (c *EntitlementsUpdateCall) Do(opts ...googleapi.CallOption) (*Entitlement, error) {
5402	gensupport.SetOptions(c.urlParams_, opts...)
5403	res, err := c.doRequest("json")
5404	if res != nil && res.StatusCode == http.StatusNotModified {
5405		if res.Body != nil {
5406			res.Body.Close()
5407		}
5408		return nil, &googleapi.Error{
5409			Code:   res.StatusCode,
5410			Header: res.Header,
5411		}
5412	}
5413	if err != nil {
5414		return nil, err
5415	}
5416	defer googleapi.CloseBody(res)
5417	if err := googleapi.CheckResponse(res); err != nil {
5418		return nil, err
5419	}
5420	ret := &Entitlement{
5421		ServerResponse: googleapi.ServerResponse{
5422			Header:         res.Header,
5423			HTTPStatusCode: res.StatusCode,
5424		},
5425	}
5426	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5427		return nil, err
5428	}
5429	return ret, nil
5430	// {
5431	//   "description": "Adds or updates an entitlement to an app for a user.",
5432	//   "httpMethod": "PUT",
5433	//   "id": "androidenterprise.entitlements.update",
5434	//   "parameterOrder": [
5435	//     "enterpriseId",
5436	//     "userId",
5437	//     "entitlementId"
5438	//   ],
5439	//   "parameters": {
5440	//     "enterpriseId": {
5441	//       "description": "The ID of the enterprise.",
5442	//       "location": "path",
5443	//       "required": true,
5444	//       "type": "string"
5445	//     },
5446	//     "entitlementId": {
5447	//       "description": "The ID of the entitlement, e.g. \"app:com.google.android.gm\".",
5448	//       "location": "path",
5449	//       "required": true,
5450	//       "type": "string"
5451	//     },
5452	//     "install": {
5453	//       "description": "Set to true to also install the product on all the user's devices where possible. Failure to install on one or more devices will not prevent this operation from returning successfully, as long as the entitlement was successfully assigned to the user.",
5454	//       "location": "query",
5455	//       "type": "boolean"
5456	//     },
5457	//     "userId": {
5458	//       "description": "The ID of the user.",
5459	//       "location": "path",
5460	//       "required": true,
5461	//       "type": "string"
5462	//     }
5463	//   },
5464	//   "path": "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}",
5465	//   "request": {
5466	//     "$ref": "Entitlement"
5467	//   },
5468	//   "response": {
5469	//     "$ref": "Entitlement"
5470	//   },
5471	//   "scopes": [
5472	//     "https://www.googleapis.com/auth/androidenterprise"
5473	//   ]
5474	// }
5475
5476}
5477
5478// method id "androidenterprise.grouplicenses.get":
5479
5480type GrouplicensesGetCall struct {
5481	s              *Service
5482	enterpriseId   string
5483	groupLicenseId string
5484	urlParams_     gensupport.URLParams
5485	ifNoneMatch_   string
5486	ctx_           context.Context
5487}
5488
5489// Get: Retrieves details of an enterprise's group license for a
5490// product.
5491func (r *GrouplicensesService) Get(enterpriseId string, groupLicenseId string) *GrouplicensesGetCall {
5492	c := &GrouplicensesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5493	c.enterpriseId = enterpriseId
5494	c.groupLicenseId = groupLicenseId
5495	return c
5496}
5497
5498// Fields allows partial responses to be retrieved. See
5499// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5500// for more information.
5501func (c *GrouplicensesGetCall) Fields(s ...googleapi.Field) *GrouplicensesGetCall {
5502	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5503	return c
5504}
5505
5506// IfNoneMatch sets the optional parameter which makes the operation
5507// fail if the object's ETag matches the given value. This is useful for
5508// getting updates only after the object has changed since the last
5509// request. Use googleapi.IsNotModified to check whether the response
5510// error from Do is the result of In-None-Match.
5511func (c *GrouplicensesGetCall) IfNoneMatch(entityTag string) *GrouplicensesGetCall {
5512	c.ifNoneMatch_ = entityTag
5513	return c
5514}
5515
5516// Context sets the context to be used in this call's Do method. Any
5517// pending HTTP request will be aborted if the provided context is
5518// canceled.
5519func (c *GrouplicensesGetCall) Context(ctx context.Context) *GrouplicensesGetCall {
5520	c.ctx_ = ctx
5521	return c
5522}
5523
5524func (c *GrouplicensesGetCall) doRequest(alt string) (*http.Response, error) {
5525	var body io.Reader = nil
5526	c.urlParams_.Set("alt", alt)
5527	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}")
5528	urls += "?" + c.urlParams_.Encode()
5529	req, _ := http.NewRequest("GET", urls, body)
5530	googleapi.Expand(req.URL, map[string]string{
5531		"enterpriseId":   c.enterpriseId,
5532		"groupLicenseId": c.groupLicenseId,
5533	})
5534	req.Header.Set("User-Agent", c.s.userAgent())
5535	if c.ifNoneMatch_ != "" {
5536		req.Header.Set("If-None-Match", c.ifNoneMatch_)
5537	}
5538	if c.ctx_ != nil {
5539		return ctxhttp.Do(c.ctx_, c.s.client, req)
5540	}
5541	return c.s.client.Do(req)
5542}
5543
5544// Do executes the "androidenterprise.grouplicenses.get" call.
5545// Exactly one of *GroupLicense or error will be non-nil. Any non-2xx
5546// status code is an error. Response headers are in either
5547// *GroupLicense.ServerResponse.Header or (if a response was returned at
5548// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5549// to check whether the returned error was because
5550// http.StatusNotModified was returned.
5551func (c *GrouplicensesGetCall) Do(opts ...googleapi.CallOption) (*GroupLicense, error) {
5552	gensupport.SetOptions(c.urlParams_, opts...)
5553	res, err := c.doRequest("json")
5554	if res != nil && res.StatusCode == http.StatusNotModified {
5555		if res.Body != nil {
5556			res.Body.Close()
5557		}
5558		return nil, &googleapi.Error{
5559			Code:   res.StatusCode,
5560			Header: res.Header,
5561		}
5562	}
5563	if err != nil {
5564		return nil, err
5565	}
5566	defer googleapi.CloseBody(res)
5567	if err := googleapi.CheckResponse(res); err != nil {
5568		return nil, err
5569	}
5570	ret := &GroupLicense{
5571		ServerResponse: googleapi.ServerResponse{
5572			Header:         res.Header,
5573			HTTPStatusCode: res.StatusCode,
5574		},
5575	}
5576	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5577		return nil, err
5578	}
5579	return ret, nil
5580	// {
5581	//   "description": "Retrieves details of an enterprise's group license for a product.",
5582	//   "httpMethod": "GET",
5583	//   "id": "androidenterprise.grouplicenses.get",
5584	//   "parameterOrder": [
5585	//     "enterpriseId",
5586	//     "groupLicenseId"
5587	//   ],
5588	//   "parameters": {
5589	//     "enterpriseId": {
5590	//       "description": "The ID of the enterprise.",
5591	//       "location": "path",
5592	//       "required": true,
5593	//       "type": "string"
5594	//     },
5595	//     "groupLicenseId": {
5596	//       "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
5597	//       "location": "path",
5598	//       "required": true,
5599	//       "type": "string"
5600	//     }
5601	//   },
5602	//   "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}",
5603	//   "response": {
5604	//     "$ref": "GroupLicense"
5605	//   },
5606	//   "scopes": [
5607	//     "https://www.googleapis.com/auth/androidenterprise"
5608	//   ]
5609	// }
5610
5611}
5612
5613// method id "androidenterprise.grouplicenses.list":
5614
5615type GrouplicensesListCall struct {
5616	s            *Service
5617	enterpriseId string
5618	urlParams_   gensupport.URLParams
5619	ifNoneMatch_ string
5620	ctx_         context.Context
5621}
5622
5623// List: Retrieves IDs of all products for which the enterprise has a
5624// group license.
5625func (r *GrouplicensesService) List(enterpriseId string) *GrouplicensesListCall {
5626	c := &GrouplicensesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5627	c.enterpriseId = enterpriseId
5628	return c
5629}
5630
5631// Fields allows partial responses to be retrieved. See
5632// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5633// for more information.
5634func (c *GrouplicensesListCall) Fields(s ...googleapi.Field) *GrouplicensesListCall {
5635	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5636	return c
5637}
5638
5639// IfNoneMatch sets the optional parameter which makes the operation
5640// fail if the object's ETag matches the given value. This is useful for
5641// getting updates only after the object has changed since the last
5642// request. Use googleapi.IsNotModified to check whether the response
5643// error from Do is the result of In-None-Match.
5644func (c *GrouplicensesListCall) IfNoneMatch(entityTag string) *GrouplicensesListCall {
5645	c.ifNoneMatch_ = entityTag
5646	return c
5647}
5648
5649// Context sets the context to be used in this call's Do method. Any
5650// pending HTTP request will be aborted if the provided context is
5651// canceled.
5652func (c *GrouplicensesListCall) Context(ctx context.Context) *GrouplicensesListCall {
5653	c.ctx_ = ctx
5654	return c
5655}
5656
5657func (c *GrouplicensesListCall) doRequest(alt string) (*http.Response, error) {
5658	var body io.Reader = nil
5659	c.urlParams_.Set("alt", alt)
5660	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses")
5661	urls += "?" + c.urlParams_.Encode()
5662	req, _ := http.NewRequest("GET", urls, body)
5663	googleapi.Expand(req.URL, map[string]string{
5664		"enterpriseId": c.enterpriseId,
5665	})
5666	req.Header.Set("User-Agent", c.s.userAgent())
5667	if c.ifNoneMatch_ != "" {
5668		req.Header.Set("If-None-Match", c.ifNoneMatch_)
5669	}
5670	if c.ctx_ != nil {
5671		return ctxhttp.Do(c.ctx_, c.s.client, req)
5672	}
5673	return c.s.client.Do(req)
5674}
5675
5676// Do executes the "androidenterprise.grouplicenses.list" call.
5677// Exactly one of *GroupLicensesListResponse or error will be non-nil.
5678// Any non-2xx status code is an error. Response headers are in either
5679// *GroupLicensesListResponse.ServerResponse.Header or (if a response
5680// was returned at all) in error.(*googleapi.Error).Header. Use
5681// googleapi.IsNotModified to check whether the returned error was
5682// because http.StatusNotModified was returned.
5683func (c *GrouplicensesListCall) Do(opts ...googleapi.CallOption) (*GroupLicensesListResponse, error) {
5684	gensupport.SetOptions(c.urlParams_, opts...)
5685	res, err := c.doRequest("json")
5686	if res != nil && res.StatusCode == http.StatusNotModified {
5687		if res.Body != nil {
5688			res.Body.Close()
5689		}
5690		return nil, &googleapi.Error{
5691			Code:   res.StatusCode,
5692			Header: res.Header,
5693		}
5694	}
5695	if err != nil {
5696		return nil, err
5697	}
5698	defer googleapi.CloseBody(res)
5699	if err := googleapi.CheckResponse(res); err != nil {
5700		return nil, err
5701	}
5702	ret := &GroupLicensesListResponse{
5703		ServerResponse: googleapi.ServerResponse{
5704			Header:         res.Header,
5705			HTTPStatusCode: res.StatusCode,
5706		},
5707	}
5708	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5709		return nil, err
5710	}
5711	return ret, nil
5712	// {
5713	//   "description": "Retrieves IDs of all products for which the enterprise has a group license.",
5714	//   "httpMethod": "GET",
5715	//   "id": "androidenterprise.grouplicenses.list",
5716	//   "parameterOrder": [
5717	//     "enterpriseId"
5718	//   ],
5719	//   "parameters": {
5720	//     "enterpriseId": {
5721	//       "description": "The ID of the enterprise.",
5722	//       "location": "path",
5723	//       "required": true,
5724	//       "type": "string"
5725	//     }
5726	//   },
5727	//   "path": "enterprises/{enterpriseId}/groupLicenses",
5728	//   "response": {
5729	//     "$ref": "GroupLicensesListResponse"
5730	//   },
5731	//   "scopes": [
5732	//     "https://www.googleapis.com/auth/androidenterprise"
5733	//   ]
5734	// }
5735
5736}
5737
5738// method id "androidenterprise.grouplicenseusers.list":
5739
5740type GrouplicenseusersListCall struct {
5741	s              *Service
5742	enterpriseId   string
5743	groupLicenseId string
5744	urlParams_     gensupport.URLParams
5745	ifNoneMatch_   string
5746	ctx_           context.Context
5747}
5748
5749// List: Retrieves the IDs of the users who have been granted
5750// entitlements under the license.
5751func (r *GrouplicenseusersService) List(enterpriseId string, groupLicenseId string) *GrouplicenseusersListCall {
5752	c := &GrouplicenseusersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5753	c.enterpriseId = enterpriseId
5754	c.groupLicenseId = groupLicenseId
5755	return c
5756}
5757
5758// Fields allows partial responses to be retrieved. See
5759// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5760// for more information.
5761func (c *GrouplicenseusersListCall) Fields(s ...googleapi.Field) *GrouplicenseusersListCall {
5762	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5763	return c
5764}
5765
5766// IfNoneMatch sets the optional parameter which makes the operation
5767// fail if the object's ETag matches the given value. This is useful for
5768// getting updates only after the object has changed since the last
5769// request. Use googleapi.IsNotModified to check whether the response
5770// error from Do is the result of In-None-Match.
5771func (c *GrouplicenseusersListCall) IfNoneMatch(entityTag string) *GrouplicenseusersListCall {
5772	c.ifNoneMatch_ = entityTag
5773	return c
5774}
5775
5776// Context sets the context to be used in this call's Do method. Any
5777// pending HTTP request will be aborted if the provided context is
5778// canceled.
5779func (c *GrouplicenseusersListCall) Context(ctx context.Context) *GrouplicenseusersListCall {
5780	c.ctx_ = ctx
5781	return c
5782}
5783
5784func (c *GrouplicenseusersListCall) doRequest(alt string) (*http.Response, error) {
5785	var body io.Reader = nil
5786	c.urlParams_.Set("alt", alt)
5787	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users")
5788	urls += "?" + c.urlParams_.Encode()
5789	req, _ := http.NewRequest("GET", urls, body)
5790	googleapi.Expand(req.URL, map[string]string{
5791		"enterpriseId":   c.enterpriseId,
5792		"groupLicenseId": c.groupLicenseId,
5793	})
5794	req.Header.Set("User-Agent", c.s.userAgent())
5795	if c.ifNoneMatch_ != "" {
5796		req.Header.Set("If-None-Match", c.ifNoneMatch_)
5797	}
5798	if c.ctx_ != nil {
5799		return ctxhttp.Do(c.ctx_, c.s.client, req)
5800	}
5801	return c.s.client.Do(req)
5802}
5803
5804// Do executes the "androidenterprise.grouplicenseusers.list" call.
5805// Exactly one of *GroupLicenseUsersListResponse or error will be
5806// non-nil. Any non-2xx status code is an error. Response headers are in
5807// either *GroupLicenseUsersListResponse.ServerResponse.Header or (if a
5808// response was returned at all) in error.(*googleapi.Error).Header. Use
5809// googleapi.IsNotModified to check whether the returned error was
5810// because http.StatusNotModified was returned.
5811func (c *GrouplicenseusersListCall) Do(opts ...googleapi.CallOption) (*GroupLicenseUsersListResponse, error) {
5812	gensupport.SetOptions(c.urlParams_, opts...)
5813	res, err := c.doRequest("json")
5814	if res != nil && res.StatusCode == http.StatusNotModified {
5815		if res.Body != nil {
5816			res.Body.Close()
5817		}
5818		return nil, &googleapi.Error{
5819			Code:   res.StatusCode,
5820			Header: res.Header,
5821		}
5822	}
5823	if err != nil {
5824		return nil, err
5825	}
5826	defer googleapi.CloseBody(res)
5827	if err := googleapi.CheckResponse(res); err != nil {
5828		return nil, err
5829	}
5830	ret := &GroupLicenseUsersListResponse{
5831		ServerResponse: googleapi.ServerResponse{
5832			Header:         res.Header,
5833			HTTPStatusCode: res.StatusCode,
5834		},
5835	}
5836	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5837		return nil, err
5838	}
5839	return ret, nil
5840	// {
5841	//   "description": "Retrieves the IDs of the users who have been granted entitlements under the license.",
5842	//   "httpMethod": "GET",
5843	//   "id": "androidenterprise.grouplicenseusers.list",
5844	//   "parameterOrder": [
5845	//     "enterpriseId",
5846	//     "groupLicenseId"
5847	//   ],
5848	//   "parameters": {
5849	//     "enterpriseId": {
5850	//       "description": "The ID of the enterprise.",
5851	//       "location": "path",
5852	//       "required": true,
5853	//       "type": "string"
5854	//     },
5855	//     "groupLicenseId": {
5856	//       "description": "The ID of the product the group license is for, e.g. \"app:com.google.android.gm\".",
5857	//       "location": "path",
5858	//       "required": true,
5859	//       "type": "string"
5860	//     }
5861	//   },
5862	//   "path": "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}/users",
5863	//   "response": {
5864	//     "$ref": "GroupLicenseUsersListResponse"
5865	//   },
5866	//   "scopes": [
5867	//     "https://www.googleapis.com/auth/androidenterprise"
5868	//   ]
5869	// }
5870
5871}
5872
5873// method id "androidenterprise.installs.delete":
5874
5875type InstallsDeleteCall struct {
5876	s            *Service
5877	enterpriseId string
5878	userId       string
5879	deviceId     string
5880	installId    string
5881	urlParams_   gensupport.URLParams
5882	ctx_         context.Context
5883}
5884
5885// Delete: Requests to remove an app from a device. A call to get or
5886// list will still show the app as installed on the device until it is
5887// actually removed.
5888func (r *InstallsService) Delete(enterpriseId string, userId string, deviceId string, installId string) *InstallsDeleteCall {
5889	c := &InstallsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5890	c.enterpriseId = enterpriseId
5891	c.userId = userId
5892	c.deviceId = deviceId
5893	c.installId = installId
5894	return c
5895}
5896
5897// Fields allows partial responses to be retrieved. See
5898// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5899// for more information.
5900func (c *InstallsDeleteCall) Fields(s ...googleapi.Field) *InstallsDeleteCall {
5901	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5902	return c
5903}
5904
5905// Context sets the context to be used in this call's Do method. Any
5906// pending HTTP request will be aborted if the provided context is
5907// canceled.
5908func (c *InstallsDeleteCall) Context(ctx context.Context) *InstallsDeleteCall {
5909	c.ctx_ = ctx
5910	return c
5911}
5912
5913func (c *InstallsDeleteCall) doRequest(alt string) (*http.Response, error) {
5914	var body io.Reader = nil
5915	c.urlParams_.Set("alt", alt)
5916	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
5917	urls += "?" + c.urlParams_.Encode()
5918	req, _ := http.NewRequest("DELETE", urls, body)
5919	googleapi.Expand(req.URL, map[string]string{
5920		"enterpriseId": c.enterpriseId,
5921		"userId":       c.userId,
5922		"deviceId":     c.deviceId,
5923		"installId":    c.installId,
5924	})
5925	req.Header.Set("User-Agent", c.s.userAgent())
5926	if c.ctx_ != nil {
5927		return ctxhttp.Do(c.ctx_, c.s.client, req)
5928	}
5929	return c.s.client.Do(req)
5930}
5931
5932// Do executes the "androidenterprise.installs.delete" call.
5933func (c *InstallsDeleteCall) Do(opts ...googleapi.CallOption) error {
5934	gensupport.SetOptions(c.urlParams_, opts...)
5935	res, err := c.doRequest("json")
5936	if err != nil {
5937		return err
5938	}
5939	defer googleapi.CloseBody(res)
5940	if err := googleapi.CheckResponse(res); err != nil {
5941		return err
5942	}
5943	return nil
5944	// {
5945	//   "description": "Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed.",
5946	//   "httpMethod": "DELETE",
5947	//   "id": "androidenterprise.installs.delete",
5948	//   "parameterOrder": [
5949	//     "enterpriseId",
5950	//     "userId",
5951	//     "deviceId",
5952	//     "installId"
5953	//   ],
5954	//   "parameters": {
5955	//     "deviceId": {
5956	//       "description": "The Android ID of the device.",
5957	//       "location": "path",
5958	//       "required": true,
5959	//       "type": "string"
5960	//     },
5961	//     "enterpriseId": {
5962	//       "description": "The ID of the enterprise.",
5963	//       "location": "path",
5964	//       "required": true,
5965	//       "type": "string"
5966	//     },
5967	//     "installId": {
5968	//       "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
5969	//       "location": "path",
5970	//       "required": true,
5971	//       "type": "string"
5972	//     },
5973	//     "userId": {
5974	//       "description": "The ID of the user.",
5975	//       "location": "path",
5976	//       "required": true,
5977	//       "type": "string"
5978	//     }
5979	//   },
5980	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
5981	//   "scopes": [
5982	//     "https://www.googleapis.com/auth/androidenterprise"
5983	//   ]
5984	// }
5985
5986}
5987
5988// method id "androidenterprise.installs.get":
5989
5990type InstallsGetCall struct {
5991	s            *Service
5992	enterpriseId string
5993	userId       string
5994	deviceId     string
5995	installId    string
5996	urlParams_   gensupport.URLParams
5997	ifNoneMatch_ string
5998	ctx_         context.Context
5999}
6000
6001// Get: Retrieves details of an installation of an app on a device.
6002func (r *InstallsService) Get(enterpriseId string, userId string, deviceId string, installId string) *InstallsGetCall {
6003	c := &InstallsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6004	c.enterpriseId = enterpriseId
6005	c.userId = userId
6006	c.deviceId = deviceId
6007	c.installId = installId
6008	return c
6009}
6010
6011// Fields allows partial responses to be retrieved. See
6012// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6013// for more information.
6014func (c *InstallsGetCall) Fields(s ...googleapi.Field) *InstallsGetCall {
6015	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6016	return c
6017}
6018
6019// IfNoneMatch sets the optional parameter which makes the operation
6020// fail if the object's ETag matches the given value. This is useful for
6021// getting updates only after the object has changed since the last
6022// request. Use googleapi.IsNotModified to check whether the response
6023// error from Do is the result of In-None-Match.
6024func (c *InstallsGetCall) IfNoneMatch(entityTag string) *InstallsGetCall {
6025	c.ifNoneMatch_ = entityTag
6026	return c
6027}
6028
6029// Context sets the context to be used in this call's Do method. Any
6030// pending HTTP request will be aborted if the provided context is
6031// canceled.
6032func (c *InstallsGetCall) Context(ctx context.Context) *InstallsGetCall {
6033	c.ctx_ = ctx
6034	return c
6035}
6036
6037func (c *InstallsGetCall) doRequest(alt string) (*http.Response, error) {
6038	var body io.Reader = nil
6039	c.urlParams_.Set("alt", alt)
6040	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
6041	urls += "?" + c.urlParams_.Encode()
6042	req, _ := http.NewRequest("GET", urls, body)
6043	googleapi.Expand(req.URL, map[string]string{
6044		"enterpriseId": c.enterpriseId,
6045		"userId":       c.userId,
6046		"deviceId":     c.deviceId,
6047		"installId":    c.installId,
6048	})
6049	req.Header.Set("User-Agent", c.s.userAgent())
6050	if c.ifNoneMatch_ != "" {
6051		req.Header.Set("If-None-Match", c.ifNoneMatch_)
6052	}
6053	if c.ctx_ != nil {
6054		return ctxhttp.Do(c.ctx_, c.s.client, req)
6055	}
6056	return c.s.client.Do(req)
6057}
6058
6059// Do executes the "androidenterprise.installs.get" call.
6060// Exactly one of *Install or error will be non-nil. Any non-2xx status
6061// code is an error. Response headers are in either
6062// *Install.ServerResponse.Header or (if a response was returned at all)
6063// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6064// check whether the returned error was because http.StatusNotModified
6065// was returned.
6066func (c *InstallsGetCall) Do(opts ...googleapi.CallOption) (*Install, error) {
6067	gensupport.SetOptions(c.urlParams_, opts...)
6068	res, err := c.doRequest("json")
6069	if res != nil && res.StatusCode == http.StatusNotModified {
6070		if res.Body != nil {
6071			res.Body.Close()
6072		}
6073		return nil, &googleapi.Error{
6074			Code:   res.StatusCode,
6075			Header: res.Header,
6076		}
6077	}
6078	if err != nil {
6079		return nil, err
6080	}
6081	defer googleapi.CloseBody(res)
6082	if err := googleapi.CheckResponse(res); err != nil {
6083		return nil, err
6084	}
6085	ret := &Install{
6086		ServerResponse: googleapi.ServerResponse{
6087			Header:         res.Header,
6088			HTTPStatusCode: res.StatusCode,
6089		},
6090	}
6091	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
6092		return nil, err
6093	}
6094	return ret, nil
6095	// {
6096	//   "description": "Retrieves details of an installation of an app on a device.",
6097	//   "httpMethod": "GET",
6098	//   "id": "androidenterprise.installs.get",
6099	//   "parameterOrder": [
6100	//     "enterpriseId",
6101	//     "userId",
6102	//     "deviceId",
6103	//     "installId"
6104	//   ],
6105	//   "parameters": {
6106	//     "deviceId": {
6107	//       "description": "The Android ID of the device.",
6108	//       "location": "path",
6109	//       "required": true,
6110	//       "type": "string"
6111	//     },
6112	//     "enterpriseId": {
6113	//       "description": "The ID of the enterprise.",
6114	//       "location": "path",
6115	//       "required": true,
6116	//       "type": "string"
6117	//     },
6118	//     "installId": {
6119	//       "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
6120	//       "location": "path",
6121	//       "required": true,
6122	//       "type": "string"
6123	//     },
6124	//     "userId": {
6125	//       "description": "The ID of the user.",
6126	//       "location": "path",
6127	//       "required": true,
6128	//       "type": "string"
6129	//     }
6130	//   },
6131	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
6132	//   "response": {
6133	//     "$ref": "Install"
6134	//   },
6135	//   "scopes": [
6136	//     "https://www.googleapis.com/auth/androidenterprise"
6137	//   ]
6138	// }
6139
6140}
6141
6142// method id "androidenterprise.installs.list":
6143
6144type InstallsListCall struct {
6145	s            *Service
6146	enterpriseId string
6147	userId       string
6148	deviceId     string
6149	urlParams_   gensupport.URLParams
6150	ifNoneMatch_ string
6151	ctx_         context.Context
6152}
6153
6154// List: Retrieves the details of all apps installed on the specified
6155// device.
6156func (r *InstallsService) List(enterpriseId string, userId string, deviceId string) *InstallsListCall {
6157	c := &InstallsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6158	c.enterpriseId = enterpriseId
6159	c.userId = userId
6160	c.deviceId = deviceId
6161	return c
6162}
6163
6164// Fields allows partial responses to be retrieved. See
6165// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6166// for more information.
6167func (c *InstallsListCall) Fields(s ...googleapi.Field) *InstallsListCall {
6168	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6169	return c
6170}
6171
6172// IfNoneMatch sets the optional parameter which makes the operation
6173// fail if the object's ETag matches the given value. This is useful for
6174// getting updates only after the object has changed since the last
6175// request. Use googleapi.IsNotModified to check whether the response
6176// error from Do is the result of In-None-Match.
6177func (c *InstallsListCall) IfNoneMatch(entityTag string) *InstallsListCall {
6178	c.ifNoneMatch_ = entityTag
6179	return c
6180}
6181
6182// Context sets the context to be used in this call's Do method. Any
6183// pending HTTP request will be aborted if the provided context is
6184// canceled.
6185func (c *InstallsListCall) Context(ctx context.Context) *InstallsListCall {
6186	c.ctx_ = ctx
6187	return c
6188}
6189
6190func (c *InstallsListCall) doRequest(alt string) (*http.Response, error) {
6191	var body io.Reader = nil
6192	c.urlParams_.Set("alt", alt)
6193	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs")
6194	urls += "?" + c.urlParams_.Encode()
6195	req, _ := http.NewRequest("GET", urls, body)
6196	googleapi.Expand(req.URL, map[string]string{
6197		"enterpriseId": c.enterpriseId,
6198		"userId":       c.userId,
6199		"deviceId":     c.deviceId,
6200	})
6201	req.Header.Set("User-Agent", c.s.userAgent())
6202	if c.ifNoneMatch_ != "" {
6203		req.Header.Set("If-None-Match", c.ifNoneMatch_)
6204	}
6205	if c.ctx_ != nil {
6206		return ctxhttp.Do(c.ctx_, c.s.client, req)
6207	}
6208	return c.s.client.Do(req)
6209}
6210
6211// Do executes the "androidenterprise.installs.list" call.
6212// Exactly one of *InstallsListResponse or error will be non-nil. Any
6213// non-2xx status code is an error. Response headers are in either
6214// *InstallsListResponse.ServerResponse.Header or (if a response was
6215// returned at all) in error.(*googleapi.Error).Header. Use
6216// googleapi.IsNotModified to check whether the returned error was
6217// because http.StatusNotModified was returned.
6218func (c *InstallsListCall) Do(opts ...googleapi.CallOption) (*InstallsListResponse, error) {
6219	gensupport.SetOptions(c.urlParams_, opts...)
6220	res, err := c.doRequest("json")
6221	if res != nil && res.StatusCode == http.StatusNotModified {
6222		if res.Body != nil {
6223			res.Body.Close()
6224		}
6225		return nil, &googleapi.Error{
6226			Code:   res.StatusCode,
6227			Header: res.Header,
6228		}
6229	}
6230	if err != nil {
6231		return nil, err
6232	}
6233	defer googleapi.CloseBody(res)
6234	if err := googleapi.CheckResponse(res); err != nil {
6235		return nil, err
6236	}
6237	ret := &InstallsListResponse{
6238		ServerResponse: googleapi.ServerResponse{
6239			Header:         res.Header,
6240			HTTPStatusCode: res.StatusCode,
6241		},
6242	}
6243	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
6244		return nil, err
6245	}
6246	return ret, nil
6247	// {
6248	//   "description": "Retrieves the details of all apps installed on the specified device.",
6249	//   "httpMethod": "GET",
6250	//   "id": "androidenterprise.installs.list",
6251	//   "parameterOrder": [
6252	//     "enterpriseId",
6253	//     "userId",
6254	//     "deviceId"
6255	//   ],
6256	//   "parameters": {
6257	//     "deviceId": {
6258	//       "description": "The Android ID of the device.",
6259	//       "location": "path",
6260	//       "required": true,
6261	//       "type": "string"
6262	//     },
6263	//     "enterpriseId": {
6264	//       "description": "The ID of the enterprise.",
6265	//       "location": "path",
6266	//       "required": true,
6267	//       "type": "string"
6268	//     },
6269	//     "userId": {
6270	//       "description": "The ID of the user.",
6271	//       "location": "path",
6272	//       "required": true,
6273	//       "type": "string"
6274	//     }
6275	//   },
6276	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs",
6277	//   "response": {
6278	//     "$ref": "InstallsListResponse"
6279	//   },
6280	//   "scopes": [
6281	//     "https://www.googleapis.com/auth/androidenterprise"
6282	//   ]
6283	// }
6284
6285}
6286
6287// method id "androidenterprise.installs.patch":
6288
6289type InstallsPatchCall struct {
6290	s            *Service
6291	enterpriseId string
6292	userId       string
6293	deviceId     string
6294	installId    string
6295	install      *Install
6296	urlParams_   gensupport.URLParams
6297	ctx_         context.Context
6298}
6299
6300// Patch: Requests to install the latest version of an app to a device.
6301// If the app is already installed then it is updated to the latest
6302// version if necessary. This method supports patch semantics.
6303func (r *InstallsService) Patch(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsPatchCall {
6304	c := &InstallsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6305	c.enterpriseId = enterpriseId
6306	c.userId = userId
6307	c.deviceId = deviceId
6308	c.installId = installId
6309	c.install = install
6310	return c
6311}
6312
6313// Fields allows partial responses to be retrieved. See
6314// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6315// for more information.
6316func (c *InstallsPatchCall) Fields(s ...googleapi.Field) *InstallsPatchCall {
6317	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6318	return c
6319}
6320
6321// Context sets the context to be used in this call's Do method. Any
6322// pending HTTP request will be aborted if the provided context is
6323// canceled.
6324func (c *InstallsPatchCall) Context(ctx context.Context) *InstallsPatchCall {
6325	c.ctx_ = ctx
6326	return c
6327}
6328
6329func (c *InstallsPatchCall) doRequest(alt string) (*http.Response, error) {
6330	var body io.Reader = nil
6331	body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
6332	if err != nil {
6333		return nil, err
6334	}
6335	ctype := "application/json"
6336	c.urlParams_.Set("alt", alt)
6337	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
6338	urls += "?" + c.urlParams_.Encode()
6339	req, _ := http.NewRequest("PATCH", urls, body)
6340	googleapi.Expand(req.URL, map[string]string{
6341		"enterpriseId": c.enterpriseId,
6342		"userId":       c.userId,
6343		"deviceId":     c.deviceId,
6344		"installId":    c.installId,
6345	})
6346	req.Header.Set("Content-Type", ctype)
6347	req.Header.Set("User-Agent", c.s.userAgent())
6348	if c.ctx_ != nil {
6349		return ctxhttp.Do(c.ctx_, c.s.client, req)
6350	}
6351	return c.s.client.Do(req)
6352}
6353
6354// Do executes the "androidenterprise.installs.patch" call.
6355// Exactly one of *Install or error will be non-nil. Any non-2xx status
6356// code is an error. Response headers are in either
6357// *Install.ServerResponse.Header or (if a response was returned at all)
6358// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6359// check whether the returned error was because http.StatusNotModified
6360// was returned.
6361func (c *InstallsPatchCall) Do(opts ...googleapi.CallOption) (*Install, error) {
6362	gensupport.SetOptions(c.urlParams_, opts...)
6363	res, err := c.doRequest("json")
6364	if res != nil && res.StatusCode == http.StatusNotModified {
6365		if res.Body != nil {
6366			res.Body.Close()
6367		}
6368		return nil, &googleapi.Error{
6369			Code:   res.StatusCode,
6370			Header: res.Header,
6371		}
6372	}
6373	if err != nil {
6374		return nil, err
6375	}
6376	defer googleapi.CloseBody(res)
6377	if err := googleapi.CheckResponse(res); err != nil {
6378		return nil, err
6379	}
6380	ret := &Install{
6381		ServerResponse: googleapi.ServerResponse{
6382			Header:         res.Header,
6383			HTTPStatusCode: res.StatusCode,
6384		},
6385	}
6386	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
6387		return nil, err
6388	}
6389	return ret, nil
6390	// {
6391	//   "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. This method supports patch semantics.",
6392	//   "httpMethod": "PATCH",
6393	//   "id": "androidenterprise.installs.patch",
6394	//   "parameterOrder": [
6395	//     "enterpriseId",
6396	//     "userId",
6397	//     "deviceId",
6398	//     "installId"
6399	//   ],
6400	//   "parameters": {
6401	//     "deviceId": {
6402	//       "description": "The Android ID of the device.",
6403	//       "location": "path",
6404	//       "required": true,
6405	//       "type": "string"
6406	//     },
6407	//     "enterpriseId": {
6408	//       "description": "The ID of the enterprise.",
6409	//       "location": "path",
6410	//       "required": true,
6411	//       "type": "string"
6412	//     },
6413	//     "installId": {
6414	//       "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
6415	//       "location": "path",
6416	//       "required": true,
6417	//       "type": "string"
6418	//     },
6419	//     "userId": {
6420	//       "description": "The ID of the user.",
6421	//       "location": "path",
6422	//       "required": true,
6423	//       "type": "string"
6424	//     }
6425	//   },
6426	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
6427	//   "request": {
6428	//     "$ref": "Install"
6429	//   },
6430	//   "response": {
6431	//     "$ref": "Install"
6432	//   },
6433	//   "scopes": [
6434	//     "https://www.googleapis.com/auth/androidenterprise"
6435	//   ]
6436	// }
6437
6438}
6439
6440// method id "androidenterprise.installs.update":
6441
6442type InstallsUpdateCall struct {
6443	s            *Service
6444	enterpriseId string
6445	userId       string
6446	deviceId     string
6447	installId    string
6448	install      *Install
6449	urlParams_   gensupport.URLParams
6450	ctx_         context.Context
6451}
6452
6453// Update: Requests to install the latest version of an app to a device.
6454// If the app is already installed then it is updated to the latest
6455// version if necessary.
6456func (r *InstallsService) Update(enterpriseId string, userId string, deviceId string, installId string, install *Install) *InstallsUpdateCall {
6457	c := &InstallsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6458	c.enterpriseId = enterpriseId
6459	c.userId = userId
6460	c.deviceId = deviceId
6461	c.installId = installId
6462	c.install = install
6463	return c
6464}
6465
6466// Fields allows partial responses to be retrieved. See
6467// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6468// for more information.
6469func (c *InstallsUpdateCall) Fields(s ...googleapi.Field) *InstallsUpdateCall {
6470	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6471	return c
6472}
6473
6474// Context sets the context to be used in this call's Do method. Any
6475// pending HTTP request will be aborted if the provided context is
6476// canceled.
6477func (c *InstallsUpdateCall) Context(ctx context.Context) *InstallsUpdateCall {
6478	c.ctx_ = ctx
6479	return c
6480}
6481
6482func (c *InstallsUpdateCall) doRequest(alt string) (*http.Response, error) {
6483	var body io.Reader = nil
6484	body, err := googleapi.WithoutDataWrapper.JSONReader(c.install)
6485	if err != nil {
6486		return nil, err
6487	}
6488	ctype := "application/json"
6489	c.urlParams_.Set("alt", alt)
6490	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}")
6491	urls += "?" + c.urlParams_.Encode()
6492	req, _ := http.NewRequest("PUT", urls, body)
6493	googleapi.Expand(req.URL, map[string]string{
6494		"enterpriseId": c.enterpriseId,
6495		"userId":       c.userId,
6496		"deviceId":     c.deviceId,
6497		"installId":    c.installId,
6498	})
6499	req.Header.Set("Content-Type", ctype)
6500	req.Header.Set("User-Agent", c.s.userAgent())
6501	if c.ctx_ != nil {
6502		return ctxhttp.Do(c.ctx_, c.s.client, req)
6503	}
6504	return c.s.client.Do(req)
6505}
6506
6507// Do executes the "androidenterprise.installs.update" call.
6508// Exactly one of *Install or error will be non-nil. Any non-2xx status
6509// code is an error. Response headers are in either
6510// *Install.ServerResponse.Header or (if a response was returned at all)
6511// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6512// check whether the returned error was because http.StatusNotModified
6513// was returned.
6514func (c *InstallsUpdateCall) Do(opts ...googleapi.CallOption) (*Install, error) {
6515	gensupport.SetOptions(c.urlParams_, opts...)
6516	res, err := c.doRequest("json")
6517	if res != nil && res.StatusCode == http.StatusNotModified {
6518		if res.Body != nil {
6519			res.Body.Close()
6520		}
6521		return nil, &googleapi.Error{
6522			Code:   res.StatusCode,
6523			Header: res.Header,
6524		}
6525	}
6526	if err != nil {
6527		return nil, err
6528	}
6529	defer googleapi.CloseBody(res)
6530	if err := googleapi.CheckResponse(res); err != nil {
6531		return nil, err
6532	}
6533	ret := &Install{
6534		ServerResponse: googleapi.ServerResponse{
6535			Header:         res.Header,
6536			HTTPStatusCode: res.StatusCode,
6537		},
6538	}
6539	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
6540		return nil, err
6541	}
6542	return ret, nil
6543	// {
6544	//   "description": "Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary.",
6545	//   "httpMethod": "PUT",
6546	//   "id": "androidenterprise.installs.update",
6547	//   "parameterOrder": [
6548	//     "enterpriseId",
6549	//     "userId",
6550	//     "deviceId",
6551	//     "installId"
6552	//   ],
6553	//   "parameters": {
6554	//     "deviceId": {
6555	//       "description": "The Android ID of the device.",
6556	//       "location": "path",
6557	//       "required": true,
6558	//       "type": "string"
6559	//     },
6560	//     "enterpriseId": {
6561	//       "description": "The ID of the enterprise.",
6562	//       "location": "path",
6563	//       "required": true,
6564	//       "type": "string"
6565	//     },
6566	//     "installId": {
6567	//       "description": "The ID of the product represented by the install, e.g. \"app:com.google.android.gm\".",
6568	//       "location": "path",
6569	//       "required": true,
6570	//       "type": "string"
6571	//     },
6572	//     "userId": {
6573	//       "description": "The ID of the user.",
6574	//       "location": "path",
6575	//       "required": true,
6576	//       "type": "string"
6577	//     }
6578	//   },
6579	//   "path": "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}",
6580	//   "request": {
6581	//     "$ref": "Install"
6582	//   },
6583	//   "response": {
6584	//     "$ref": "Install"
6585	//   },
6586	//   "scopes": [
6587	//     "https://www.googleapis.com/auth/androidenterprise"
6588	//   ]
6589	// }
6590
6591}
6592
6593// method id "androidenterprise.permissions.get":
6594
6595type PermissionsGetCall struct {
6596	s            *Service
6597	permissionId string
6598	urlParams_   gensupport.URLParams
6599	ifNoneMatch_ string
6600	ctx_         context.Context
6601}
6602
6603// Get: Retrieves details of an Android app permission for display to an
6604// enterprise admin.
6605func (r *PermissionsService) Get(permissionId string) *PermissionsGetCall {
6606	c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6607	c.permissionId = permissionId
6608	return c
6609}
6610
6611// Language sets the optional parameter "language": The BCP47 tag for
6612// the user's preferred language (e.g. "en-US", "de")
6613func (c *PermissionsGetCall) Language(language string) *PermissionsGetCall {
6614	c.urlParams_.Set("language", language)
6615	return c
6616}
6617
6618// Fields allows partial responses to be retrieved. See
6619// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6620// for more information.
6621func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall {
6622	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6623	return c
6624}
6625
6626// IfNoneMatch sets the optional parameter which makes the operation
6627// fail if the object's ETag matches the given value. This is useful for
6628// getting updates only after the object has changed since the last
6629// request. Use googleapi.IsNotModified to check whether the response
6630// error from Do is the result of In-None-Match.
6631func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall {
6632	c.ifNoneMatch_ = entityTag
6633	return c
6634}
6635
6636// Context sets the context to be used in this call's Do method. Any
6637// pending HTTP request will be aborted if the provided context is
6638// canceled.
6639func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall {
6640	c.ctx_ = ctx
6641	return c
6642}
6643
6644func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) {
6645	var body io.Reader = nil
6646	c.urlParams_.Set("alt", alt)
6647	urls := googleapi.ResolveRelative(c.s.BasePath, "permissions/{permissionId}")
6648	urls += "?" + c.urlParams_.Encode()
6649	req, _ := http.NewRequest("GET", urls, body)
6650	googleapi.Expand(req.URL, map[string]string{
6651		"permissionId": c.permissionId,
6652	})
6653	req.Header.Set("User-Agent", c.s.userAgent())
6654	if c.ifNoneMatch_ != "" {
6655		req.Header.Set("If-None-Match", c.ifNoneMatch_)
6656	}
6657	if c.ctx_ != nil {
6658		return ctxhttp.Do(c.ctx_, c.s.client, req)
6659	}
6660	return c.s.client.Do(req)
6661}
6662
6663// Do executes the "androidenterprise.permissions.get" call.
6664// Exactly one of *Permission or error will be non-nil. Any non-2xx
6665// status code is an error. Response headers are in either
6666// *Permission.ServerResponse.Header or (if a response was returned at
6667// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
6668// to check whether the returned error was because
6669// http.StatusNotModified was returned.
6670func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
6671	gensupport.SetOptions(c.urlParams_, opts...)
6672	res, err := c.doRequest("json")
6673	if res != nil && res.StatusCode == http.StatusNotModified {
6674		if res.Body != nil {
6675			res.Body.Close()
6676		}
6677		return nil, &googleapi.Error{
6678			Code:   res.StatusCode,
6679			Header: res.Header,
6680		}
6681	}
6682	if err != nil {
6683		return nil, err
6684	}
6685	defer googleapi.CloseBody(res)
6686	if err := googleapi.CheckResponse(res); err != nil {
6687		return nil, err
6688	}
6689	ret := &Permission{
6690		ServerResponse: googleapi.ServerResponse{
6691			Header:         res.Header,
6692			HTTPStatusCode: res.StatusCode,
6693		},
6694	}
6695	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
6696		return nil, err
6697	}
6698	return ret, nil
6699	// {
6700	//   "description": "Retrieves details of an Android app permission for display to an enterprise admin.",
6701	//   "httpMethod": "GET",
6702	//   "id": "androidenterprise.permissions.get",
6703	//   "parameterOrder": [
6704	//     "permissionId"
6705	//   ],
6706	//   "parameters": {
6707	//     "language": {
6708	//       "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\")",
6709	//       "location": "query",
6710	//       "type": "string"
6711	//     },
6712	//     "permissionId": {
6713	//       "description": "The ID of the permission.",
6714	//       "location": "path",
6715	//       "required": true,
6716	//       "type": "string"
6717	//     }
6718	//   },
6719	//   "path": "permissions/{permissionId}",
6720	//   "response": {
6721	//     "$ref": "Permission"
6722	//   },
6723	//   "scopes": [
6724	//     "https://www.googleapis.com/auth/androidenterprise"
6725	//   ]
6726	// }
6727
6728}
6729
6730// method id "androidenterprise.products.approve":
6731
6732type ProductsApproveCall struct {
6733	s                      *Service
6734	enterpriseId           string
6735	productId              string
6736	productsapproverequest *ProductsApproveRequest
6737	urlParams_             gensupport.URLParams
6738	ctx_                   context.Context
6739}
6740
6741// Approve: Approves the specified product (and the relevant app
6742// permissions, if any).
6743func (r *ProductsService) Approve(enterpriseId string, productId string, productsapproverequest *ProductsApproveRequest) *ProductsApproveCall {
6744	c := &ProductsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6745	c.enterpriseId = enterpriseId
6746	c.productId = productId
6747	c.productsapproverequest = productsapproverequest
6748	return c
6749}
6750
6751// Fields allows partial responses to be retrieved. See
6752// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6753// for more information.
6754func (c *ProductsApproveCall) Fields(s ...googleapi.Field) *ProductsApproveCall {
6755	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6756	return c
6757}
6758
6759// Context sets the context to be used in this call's Do method. Any
6760// pending HTTP request will be aborted if the provided context is
6761// canceled.
6762func (c *ProductsApproveCall) Context(ctx context.Context) *ProductsApproveCall {
6763	c.ctx_ = ctx
6764	return c
6765}
6766
6767func (c *ProductsApproveCall) doRequest(alt string) (*http.Response, error) {
6768	var body io.Reader = nil
6769	body, err := googleapi.WithoutDataWrapper.JSONReader(c.productsapproverequest)
6770	if err != nil {
6771		return nil, err
6772	}
6773	ctype := "application/json"
6774	c.urlParams_.Set("alt", alt)
6775	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/approve")
6776	urls += "?" + c.urlParams_.Encode()
6777	req, _ := http.NewRequest("POST", urls, body)
6778	googleapi.Expand(req.URL, map[string]string{
6779		"enterpriseId": c.enterpriseId,
6780		"productId":    c.productId,
6781	})
6782	req.Header.Set("Content-Type", ctype)
6783	req.Header.Set("User-Agent", c.s.userAgent())
6784	if c.ctx_ != nil {
6785		return ctxhttp.Do(c.ctx_, c.s.client, req)
6786	}
6787	return c.s.client.Do(req)
6788}
6789
6790// Do executes the "androidenterprise.products.approve" call.
6791func (c *ProductsApproveCall) Do(opts ...googleapi.CallOption) error {
6792	gensupport.SetOptions(c.urlParams_, opts...)
6793	res, err := c.doRequest("json")
6794	if err != nil {
6795		return err
6796	}
6797	defer googleapi.CloseBody(res)
6798	if err := googleapi.CheckResponse(res); err != nil {
6799		return err
6800	}
6801	return nil
6802	// {
6803	//   "description": "Approves the specified product (and the relevant app permissions, if any).",
6804	//   "httpMethod": "POST",
6805	//   "id": "androidenterprise.products.approve",
6806	//   "parameterOrder": [
6807	//     "enterpriseId",
6808	//     "productId"
6809	//   ],
6810	//   "parameters": {
6811	//     "enterpriseId": {
6812	//       "description": "The ID of the enterprise.",
6813	//       "location": "path",
6814	//       "required": true,
6815	//       "type": "string"
6816	//     },
6817	//     "productId": {
6818	//       "description": "The ID of the product.",
6819	//       "location": "path",
6820	//       "required": true,
6821	//       "type": "string"
6822	//     }
6823	//   },
6824	//   "path": "enterprises/{enterpriseId}/products/{productId}/approve",
6825	//   "request": {
6826	//     "$ref": "ProductsApproveRequest"
6827	//   },
6828	//   "scopes": [
6829	//     "https://www.googleapis.com/auth/androidenterprise"
6830	//   ]
6831	// }
6832
6833}
6834
6835// method id "androidenterprise.products.generateApprovalUrl":
6836
6837type ProductsGenerateApprovalUrlCall struct {
6838	s            *Service
6839	enterpriseId string
6840	productId    string
6841	urlParams_   gensupport.URLParams
6842	ctx_         context.Context
6843}
6844
6845// GenerateApprovalUrl: Generates a URL that can be rendered in an
6846// iframe to display the permissions (if any) of a product. An
6847// enterprise admin must view these permissions and accept them on
6848// behalf of their organization in order to approve that
6849// product.
6850//
6851// Admins should accept the displayed permissions by interacting with a
6852// separate UI element in the EMM console, which in turn should trigger
6853// the use of this URL as the approvalUrlInfo.approvalUrl property in a
6854// Products.approve call to approve the product. This URL can only be
6855// used to display permissions for up to 1 day.
6856func (r *ProductsService) GenerateApprovalUrl(enterpriseId string, productId string) *ProductsGenerateApprovalUrlCall {
6857	c := &ProductsGenerateApprovalUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6858	c.enterpriseId = enterpriseId
6859	c.productId = productId
6860	return c
6861}
6862
6863// LanguageCode sets the optional parameter "languageCode": The BCP 47
6864// language code used for permission names and descriptions in the
6865// returned iframe, for instance "en-US".
6866func (c *ProductsGenerateApprovalUrlCall) LanguageCode(languageCode string) *ProductsGenerateApprovalUrlCall {
6867	c.urlParams_.Set("languageCode", languageCode)
6868	return c
6869}
6870
6871// Fields allows partial responses to be retrieved. See
6872// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6873// for more information.
6874func (c *ProductsGenerateApprovalUrlCall) Fields(s ...googleapi.Field) *ProductsGenerateApprovalUrlCall {
6875	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6876	return c
6877}
6878
6879// Context sets the context to be used in this call's Do method. Any
6880// pending HTTP request will be aborted if the provided context is
6881// canceled.
6882func (c *ProductsGenerateApprovalUrlCall) Context(ctx context.Context) *ProductsGenerateApprovalUrlCall {
6883	c.ctx_ = ctx
6884	return c
6885}
6886
6887func (c *ProductsGenerateApprovalUrlCall) doRequest(alt string) (*http.Response, error) {
6888	var body io.Reader = nil
6889	c.urlParams_.Set("alt", alt)
6890	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl")
6891	urls += "?" + c.urlParams_.Encode()
6892	req, _ := http.NewRequest("POST", urls, body)
6893	googleapi.Expand(req.URL, map[string]string{
6894		"enterpriseId": c.enterpriseId,
6895		"productId":    c.productId,
6896	})
6897	req.Header.Set("User-Agent", c.s.userAgent())
6898	if c.ctx_ != nil {
6899		return ctxhttp.Do(c.ctx_, c.s.client, req)
6900	}
6901	return c.s.client.Do(req)
6902}
6903
6904// Do executes the "androidenterprise.products.generateApprovalUrl" call.
6905// Exactly one of *ProductsGenerateApprovalUrlResponse or error will be
6906// non-nil. Any non-2xx status code is an error. Response headers are in
6907// either *ProductsGenerateApprovalUrlResponse.ServerResponse.Header or
6908// (if a response was returned at all) in
6909// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6910// whether the returned error was because http.StatusNotModified was
6911// returned.
6912func (c *ProductsGenerateApprovalUrlCall) Do(opts ...googleapi.CallOption) (*ProductsGenerateApprovalUrlResponse, error) {
6913	gensupport.SetOptions(c.urlParams_, opts...)
6914	res, err := c.doRequest("json")
6915	if res != nil && res.StatusCode == http.StatusNotModified {
6916		if res.Body != nil {
6917			res.Body.Close()
6918		}
6919		return nil, &googleapi.Error{
6920			Code:   res.StatusCode,
6921			Header: res.Header,
6922		}
6923	}
6924	if err != nil {
6925		return nil, err
6926	}
6927	defer googleapi.CloseBody(res)
6928	if err := googleapi.CheckResponse(res); err != nil {
6929		return nil, err
6930	}
6931	ret := &ProductsGenerateApprovalUrlResponse{
6932		ServerResponse: googleapi.ServerResponse{
6933			Header:         res.Header,
6934			HTTPStatusCode: res.StatusCode,
6935		},
6936	}
6937	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
6938		return nil, err
6939	}
6940	return ret, nil
6941	// {
6942	//   "description": "Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product.\n\nAdmins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day.",
6943	//   "httpMethod": "POST",
6944	//   "id": "androidenterprise.products.generateApprovalUrl",
6945	//   "parameterOrder": [
6946	//     "enterpriseId",
6947	//     "productId"
6948	//   ],
6949	//   "parameters": {
6950	//     "enterpriseId": {
6951	//       "description": "The ID of the enterprise.",
6952	//       "location": "path",
6953	//       "required": true,
6954	//       "type": "string"
6955	//     },
6956	//     "languageCode": {
6957	//       "description": "The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance \"en-US\".",
6958	//       "location": "query",
6959	//       "type": "string"
6960	//     },
6961	//     "productId": {
6962	//       "description": "The ID of the product.",
6963	//       "location": "path",
6964	//       "required": true,
6965	//       "type": "string"
6966	//     }
6967	//   },
6968	//   "path": "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl",
6969	//   "response": {
6970	//     "$ref": "ProductsGenerateApprovalUrlResponse"
6971	//   },
6972	//   "scopes": [
6973	//     "https://www.googleapis.com/auth/androidenterprise"
6974	//   ]
6975	// }
6976
6977}
6978
6979// method id "androidenterprise.products.get":
6980
6981type ProductsGetCall struct {
6982	s            *Service
6983	enterpriseId string
6984	productId    string
6985	urlParams_   gensupport.URLParams
6986	ifNoneMatch_ string
6987	ctx_         context.Context
6988}
6989
6990// Get: Retrieves details of a product for display to an enterprise
6991// admin.
6992func (r *ProductsService) Get(enterpriseId string, productId string) *ProductsGetCall {
6993	c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6994	c.enterpriseId = enterpriseId
6995	c.productId = productId
6996	return c
6997}
6998
6999// Language sets the optional parameter "language": The BCP47 tag for
7000// the user's preferred language (e.g. "en-US", "de").
7001func (c *ProductsGetCall) Language(language string) *ProductsGetCall {
7002	c.urlParams_.Set("language", language)
7003	return c
7004}
7005
7006// Fields allows partial responses to be retrieved. See
7007// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7008// for more information.
7009func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
7010	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7011	return c
7012}
7013
7014// IfNoneMatch sets the optional parameter which makes the operation
7015// fail if the object's ETag matches the given value. This is useful for
7016// getting updates only after the object has changed since the last
7017// request. Use googleapi.IsNotModified to check whether the response
7018// error from Do is the result of In-None-Match.
7019func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
7020	c.ifNoneMatch_ = entityTag
7021	return c
7022}
7023
7024// Context sets the context to be used in this call's Do method. Any
7025// pending HTTP request will be aborted if the provided context is
7026// canceled.
7027func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
7028	c.ctx_ = ctx
7029	return c
7030}
7031
7032func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
7033	var body io.Reader = nil
7034	c.urlParams_.Set("alt", alt)
7035	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}")
7036	urls += "?" + c.urlParams_.Encode()
7037	req, _ := http.NewRequest("GET", urls, body)
7038	googleapi.Expand(req.URL, map[string]string{
7039		"enterpriseId": c.enterpriseId,
7040		"productId":    c.productId,
7041	})
7042	req.Header.Set("User-Agent", c.s.userAgent())
7043	if c.ifNoneMatch_ != "" {
7044		req.Header.Set("If-None-Match", c.ifNoneMatch_)
7045	}
7046	if c.ctx_ != nil {
7047		return ctxhttp.Do(c.ctx_, c.s.client, req)
7048	}
7049	return c.s.client.Do(req)
7050}
7051
7052// Do executes the "androidenterprise.products.get" call.
7053// Exactly one of *Product or error will be non-nil. Any non-2xx status
7054// code is an error. Response headers are in either
7055// *Product.ServerResponse.Header or (if a response was returned at all)
7056// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7057// check whether the returned error was because http.StatusNotModified
7058// was returned.
7059func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
7060	gensupport.SetOptions(c.urlParams_, opts...)
7061	res, err := c.doRequest("json")
7062	if res != nil && res.StatusCode == http.StatusNotModified {
7063		if res.Body != nil {
7064			res.Body.Close()
7065		}
7066		return nil, &googleapi.Error{
7067			Code:   res.StatusCode,
7068			Header: res.Header,
7069		}
7070	}
7071	if err != nil {
7072		return nil, err
7073	}
7074	defer googleapi.CloseBody(res)
7075	if err := googleapi.CheckResponse(res); err != nil {
7076		return nil, err
7077	}
7078	ret := &Product{
7079		ServerResponse: googleapi.ServerResponse{
7080			Header:         res.Header,
7081			HTTPStatusCode: res.StatusCode,
7082		},
7083	}
7084	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
7085		return nil, err
7086	}
7087	return ret, nil
7088	// {
7089	//   "description": "Retrieves details of a product for display to an enterprise admin.",
7090	//   "httpMethod": "GET",
7091	//   "id": "androidenterprise.products.get",
7092	//   "parameterOrder": [
7093	//     "enterpriseId",
7094	//     "productId"
7095	//   ],
7096	//   "parameters": {
7097	//     "enterpriseId": {
7098	//       "description": "The ID of the enterprise.",
7099	//       "location": "path",
7100	//       "required": true,
7101	//       "type": "string"
7102	//     },
7103	//     "language": {
7104	//       "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
7105	//       "location": "query",
7106	//       "type": "string"
7107	//     },
7108	//     "productId": {
7109	//       "description": "The ID of the product, e.g. \"app:com.google.android.gm\".",
7110	//       "location": "path",
7111	//       "required": true,
7112	//       "type": "string"
7113	//     }
7114	//   },
7115	//   "path": "enterprises/{enterpriseId}/products/{productId}",
7116	//   "response": {
7117	//     "$ref": "Product"
7118	//   },
7119	//   "scopes": [
7120	//     "https://www.googleapis.com/auth/androidenterprise"
7121	//   ]
7122	// }
7123
7124}
7125
7126// method id "androidenterprise.products.getAppRestrictionsSchema":
7127
7128type ProductsGetAppRestrictionsSchemaCall struct {
7129	s            *Service
7130	enterpriseId string
7131	productId    string
7132	urlParams_   gensupport.URLParams
7133	ifNoneMatch_ string
7134	ctx_         context.Context
7135}
7136
7137// GetAppRestrictionsSchema: Retrieves the schema defining app
7138// restrictions configurable for this product. All products have a
7139// schema, but this may be empty if no app restrictions are defined.
7140func (r *ProductsService) GetAppRestrictionsSchema(enterpriseId string, productId string) *ProductsGetAppRestrictionsSchemaCall {
7141	c := &ProductsGetAppRestrictionsSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7142	c.enterpriseId = enterpriseId
7143	c.productId = productId
7144	return c
7145}
7146
7147// Language sets the optional parameter "language": The BCP47 tag for
7148// the user's preferred language (e.g. "en-US", "de").
7149func (c *ProductsGetAppRestrictionsSchemaCall) Language(language string) *ProductsGetAppRestrictionsSchemaCall {
7150	c.urlParams_.Set("language", language)
7151	return c
7152}
7153
7154// Fields allows partial responses to be retrieved. See
7155// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7156// for more information.
7157func (c *ProductsGetAppRestrictionsSchemaCall) Fields(s ...googleapi.Field) *ProductsGetAppRestrictionsSchemaCall {
7158	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7159	return c
7160}
7161
7162// IfNoneMatch sets the optional parameter which makes the operation
7163// fail if the object's ETag matches the given value. This is useful for
7164// getting updates only after the object has changed since the last
7165// request. Use googleapi.IsNotModified to check whether the response
7166// error from Do is the result of In-None-Match.
7167func (c *ProductsGetAppRestrictionsSchemaCall) IfNoneMatch(entityTag string) *ProductsGetAppRestrictionsSchemaCall {
7168	c.ifNoneMatch_ = entityTag
7169	return c
7170}
7171
7172// Context sets the context to be used in this call's Do method. Any
7173// pending HTTP request will be aborted if the provided context is
7174// canceled.
7175func (c *ProductsGetAppRestrictionsSchemaCall) Context(ctx context.Context) *ProductsGetAppRestrictionsSchemaCall {
7176	c.ctx_ = ctx
7177	return c
7178}
7179
7180func (c *ProductsGetAppRestrictionsSchemaCall) doRequest(alt string) (*http.Response, error) {
7181	var body io.Reader = nil
7182	c.urlParams_.Set("alt", alt)
7183	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema")
7184	urls += "?" + c.urlParams_.Encode()
7185	req, _ := http.NewRequest("GET", urls, body)
7186	googleapi.Expand(req.URL, map[string]string{
7187		"enterpriseId": c.enterpriseId,
7188		"productId":    c.productId,
7189	})
7190	req.Header.Set("User-Agent", c.s.userAgent())
7191	if c.ifNoneMatch_ != "" {
7192		req.Header.Set("If-None-Match", c.ifNoneMatch_)
7193	}
7194	if c.ctx_ != nil {
7195		return ctxhttp.Do(c.ctx_, c.s.client, req)
7196	}
7197	return c.s.client.Do(req)
7198}
7199
7200// Do executes the "androidenterprise.products.getAppRestrictionsSchema" call.
7201// Exactly one of *AppRestrictionsSchema or error will be non-nil. Any
7202// non-2xx status code is an error. Response headers are in either
7203// *AppRestrictionsSchema.ServerResponse.Header or (if a response was
7204// returned at all) in error.(*googleapi.Error).Header. Use
7205// googleapi.IsNotModified to check whether the returned error was
7206// because http.StatusNotModified was returned.
7207func (c *ProductsGetAppRestrictionsSchemaCall) Do(opts ...googleapi.CallOption) (*AppRestrictionsSchema, error) {
7208	gensupport.SetOptions(c.urlParams_, opts...)
7209	res, err := c.doRequest("json")
7210	if res != nil && res.StatusCode == http.StatusNotModified {
7211		if res.Body != nil {
7212			res.Body.Close()
7213		}
7214		return nil, &googleapi.Error{
7215			Code:   res.StatusCode,
7216			Header: res.Header,
7217		}
7218	}
7219	if err != nil {
7220		return nil, err
7221	}
7222	defer googleapi.CloseBody(res)
7223	if err := googleapi.CheckResponse(res); err != nil {
7224		return nil, err
7225	}
7226	ret := &AppRestrictionsSchema{
7227		ServerResponse: googleapi.ServerResponse{
7228			Header:         res.Header,
7229			HTTPStatusCode: res.StatusCode,
7230		},
7231	}
7232	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
7233		return nil, err
7234	}
7235	return ret, nil
7236	// {
7237	//   "description": "Retrieves the schema defining app restrictions configurable for this product. All products have a schema, but this may be empty if no app restrictions are defined.",
7238	//   "httpMethod": "GET",
7239	//   "id": "androidenterprise.products.getAppRestrictionsSchema",
7240	//   "parameterOrder": [
7241	//     "enterpriseId",
7242	//     "productId"
7243	//   ],
7244	//   "parameters": {
7245	//     "enterpriseId": {
7246	//       "description": "The ID of the enterprise.",
7247	//       "location": "path",
7248	//       "required": true,
7249	//       "type": "string"
7250	//     },
7251	//     "language": {
7252	//       "description": "The BCP47 tag for the user's preferred language (e.g. \"en-US\", \"de\").",
7253	//       "location": "query",
7254	//       "type": "string"
7255	//     },
7256	//     "productId": {
7257	//       "description": "The ID of the product.",
7258	//       "location": "path",
7259	//       "required": true,
7260	//       "type": "string"
7261	//     }
7262	//   },
7263	//   "path": "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema",
7264	//   "response": {
7265	//     "$ref": "AppRestrictionsSchema"
7266	//   },
7267	//   "scopes": [
7268	//     "https://www.googleapis.com/auth/androidenterprise"
7269	//   ]
7270	// }
7271
7272}
7273
7274// method id "androidenterprise.products.getPermissions":
7275
7276type ProductsGetPermissionsCall struct {
7277	s            *Service
7278	enterpriseId string
7279	productId    string
7280	urlParams_   gensupport.URLParams
7281	ifNoneMatch_ string
7282	ctx_         context.Context
7283}
7284
7285// GetPermissions: Retrieves the Android app permissions required by
7286// this app.
7287func (r *ProductsService) GetPermissions(enterpriseId string, productId string) *ProductsGetPermissionsCall {
7288	c := &ProductsGetPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7289	c.enterpriseId = enterpriseId
7290	c.productId = productId
7291	return c
7292}
7293
7294// Fields allows partial responses to be retrieved. See
7295// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7296// for more information.
7297func (c *ProductsGetPermissionsCall) Fields(s ...googleapi.Field) *ProductsGetPermissionsCall {
7298	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7299	return c
7300}
7301
7302// IfNoneMatch sets the optional parameter which makes the operation
7303// fail if the object's ETag matches the given value. This is useful for
7304// getting updates only after the object has changed since the last
7305// request. Use googleapi.IsNotModified to check whether the response
7306// error from Do is the result of In-None-Match.
7307func (c *ProductsGetPermissionsCall) IfNoneMatch(entityTag string) *ProductsGetPermissionsCall {
7308	c.ifNoneMatch_ = entityTag
7309	return c
7310}
7311
7312// Context sets the context to be used in this call's Do method. Any
7313// pending HTTP request will be aborted if the provided context is
7314// canceled.
7315func (c *ProductsGetPermissionsCall) Context(ctx context.Context) *ProductsGetPermissionsCall {
7316	c.ctx_ = ctx
7317	return c
7318}
7319
7320func (c *ProductsGetPermissionsCall) doRequest(alt string) (*http.Response, error) {
7321	var body io.Reader = nil
7322	c.urlParams_.Set("alt", alt)
7323	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions")
7324	urls += "?" + c.urlParams_.Encode()
7325	req, _ := http.NewRequest("GET", urls, body)
7326	googleapi.Expand(req.URL, map[string]string{
7327		"enterpriseId": c.enterpriseId,
7328		"productId":    c.productId,
7329	})
7330	req.Header.Set("User-Agent", c.s.userAgent())
7331	if c.ifNoneMatch_ != "" {
7332		req.Header.Set("If-None-Match", c.ifNoneMatch_)
7333	}
7334	if c.ctx_ != nil {
7335		return ctxhttp.Do(c.ctx_, c.s.client, req)
7336	}
7337	return c.s.client.Do(req)
7338}
7339
7340// Do executes the "androidenterprise.products.getPermissions" call.
7341// Exactly one of *ProductPermissions or error will be non-nil. Any
7342// non-2xx status code is an error. Response headers are in either
7343// *ProductPermissions.ServerResponse.Header or (if a response was
7344// returned at all) in error.(*googleapi.Error).Header. Use
7345// googleapi.IsNotModified to check whether the returned error was
7346// because http.StatusNotModified was returned.
7347func (c *ProductsGetPermissionsCall) Do(opts ...googleapi.CallOption) (*ProductPermissions, error) {
7348	gensupport.SetOptions(c.urlParams_, opts...)
7349	res, err := c.doRequest("json")
7350	if res != nil && res.StatusCode == http.StatusNotModified {
7351		if res.Body != nil {
7352			res.Body.Close()
7353		}
7354		return nil, &googleapi.Error{
7355			Code:   res.StatusCode,
7356			Header: res.Header,
7357		}
7358	}
7359	if err != nil {
7360		return nil, err
7361	}
7362	defer googleapi.CloseBody(res)
7363	if err := googleapi.CheckResponse(res); err != nil {
7364		return nil, err
7365	}
7366	ret := &ProductPermissions{
7367		ServerResponse: googleapi.ServerResponse{
7368			Header:         res.Header,
7369			HTTPStatusCode: res.StatusCode,
7370		},
7371	}
7372	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
7373		return nil, err
7374	}
7375	return ret, nil
7376	// {
7377	//   "description": "Retrieves the Android app permissions required by this app.",
7378	//   "httpMethod": "GET",
7379	//   "id": "androidenterprise.products.getPermissions",
7380	//   "parameterOrder": [
7381	//     "enterpriseId",
7382	//     "productId"
7383	//   ],
7384	//   "parameters": {
7385	//     "enterpriseId": {
7386	//       "description": "The ID of the enterprise.",
7387	//       "location": "path",
7388	//       "required": true,
7389	//       "type": "string"
7390	//     },
7391	//     "productId": {
7392	//       "description": "The ID of the product.",
7393	//       "location": "path",
7394	//       "required": true,
7395	//       "type": "string"
7396	//     }
7397	//   },
7398	//   "path": "enterprises/{enterpriseId}/products/{productId}/permissions",
7399	//   "response": {
7400	//     "$ref": "ProductPermissions"
7401	//   },
7402	//   "scopes": [
7403	//     "https://www.googleapis.com/auth/androidenterprise"
7404	//   ]
7405	// }
7406
7407}
7408
7409// method id "androidenterprise.products.updatePermissions":
7410
7411type ProductsUpdatePermissionsCall struct {
7412	s                  *Service
7413	enterpriseId       string
7414	productId          string
7415	productpermissions *ProductPermissions
7416	urlParams_         gensupport.URLParams
7417	ctx_               context.Context
7418}
7419
7420// UpdatePermissions: This method has been deprecated. To
7421// programmatically approve applications, you must use the iframe
7422// mechanism via the  generateApprovalUrl and  approve methods of the
7423// Products resource. For more information, see the  Play EMM API usage
7424// requirements.
7425//
7426// The updatePermissions method (deprecated) updates the set of Android
7427// app permissions for this app that have been accepted by the
7428// enterprise.
7429func (r *ProductsService) UpdatePermissions(enterpriseId string, productId string, productpermissions *ProductPermissions) *ProductsUpdatePermissionsCall {
7430	c := &ProductsUpdatePermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7431	c.enterpriseId = enterpriseId
7432	c.productId = productId
7433	c.productpermissions = productpermissions
7434	return c
7435}
7436
7437// Fields allows partial responses to be retrieved. See
7438// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7439// for more information.
7440func (c *ProductsUpdatePermissionsCall) Fields(s ...googleapi.Field) *ProductsUpdatePermissionsCall {
7441	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7442	return c
7443}
7444
7445// Context sets the context to be used in this call's Do method. Any
7446// pending HTTP request will be aborted if the provided context is
7447// canceled.
7448func (c *ProductsUpdatePermissionsCall) Context(ctx context.Context) *ProductsUpdatePermissionsCall {
7449	c.ctx_ = ctx
7450	return c
7451}
7452
7453func (c *ProductsUpdatePermissionsCall) doRequest(alt string) (*http.Response, error) {
7454	var body io.Reader = nil
7455	body, err := googleapi.WithoutDataWrapper.JSONReader(c.productpermissions)
7456	if err != nil {
7457		return nil, err
7458	}
7459	ctype := "application/json"
7460	c.urlParams_.Set("alt", alt)
7461	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/products/{productId}/permissions")
7462	urls += "?" + c.urlParams_.Encode()
7463	req, _ := http.NewRequest("PUT", urls, body)
7464	googleapi.Expand(req.URL, map[string]string{
7465		"enterpriseId": c.enterpriseId,
7466		"productId":    c.productId,
7467	})
7468	req.Header.Set("Content-Type", ctype)
7469	req.Header.Set("User-Agent", c.s.userAgent())
7470	if c.ctx_ != nil {
7471		return ctxhttp.Do(c.ctx_, c.s.client, req)
7472	}
7473	return c.s.client.Do(req)
7474}
7475
7476// Do executes the "androidenterprise.products.updatePermissions" call.
7477// Exactly one of *ProductPermissions or error will be non-nil. Any
7478// non-2xx status code is an error. Response headers are in either
7479// *ProductPermissions.ServerResponse.Header or (if a response was
7480// returned at all) in error.(*googleapi.Error).Header. Use
7481// googleapi.IsNotModified to check whether the returned error was
7482// because http.StatusNotModified was returned.
7483func (c *ProductsUpdatePermissionsCall) Do(opts ...googleapi.CallOption) (*ProductPermissions, error) {
7484	gensupport.SetOptions(c.urlParams_, opts...)
7485	res, err := c.doRequest("json")
7486	if res != nil && res.StatusCode == http.StatusNotModified {
7487		if res.Body != nil {
7488			res.Body.Close()
7489		}
7490		return nil, &googleapi.Error{
7491			Code:   res.StatusCode,
7492			Header: res.Header,
7493		}
7494	}
7495	if err != nil {
7496		return nil, err
7497	}
7498	defer googleapi.CloseBody(res)
7499	if err := googleapi.CheckResponse(res); err != nil {
7500		return nil, err
7501	}
7502	ret := &ProductPermissions{
7503		ServerResponse: googleapi.ServerResponse{
7504			Header:         res.Header,
7505			HTTPStatusCode: res.StatusCode,
7506		},
7507	}
7508	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
7509		return nil, err
7510	}
7511	return ret, nil
7512	// {
7513	//   "description": "This method has been deprecated. To programmatically approve applications, you must use the iframe mechanism via the  generateApprovalUrl and  approve methods of the Products resource. For more information, see the  Play EMM API usage requirements.\n\nThe updatePermissions method (deprecated) updates the set of Android app permissions for this app that have been accepted by the enterprise.",
7514	//   "httpMethod": "PUT",
7515	//   "id": "androidenterprise.products.updatePermissions",
7516	//   "parameterOrder": [
7517	//     "enterpriseId",
7518	//     "productId"
7519	//   ],
7520	//   "parameters": {
7521	//     "enterpriseId": {
7522	//       "description": "The ID of the enterprise.",
7523	//       "location": "path",
7524	//       "required": true,
7525	//       "type": "string"
7526	//     },
7527	//     "productId": {
7528	//       "description": "The ID of the product.",
7529	//       "location": "path",
7530	//       "required": true,
7531	//       "type": "string"
7532	//     }
7533	//   },
7534	//   "path": "enterprises/{enterpriseId}/products/{productId}/permissions",
7535	//   "request": {
7536	//     "$ref": "ProductPermissions"
7537	//   },
7538	//   "response": {
7539	//     "$ref": "ProductPermissions"
7540	//   },
7541	//   "scopes": [
7542	//     "https://www.googleapis.com/auth/androidenterprise"
7543	//   ]
7544	// }
7545
7546}
7547
7548// method id "androidenterprise.storelayoutclusters.delete":
7549
7550type StorelayoutclustersDeleteCall struct {
7551	s            *Service
7552	enterpriseId string
7553	pageId       string
7554	clusterId    string
7555	urlParams_   gensupport.URLParams
7556	ctx_         context.Context
7557}
7558
7559// Delete: Deletes a cluster.
7560func (r *StorelayoutclustersService) Delete(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersDeleteCall {
7561	c := &StorelayoutclustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7562	c.enterpriseId = enterpriseId
7563	c.pageId = pageId
7564	c.clusterId = clusterId
7565	return c
7566}
7567
7568// Fields allows partial responses to be retrieved. See
7569// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7570// for more information.
7571func (c *StorelayoutclustersDeleteCall) Fields(s ...googleapi.Field) *StorelayoutclustersDeleteCall {
7572	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7573	return c
7574}
7575
7576// Context sets the context to be used in this call's Do method. Any
7577// pending HTTP request will be aborted if the provided context is
7578// canceled.
7579func (c *StorelayoutclustersDeleteCall) Context(ctx context.Context) *StorelayoutclustersDeleteCall {
7580	c.ctx_ = ctx
7581	return c
7582}
7583
7584func (c *StorelayoutclustersDeleteCall) doRequest(alt string) (*http.Response, error) {
7585	var body io.Reader = nil
7586	c.urlParams_.Set("alt", alt)
7587	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
7588	urls += "?" + c.urlParams_.Encode()
7589	req, _ := http.NewRequest("DELETE", urls, body)
7590	googleapi.Expand(req.URL, map[string]string{
7591		"enterpriseId": c.enterpriseId,
7592		"pageId":       c.pageId,
7593		"clusterId":    c.clusterId,
7594	})
7595	req.Header.Set("User-Agent", c.s.userAgent())
7596	if c.ctx_ != nil {
7597		return ctxhttp.Do(c.ctx_, c.s.client, req)
7598	}
7599	return c.s.client.Do(req)
7600}
7601
7602// Do executes the "androidenterprise.storelayoutclusters.delete" call.
7603func (c *StorelayoutclustersDeleteCall) Do(opts ...googleapi.CallOption) error {
7604	gensupport.SetOptions(c.urlParams_, opts...)
7605	res, err := c.doRequest("json")
7606	if err != nil {
7607		return err
7608	}
7609	defer googleapi.CloseBody(res)
7610	if err := googleapi.CheckResponse(res); err != nil {
7611		return err
7612	}
7613	return nil
7614	// {
7615	//   "description": "Deletes a cluster.",
7616	//   "httpMethod": "DELETE",
7617	//   "id": "androidenterprise.storelayoutclusters.delete",
7618	//   "parameterOrder": [
7619	//     "enterpriseId",
7620	//     "pageId",
7621	//     "clusterId"
7622	//   ],
7623	//   "parameters": {
7624	//     "clusterId": {
7625	//       "description": "The ID of the cluster.",
7626	//       "location": "path",
7627	//       "required": true,
7628	//       "type": "string"
7629	//     },
7630	//     "enterpriseId": {
7631	//       "description": "The ID of the enterprise.",
7632	//       "location": "path",
7633	//       "required": true,
7634	//       "type": "string"
7635	//     },
7636	//     "pageId": {
7637	//       "description": "The ID of the page.",
7638	//       "location": "path",
7639	//       "required": true,
7640	//       "type": "string"
7641	//     }
7642	//   },
7643	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
7644	//   "scopes": [
7645	//     "https://www.googleapis.com/auth/androidenterprise"
7646	//   ]
7647	// }
7648
7649}
7650
7651// method id "androidenterprise.storelayoutclusters.get":
7652
7653type StorelayoutclustersGetCall struct {
7654	s            *Service
7655	enterpriseId string
7656	pageId       string
7657	clusterId    string
7658	urlParams_   gensupport.URLParams
7659	ifNoneMatch_ string
7660	ctx_         context.Context
7661}
7662
7663// Get: Retrieves details of a cluster.
7664func (r *StorelayoutclustersService) Get(enterpriseId string, pageId string, clusterId string) *StorelayoutclustersGetCall {
7665	c := &StorelayoutclustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7666	c.enterpriseId = enterpriseId
7667	c.pageId = pageId
7668	c.clusterId = clusterId
7669	return c
7670}
7671
7672// Fields allows partial responses to be retrieved. See
7673// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7674// for more information.
7675func (c *StorelayoutclustersGetCall) Fields(s ...googleapi.Field) *StorelayoutclustersGetCall {
7676	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7677	return c
7678}
7679
7680// IfNoneMatch sets the optional parameter which makes the operation
7681// fail if the object's ETag matches the given value. This is useful for
7682// getting updates only after the object has changed since the last
7683// request. Use googleapi.IsNotModified to check whether the response
7684// error from Do is the result of In-None-Match.
7685func (c *StorelayoutclustersGetCall) IfNoneMatch(entityTag string) *StorelayoutclustersGetCall {
7686	c.ifNoneMatch_ = entityTag
7687	return c
7688}
7689
7690// Context sets the context to be used in this call's Do method. Any
7691// pending HTTP request will be aborted if the provided context is
7692// canceled.
7693func (c *StorelayoutclustersGetCall) Context(ctx context.Context) *StorelayoutclustersGetCall {
7694	c.ctx_ = ctx
7695	return c
7696}
7697
7698func (c *StorelayoutclustersGetCall) doRequest(alt string) (*http.Response, error) {
7699	var body io.Reader = nil
7700	c.urlParams_.Set("alt", alt)
7701	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
7702	urls += "?" + c.urlParams_.Encode()
7703	req, _ := http.NewRequest("GET", urls, body)
7704	googleapi.Expand(req.URL, map[string]string{
7705		"enterpriseId": c.enterpriseId,
7706		"pageId":       c.pageId,
7707		"clusterId":    c.clusterId,
7708	})
7709	req.Header.Set("User-Agent", c.s.userAgent())
7710	if c.ifNoneMatch_ != "" {
7711		req.Header.Set("If-None-Match", c.ifNoneMatch_)
7712	}
7713	if c.ctx_ != nil {
7714		return ctxhttp.Do(c.ctx_, c.s.client, req)
7715	}
7716	return c.s.client.Do(req)
7717}
7718
7719// Do executes the "androidenterprise.storelayoutclusters.get" call.
7720// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
7721// status code is an error. Response headers are in either
7722// *StoreCluster.ServerResponse.Header or (if a response was returned at
7723// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7724// to check whether the returned error was because
7725// http.StatusNotModified was returned.
7726func (c *StorelayoutclustersGetCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
7727	gensupport.SetOptions(c.urlParams_, opts...)
7728	res, err := c.doRequest("json")
7729	if res != nil && res.StatusCode == http.StatusNotModified {
7730		if res.Body != nil {
7731			res.Body.Close()
7732		}
7733		return nil, &googleapi.Error{
7734			Code:   res.StatusCode,
7735			Header: res.Header,
7736		}
7737	}
7738	if err != nil {
7739		return nil, err
7740	}
7741	defer googleapi.CloseBody(res)
7742	if err := googleapi.CheckResponse(res); err != nil {
7743		return nil, err
7744	}
7745	ret := &StoreCluster{
7746		ServerResponse: googleapi.ServerResponse{
7747			Header:         res.Header,
7748			HTTPStatusCode: res.StatusCode,
7749		},
7750	}
7751	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
7752		return nil, err
7753	}
7754	return ret, nil
7755	// {
7756	//   "description": "Retrieves details of a cluster.",
7757	//   "httpMethod": "GET",
7758	//   "id": "androidenterprise.storelayoutclusters.get",
7759	//   "parameterOrder": [
7760	//     "enterpriseId",
7761	//     "pageId",
7762	//     "clusterId"
7763	//   ],
7764	//   "parameters": {
7765	//     "clusterId": {
7766	//       "description": "The ID of the cluster.",
7767	//       "location": "path",
7768	//       "required": true,
7769	//       "type": "string"
7770	//     },
7771	//     "enterpriseId": {
7772	//       "description": "The ID of the enterprise.",
7773	//       "location": "path",
7774	//       "required": true,
7775	//       "type": "string"
7776	//     },
7777	//     "pageId": {
7778	//       "description": "The ID of the page.",
7779	//       "location": "path",
7780	//       "required": true,
7781	//       "type": "string"
7782	//     }
7783	//   },
7784	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
7785	//   "response": {
7786	//     "$ref": "StoreCluster"
7787	//   },
7788	//   "scopes": [
7789	//     "https://www.googleapis.com/auth/androidenterprise"
7790	//   ]
7791	// }
7792
7793}
7794
7795// method id "androidenterprise.storelayoutclusters.insert":
7796
7797type StorelayoutclustersInsertCall struct {
7798	s            *Service
7799	enterpriseId string
7800	pageId       string
7801	storecluster *StoreCluster
7802	urlParams_   gensupport.URLParams
7803	ctx_         context.Context
7804}
7805
7806// Insert: Inserts a new cluster in a page.
7807func (r *StorelayoutclustersService) Insert(enterpriseId string, pageId string, storecluster *StoreCluster) *StorelayoutclustersInsertCall {
7808	c := &StorelayoutclustersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7809	c.enterpriseId = enterpriseId
7810	c.pageId = pageId
7811	c.storecluster = storecluster
7812	return c
7813}
7814
7815// Fields allows partial responses to be retrieved. See
7816// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7817// for more information.
7818func (c *StorelayoutclustersInsertCall) Fields(s ...googleapi.Field) *StorelayoutclustersInsertCall {
7819	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7820	return c
7821}
7822
7823// Context sets the context to be used in this call's Do method. Any
7824// pending HTTP request will be aborted if the provided context is
7825// canceled.
7826func (c *StorelayoutclustersInsertCall) Context(ctx context.Context) *StorelayoutclustersInsertCall {
7827	c.ctx_ = ctx
7828	return c
7829}
7830
7831func (c *StorelayoutclustersInsertCall) doRequest(alt string) (*http.Response, error) {
7832	var body io.Reader = nil
7833	body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
7834	if err != nil {
7835		return nil, err
7836	}
7837	ctype := "application/json"
7838	c.urlParams_.Set("alt", alt)
7839	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters")
7840	urls += "?" + c.urlParams_.Encode()
7841	req, _ := http.NewRequest("POST", urls, body)
7842	googleapi.Expand(req.URL, map[string]string{
7843		"enterpriseId": c.enterpriseId,
7844		"pageId":       c.pageId,
7845	})
7846	req.Header.Set("Content-Type", ctype)
7847	req.Header.Set("User-Agent", c.s.userAgent())
7848	if c.ctx_ != nil {
7849		return ctxhttp.Do(c.ctx_, c.s.client, req)
7850	}
7851	return c.s.client.Do(req)
7852}
7853
7854// Do executes the "androidenterprise.storelayoutclusters.insert" call.
7855// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
7856// status code is an error. Response headers are in either
7857// *StoreCluster.ServerResponse.Header or (if a response was returned at
7858// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7859// to check whether the returned error was because
7860// http.StatusNotModified was returned.
7861func (c *StorelayoutclustersInsertCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
7862	gensupport.SetOptions(c.urlParams_, opts...)
7863	res, err := c.doRequest("json")
7864	if res != nil && res.StatusCode == http.StatusNotModified {
7865		if res.Body != nil {
7866			res.Body.Close()
7867		}
7868		return nil, &googleapi.Error{
7869			Code:   res.StatusCode,
7870			Header: res.Header,
7871		}
7872	}
7873	if err != nil {
7874		return nil, err
7875	}
7876	defer googleapi.CloseBody(res)
7877	if err := googleapi.CheckResponse(res); err != nil {
7878		return nil, err
7879	}
7880	ret := &StoreCluster{
7881		ServerResponse: googleapi.ServerResponse{
7882			Header:         res.Header,
7883			HTTPStatusCode: res.StatusCode,
7884		},
7885	}
7886	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
7887		return nil, err
7888	}
7889	return ret, nil
7890	// {
7891	//   "description": "Inserts a new cluster in a page.",
7892	//   "httpMethod": "POST",
7893	//   "id": "androidenterprise.storelayoutclusters.insert",
7894	//   "parameterOrder": [
7895	//     "enterpriseId",
7896	//     "pageId"
7897	//   ],
7898	//   "parameters": {
7899	//     "enterpriseId": {
7900	//       "description": "The ID of the enterprise.",
7901	//       "location": "path",
7902	//       "required": true,
7903	//       "type": "string"
7904	//     },
7905	//     "pageId": {
7906	//       "description": "The ID of the page.",
7907	//       "location": "path",
7908	//       "required": true,
7909	//       "type": "string"
7910	//     }
7911	//   },
7912	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters",
7913	//   "request": {
7914	//     "$ref": "StoreCluster"
7915	//   },
7916	//   "response": {
7917	//     "$ref": "StoreCluster"
7918	//   },
7919	//   "scopes": [
7920	//     "https://www.googleapis.com/auth/androidenterprise"
7921	//   ]
7922	// }
7923
7924}
7925
7926// method id "androidenterprise.storelayoutclusters.list":
7927
7928type StorelayoutclustersListCall struct {
7929	s            *Service
7930	enterpriseId string
7931	pageId       string
7932	urlParams_   gensupport.URLParams
7933	ifNoneMatch_ string
7934	ctx_         context.Context
7935}
7936
7937// List: Retrieves the details of all clusters on the specified page.
7938func (r *StorelayoutclustersService) List(enterpriseId string, pageId string) *StorelayoutclustersListCall {
7939	c := &StorelayoutclustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7940	c.enterpriseId = enterpriseId
7941	c.pageId = pageId
7942	return c
7943}
7944
7945// Fields allows partial responses to be retrieved. See
7946// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7947// for more information.
7948func (c *StorelayoutclustersListCall) Fields(s ...googleapi.Field) *StorelayoutclustersListCall {
7949	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7950	return c
7951}
7952
7953// IfNoneMatch sets the optional parameter which makes the operation
7954// fail if the object's ETag matches the given value. This is useful for
7955// getting updates only after the object has changed since the last
7956// request. Use googleapi.IsNotModified to check whether the response
7957// error from Do is the result of In-None-Match.
7958func (c *StorelayoutclustersListCall) IfNoneMatch(entityTag string) *StorelayoutclustersListCall {
7959	c.ifNoneMatch_ = entityTag
7960	return c
7961}
7962
7963// Context sets the context to be used in this call's Do method. Any
7964// pending HTTP request will be aborted if the provided context is
7965// canceled.
7966func (c *StorelayoutclustersListCall) Context(ctx context.Context) *StorelayoutclustersListCall {
7967	c.ctx_ = ctx
7968	return c
7969}
7970
7971func (c *StorelayoutclustersListCall) doRequest(alt string) (*http.Response, error) {
7972	var body io.Reader = nil
7973	c.urlParams_.Set("alt", alt)
7974	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters")
7975	urls += "?" + c.urlParams_.Encode()
7976	req, _ := http.NewRequest("GET", urls, body)
7977	googleapi.Expand(req.URL, map[string]string{
7978		"enterpriseId": c.enterpriseId,
7979		"pageId":       c.pageId,
7980	})
7981	req.Header.Set("User-Agent", c.s.userAgent())
7982	if c.ifNoneMatch_ != "" {
7983		req.Header.Set("If-None-Match", c.ifNoneMatch_)
7984	}
7985	if c.ctx_ != nil {
7986		return ctxhttp.Do(c.ctx_, c.s.client, req)
7987	}
7988	return c.s.client.Do(req)
7989}
7990
7991// Do executes the "androidenterprise.storelayoutclusters.list" call.
7992// Exactly one of *StoreLayoutClustersListResponse or error will be
7993// non-nil. Any non-2xx status code is an error. Response headers are in
7994// either *StoreLayoutClustersListResponse.ServerResponse.Header or (if
7995// a response was returned at all) in error.(*googleapi.Error).Header.
7996// Use googleapi.IsNotModified to check whether the returned error was
7997// because http.StatusNotModified was returned.
7998func (c *StorelayoutclustersListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutClustersListResponse, error) {
7999	gensupport.SetOptions(c.urlParams_, opts...)
8000	res, err := c.doRequest("json")
8001	if res != nil && res.StatusCode == http.StatusNotModified {
8002		if res.Body != nil {
8003			res.Body.Close()
8004		}
8005		return nil, &googleapi.Error{
8006			Code:   res.StatusCode,
8007			Header: res.Header,
8008		}
8009	}
8010	if err != nil {
8011		return nil, err
8012	}
8013	defer googleapi.CloseBody(res)
8014	if err := googleapi.CheckResponse(res); err != nil {
8015		return nil, err
8016	}
8017	ret := &StoreLayoutClustersListResponse{
8018		ServerResponse: googleapi.ServerResponse{
8019			Header:         res.Header,
8020			HTTPStatusCode: res.StatusCode,
8021		},
8022	}
8023	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
8024		return nil, err
8025	}
8026	return ret, nil
8027	// {
8028	//   "description": "Retrieves the details of all clusters on the specified page.",
8029	//   "httpMethod": "GET",
8030	//   "id": "androidenterprise.storelayoutclusters.list",
8031	//   "parameterOrder": [
8032	//     "enterpriseId",
8033	//     "pageId"
8034	//   ],
8035	//   "parameters": {
8036	//     "enterpriseId": {
8037	//       "description": "The ID of the enterprise.",
8038	//       "location": "path",
8039	//       "required": true,
8040	//       "type": "string"
8041	//     },
8042	//     "pageId": {
8043	//       "description": "The ID of the page.",
8044	//       "location": "path",
8045	//       "required": true,
8046	//       "type": "string"
8047	//     }
8048	//   },
8049	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters",
8050	//   "response": {
8051	//     "$ref": "StoreLayoutClustersListResponse"
8052	//   },
8053	//   "scopes": [
8054	//     "https://www.googleapis.com/auth/androidenterprise"
8055	//   ]
8056	// }
8057
8058}
8059
8060// method id "androidenterprise.storelayoutclusters.patch":
8061
8062type StorelayoutclustersPatchCall struct {
8063	s            *Service
8064	enterpriseId string
8065	pageId       string
8066	clusterId    string
8067	storecluster *StoreCluster
8068	urlParams_   gensupport.URLParams
8069	ctx_         context.Context
8070}
8071
8072// Patch: Updates a cluster. This method supports patch semantics.
8073func (r *StorelayoutclustersService) Patch(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersPatchCall {
8074	c := &StorelayoutclustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8075	c.enterpriseId = enterpriseId
8076	c.pageId = pageId
8077	c.clusterId = clusterId
8078	c.storecluster = storecluster
8079	return c
8080}
8081
8082// Fields allows partial responses to be retrieved. See
8083// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8084// for more information.
8085func (c *StorelayoutclustersPatchCall) Fields(s ...googleapi.Field) *StorelayoutclustersPatchCall {
8086	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8087	return c
8088}
8089
8090// Context sets the context to be used in this call's Do method. Any
8091// pending HTTP request will be aborted if the provided context is
8092// canceled.
8093func (c *StorelayoutclustersPatchCall) Context(ctx context.Context) *StorelayoutclustersPatchCall {
8094	c.ctx_ = ctx
8095	return c
8096}
8097
8098func (c *StorelayoutclustersPatchCall) doRequest(alt string) (*http.Response, error) {
8099	var body io.Reader = nil
8100	body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
8101	if err != nil {
8102		return nil, err
8103	}
8104	ctype := "application/json"
8105	c.urlParams_.Set("alt", alt)
8106	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
8107	urls += "?" + c.urlParams_.Encode()
8108	req, _ := http.NewRequest("PATCH", urls, body)
8109	googleapi.Expand(req.URL, map[string]string{
8110		"enterpriseId": c.enterpriseId,
8111		"pageId":       c.pageId,
8112		"clusterId":    c.clusterId,
8113	})
8114	req.Header.Set("Content-Type", ctype)
8115	req.Header.Set("User-Agent", c.s.userAgent())
8116	if c.ctx_ != nil {
8117		return ctxhttp.Do(c.ctx_, c.s.client, req)
8118	}
8119	return c.s.client.Do(req)
8120}
8121
8122// Do executes the "androidenterprise.storelayoutclusters.patch" call.
8123// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
8124// status code is an error. Response headers are in either
8125// *StoreCluster.ServerResponse.Header or (if a response was returned at
8126// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8127// to check whether the returned error was because
8128// http.StatusNotModified was returned.
8129func (c *StorelayoutclustersPatchCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
8130	gensupport.SetOptions(c.urlParams_, opts...)
8131	res, err := c.doRequest("json")
8132	if res != nil && res.StatusCode == http.StatusNotModified {
8133		if res.Body != nil {
8134			res.Body.Close()
8135		}
8136		return nil, &googleapi.Error{
8137			Code:   res.StatusCode,
8138			Header: res.Header,
8139		}
8140	}
8141	if err != nil {
8142		return nil, err
8143	}
8144	defer googleapi.CloseBody(res)
8145	if err := googleapi.CheckResponse(res); err != nil {
8146		return nil, err
8147	}
8148	ret := &StoreCluster{
8149		ServerResponse: googleapi.ServerResponse{
8150			Header:         res.Header,
8151			HTTPStatusCode: res.StatusCode,
8152		},
8153	}
8154	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
8155		return nil, err
8156	}
8157	return ret, nil
8158	// {
8159	//   "description": "Updates a cluster. This method supports patch semantics.",
8160	//   "httpMethod": "PATCH",
8161	//   "id": "androidenterprise.storelayoutclusters.patch",
8162	//   "parameterOrder": [
8163	//     "enterpriseId",
8164	//     "pageId",
8165	//     "clusterId"
8166	//   ],
8167	//   "parameters": {
8168	//     "clusterId": {
8169	//       "description": "The ID of the cluster.",
8170	//       "location": "path",
8171	//       "required": true,
8172	//       "type": "string"
8173	//     },
8174	//     "enterpriseId": {
8175	//       "description": "The ID of the enterprise.",
8176	//       "location": "path",
8177	//       "required": true,
8178	//       "type": "string"
8179	//     },
8180	//     "pageId": {
8181	//       "description": "The ID of the page.",
8182	//       "location": "path",
8183	//       "required": true,
8184	//       "type": "string"
8185	//     }
8186	//   },
8187	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
8188	//   "request": {
8189	//     "$ref": "StoreCluster"
8190	//   },
8191	//   "response": {
8192	//     "$ref": "StoreCluster"
8193	//   },
8194	//   "scopes": [
8195	//     "https://www.googleapis.com/auth/androidenterprise"
8196	//   ]
8197	// }
8198
8199}
8200
8201// method id "androidenterprise.storelayoutclusters.update":
8202
8203type StorelayoutclustersUpdateCall struct {
8204	s            *Service
8205	enterpriseId string
8206	pageId       string
8207	clusterId    string
8208	storecluster *StoreCluster
8209	urlParams_   gensupport.URLParams
8210	ctx_         context.Context
8211}
8212
8213// Update: Updates a cluster.
8214func (r *StorelayoutclustersService) Update(enterpriseId string, pageId string, clusterId string, storecluster *StoreCluster) *StorelayoutclustersUpdateCall {
8215	c := &StorelayoutclustersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8216	c.enterpriseId = enterpriseId
8217	c.pageId = pageId
8218	c.clusterId = clusterId
8219	c.storecluster = storecluster
8220	return c
8221}
8222
8223// Fields allows partial responses to be retrieved. See
8224// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8225// for more information.
8226func (c *StorelayoutclustersUpdateCall) Fields(s ...googleapi.Field) *StorelayoutclustersUpdateCall {
8227	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8228	return c
8229}
8230
8231// Context sets the context to be used in this call's Do method. Any
8232// pending HTTP request will be aborted if the provided context is
8233// canceled.
8234func (c *StorelayoutclustersUpdateCall) Context(ctx context.Context) *StorelayoutclustersUpdateCall {
8235	c.ctx_ = ctx
8236	return c
8237}
8238
8239func (c *StorelayoutclustersUpdateCall) doRequest(alt string) (*http.Response, error) {
8240	var body io.Reader = nil
8241	body, err := googleapi.WithoutDataWrapper.JSONReader(c.storecluster)
8242	if err != nil {
8243		return nil, err
8244	}
8245	ctype := "application/json"
8246	c.urlParams_.Set("alt", alt)
8247	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}")
8248	urls += "?" + c.urlParams_.Encode()
8249	req, _ := http.NewRequest("PUT", urls, body)
8250	googleapi.Expand(req.URL, map[string]string{
8251		"enterpriseId": c.enterpriseId,
8252		"pageId":       c.pageId,
8253		"clusterId":    c.clusterId,
8254	})
8255	req.Header.Set("Content-Type", ctype)
8256	req.Header.Set("User-Agent", c.s.userAgent())
8257	if c.ctx_ != nil {
8258		return ctxhttp.Do(c.ctx_, c.s.client, req)
8259	}
8260	return c.s.client.Do(req)
8261}
8262
8263// Do executes the "androidenterprise.storelayoutclusters.update" call.
8264// Exactly one of *StoreCluster or error will be non-nil. Any non-2xx
8265// status code is an error. Response headers are in either
8266// *StoreCluster.ServerResponse.Header or (if a response was returned at
8267// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8268// to check whether the returned error was because
8269// http.StatusNotModified was returned.
8270func (c *StorelayoutclustersUpdateCall) Do(opts ...googleapi.CallOption) (*StoreCluster, error) {
8271	gensupport.SetOptions(c.urlParams_, opts...)
8272	res, err := c.doRequest("json")
8273	if res != nil && res.StatusCode == http.StatusNotModified {
8274		if res.Body != nil {
8275			res.Body.Close()
8276		}
8277		return nil, &googleapi.Error{
8278			Code:   res.StatusCode,
8279			Header: res.Header,
8280		}
8281	}
8282	if err != nil {
8283		return nil, err
8284	}
8285	defer googleapi.CloseBody(res)
8286	if err := googleapi.CheckResponse(res); err != nil {
8287		return nil, err
8288	}
8289	ret := &StoreCluster{
8290		ServerResponse: googleapi.ServerResponse{
8291			Header:         res.Header,
8292			HTTPStatusCode: res.StatusCode,
8293		},
8294	}
8295	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
8296		return nil, err
8297	}
8298	return ret, nil
8299	// {
8300	//   "description": "Updates a cluster.",
8301	//   "httpMethod": "PUT",
8302	//   "id": "androidenterprise.storelayoutclusters.update",
8303	//   "parameterOrder": [
8304	//     "enterpriseId",
8305	//     "pageId",
8306	//     "clusterId"
8307	//   ],
8308	//   "parameters": {
8309	//     "clusterId": {
8310	//       "description": "The ID of the cluster.",
8311	//       "location": "path",
8312	//       "required": true,
8313	//       "type": "string"
8314	//     },
8315	//     "enterpriseId": {
8316	//       "description": "The ID of the enterprise.",
8317	//       "location": "path",
8318	//       "required": true,
8319	//       "type": "string"
8320	//     },
8321	//     "pageId": {
8322	//       "description": "The ID of the page.",
8323	//       "location": "path",
8324	//       "required": true,
8325	//       "type": "string"
8326	//     }
8327	//   },
8328	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}",
8329	//   "request": {
8330	//     "$ref": "StoreCluster"
8331	//   },
8332	//   "response": {
8333	//     "$ref": "StoreCluster"
8334	//   },
8335	//   "scopes": [
8336	//     "https://www.googleapis.com/auth/androidenterprise"
8337	//   ]
8338	// }
8339
8340}
8341
8342// method id "androidenterprise.storelayoutpages.delete":
8343
8344type StorelayoutpagesDeleteCall struct {
8345	s            *Service
8346	enterpriseId string
8347	pageId       string
8348	urlParams_   gensupport.URLParams
8349	ctx_         context.Context
8350}
8351
8352// Delete: Deletes a store page.
8353func (r *StorelayoutpagesService) Delete(enterpriseId string, pageId string) *StorelayoutpagesDeleteCall {
8354	c := &StorelayoutpagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8355	c.enterpriseId = enterpriseId
8356	c.pageId = pageId
8357	return c
8358}
8359
8360// Fields allows partial responses to be retrieved. See
8361// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8362// for more information.
8363func (c *StorelayoutpagesDeleteCall) Fields(s ...googleapi.Field) *StorelayoutpagesDeleteCall {
8364	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8365	return c
8366}
8367
8368// Context sets the context to be used in this call's Do method. Any
8369// pending HTTP request will be aborted if the provided context is
8370// canceled.
8371func (c *StorelayoutpagesDeleteCall) Context(ctx context.Context) *StorelayoutpagesDeleteCall {
8372	c.ctx_ = ctx
8373	return c
8374}
8375
8376func (c *StorelayoutpagesDeleteCall) doRequest(alt string) (*http.Response, error) {
8377	var body io.Reader = nil
8378	c.urlParams_.Set("alt", alt)
8379	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
8380	urls += "?" + c.urlParams_.Encode()
8381	req, _ := http.NewRequest("DELETE", urls, body)
8382	googleapi.Expand(req.URL, map[string]string{
8383		"enterpriseId": c.enterpriseId,
8384		"pageId":       c.pageId,
8385	})
8386	req.Header.Set("User-Agent", c.s.userAgent())
8387	if c.ctx_ != nil {
8388		return ctxhttp.Do(c.ctx_, c.s.client, req)
8389	}
8390	return c.s.client.Do(req)
8391}
8392
8393// Do executes the "androidenterprise.storelayoutpages.delete" call.
8394func (c *StorelayoutpagesDeleteCall) Do(opts ...googleapi.CallOption) error {
8395	gensupport.SetOptions(c.urlParams_, opts...)
8396	res, err := c.doRequest("json")
8397	if err != nil {
8398		return err
8399	}
8400	defer googleapi.CloseBody(res)
8401	if err := googleapi.CheckResponse(res); err != nil {
8402		return err
8403	}
8404	return nil
8405	// {
8406	//   "description": "Deletes a store page.",
8407	//   "httpMethod": "DELETE",
8408	//   "id": "androidenterprise.storelayoutpages.delete",
8409	//   "parameterOrder": [
8410	//     "enterpriseId",
8411	//     "pageId"
8412	//   ],
8413	//   "parameters": {
8414	//     "enterpriseId": {
8415	//       "description": "The ID of the enterprise.",
8416	//       "location": "path",
8417	//       "required": true,
8418	//       "type": "string"
8419	//     },
8420	//     "pageId": {
8421	//       "description": "The ID of the page.",
8422	//       "location": "path",
8423	//       "required": true,
8424	//       "type": "string"
8425	//     }
8426	//   },
8427	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
8428	//   "scopes": [
8429	//     "https://www.googleapis.com/auth/androidenterprise"
8430	//   ]
8431	// }
8432
8433}
8434
8435// method id "androidenterprise.storelayoutpages.get":
8436
8437type StorelayoutpagesGetCall struct {
8438	s            *Service
8439	enterpriseId string
8440	pageId       string
8441	urlParams_   gensupport.URLParams
8442	ifNoneMatch_ string
8443	ctx_         context.Context
8444}
8445
8446// Get: Retrieves details of a store page.
8447func (r *StorelayoutpagesService) Get(enterpriseId string, pageId string) *StorelayoutpagesGetCall {
8448	c := &StorelayoutpagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8449	c.enterpriseId = enterpriseId
8450	c.pageId = pageId
8451	return c
8452}
8453
8454// Fields allows partial responses to be retrieved. See
8455// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8456// for more information.
8457func (c *StorelayoutpagesGetCall) Fields(s ...googleapi.Field) *StorelayoutpagesGetCall {
8458	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8459	return c
8460}
8461
8462// IfNoneMatch sets the optional parameter which makes the operation
8463// fail if the object's ETag matches the given value. This is useful for
8464// getting updates only after the object has changed since the last
8465// request. Use googleapi.IsNotModified to check whether the response
8466// error from Do is the result of In-None-Match.
8467func (c *StorelayoutpagesGetCall) IfNoneMatch(entityTag string) *StorelayoutpagesGetCall {
8468	c.ifNoneMatch_ = entityTag
8469	return c
8470}
8471
8472// Context sets the context to be used in this call's Do method. Any
8473// pending HTTP request will be aborted if the provided context is
8474// canceled.
8475func (c *StorelayoutpagesGetCall) Context(ctx context.Context) *StorelayoutpagesGetCall {
8476	c.ctx_ = ctx
8477	return c
8478}
8479
8480func (c *StorelayoutpagesGetCall) doRequest(alt string) (*http.Response, error) {
8481	var body io.Reader = nil
8482	c.urlParams_.Set("alt", alt)
8483	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
8484	urls += "?" + c.urlParams_.Encode()
8485	req, _ := http.NewRequest("GET", urls, body)
8486	googleapi.Expand(req.URL, map[string]string{
8487		"enterpriseId": c.enterpriseId,
8488		"pageId":       c.pageId,
8489	})
8490	req.Header.Set("User-Agent", c.s.userAgent())
8491	if c.ifNoneMatch_ != "" {
8492		req.Header.Set("If-None-Match", c.ifNoneMatch_)
8493	}
8494	if c.ctx_ != nil {
8495		return ctxhttp.Do(c.ctx_, c.s.client, req)
8496	}
8497	return c.s.client.Do(req)
8498}
8499
8500// Do executes the "androidenterprise.storelayoutpages.get" call.
8501// Exactly one of *StorePage or error will be non-nil. Any non-2xx
8502// status code is an error. Response headers are in either
8503// *StorePage.ServerResponse.Header or (if a response was returned at
8504// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8505// to check whether the returned error was because
8506// http.StatusNotModified was returned.
8507func (c *StorelayoutpagesGetCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
8508	gensupport.SetOptions(c.urlParams_, opts...)
8509	res, err := c.doRequest("json")
8510	if res != nil && res.StatusCode == http.StatusNotModified {
8511		if res.Body != nil {
8512			res.Body.Close()
8513		}
8514		return nil, &googleapi.Error{
8515			Code:   res.StatusCode,
8516			Header: res.Header,
8517		}
8518	}
8519	if err != nil {
8520		return nil, err
8521	}
8522	defer googleapi.CloseBody(res)
8523	if err := googleapi.CheckResponse(res); err != nil {
8524		return nil, err
8525	}
8526	ret := &StorePage{
8527		ServerResponse: googleapi.ServerResponse{
8528			Header:         res.Header,
8529			HTTPStatusCode: res.StatusCode,
8530		},
8531	}
8532	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
8533		return nil, err
8534	}
8535	return ret, nil
8536	// {
8537	//   "description": "Retrieves details of a store page.",
8538	//   "httpMethod": "GET",
8539	//   "id": "androidenterprise.storelayoutpages.get",
8540	//   "parameterOrder": [
8541	//     "enterpriseId",
8542	//     "pageId"
8543	//   ],
8544	//   "parameters": {
8545	//     "enterpriseId": {
8546	//       "description": "The ID of the enterprise.",
8547	//       "location": "path",
8548	//       "required": true,
8549	//       "type": "string"
8550	//     },
8551	//     "pageId": {
8552	//       "description": "The ID of the page.",
8553	//       "location": "path",
8554	//       "required": true,
8555	//       "type": "string"
8556	//     }
8557	//   },
8558	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
8559	//   "response": {
8560	//     "$ref": "StorePage"
8561	//   },
8562	//   "scopes": [
8563	//     "https://www.googleapis.com/auth/androidenterprise"
8564	//   ]
8565	// }
8566
8567}
8568
8569// method id "androidenterprise.storelayoutpages.insert":
8570
8571type StorelayoutpagesInsertCall struct {
8572	s            *Service
8573	enterpriseId string
8574	storepage    *StorePage
8575	urlParams_   gensupport.URLParams
8576	ctx_         context.Context
8577}
8578
8579// Insert: Inserts a new store page.
8580func (r *StorelayoutpagesService) Insert(enterpriseId string, storepage *StorePage) *StorelayoutpagesInsertCall {
8581	c := &StorelayoutpagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8582	c.enterpriseId = enterpriseId
8583	c.storepage = storepage
8584	return c
8585}
8586
8587// Fields allows partial responses to be retrieved. See
8588// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8589// for more information.
8590func (c *StorelayoutpagesInsertCall) Fields(s ...googleapi.Field) *StorelayoutpagesInsertCall {
8591	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8592	return c
8593}
8594
8595// Context sets the context to be used in this call's Do method. Any
8596// pending HTTP request will be aborted if the provided context is
8597// canceled.
8598func (c *StorelayoutpagesInsertCall) Context(ctx context.Context) *StorelayoutpagesInsertCall {
8599	c.ctx_ = ctx
8600	return c
8601}
8602
8603func (c *StorelayoutpagesInsertCall) doRequest(alt string) (*http.Response, error) {
8604	var body io.Reader = nil
8605	body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
8606	if err != nil {
8607		return nil, err
8608	}
8609	ctype := "application/json"
8610	c.urlParams_.Set("alt", alt)
8611	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages")
8612	urls += "?" + c.urlParams_.Encode()
8613	req, _ := http.NewRequest("POST", urls, body)
8614	googleapi.Expand(req.URL, map[string]string{
8615		"enterpriseId": c.enterpriseId,
8616	})
8617	req.Header.Set("Content-Type", ctype)
8618	req.Header.Set("User-Agent", c.s.userAgent())
8619	if c.ctx_ != nil {
8620		return ctxhttp.Do(c.ctx_, c.s.client, req)
8621	}
8622	return c.s.client.Do(req)
8623}
8624
8625// Do executes the "androidenterprise.storelayoutpages.insert" call.
8626// Exactly one of *StorePage or error will be non-nil. Any non-2xx
8627// status code is an error. Response headers are in either
8628// *StorePage.ServerResponse.Header or (if a response was returned at
8629// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8630// to check whether the returned error was because
8631// http.StatusNotModified was returned.
8632func (c *StorelayoutpagesInsertCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
8633	gensupport.SetOptions(c.urlParams_, opts...)
8634	res, err := c.doRequest("json")
8635	if res != nil && res.StatusCode == http.StatusNotModified {
8636		if res.Body != nil {
8637			res.Body.Close()
8638		}
8639		return nil, &googleapi.Error{
8640			Code:   res.StatusCode,
8641			Header: res.Header,
8642		}
8643	}
8644	if err != nil {
8645		return nil, err
8646	}
8647	defer googleapi.CloseBody(res)
8648	if err := googleapi.CheckResponse(res); err != nil {
8649		return nil, err
8650	}
8651	ret := &StorePage{
8652		ServerResponse: googleapi.ServerResponse{
8653			Header:         res.Header,
8654			HTTPStatusCode: res.StatusCode,
8655		},
8656	}
8657	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
8658		return nil, err
8659	}
8660	return ret, nil
8661	// {
8662	//   "description": "Inserts a new store page.",
8663	//   "httpMethod": "POST",
8664	//   "id": "androidenterprise.storelayoutpages.insert",
8665	//   "parameterOrder": [
8666	//     "enterpriseId"
8667	//   ],
8668	//   "parameters": {
8669	//     "enterpriseId": {
8670	//       "description": "The ID of the enterprise.",
8671	//       "location": "path",
8672	//       "required": true,
8673	//       "type": "string"
8674	//     }
8675	//   },
8676	//   "path": "enterprises/{enterpriseId}/storeLayout/pages",
8677	//   "request": {
8678	//     "$ref": "StorePage"
8679	//   },
8680	//   "response": {
8681	//     "$ref": "StorePage"
8682	//   },
8683	//   "scopes": [
8684	//     "https://www.googleapis.com/auth/androidenterprise"
8685	//   ]
8686	// }
8687
8688}
8689
8690// method id "androidenterprise.storelayoutpages.list":
8691
8692type StorelayoutpagesListCall struct {
8693	s            *Service
8694	enterpriseId string
8695	urlParams_   gensupport.URLParams
8696	ifNoneMatch_ string
8697	ctx_         context.Context
8698}
8699
8700// List: Retrieves the details of all pages in the store.
8701func (r *StorelayoutpagesService) List(enterpriseId string) *StorelayoutpagesListCall {
8702	c := &StorelayoutpagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8703	c.enterpriseId = enterpriseId
8704	return c
8705}
8706
8707// Fields allows partial responses to be retrieved. See
8708// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8709// for more information.
8710func (c *StorelayoutpagesListCall) Fields(s ...googleapi.Field) *StorelayoutpagesListCall {
8711	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8712	return c
8713}
8714
8715// IfNoneMatch sets the optional parameter which makes the operation
8716// fail if the object's ETag matches the given value. This is useful for
8717// getting updates only after the object has changed since the last
8718// request. Use googleapi.IsNotModified to check whether the response
8719// error from Do is the result of In-None-Match.
8720func (c *StorelayoutpagesListCall) IfNoneMatch(entityTag string) *StorelayoutpagesListCall {
8721	c.ifNoneMatch_ = entityTag
8722	return c
8723}
8724
8725// Context sets the context to be used in this call's Do method. Any
8726// pending HTTP request will be aborted if the provided context is
8727// canceled.
8728func (c *StorelayoutpagesListCall) Context(ctx context.Context) *StorelayoutpagesListCall {
8729	c.ctx_ = ctx
8730	return c
8731}
8732
8733func (c *StorelayoutpagesListCall) doRequest(alt string) (*http.Response, error) {
8734	var body io.Reader = nil
8735	c.urlParams_.Set("alt", alt)
8736	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages")
8737	urls += "?" + c.urlParams_.Encode()
8738	req, _ := http.NewRequest("GET", urls, body)
8739	googleapi.Expand(req.URL, map[string]string{
8740		"enterpriseId": c.enterpriseId,
8741	})
8742	req.Header.Set("User-Agent", c.s.userAgent())
8743	if c.ifNoneMatch_ != "" {
8744		req.Header.Set("If-None-Match", c.ifNoneMatch_)
8745	}
8746	if c.ctx_ != nil {
8747		return ctxhttp.Do(c.ctx_, c.s.client, req)
8748	}
8749	return c.s.client.Do(req)
8750}
8751
8752// Do executes the "androidenterprise.storelayoutpages.list" call.
8753// Exactly one of *StoreLayoutPagesListResponse or error will be
8754// non-nil. Any non-2xx status code is an error. Response headers are in
8755// either *StoreLayoutPagesListResponse.ServerResponse.Header or (if a
8756// response was returned at all) in error.(*googleapi.Error).Header. Use
8757// googleapi.IsNotModified to check whether the returned error was
8758// because http.StatusNotModified was returned.
8759func (c *StorelayoutpagesListCall) Do(opts ...googleapi.CallOption) (*StoreLayoutPagesListResponse, error) {
8760	gensupport.SetOptions(c.urlParams_, opts...)
8761	res, err := c.doRequest("json")
8762	if res != nil && res.StatusCode == http.StatusNotModified {
8763		if res.Body != nil {
8764			res.Body.Close()
8765		}
8766		return nil, &googleapi.Error{
8767			Code:   res.StatusCode,
8768			Header: res.Header,
8769		}
8770	}
8771	if err != nil {
8772		return nil, err
8773	}
8774	defer googleapi.CloseBody(res)
8775	if err := googleapi.CheckResponse(res); err != nil {
8776		return nil, err
8777	}
8778	ret := &StoreLayoutPagesListResponse{
8779		ServerResponse: googleapi.ServerResponse{
8780			Header:         res.Header,
8781			HTTPStatusCode: res.StatusCode,
8782		},
8783	}
8784	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
8785		return nil, err
8786	}
8787	return ret, nil
8788	// {
8789	//   "description": "Retrieves the details of all pages in the store.",
8790	//   "httpMethod": "GET",
8791	//   "id": "androidenterprise.storelayoutpages.list",
8792	//   "parameterOrder": [
8793	//     "enterpriseId"
8794	//   ],
8795	//   "parameters": {
8796	//     "enterpriseId": {
8797	//       "description": "The ID of the enterprise.",
8798	//       "location": "path",
8799	//       "required": true,
8800	//       "type": "string"
8801	//     }
8802	//   },
8803	//   "path": "enterprises/{enterpriseId}/storeLayout/pages",
8804	//   "response": {
8805	//     "$ref": "StoreLayoutPagesListResponse"
8806	//   },
8807	//   "scopes": [
8808	//     "https://www.googleapis.com/auth/androidenterprise"
8809	//   ]
8810	// }
8811
8812}
8813
8814// method id "androidenterprise.storelayoutpages.patch":
8815
8816type StorelayoutpagesPatchCall struct {
8817	s            *Service
8818	enterpriseId string
8819	pageId       string
8820	storepage    *StorePage
8821	urlParams_   gensupport.URLParams
8822	ctx_         context.Context
8823}
8824
8825// Patch: Updates the content of a store page. This method supports
8826// patch semantics.
8827func (r *StorelayoutpagesService) Patch(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesPatchCall {
8828	c := &StorelayoutpagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8829	c.enterpriseId = enterpriseId
8830	c.pageId = pageId
8831	c.storepage = storepage
8832	return c
8833}
8834
8835// Fields allows partial responses to be retrieved. See
8836// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8837// for more information.
8838func (c *StorelayoutpagesPatchCall) Fields(s ...googleapi.Field) *StorelayoutpagesPatchCall {
8839	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8840	return c
8841}
8842
8843// Context sets the context to be used in this call's Do method. Any
8844// pending HTTP request will be aborted if the provided context is
8845// canceled.
8846func (c *StorelayoutpagesPatchCall) Context(ctx context.Context) *StorelayoutpagesPatchCall {
8847	c.ctx_ = ctx
8848	return c
8849}
8850
8851func (c *StorelayoutpagesPatchCall) doRequest(alt string) (*http.Response, error) {
8852	var body io.Reader = nil
8853	body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
8854	if err != nil {
8855		return nil, err
8856	}
8857	ctype := "application/json"
8858	c.urlParams_.Set("alt", alt)
8859	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
8860	urls += "?" + c.urlParams_.Encode()
8861	req, _ := http.NewRequest("PATCH", urls, body)
8862	googleapi.Expand(req.URL, map[string]string{
8863		"enterpriseId": c.enterpriseId,
8864		"pageId":       c.pageId,
8865	})
8866	req.Header.Set("Content-Type", ctype)
8867	req.Header.Set("User-Agent", c.s.userAgent())
8868	if c.ctx_ != nil {
8869		return ctxhttp.Do(c.ctx_, c.s.client, req)
8870	}
8871	return c.s.client.Do(req)
8872}
8873
8874// Do executes the "androidenterprise.storelayoutpages.patch" call.
8875// Exactly one of *StorePage or error will be non-nil. Any non-2xx
8876// status code is an error. Response headers are in either
8877// *StorePage.ServerResponse.Header or (if a response was returned at
8878// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8879// to check whether the returned error was because
8880// http.StatusNotModified was returned.
8881func (c *StorelayoutpagesPatchCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
8882	gensupport.SetOptions(c.urlParams_, opts...)
8883	res, err := c.doRequest("json")
8884	if res != nil && res.StatusCode == http.StatusNotModified {
8885		if res.Body != nil {
8886			res.Body.Close()
8887		}
8888		return nil, &googleapi.Error{
8889			Code:   res.StatusCode,
8890			Header: res.Header,
8891		}
8892	}
8893	if err != nil {
8894		return nil, err
8895	}
8896	defer googleapi.CloseBody(res)
8897	if err := googleapi.CheckResponse(res); err != nil {
8898		return nil, err
8899	}
8900	ret := &StorePage{
8901		ServerResponse: googleapi.ServerResponse{
8902			Header:         res.Header,
8903			HTTPStatusCode: res.StatusCode,
8904		},
8905	}
8906	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
8907		return nil, err
8908	}
8909	return ret, nil
8910	// {
8911	//   "description": "Updates the content of a store page. This method supports patch semantics.",
8912	//   "httpMethod": "PATCH",
8913	//   "id": "androidenterprise.storelayoutpages.patch",
8914	//   "parameterOrder": [
8915	//     "enterpriseId",
8916	//     "pageId"
8917	//   ],
8918	//   "parameters": {
8919	//     "enterpriseId": {
8920	//       "description": "The ID of the enterprise.",
8921	//       "location": "path",
8922	//       "required": true,
8923	//       "type": "string"
8924	//     },
8925	//     "pageId": {
8926	//       "description": "The ID of the page.",
8927	//       "location": "path",
8928	//       "required": true,
8929	//       "type": "string"
8930	//     }
8931	//   },
8932	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
8933	//   "request": {
8934	//     "$ref": "StorePage"
8935	//   },
8936	//   "response": {
8937	//     "$ref": "StorePage"
8938	//   },
8939	//   "scopes": [
8940	//     "https://www.googleapis.com/auth/androidenterprise"
8941	//   ]
8942	// }
8943
8944}
8945
8946// method id "androidenterprise.storelayoutpages.update":
8947
8948type StorelayoutpagesUpdateCall struct {
8949	s            *Service
8950	enterpriseId string
8951	pageId       string
8952	storepage    *StorePage
8953	urlParams_   gensupport.URLParams
8954	ctx_         context.Context
8955}
8956
8957// Update: Updates the content of a store page.
8958func (r *StorelayoutpagesService) Update(enterpriseId string, pageId string, storepage *StorePage) *StorelayoutpagesUpdateCall {
8959	c := &StorelayoutpagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8960	c.enterpriseId = enterpriseId
8961	c.pageId = pageId
8962	c.storepage = storepage
8963	return c
8964}
8965
8966// Fields allows partial responses to be retrieved. See
8967// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8968// for more information.
8969func (c *StorelayoutpagesUpdateCall) Fields(s ...googleapi.Field) *StorelayoutpagesUpdateCall {
8970	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8971	return c
8972}
8973
8974// Context sets the context to be used in this call's Do method. Any
8975// pending HTTP request will be aborted if the provided context is
8976// canceled.
8977func (c *StorelayoutpagesUpdateCall) Context(ctx context.Context) *StorelayoutpagesUpdateCall {
8978	c.ctx_ = ctx
8979	return c
8980}
8981
8982func (c *StorelayoutpagesUpdateCall) doRequest(alt string) (*http.Response, error) {
8983	var body io.Reader = nil
8984	body, err := googleapi.WithoutDataWrapper.JSONReader(c.storepage)
8985	if err != nil {
8986		return nil, err
8987	}
8988	ctype := "application/json"
8989	c.urlParams_.Set("alt", alt)
8990	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/storeLayout/pages/{pageId}")
8991	urls += "?" + c.urlParams_.Encode()
8992	req, _ := http.NewRequest("PUT", urls, body)
8993	googleapi.Expand(req.URL, map[string]string{
8994		"enterpriseId": c.enterpriseId,
8995		"pageId":       c.pageId,
8996	})
8997	req.Header.Set("Content-Type", ctype)
8998	req.Header.Set("User-Agent", c.s.userAgent())
8999	if c.ctx_ != nil {
9000		return ctxhttp.Do(c.ctx_, c.s.client, req)
9001	}
9002	return c.s.client.Do(req)
9003}
9004
9005// Do executes the "androidenterprise.storelayoutpages.update" call.
9006// Exactly one of *StorePage or error will be non-nil. Any non-2xx
9007// status code is an error. Response headers are in either
9008// *StorePage.ServerResponse.Header or (if a response was returned at
9009// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9010// to check whether the returned error was because
9011// http.StatusNotModified was returned.
9012func (c *StorelayoutpagesUpdateCall) Do(opts ...googleapi.CallOption) (*StorePage, error) {
9013	gensupport.SetOptions(c.urlParams_, opts...)
9014	res, err := c.doRequest("json")
9015	if res != nil && res.StatusCode == http.StatusNotModified {
9016		if res.Body != nil {
9017			res.Body.Close()
9018		}
9019		return nil, &googleapi.Error{
9020			Code:   res.StatusCode,
9021			Header: res.Header,
9022		}
9023	}
9024	if err != nil {
9025		return nil, err
9026	}
9027	defer googleapi.CloseBody(res)
9028	if err := googleapi.CheckResponse(res); err != nil {
9029		return nil, err
9030	}
9031	ret := &StorePage{
9032		ServerResponse: googleapi.ServerResponse{
9033			Header:         res.Header,
9034			HTTPStatusCode: res.StatusCode,
9035		},
9036	}
9037	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
9038		return nil, err
9039	}
9040	return ret, nil
9041	// {
9042	//   "description": "Updates the content of a store page.",
9043	//   "httpMethod": "PUT",
9044	//   "id": "androidenterprise.storelayoutpages.update",
9045	//   "parameterOrder": [
9046	//     "enterpriseId",
9047	//     "pageId"
9048	//   ],
9049	//   "parameters": {
9050	//     "enterpriseId": {
9051	//       "description": "The ID of the enterprise.",
9052	//       "location": "path",
9053	//       "required": true,
9054	//       "type": "string"
9055	//     },
9056	//     "pageId": {
9057	//       "description": "The ID of the page.",
9058	//       "location": "path",
9059	//       "required": true,
9060	//       "type": "string"
9061	//     }
9062	//   },
9063	//   "path": "enterprises/{enterpriseId}/storeLayout/pages/{pageId}",
9064	//   "request": {
9065	//     "$ref": "StorePage"
9066	//   },
9067	//   "response": {
9068	//     "$ref": "StorePage"
9069	//   },
9070	//   "scopes": [
9071	//     "https://www.googleapis.com/auth/androidenterprise"
9072	//   ]
9073	// }
9074
9075}
9076
9077// method id "androidenterprise.users.generateToken":
9078
9079type UsersGenerateTokenCall struct {
9080	s            *Service
9081	enterpriseId string
9082	userId       string
9083	urlParams_   gensupport.URLParams
9084	ctx_         context.Context
9085}
9086
9087// GenerateToken: Generates a token (activation code) to allow this user
9088// to configure their work account in the Android Setup Wizard. Revokes
9089// any previously generated token.
9090//
9091// This call only works with Google managed accounts.
9092func (r *UsersService) GenerateToken(enterpriseId string, userId string) *UsersGenerateTokenCall {
9093	c := &UsersGenerateTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9094	c.enterpriseId = enterpriseId
9095	c.userId = userId
9096	return c
9097}
9098
9099// Fields allows partial responses to be retrieved. See
9100// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9101// for more information.
9102func (c *UsersGenerateTokenCall) Fields(s ...googleapi.Field) *UsersGenerateTokenCall {
9103	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9104	return c
9105}
9106
9107// Context sets the context to be used in this call's Do method. Any
9108// pending HTTP request will be aborted if the provided context is
9109// canceled.
9110func (c *UsersGenerateTokenCall) Context(ctx context.Context) *UsersGenerateTokenCall {
9111	c.ctx_ = ctx
9112	return c
9113}
9114
9115func (c *UsersGenerateTokenCall) doRequest(alt string) (*http.Response, error) {
9116	var body io.Reader = nil
9117	c.urlParams_.Set("alt", alt)
9118	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
9119	urls += "?" + c.urlParams_.Encode()
9120	req, _ := http.NewRequest("POST", urls, body)
9121	googleapi.Expand(req.URL, map[string]string{
9122		"enterpriseId": c.enterpriseId,
9123		"userId":       c.userId,
9124	})
9125	req.Header.Set("User-Agent", c.s.userAgent())
9126	if c.ctx_ != nil {
9127		return ctxhttp.Do(c.ctx_, c.s.client, req)
9128	}
9129	return c.s.client.Do(req)
9130}
9131
9132// Do executes the "androidenterprise.users.generateToken" call.
9133// Exactly one of *UserToken or error will be non-nil. Any non-2xx
9134// status code is an error. Response headers are in either
9135// *UserToken.ServerResponse.Header or (if a response was returned at
9136// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9137// to check whether the returned error was because
9138// http.StatusNotModified was returned.
9139func (c *UsersGenerateTokenCall) Do(opts ...googleapi.CallOption) (*UserToken, error) {
9140	gensupport.SetOptions(c.urlParams_, opts...)
9141	res, err := c.doRequest("json")
9142	if res != nil && res.StatusCode == http.StatusNotModified {
9143		if res.Body != nil {
9144			res.Body.Close()
9145		}
9146		return nil, &googleapi.Error{
9147			Code:   res.StatusCode,
9148			Header: res.Header,
9149		}
9150	}
9151	if err != nil {
9152		return nil, err
9153	}
9154	defer googleapi.CloseBody(res)
9155	if err := googleapi.CheckResponse(res); err != nil {
9156		return nil, err
9157	}
9158	ret := &UserToken{
9159		ServerResponse: googleapi.ServerResponse{
9160			Header:         res.Header,
9161			HTTPStatusCode: res.StatusCode,
9162		},
9163	}
9164	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
9165		return nil, err
9166	}
9167	return ret, nil
9168	// {
9169	//   "description": "Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.\n\nThis call only works with Google managed accounts.",
9170	//   "httpMethod": "POST",
9171	//   "id": "androidenterprise.users.generateToken",
9172	//   "parameterOrder": [
9173	//     "enterpriseId",
9174	//     "userId"
9175	//   ],
9176	//   "parameters": {
9177	//     "enterpriseId": {
9178	//       "description": "The ID of the enterprise.",
9179	//       "location": "path",
9180	//       "required": true,
9181	//       "type": "string"
9182	//     },
9183	//     "userId": {
9184	//       "description": "The ID of the user.",
9185	//       "location": "path",
9186	//       "required": true,
9187	//       "type": "string"
9188	//     }
9189	//   },
9190	//   "path": "enterprises/{enterpriseId}/users/{userId}/token",
9191	//   "response": {
9192	//     "$ref": "UserToken"
9193	//   },
9194	//   "scopes": [
9195	//     "https://www.googleapis.com/auth/androidenterprise"
9196	//   ]
9197	// }
9198
9199}
9200
9201// method id "androidenterprise.users.get":
9202
9203type UsersGetCall struct {
9204	s            *Service
9205	enterpriseId string
9206	userId       string
9207	urlParams_   gensupport.URLParams
9208	ifNoneMatch_ string
9209	ctx_         context.Context
9210}
9211
9212// Get: Retrieves a user's details.
9213func (r *UsersService) Get(enterpriseId string, userId string) *UsersGetCall {
9214	c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9215	c.enterpriseId = enterpriseId
9216	c.userId = userId
9217	return c
9218}
9219
9220// Fields allows partial responses to be retrieved. See
9221// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9222// for more information.
9223func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
9224	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9225	return c
9226}
9227
9228// IfNoneMatch sets the optional parameter which makes the operation
9229// fail if the object's ETag matches the given value. This is useful for
9230// getting updates only after the object has changed since the last
9231// request. Use googleapi.IsNotModified to check whether the response
9232// error from Do is the result of In-None-Match.
9233func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
9234	c.ifNoneMatch_ = entityTag
9235	return c
9236}
9237
9238// Context sets the context to be used in this call's Do method. Any
9239// pending HTTP request will be aborted if the provided context is
9240// canceled.
9241func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
9242	c.ctx_ = ctx
9243	return c
9244}
9245
9246func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
9247	var body io.Reader = nil
9248	c.urlParams_.Set("alt", alt)
9249	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}")
9250	urls += "?" + c.urlParams_.Encode()
9251	req, _ := http.NewRequest("GET", urls, body)
9252	googleapi.Expand(req.URL, map[string]string{
9253		"enterpriseId": c.enterpriseId,
9254		"userId":       c.userId,
9255	})
9256	req.Header.Set("User-Agent", c.s.userAgent())
9257	if c.ifNoneMatch_ != "" {
9258		req.Header.Set("If-None-Match", c.ifNoneMatch_)
9259	}
9260	if c.ctx_ != nil {
9261		return ctxhttp.Do(c.ctx_, c.s.client, req)
9262	}
9263	return c.s.client.Do(req)
9264}
9265
9266// Do executes the "androidenterprise.users.get" call.
9267// Exactly one of *User or error will be non-nil. Any non-2xx status
9268// code is an error. Response headers are in either
9269// *User.ServerResponse.Header or (if a response was returned at all) in
9270// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9271// whether the returned error was because http.StatusNotModified was
9272// returned.
9273func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
9274	gensupport.SetOptions(c.urlParams_, opts...)
9275	res, err := c.doRequest("json")
9276	if res != nil && res.StatusCode == http.StatusNotModified {
9277		if res.Body != nil {
9278			res.Body.Close()
9279		}
9280		return nil, &googleapi.Error{
9281			Code:   res.StatusCode,
9282			Header: res.Header,
9283		}
9284	}
9285	if err != nil {
9286		return nil, err
9287	}
9288	defer googleapi.CloseBody(res)
9289	if err := googleapi.CheckResponse(res); err != nil {
9290		return nil, err
9291	}
9292	ret := &User{
9293		ServerResponse: googleapi.ServerResponse{
9294			Header:         res.Header,
9295			HTTPStatusCode: res.StatusCode,
9296		},
9297	}
9298	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
9299		return nil, err
9300	}
9301	return ret, nil
9302	// {
9303	//   "description": "Retrieves a user's details.",
9304	//   "httpMethod": "GET",
9305	//   "id": "androidenterprise.users.get",
9306	//   "parameterOrder": [
9307	//     "enterpriseId",
9308	//     "userId"
9309	//   ],
9310	//   "parameters": {
9311	//     "enterpriseId": {
9312	//       "description": "The ID of the enterprise.",
9313	//       "location": "path",
9314	//       "required": true,
9315	//       "type": "string"
9316	//     },
9317	//     "userId": {
9318	//       "description": "The ID of the user.",
9319	//       "location": "path",
9320	//       "required": true,
9321	//       "type": "string"
9322	//     }
9323	//   },
9324	//   "path": "enterprises/{enterpriseId}/users/{userId}",
9325	//   "response": {
9326	//     "$ref": "User"
9327	//   },
9328	//   "scopes": [
9329	//     "https://www.googleapis.com/auth/androidenterprise"
9330	//   ]
9331	// }
9332
9333}
9334
9335// method id "androidenterprise.users.getAvailableProductSet":
9336
9337type UsersGetAvailableProductSetCall struct {
9338	s            *Service
9339	enterpriseId string
9340	userId       string
9341	urlParams_   gensupport.URLParams
9342	ifNoneMatch_ string
9343	ctx_         context.Context
9344}
9345
9346// GetAvailableProductSet: Retrieves the set of products a user is
9347// entitled to access.
9348func (r *UsersService) GetAvailableProductSet(enterpriseId string, userId string) *UsersGetAvailableProductSetCall {
9349	c := &UsersGetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9350	c.enterpriseId = enterpriseId
9351	c.userId = userId
9352	return c
9353}
9354
9355// Fields allows partial responses to be retrieved. See
9356// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9357// for more information.
9358func (c *UsersGetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersGetAvailableProductSetCall {
9359	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9360	return c
9361}
9362
9363// IfNoneMatch sets the optional parameter which makes the operation
9364// fail if the object's ETag matches the given value. This is useful for
9365// getting updates only after the object has changed since the last
9366// request. Use googleapi.IsNotModified to check whether the response
9367// error from Do is the result of In-None-Match.
9368func (c *UsersGetAvailableProductSetCall) IfNoneMatch(entityTag string) *UsersGetAvailableProductSetCall {
9369	c.ifNoneMatch_ = entityTag
9370	return c
9371}
9372
9373// Context sets the context to be used in this call's Do method. Any
9374// pending HTTP request will be aborted if the provided context is
9375// canceled.
9376func (c *UsersGetAvailableProductSetCall) Context(ctx context.Context) *UsersGetAvailableProductSetCall {
9377	c.ctx_ = ctx
9378	return c
9379}
9380
9381func (c *UsersGetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
9382	var body io.Reader = nil
9383	c.urlParams_.Set("alt", alt)
9384	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
9385	urls += "?" + c.urlParams_.Encode()
9386	req, _ := http.NewRequest("GET", urls, body)
9387	googleapi.Expand(req.URL, map[string]string{
9388		"enterpriseId": c.enterpriseId,
9389		"userId":       c.userId,
9390	})
9391	req.Header.Set("User-Agent", c.s.userAgent())
9392	if c.ifNoneMatch_ != "" {
9393		req.Header.Set("If-None-Match", c.ifNoneMatch_)
9394	}
9395	if c.ctx_ != nil {
9396		return ctxhttp.Do(c.ctx_, c.s.client, req)
9397	}
9398	return c.s.client.Do(req)
9399}
9400
9401// Do executes the "androidenterprise.users.getAvailableProductSet" call.
9402// Exactly one of *ProductSet or error will be non-nil. Any non-2xx
9403// status code is an error. Response headers are in either
9404// *ProductSet.ServerResponse.Header or (if a response was returned at
9405// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9406// to check whether the returned error was because
9407// http.StatusNotModified was returned.
9408func (c *UsersGetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
9409	gensupport.SetOptions(c.urlParams_, opts...)
9410	res, err := c.doRequest("json")
9411	if res != nil && res.StatusCode == http.StatusNotModified {
9412		if res.Body != nil {
9413			res.Body.Close()
9414		}
9415		return nil, &googleapi.Error{
9416			Code:   res.StatusCode,
9417			Header: res.Header,
9418		}
9419	}
9420	if err != nil {
9421		return nil, err
9422	}
9423	defer googleapi.CloseBody(res)
9424	if err := googleapi.CheckResponse(res); err != nil {
9425		return nil, err
9426	}
9427	ret := &ProductSet{
9428		ServerResponse: googleapi.ServerResponse{
9429			Header:         res.Header,
9430			HTTPStatusCode: res.StatusCode,
9431		},
9432	}
9433	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
9434		return nil, err
9435	}
9436	return ret, nil
9437	// {
9438	//   "description": "Retrieves the set of products a user is entitled to access.",
9439	//   "httpMethod": "GET",
9440	//   "id": "androidenterprise.users.getAvailableProductSet",
9441	//   "parameterOrder": [
9442	//     "enterpriseId",
9443	//     "userId"
9444	//   ],
9445	//   "parameters": {
9446	//     "enterpriseId": {
9447	//       "description": "The ID of the enterprise.",
9448	//       "location": "path",
9449	//       "required": true,
9450	//       "type": "string"
9451	//     },
9452	//     "userId": {
9453	//       "description": "The ID of the user.",
9454	//       "location": "path",
9455	//       "required": true,
9456	//       "type": "string"
9457	//     }
9458	//   },
9459	//   "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
9460	//   "response": {
9461	//     "$ref": "ProductSet"
9462	//   },
9463	//   "scopes": [
9464	//     "https://www.googleapis.com/auth/androidenterprise"
9465	//   ]
9466	// }
9467
9468}
9469
9470// method id "androidenterprise.users.list":
9471
9472type UsersListCall struct {
9473	s            *Service
9474	enterpriseId string
9475	urlParams_   gensupport.URLParams
9476	ifNoneMatch_ string
9477	ctx_         context.Context
9478}
9479
9480// List: Looks up a user by their primary email address.
9481func (r *UsersService) List(enterpriseId string, email string) *UsersListCall {
9482	c := &UsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9483	c.enterpriseId = enterpriseId
9484	c.urlParams_.Set("email", email)
9485	return c
9486}
9487
9488// Fields allows partial responses to be retrieved. See
9489// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9490// for more information.
9491func (c *UsersListCall) Fields(s ...googleapi.Field) *UsersListCall {
9492	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9493	return c
9494}
9495
9496// IfNoneMatch sets the optional parameter which makes the operation
9497// fail if the object's ETag matches the given value. This is useful for
9498// getting updates only after the object has changed since the last
9499// request. Use googleapi.IsNotModified to check whether the response
9500// error from Do is the result of In-None-Match.
9501func (c *UsersListCall) IfNoneMatch(entityTag string) *UsersListCall {
9502	c.ifNoneMatch_ = entityTag
9503	return c
9504}
9505
9506// Context sets the context to be used in this call's Do method. Any
9507// pending HTTP request will be aborted if the provided context is
9508// canceled.
9509func (c *UsersListCall) Context(ctx context.Context) *UsersListCall {
9510	c.ctx_ = ctx
9511	return c
9512}
9513
9514func (c *UsersListCall) doRequest(alt string) (*http.Response, error) {
9515	var body io.Reader = nil
9516	c.urlParams_.Set("alt", alt)
9517	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users")
9518	urls += "?" + c.urlParams_.Encode()
9519	req, _ := http.NewRequest("GET", urls, body)
9520	googleapi.Expand(req.URL, map[string]string{
9521		"enterpriseId": c.enterpriseId,
9522	})
9523	req.Header.Set("User-Agent", c.s.userAgent())
9524	if c.ifNoneMatch_ != "" {
9525		req.Header.Set("If-None-Match", c.ifNoneMatch_)
9526	}
9527	if c.ctx_ != nil {
9528		return ctxhttp.Do(c.ctx_, c.s.client, req)
9529	}
9530	return c.s.client.Do(req)
9531}
9532
9533// Do executes the "androidenterprise.users.list" call.
9534// Exactly one of *UsersListResponse or error will be non-nil. Any
9535// non-2xx status code is an error. Response headers are in either
9536// *UsersListResponse.ServerResponse.Header or (if a response was
9537// returned at all) in error.(*googleapi.Error).Header. Use
9538// googleapi.IsNotModified to check whether the returned error was
9539// because http.StatusNotModified was returned.
9540func (c *UsersListCall) Do(opts ...googleapi.CallOption) (*UsersListResponse, error) {
9541	gensupport.SetOptions(c.urlParams_, opts...)
9542	res, err := c.doRequest("json")
9543	if res != nil && res.StatusCode == http.StatusNotModified {
9544		if res.Body != nil {
9545			res.Body.Close()
9546		}
9547		return nil, &googleapi.Error{
9548			Code:   res.StatusCode,
9549			Header: res.Header,
9550		}
9551	}
9552	if err != nil {
9553		return nil, err
9554	}
9555	defer googleapi.CloseBody(res)
9556	if err := googleapi.CheckResponse(res); err != nil {
9557		return nil, err
9558	}
9559	ret := &UsersListResponse{
9560		ServerResponse: googleapi.ServerResponse{
9561			Header:         res.Header,
9562			HTTPStatusCode: res.StatusCode,
9563		},
9564	}
9565	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
9566		return nil, err
9567	}
9568	return ret, nil
9569	// {
9570	//   "description": "Looks up a user by their primary email address.",
9571	//   "httpMethod": "GET",
9572	//   "id": "androidenterprise.users.list",
9573	//   "parameterOrder": [
9574	//     "enterpriseId",
9575	//     "email"
9576	//   ],
9577	//   "parameters": {
9578	//     "email": {
9579	//       "description": "The exact primary email address of the user to look up.",
9580	//       "location": "query",
9581	//       "required": true,
9582	//       "type": "string"
9583	//     },
9584	//     "enterpriseId": {
9585	//       "description": "The ID of the enterprise.",
9586	//       "location": "path",
9587	//       "required": true,
9588	//       "type": "string"
9589	//     }
9590	//   },
9591	//   "path": "enterprises/{enterpriseId}/users",
9592	//   "response": {
9593	//     "$ref": "UsersListResponse"
9594	//   },
9595	//   "scopes": [
9596	//     "https://www.googleapis.com/auth/androidenterprise"
9597	//   ]
9598	// }
9599
9600}
9601
9602// method id "androidenterprise.users.revokeToken":
9603
9604type UsersRevokeTokenCall struct {
9605	s            *Service
9606	enterpriseId string
9607	userId       string
9608	urlParams_   gensupport.URLParams
9609	ctx_         context.Context
9610}
9611
9612// RevokeToken: Revokes a previously generated token (activation code)
9613// for the user.
9614func (r *UsersService) RevokeToken(enterpriseId string, userId string) *UsersRevokeTokenCall {
9615	c := &UsersRevokeTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9616	c.enterpriseId = enterpriseId
9617	c.userId = userId
9618	return c
9619}
9620
9621// Fields allows partial responses to be retrieved. See
9622// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9623// for more information.
9624func (c *UsersRevokeTokenCall) Fields(s ...googleapi.Field) *UsersRevokeTokenCall {
9625	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9626	return c
9627}
9628
9629// Context sets the context to be used in this call's Do method. Any
9630// pending HTTP request will be aborted if the provided context is
9631// canceled.
9632func (c *UsersRevokeTokenCall) Context(ctx context.Context) *UsersRevokeTokenCall {
9633	c.ctx_ = ctx
9634	return c
9635}
9636
9637func (c *UsersRevokeTokenCall) doRequest(alt string) (*http.Response, error) {
9638	var body io.Reader = nil
9639	c.urlParams_.Set("alt", alt)
9640	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/token")
9641	urls += "?" + c.urlParams_.Encode()
9642	req, _ := http.NewRequest("DELETE", urls, body)
9643	googleapi.Expand(req.URL, map[string]string{
9644		"enterpriseId": c.enterpriseId,
9645		"userId":       c.userId,
9646	})
9647	req.Header.Set("User-Agent", c.s.userAgent())
9648	if c.ctx_ != nil {
9649		return ctxhttp.Do(c.ctx_, c.s.client, req)
9650	}
9651	return c.s.client.Do(req)
9652}
9653
9654// Do executes the "androidenterprise.users.revokeToken" call.
9655func (c *UsersRevokeTokenCall) Do(opts ...googleapi.CallOption) error {
9656	gensupport.SetOptions(c.urlParams_, opts...)
9657	res, err := c.doRequest("json")
9658	if err != nil {
9659		return err
9660	}
9661	defer googleapi.CloseBody(res)
9662	if err := googleapi.CheckResponse(res); err != nil {
9663		return err
9664	}
9665	return nil
9666	// {
9667	//   "description": "Revokes a previously generated token (activation code) for the user.",
9668	//   "httpMethod": "DELETE",
9669	//   "id": "androidenterprise.users.revokeToken",
9670	//   "parameterOrder": [
9671	//     "enterpriseId",
9672	//     "userId"
9673	//   ],
9674	//   "parameters": {
9675	//     "enterpriseId": {
9676	//       "description": "The ID of the enterprise.",
9677	//       "location": "path",
9678	//       "required": true,
9679	//       "type": "string"
9680	//     },
9681	//     "userId": {
9682	//       "description": "The ID of the user.",
9683	//       "location": "path",
9684	//       "required": true,
9685	//       "type": "string"
9686	//     }
9687	//   },
9688	//   "path": "enterprises/{enterpriseId}/users/{userId}/token",
9689	//   "scopes": [
9690	//     "https://www.googleapis.com/auth/androidenterprise"
9691	//   ]
9692	// }
9693
9694}
9695
9696// method id "androidenterprise.users.setAvailableProductSet":
9697
9698type UsersSetAvailableProductSetCall struct {
9699	s            *Service
9700	enterpriseId string
9701	userId       string
9702	productset   *ProductSet
9703	urlParams_   gensupport.URLParams
9704	ctx_         context.Context
9705}
9706
9707// SetAvailableProductSet: Modifies the set of products a user is
9708// entitled to access.
9709func (r *UsersService) SetAvailableProductSet(enterpriseId string, userId string, productset *ProductSet) *UsersSetAvailableProductSetCall {
9710	c := &UsersSetAvailableProductSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9711	c.enterpriseId = enterpriseId
9712	c.userId = userId
9713	c.productset = productset
9714	return c
9715}
9716
9717// Fields allows partial responses to be retrieved. See
9718// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9719// for more information.
9720func (c *UsersSetAvailableProductSetCall) Fields(s ...googleapi.Field) *UsersSetAvailableProductSetCall {
9721	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9722	return c
9723}
9724
9725// Context sets the context to be used in this call's Do method. Any
9726// pending HTTP request will be aborted if the provided context is
9727// canceled.
9728func (c *UsersSetAvailableProductSetCall) Context(ctx context.Context) *UsersSetAvailableProductSetCall {
9729	c.ctx_ = ctx
9730	return c
9731}
9732
9733func (c *UsersSetAvailableProductSetCall) doRequest(alt string) (*http.Response, error) {
9734	var body io.Reader = nil
9735	body, err := googleapi.WithoutDataWrapper.JSONReader(c.productset)
9736	if err != nil {
9737		return nil, err
9738	}
9739	ctype := "application/json"
9740	c.urlParams_.Set("alt", alt)
9741	urls := googleapi.ResolveRelative(c.s.BasePath, "enterprises/{enterpriseId}/users/{userId}/availableProductSet")
9742	urls += "?" + c.urlParams_.Encode()
9743	req, _ := http.NewRequest("PUT", urls, body)
9744	googleapi.Expand(req.URL, map[string]string{
9745		"enterpriseId": c.enterpriseId,
9746		"userId":       c.userId,
9747	})
9748	req.Header.Set("Content-Type", ctype)
9749	req.Header.Set("User-Agent", c.s.userAgent())
9750	if c.ctx_ != nil {
9751		return ctxhttp.Do(c.ctx_, c.s.client, req)
9752	}
9753	return c.s.client.Do(req)
9754}
9755
9756// Do executes the "androidenterprise.users.setAvailableProductSet" call.
9757// Exactly one of *ProductSet or error will be non-nil. Any non-2xx
9758// status code is an error. Response headers are in either
9759// *ProductSet.ServerResponse.Header or (if a response was returned at
9760// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9761// to check whether the returned error was because
9762// http.StatusNotModified was returned.
9763func (c *UsersSetAvailableProductSetCall) Do(opts ...googleapi.CallOption) (*ProductSet, error) {
9764	gensupport.SetOptions(c.urlParams_, opts...)
9765	res, err := c.doRequest("json")
9766	if res != nil && res.StatusCode == http.StatusNotModified {
9767		if res.Body != nil {
9768			res.Body.Close()
9769		}
9770		return nil, &googleapi.Error{
9771			Code:   res.StatusCode,
9772			Header: res.Header,
9773		}
9774	}
9775	if err != nil {
9776		return nil, err
9777	}
9778	defer googleapi.CloseBody(res)
9779	if err := googleapi.CheckResponse(res); err != nil {
9780		return nil, err
9781	}
9782	ret := &ProductSet{
9783		ServerResponse: googleapi.ServerResponse{
9784			Header:         res.Header,
9785			HTTPStatusCode: res.StatusCode,
9786		},
9787	}
9788	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
9789		return nil, err
9790	}
9791	return ret, nil
9792	// {
9793	//   "description": "Modifies the set of products a user is entitled to access.",
9794	//   "httpMethod": "PUT",
9795	//   "id": "androidenterprise.users.setAvailableProductSet",
9796	//   "parameterOrder": [
9797	//     "enterpriseId",
9798	//     "userId"
9799	//   ],
9800	//   "parameters": {
9801	//     "enterpriseId": {
9802	//       "description": "The ID of the enterprise.",
9803	//       "location": "path",
9804	//       "required": true,
9805	//       "type": "string"
9806	//     },
9807	//     "userId": {
9808	//       "description": "The ID of the user.",
9809	//       "location": "path",
9810	//       "required": true,
9811	//       "type": "string"
9812	//     }
9813	//   },
9814	//   "path": "enterprises/{enterpriseId}/users/{userId}/availableProductSet",
9815	//   "request": {
9816	//     "$ref": "ProductSet"
9817	//   },
9818	//   "response": {
9819	//     "$ref": "ProductSet"
9820	//   },
9821	//   "scopes": [
9822	//     "https://www.googleapis.com/auth/androidenterprise"
9823	//   ]
9824	// }
9825
9826}
9827